1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 Revision 1.3 2006/08/29 09:16:05 jgrosseo
21 Revision 1.2 2006/08/15 10:50:00 jgrosseo
22 effc++ corrections (alberto)
24 Revision 1.1 2006/07/20 13:20:13 jgrosseo
25 introducing status management: The processing per subdetector is divided into several steps,
26 after each step the status is stored on disk. If the system crashes in any of the steps the Shuttle
27 can keep track of the number of failures and skips further processing after a certain threshold is
28 exceeded. These thresholds can be configured in LDAP.
33 // This class stores the status of the Shuttle processing for a given run and a given detector
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
40 #include "AliShuttleStatus.h"
42 ClassImp(AliShuttleStatus)
44 //______________________________________________________________________________________________
45 AliShuttleStatus::AliShuttleStatus() : TObject(),
50 // default constructor
53 //______________________________________________________________________________________________
54 AliShuttleStatus::AliShuttleStatus(Status status) : TObject(),
64 //______________________________________________________________________________________________
65 AliShuttleStatus::AliShuttleStatus(const AliShuttleStatus& c) :
66 TObject(c), fTimeStamp(0),
72 ((AliShuttleStatus &)c).Copy(*this);
75 //______________________________________________________________________________________________
76 AliShuttleStatus::~AliShuttleStatus()
81 //______________________________________________________________________________________________
82 AliShuttleStatus &AliShuttleStatus::operator=(const AliShuttleStatus &c)
87 ((AliShuttleStatus &) c).Copy(*this);
92 //______________________________________________________________________________________________
93 void AliShuttleStatus::Copy(TObject& c) const
97 AliShuttleStatus& target = (AliShuttleStatus &) c;
99 target.fTimeStamp = fTimeStamp;
100 target.fStatus = fStatus;
101 target.fCount = fCount;
104 //______________________________________________________________________________________________
105 void AliShuttleStatus::SetStatus(Status status)
107 // sets a new status, add the same time the timestamp is set to now
110 fTimeStamp = time(0);
113 //______________________________________________________________________________________________
114 const char* AliShuttleStatus::GetStatusName(Status status)
116 // returns a name (string) of the status
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";
126 case kDone: return "Done";
127 case kFailed: return "Failed";
128 case kStoreFailed: return "StoreFailed";