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.2 2006/08/15 10:50:00 jgrosseo
19 effc++ corrections (alberto)
21 Revision 1.1 2006/07/20 13:20:13 jgrosseo
22 introducing status management: The processing per subdetector is divided into several steps,
23 after each step the status is stored on disk. If the system crashes in any of the steps the Shuttle
24 can keep track of the number of failures and skips further processing after a certain threshold is
25 exceeded. These thresholds can be configured in LDAP.
30 // This class stores the status of the Shuttle processing for a given run and a given detector
32 // This class stores the status of the processing, the number of retries and the timestamp of the last action
33 // The detector and run number are stored using the CDB framework
37 #include "AliShuttleStatus.h"
39 ClassImp(AliShuttleStatus)
41 AliShuttleStatus::AliShuttleStatus() : TObject(),
46 // default constructor
49 AliShuttleStatus::AliShuttleStatus(Status status) : TObject(),
59 AliShuttleStatus::AliShuttleStatus(const AliShuttleStatus& c) :
60 TObject(c), fTimeStamp(0),
66 ((AliShuttleStatus &)c).Copy(*this);
69 AliShuttleStatus::~AliShuttleStatus()
74 AliShuttleStatus &AliShuttleStatus::operator=(const AliShuttleStatus &c)
79 ((AliShuttleStatus &) c).Copy(*this);
84 void AliShuttleStatus::Copy(TObject& c) const
88 AliShuttleStatus& target = (AliShuttleStatus &) c;
90 target.fTimeStamp = fTimeStamp;
91 target.fStatus = fStatus;
92 target.fCount = fCount;
95 void AliShuttleStatus::SetStatus(Status status)
97 // sets a new status, add the same time the timestamp is set to now
100 fTimeStamp = time(0);
103 const char* AliShuttleStatus::GetStatusName(Status status)
105 // returns a name (string) of the status
109 case kInvalid: return "Invalid";
110 case kStarted: return "Started";
111 case kDCSStarted: return "DCSStarted";
112 case kDCSError: return "DCSError";
113 case kPPStarted: return "PPStarted";
114 case kPPError: return "PPError";
115 case kDone: return "Done";
116 case kFailed: return "Failed";
117 case kStoreFailed: return "StoreFailed";