ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\BackgroundTasks\Task\Job\JobResult Class Reference
+ Collaboration diagram for ILIAS\BackgroundTasks\Task\Job\JobResult:

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

final const int STATUS_INVALID_CONFIGURATION = 1
 
final const int STATUS_NO_ACTION = 2
 
final const int STATUS_OK = 3
 
final const int STATUS_CRASHED = 4
 
final const int STATUS_RESET = 5
 
final const int STATUS_FAIL = 6
 
final const string CODE_NO_RESULT = 'job_no_result'
 
final const string CODE_MANUAL_RESET = 'job_manual_reset'
 
final const string 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 23 of file JobResult.php.

Member Function Documentation

◆ getCode()

ILIAS\BackgroundTasks\Task\Job\JobResult::getCode ( )

Definition at line 103 of file JobResult.php.

References ILIAS\BackgroundTasks\Task\Job\JobResult\$code.

103  : ?string
104  {
105  return $this->code;
106  }

◆ getCoreCodes()

static ILIAS\BackgroundTasks\Task\Job\JobResult::getCoreCodes ( )
static
Returns
list<string>

Definition at line 44 of file JobResult.php.

Referenced by ILIAS\BackgroundTasks\Task\Job\Manager\UI\JobTable\formatResultInfo().

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

◆ getDuration()

ILIAS\BackgroundTasks\Task\Job\JobResult::getDuration ( )

Definition at line 123 of file JobResult.php.

References ILIAS\BackgroundTasks\Task\Job\JobResult\$duration.

123  : float
124  {
125  return (float) $this->duration;
126  }

◆ getMessage()

ILIAS\BackgroundTasks\Task\Job\JobResult::getMessage ( )

Definition at line 88 of file JobResult.php.

References ILIAS\BackgroundTasks\Task\Job\JobResult\$message.

88  : string
89  {
90  return $this->message;
91  }

◆ getStatus()

ILIAS\BackgroundTasks\Task\Job\JobResult::getStatus ( )

Definition at line 53 of file JobResult.php.

References ILIAS\BackgroundTasks\Task\Job\JobResult\$status.

53  : int
54  {
55  return $this->status;
56  }

◆ getValidStatus()

ILIAS\BackgroundTasks\Task\Job\JobResult::getValidStatus ( )
protected
Returns
list<int>

Definition at line 76 of file JobResult.php.

Referenced by ILIAS\BackgroundTasks\Task\Job\JobResult\setStatus().

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

◆ setCode()

ILIAS\BackgroundTasks\Task\Job\JobResult::setCode ( string  $a_value)

Definition at line 108 of file JobResult.php.

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

◆ setDuration()

ILIAS\BackgroundTasks\Task\Job\JobResult::setDuration ( float  $a_value)

Definition at line 128 of file JobResult.php.

128  : void
129  {
130  $this->duration = number_format($a_value, 3, '.', '');
131  }

◆ setMessage()

ILIAS\BackgroundTasks\Task\Job\JobResult::setMessage ( string  $value)

Definition at line 93 of file JobResult.php.

References ilStr\strLen().

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

◆ setStatus()

ILIAS\BackgroundTasks\Task\Job\JobResult::setStatus ( int  $a_value)

Definition at line 58 of file JobResult.php.

References ILIAS\BackgroundTasks\Task\Job\JobResult\getValidStatus().

Referenced by ilCronEcsTaskScheduler\run().

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

Field Documentation

◆ $code

string ILIAS\BackgroundTasks\Task\Job\JobResult::$code = null
protected

Definition at line 38 of file JobResult.php.

Referenced by ILIAS\BackgroundTasks\Task\Job\JobResult\getCode().

◆ $duration

string ILIAS\BackgroundTasks\Task\Job\JobResult::$duration = '0'
protected

Definition at line 39 of file JobResult.php.

Referenced by ILIAS\BackgroundTasks\Task\Job\JobResult\getDuration().

◆ $message

string ILIAS\BackgroundTasks\Task\Job\JobResult::$message = ''
protected

Definition at line 37 of file JobResult.php.

Referenced by ILIAS\BackgroundTasks\Task\Job\JobResult\getMessage().

◆ $status

int ILIAS\BackgroundTasks\Task\Job\JobResult::$status = self::STATUS_NO_ACTION
protected

Definition at line 36 of file JobResult.php.

Referenced by ILIAS\BackgroundTasks\Task\Job\JobResult\getStatus().

◆ CODE_MANUAL_RESET

final const string ILIAS\BackgroundTasks\Task\Job\JobResult::CODE_MANUAL_RESET = 'job_manual_reset'

◆ CODE_NO_RESULT

final const string ILIAS\BackgroundTasks\Task\Job\JobResult::CODE_NO_RESULT = 'job_no_result'

Definition at line 32 of file JobResult.php.

◆ CODE_SUPPOSED_CRASH

final const string ILIAS\BackgroundTasks\Task\Job\JobResult::CODE_SUPPOSED_CRASH = 'job_auto_deactivation_time_limit'

◆ STATUS_CRASHED

final const int ILIAS\BackgroundTasks\Task\Job\JobResult::STATUS_CRASHED = 4

◆ STATUS_FAIL

final const int ILIAS\BackgroundTasks\Task\Job\JobResult::STATUS_FAIL = 6

◆ STATUS_INVALID_CONFIGURATION

final const int ILIAS\BackgroundTasks\Task\Job\JobResult::STATUS_INVALID_CONFIGURATION = 1

◆ STATUS_NO_ACTION

final const int ILIAS\BackgroundTasks\Task\Job\JobResult::STATUS_NO_ACTION = 2

◆ STATUS_OK

final const int ILIAS\BackgroundTasks\Task\Job\JobResult::STATUS_OK = 3

◆ STATUS_RESET

final const int ILIAS\BackgroundTasks\Task\Job\JobResult::STATUS_RESET = 5

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