import BaseOperationBuilder from 'opengate-js/src/operations/catalog/BaseOperationBuilder.js'BaseOperationBuilder
Defines the builder to execute an operation that is into catalog
Constructor Summary
| Public Constructor | ||
| public |
constructor(ogapi: InternalOpenGateAPI, config: object) Constructor |
|
Member Summary
| Public Members | ||
| public |
Util used into BaseOperationBuilder to append entities the three different ways. |
|
Method Summary
| Public Methods | ||
| public |
Build a instance of Operation |
|
| public |
executeAtDate(date: Date, active: boolean): BaseOperationBuilder | CronExpressionBuilder The operation will be created with delayed start or if you not pass any argument then the method return a cron expression builder. |
|
| public |
executeEach(date: Date, name: string, end: number or Date, active: boolean, description: string): ExecuteEachBuilder The operation will execute with a period that you must define with ExecuteEachBuilder |
|
| public |
executeEvery(date: Date, name: string, end: number or Date, active: boolean, description: string): ExecuteEveryBuilder The operation will execute with a period that you must define with ExecuteEveryBuilder |
|
| public |
The operation will be created in IDLE state |
|
| public |
The operation will be execute immediately. |
|
| public |
executeLater(minutes: number, active: boolean): BaseOperationBuilder | CronExpressionBuilder The operation will be created with delayed start or if you not pass any argument then the method return a cron expression builder. |
|
| public |
withAckTimeout(milliseconds: number, format: string): BaseOperationBuilder Set ackTimeout to operation. |
|
| public |
Set a callback to operation. |
|
| public |
withJobTimeout(milliseconds: number, format: string): BaseOperationBuilder Set a timeout of job. |
|
| public |
withNotes(notes: string): BaseOperationBuilder Set notes to operation |
|
| public |
withOperationRetries(operationRetries: Array): BaseOperationBuilder Set operation retries |
|
| public |
withParameter(parameter: *, value: *): * |
|
| public |
withParameters(parameters: object): BaseOperationBuilder Set parameters of the operation |
|
| public |
withRetries(retriesNumber: number): BaseOperationBuilder Set number of retries that operation will have. |
|
| public |
withRetriesDelay(milliseconds: number, format: string): BaseOperationBuilder Set delay between operation retries. |
|
| public |
withScatteringMaxSpread(percentage: number): BaseOperationBuilder Set a scattering max spread to operation. |
|
| public |
withScatteringStrategy(factor: number, warningMaxRate: number): BaseOperationBuilder Set a scattering strategy to operation. |
|
| public |
withTimeout(milliseconds: number, format: string): BaseOperationBuilder Set timeout to operation. |
|
Public Constructors
public constructor(ogapi: InternalOpenGateAPI, config: object) source
Constructor
Params:
| Name | Type | Attribute | Description |
| ogapi | InternalOpenGateAPI |
|
this is configuration about Opengate North API. |
| config | object |
|
this is configuration about operation. |
Public Members
public appendEntitiesBy: * source
Util used into BaseOperationBuilder to append entities the three different ways. By filter, By tags, By entityList
Public Methods
public build(): Operation source
Build a instance of Operation
Throw:
Throw error if there are required parameters who have not been set |
Example:
ogapi.operations.builderFactory.newXXXBuilder().build()
public executeAtDate(date: Date, active: boolean): BaseOperationBuilder | CronExpressionBuilder source
The operation will be created with delayed start or if you not pass any argument then the method return a cron expression builder.
Throw:
throw error when minutes is not typeof number |
public executeEach(date: Date, name: string, end: number or Date, active: boolean, description: string): ExecuteEachBuilder source
The operation will execute with a period that you must define with ExecuteEachBuilder
Params:
| Name | Type | Attribute | Description |
| date | Date |
|
Date when operation will be executed |
| name | string | Name associated to periodicity |
|
| end | number or Date | When periodicity ends. By repetitions or by date |
|
| active | boolean | If active is false, an operation is created in paused |
|
| description | string | Description associated to periodicity |
Throw:
throw error when date is not typeof Date |
public executeEvery(date: Date, name: string, end: number or Date, active: boolean, description: string): ExecuteEveryBuilder source
The operation will execute with a period that you must define with ExecuteEveryBuilder
Params:
| Name | Type | Attribute | Description |
| date | Date |
|
Date when operation will be executed |
| name | string | Name associated to periodicity |
|
| end | number or Date | When periodicity ends. By repetitions or by date |
|
| active | boolean | If active is false, an operation is created in paused |
|
| description | string | Description associated to periodicity |
Throw:
throw error when date is not typeof Date |
public executeLater(minutes: number, active: boolean): BaseOperationBuilder | CronExpressionBuilder source
The operation will be created with delayed start or if you not pass any argument then the method return a cron expression builder.
Throw:
throw error when minutes is not typeof number |
public withAckTimeout(milliseconds: number, format: string): BaseOperationBuilder source
Set ackTimeout to operation.
Throw:
throw error when milliseconds is not typeof number |
Example:
ogapi.operations.builderFactory.newXXXBuilder().withAckTimeout(11)
public withCallback(url: string): BaseOperationBuilder source
Set a callback to operation. If it is set also will be set notify with true value
Params:
| Name | Type | Attribute | Description |
| url | string | If null then parameter will be removed into builder |
Throw:
throw error when url is not typeof string |
Example:
ogapi.operations.builderFactory.newXXXBuilder().withCallback("http://my.web")
public withJobTimeout(milliseconds: number, format: string): BaseOperationBuilder source
Set a timeout of job.
Throw:
throw error when milliseconds is not typeof number |
Example:
ogapi.operations.builderFactory.newXXXBuilder().withJobTimeout(180)
public withNotes(notes: string): BaseOperationBuilder source
Set notes to operation
Params:
| Name | Type | Attribute | Description |
| notes | string |
|
If null then parameter will be removed into builder |
Throw:
throw error when notes is not typeof string |
Example:
ogapi.operations.builderFactory.newXXXBuilder().withNotes("own notes")
public withOperationRetries(operationRetries: Array): BaseOperationBuilder source
Set operation retries
Params:
| Name | Type | Attribute | Description |
| operationRetries | Array |
Throw:
throw error when operationRetries is not typeof string |
Example:
ogapi.operations.builderFactory.newXXXBuilder().withOperationRetries(11)
public withParameter(parameter: *, value: *): * source
Params:
| Name | Type | Attribute | Description |
| parameter | * | ||
| value | * |
Return:
| * |
public withParameters(parameters: object): BaseOperationBuilder source
Set parameters of the operation
Params:
| Name | Type | Attribute | Description |
| parameters | object |
|
Throw:
throw error when parameters is not typeof object |
Example:
ogapi.operations.builderFactory.newXXXBuilder().withParameters({ param1: 'value1', param2: 'value2'})
public withRetries(retriesNumber: number): BaseOperationBuilder source
Set number of retries that operation will have.
Params:
| Name | Type | Attribute | Description |
| retriesNumber | number |
|
Throw:
throw error when retriesNumber is not typeof number |
Example:
ogapi.operations.builderFactory.newXXXBuilder().withRetries(2)
public withRetriesDelay(milliseconds: number, format: string): BaseOperationBuilder source
Set delay between operation retries.
Throw:
throw error when milliseconds is not typeof number |
Example:
ogapi.operations.builderFactory.newXXXBuilder().withRetriesDelay(11)
public withScatteringMaxSpread(percentage: number): BaseOperationBuilder source
Set a scattering max spread to operation.
Params:
| Name | Type | Attribute | Description |
| percentage | number | if null then parameter will be removed into builder |
Throw:
throw error when percentage is not typeof number |
|
throw error when percentage is greater than 100 and less than 0 |
Example:
ogapi.operations.builderFactory.newXXXBuilder().withScatteringMaxSpread(20)
public withScatteringStrategy(factor: number, warningMaxRate: number): BaseOperationBuilder source
Set a scattering strategy to operation.
Throw:
throw error when factor is not typeof number |
|
throw error when factor is greater than 100 and less than 0 |
Example:
ogapi.operations.builderFactory.newXXXBuilder().withScatteringStrategy(20,4)
public withTimeout(milliseconds: number, format: string): BaseOperationBuilder source
Set timeout to operation.
Throw:
throw error when milliseconds is not typeof number |
Example:
ogapi.operations.builderFactory.newXXXBuilder().withTimeout(11)