| @@ 182-199 (lines=18) @@ | ||
| 179 | { |
|
| 180 | $_oJobEntityLocal = $this->oJobRepositoryLocal->getJob($sJobName); |
|
| 181 | ||
| 182 | if ($this->isAbleToStoreEntity($_oJobEntityLocal)) |
|
| 183 | { |
|
| 184 | if ($this->oJobRepositoryChronos->addJob($_oJobEntityLocal)) |
|
| 185 | { |
|
| 186 | $this->oJobIndexService->removeJob($_oJobEntityLocal->name); |
|
| 187 | $this->oLogger->notice(sprintf( |
|
| 188 | 'Job "%s" successfully added to chronos', |
|
| 189 | $_oJobEntityLocal->name |
|
| 190 | )); |
|
| 191 | ||
| 192 | return true; |
|
| 193 | } |
|
| 194 | ||
| 195 | $this->oLogger->error(sprintf( |
|
| 196 | 'Failed to add job "%s" to chronos', |
|
| 197 | $_oJobEntityLocal->name |
|
| 198 | )); |
|
| 199 | } |
|
| 200 | ||
| 201 | return false; |
|
| 202 | } |
|
| @@ 210-227 (lines=18) @@ | ||
| 207 | */ |
|
| 208 | private function removeJob($sJobName) |
|
| 209 | { |
|
| 210 | if ($this->isAbleToDeleteJob($sJobName)) |
|
| 211 | { |
|
| 212 | if ($this->oJobRepositoryChronos->removeJob($sJobName)) |
|
| 213 | { |
|
| 214 | $this->oJobIndexService->removeJob($sJobName); |
|
| 215 | $this->oLogger->notice(sprintf( |
|
| 216 | 'Job "%s" successfully removed from chronos', |
|
| 217 | $sJobName |
|
| 218 | )); |
|
| 219 | ||
| 220 | return true; |
|
| 221 | } |
|
| 222 | ||
| 223 | $this->oLogger->error(sprintf( |
|
| 224 | 'Failed to remove job "%s" from chronos', |
|
| 225 | $sJobName |
|
| 226 | )); |
|
| 227 | } |
|
| 228 | ||
| 229 | return false; |
|
| 230 | } |
|