ILIAS  release_8 Revision v8.24
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.

99 : ?string
100 {
101 return $this->code;
102 }

References $code.

◆ getCoreCodes()

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

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

References CODE_MANUAL_RESET, CODE_NO_RESULT, and CODE_SUPPOSED_CRASH.

Referenced by ilCronManagerTableGUI\formatResultInfo().

+ Here is the caller graph for this function:

◆ getDuration()

ilCronJobResult::getDuration ( )

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

117 : float
118 {
119 return (float) $this->duration;
120 }

References $duration.

◆ getMessage()

ilCronJobResult::getMessage ( )

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

84 : string
85 {
86 return $this->message;
87 }

References $message.

◆ getStatus()

ilCronJobResult::getStatus ( )

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

51 : int
52 {
53 return $this->status;
54 }

References $status.

◆ getValidStatus()

ilCronJobResult::getValidStatus ( )
protected

◆ 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.

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

References ilStr\strLen().

+ Here is the call graph for this function:

◆ setStatus()

ilCronJobResult::setStatus ( int  $a_value)

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

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 }

References getValidStatus().

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

+ 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 getCoreCodes(), and ilCronManagerImpl\resetJob().

◆ CODE_NO_RESULT

const ilCronJobResult::CODE_NO_RESULT = 'job_no_result'

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

Referenced by getCoreCodes().

◆ CODE_SUPPOSED_CRASH

const ilCronJobResult::CODE_SUPPOSED_CRASH = 'job_auto_deactivation_time_limit'

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

Referenced by getCoreCodes(), and ilCronManagerImpl\runJob().

◆ STATUS_CRASHED

◆ STATUS_FAIL

◆ STATUS_INVALID_CONFIGURATION

const ilCronJobResult::STATUS_INVALID_CONFIGURATION = 1

◆ STATUS_NO_ACTION

◆ STATUS_OK

◆ STATUS_RESET


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