ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCronJobResult Class Reference
+ Collaboration diagram for ilCronJobResult:

Public Member Functions

 getStatus ()
 
 setStatus (int $a_value)
 
 getMessage ()
 
 setMessage (string $value)
 
 getCode ()
 
 setCode (string $a_value)
 
 getDuration ()
 
 setDuration (float $a_value)
 

Static Public Member Functions

static getCoreCodes ()
 

Data Fields

const STATUS_INVALID_CONFIGURATION = 1
 
const STATUS_NO_ACTION = 2
 
const STATUS_OK = 3
 
const STATUS_CRASHED = 4
 
const STATUS_RESET = 5
 
const STATUS_FAIL = 6
 
const CODE_NO_RESULT = 'job_no_result'
 
const CODE_MANUAL_RESET = 'job_manual_reset'
 
const CODE_SUPPOSED_CRASH = 'job_auto_deactivation_time_limit'
 

Protected Member Functions

 getValidStatus ()
 

Protected Attributes

int $status = self::STATUS_NO_ACTION
 
string $message = ''
 
string $code = null
 
string $duration = '0'
 

Detailed Description

Definition at line 21 of file class.ilCronJobResult.php.

Member Function Documentation

◆ getCode()

ilCronJobResult::getCode ( )

Definition at line 99 of file class.ilCronJobResult.php.

References $code.

Referenced by ilCronJobRepositoryImpl\updateJobResult().

99  : ?string
100  {
101  return $this->code;
102  }
+ Here is the caller graph for this function:

◆ getCoreCodes()

static ilCronJobResult::getCoreCodes ( )
static
Returns
string[]

Definition at line 42 of file class.ilCronJobResult.php.

Referenced by ilCronManagerTableGUI\formatResultInfo().

42  : array
43  {
44  return [
45  self::CODE_NO_RESULT,
46  self::CODE_MANUAL_RESET,
47  self::CODE_SUPPOSED_CRASH,
48  ];
49  }
+ Here is the caller graph for this function:

◆ getDuration()

ilCronJobResult::getDuration ( )

Definition at line 117 of file class.ilCronJobResult.php.

References $duration.

Referenced by ilCronJobRepositoryImpl\updateJobResult().

117  : float
118  {
119  return (float) $this->duration;
120  }
+ Here is the caller graph for this function:

◆ getMessage()

ilCronJobResult::getMessage ( )

Definition at line 84 of file class.ilCronJobResult.php.

References $message.

Referenced by ilCronJobRepositoryImpl\updateJobResult().

84  : string
85  {
86  return $this->message;
87  }
+ Here is the caller graph for this function:

◆ getStatus()

ilCronJobResult::getStatus ( )

Definition at line 51 of file class.ilCronJobResult.php.

References $status.

Referenced by ilCronJobRepositoryImpl\updateJobResult().

51  : int
52  {
53  return $this->status;
54  }
+ Here is the caller graph for this function:

◆ getValidStatus()

ilCronJobResult::getValidStatus ( )
protected
Returns
int[]

Definition at line 72 of file class.ilCronJobResult.php.

Referenced by setStatus().

72  : array
73  {
74  return [
75  self::STATUS_INVALID_CONFIGURATION,
76  self::STATUS_NO_ACTION,
77  self::STATUS_OK,
78  self::STATUS_CRASHED,
79  self::STATUS_FAIL,
80  self::STATUS_RESET,
81  ];
82  }
+ Here is the caller graph for this function:

◆ setCode()

ilCronJobResult::setCode ( string  $a_value)

Definition at line 104 of file class.ilCronJobResult.php.

104  : void
105  {
106  if (!in_array($a_value, self::getCoreCodes(), true)) {
107  throw new InvalidArgumentException(sprintf(
108  'The passed code "%s" is not valid, must be of one of: %s',
109  $a_value,
110  implode(', ', self::getCoreCodes())
111  ));
112  }
113 
114  $this->code = $a_value;
115  }

◆ setDuration()

ilCronJobResult::setDuration ( float  $a_value)

Definition at line 122 of file class.ilCronJobResult.php.

122  : void
123  {
124  $this->duration = number_format($a_value, 3, '.', '');
125  }

◆ setMessage()

ilCronJobResult::setMessage ( string  $value)

Definition at line 89 of file class.ilCronJobResult.php.

References ilStr\strLen().

89  : void
90  {
91  $value = trim($value);
92  if (ilStr::strLen($value) > 400) {
93  throw new InvalidArgumentException("The message must not exceed 400 characters");
94  }
95 
96  $this->message = $value;
97  }
static strLen(string $a_string)
Definition: class.ilStr.php:63
+ Here is the call graph for this function:

◆ setStatus()

ilCronJobResult::setStatus ( int  $a_value)

Definition at line 56 of file class.ilCronJobResult.php.

References getValidStatus().

Referenced by ilOerHarvester\run(), and ilCronEcsTaskScheduler\run().

56  : void
57  {
58  if (!in_array($a_value, $this->getValidStatus(), true)) {
59  throw new InvalidArgumentException(sprintf(
60  'The passed status "%s" is not valid, must be of one of: %s',
61  $a_value,
62  implode(', ', $this->getValidStatus())
63  ));
64  }
65 
66  $this->status = $a_value;
67  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $code

string ilCronJobResult::$code = null
protected

Definition at line 36 of file class.ilCronJobResult.php.

Referenced by getCode().

◆ $duration

string ilCronJobResult::$duration = '0'
protected

Definition at line 37 of file class.ilCronJobResult.php.

Referenced by getDuration().

◆ $message

string ilCronJobResult::$message = ''
protected

Definition at line 35 of file class.ilCronJobResult.php.

Referenced by getMessage().

◆ $status

int ilCronJobResult::$status = self::STATUS_NO_ACTION
protected

Definition at line 34 of file class.ilCronJobResult.php.

Referenced by getStatus().

◆ CODE_MANUAL_RESET

const ilCronJobResult::CODE_MANUAL_RESET = 'job_manual_reset'

Definition at line 31 of file class.ilCronJobResult.php.

Referenced by ilCronManagerImpl\resetJob().

◆ CODE_NO_RESULT

const ilCronJobResult::CODE_NO_RESULT = 'job_no_result'

Definition at line 30 of file class.ilCronJobResult.php.

Referenced by CronJobEntityTest\getEntity().

◆ CODE_SUPPOSED_CRASH

const ilCronJobResult::CODE_SUPPOSED_CRASH = 'job_auto_deactivation_time_limit'

Definition at line 32 of file class.ilCronJobResult.php.

Referenced by ilCronManagerImpl\runJob().

◆ STATUS_CRASHED

◆ STATUS_FAIL

◆ STATUS_INVALID_CONFIGURATION

const ilCronJobResult::STATUS_INVALID_CONFIGURATION = 1

◆ STATUS_NO_ACTION

◆ STATUS_OK

◆ STATUS_RESET

const ilCronJobResult::STATUS_RESET = 5

The documentation for this class was generated from the following file: