New developments of the analysis framework - selectorised version of the manager...
[u/mrichter/AliRoot.git] / SHUTTLE / AliShuttleStatus.cxx
CommitLineData
4a6b108b 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/*
17$Log$
2bb7b766 18Revision 1.3 2006/08/29 09:16:05 jgrosseo
19small update
20
85a80aa9 21Revision 1.2 2006/08/15 10:50:00 jgrosseo
22effc++ corrections (alberto)
23
4f0ab988 24Revision 1.1 2006/07/20 13:20:13 jgrosseo
25introducing status management: The processing per subdetector is divided into several steps,
26after each step the status is stored on disk. If the system crashes in any of the steps the Shuttle
27can keep track of the number of failures and skips further processing after a certain threshold is
28exceeded. These thresholds can be configured in LDAP.
29
4a6b108b 30*/
31
32//
33// This class stores the status of the Shuttle processing for a given run and a given detector
34//
35// This class stores the status of the processing, the number of retries and the timestamp of the last action
36// The detector and run number are stored using the CDB framework
37//
38//
39
40#include "AliShuttleStatus.h"
41
42ClassImp(AliShuttleStatus)
43
2bb7b766 44//______________________________________________________________________________________________
4a6b108b 45AliShuttleStatus::AliShuttleStatus() : TObject(),
46 fTimeStamp(0),
47 fStatus(kInvalid),
48 fCount(0)
49{
50 // default constructor
51}
52
2bb7b766 53//______________________________________________________________________________________________
4a6b108b 54AliShuttleStatus::AliShuttleStatus(Status status) : TObject(),
55 fTimeStamp(0),
56 fStatus(status),
57 fCount(1)
58{
59 // constructor
60
61 fTimeStamp = time(0);
62}
63
2bb7b766 64//______________________________________________________________________________________________
4f0ab988 65AliShuttleStatus::AliShuttleStatus(const AliShuttleStatus& c) :
66TObject(c), fTimeStamp(0),
67fStatus(kInvalid),
68fCount(1)
4a6b108b 69{
70 // copy constructor
71
72 ((AliShuttleStatus &)c).Copy(*this);
73}
74
2bb7b766 75//______________________________________________________________________________________________
4a6b108b 76AliShuttleStatus::~AliShuttleStatus()
77{
78 // destructor
79}
80
2bb7b766 81//______________________________________________________________________________________________
4a6b108b 82AliShuttleStatus &AliShuttleStatus::operator=(const AliShuttleStatus &c)
83{
84 // assigment operator
85
86 if (this != &c)
87 ((AliShuttleStatus &) c).Copy(*this);
88
89 return *this;
90}
91
2bb7b766 92//______________________________________________________________________________________________
4a6b108b 93void AliShuttleStatus::Copy(TObject& c) const
94{
95 // copy function
96
97 AliShuttleStatus& target = (AliShuttleStatus &) c;
98
99 target.fTimeStamp = fTimeStamp;
100 target.fStatus = fStatus;
101 target.fCount = fCount;
102}
103
2bb7b766 104//______________________________________________________________________________________________
4a6b108b 105void AliShuttleStatus::SetStatus(Status status)
106{
107 // sets a new status, add the same time the timestamp is set to now
108
109 fStatus = status;
110 fTimeStamp = time(0);
111}
112
2bb7b766 113//______________________________________________________________________________________________
4a6b108b 114const char* AliShuttleStatus::GetStatusName(Status status)
115{
116 // returns a name (string) of the status
117
118 switch (status)
119 {
120 case kInvalid: return "Invalid";
121 case kStarted: return "Started";
122 case kDCSStarted: return "DCSStarted";
123 case kDCSError: return "DCSError";
124 case kPPStarted: return "PPStarted";
125 case kPPError: return "PPError";
4a6b108b 126 case kDone: return "Done";
127 case kFailed: return "Failed";
85a80aa9 128 case kStoreFailed: return "StoreFailed";
4a6b108b 129 }
130
131 return 0;
132}