]> git.uio.no Git - u/mrichter/AliRoot.git/blame - SHUTTLE/AliShuttleStatus.cxx
More coding rule violations corrected.
[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$
4f0ab988 18Revision 1.1 2006/07/20 13:20:13 jgrosseo
19introducing status management: The processing per subdetector is divided into several steps,
20after each step the status is stored on disk. If the system crashes in any of the steps the Shuttle
21can keep track of the number of failures and skips further processing after a certain threshold is
22exceeded. These thresholds can be configured in LDAP.
23
4a6b108b 24*/
25
26//
27// This class stores the status of the Shuttle processing for a given run and a given detector
28//
29// This class stores the status of the processing, the number of retries and the timestamp of the last action
30// The detector and run number are stored using the CDB framework
31//
32//
33
34#include "AliShuttleStatus.h"
35
36ClassImp(AliShuttleStatus)
37
38AliShuttleStatus::AliShuttleStatus() : TObject(),
39 fTimeStamp(0),
40 fStatus(kInvalid),
41 fCount(0)
42{
43 // default constructor
44}
45
46AliShuttleStatus::AliShuttleStatus(Status status) : TObject(),
47 fTimeStamp(0),
48 fStatus(status),
49 fCount(1)
50{
51 // constructor
52
53 fTimeStamp = time(0);
54}
55
4f0ab988 56AliShuttleStatus::AliShuttleStatus(const AliShuttleStatus& c) :
57TObject(c), fTimeStamp(0),
58fStatus(kInvalid),
59fCount(1)
4a6b108b 60{
61 // copy constructor
62
63 ((AliShuttleStatus &)c).Copy(*this);
64}
65
66AliShuttleStatus::~AliShuttleStatus()
67{
68 // destructor
69}
70
71AliShuttleStatus &AliShuttleStatus::operator=(const AliShuttleStatus &c)
72{
73 // assigment operator
74
75 if (this != &c)
76 ((AliShuttleStatus &) c).Copy(*this);
77
78 return *this;
79}
80
81void AliShuttleStatus::Copy(TObject& c) const
82{
83 // copy function
84
85 AliShuttleStatus& target = (AliShuttleStatus &) c;
86
87 target.fTimeStamp = fTimeStamp;
88 target.fStatus = fStatus;
89 target.fCount = fCount;
90}
91
92void AliShuttleStatus::SetStatus(Status status)
93{
94 // sets a new status, add the same time the timestamp is set to now
95
96 fStatus = status;
97 fTimeStamp = time(0);
98}
99
100const char* AliShuttleStatus::GetStatusName(Status status)
101{
102 // returns a name (string) of the status
103
104 switch (status)
105 {
106 case kInvalid: return "Invalid";
107 case kStarted: return "Started";
108 case kDCSStarted: return "DCSStarted";
109 case kDCSError: return "DCSError";
110 case kPPStarted: return "PPStarted";
111 case kPPError: return "PPError";
112 case kPPDone: return "PPDone";
113 case kDone: return "Done";
114 case kFailed: return "Failed";
115 }
116
117 return 0;
118}