Home Manual Reference Source Test Repository
public class | source

BaseOperationBuilder

Defines the builder to execute an operation that is into catalog

Constructor Summary

Public Constructor
public

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

Set ackTimeout to operation.

public

Set a callback to operation.

public

Set a timeout of job.

public

Set notes to operation

public

Set operation retries

public

withParameter(parameter: *, value: *): *

public

Set parameters of the operation

public

Set number of retries that operation will have.

public

Set delay between operation retries.

public

Set a scattering max spread to operation.

public

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:

NameTypeAttributeDescription
ogapi InternalOpenGateAPI
  • nullable: false

this is configuration about Opengate North API.

config object
  • nullable: false

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

Return:

Operation

Throw:

Error

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.

Params:

NameTypeAttributeDescription
date Date
  • nullable: false
active boolean

If active is false, an operation is created in paused

Return:

BaseOperationBuilder | CronExpressionBuilder

Throw:

Error

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:

NameTypeAttributeDescription
date Date
  • nullable: false

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:

Error

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:

NameTypeAttributeDescription
date Date
  • nullable: false

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:

Error

throw error when date is not typeof Date

public executeIDLE(): BaseOperationBuilder source

The operation will be created in IDLE state

public executeImmediately(): BaseOperationBuilder source

The operation will be execute immediately.

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.

Params:

NameTypeAttributeDescription
minutes number
  • nullable: false
active boolean

If active is false, an operation is created in paused

Return:

BaseOperationBuilder | CronExpressionBuilder

Throw:

Error

throw error when minutes is not typeof number

public withAckTimeout(milliseconds: number, format: string): BaseOperationBuilder source

Set ackTimeout to operation.

Params:

NameTypeAttributeDescription
milliseconds number
  • nullable: false
format string

Can be 'milliseconds' || 'ms' ,'seconds' || 's', 'minutes' || 'm', 'hours' || 'h', 'days' || 'd', 'weeks' || 'w', 'months' || 'M'

Throw:

Error

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:

NameTypeAttributeDescription
url string

If null then parameter will be removed into builder

Throw:

Error

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.

Params:

NameTypeAttributeDescription
milliseconds number
  • nullable: false

if null then parameter will be removed into builder

format string

Can be 'milliseconds' || 'ms' ,'seconds' || 's', 'mintutes' || 'm', 'hours' || 'h', 'days' || 'd', 'weeks' || 'w', 'months' || 'M'

Throw:

Error

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:

NameTypeAttributeDescription
notes string
  • nullable: false

If null then parameter will be removed into builder

Throw:

Error

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:

NameTypeAttributeDescription
operationRetries Array

Throw:

Error

throw error when operationRetries is not typeof string

Example:

 ogapi.operations.builderFactory.newXXXBuilder().withOperationRetries(11)

public withParameter(parameter: *, value: *): * source

Params:

NameTypeAttributeDescription
parameter *
value *

Return:

*

public withParameters(parameters: object): BaseOperationBuilder source

Set parameters of the operation

Params:

NameTypeAttributeDescription
parameters object
  • nullable: false

Throw:

Error

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:

NameTypeAttributeDescription
retriesNumber number
  • nullable: false

Throw:

Error

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.

Params:

NameTypeAttributeDescription
milliseconds number
  • nullable: false
format string

Can be 'milliseconds' || 'ms' ,'seconds' || 's', 'minutes' || 'm', 'hours' || 'h', 'days' || 'd', 'weeks' || 'w', 'months' || 'M'

Throw:

Error

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:

NameTypeAttributeDescription
percentage number

if null then parameter will be removed into builder

Throw:

Error

throw error when percentage is not typeof number

Error

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.

Params:

NameTypeAttributeDescription
factor number

if null then parameter will be removed into builder

warningMaxRate number

Throw:

Error

throw error when factor is not typeof number

Error

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.

Params:

NameTypeAttributeDescription
milliseconds number
  • nullable: false
format string

Can be 'milliseconds' || 'ms' ,'seconds' || 's', 'minutes' || 'm', 'hours' || 'h', 'days' || 'd', 'weeks' || 'w', 'months' || 'M'

Throw:

Error

throw error when milliseconds is not typeof number

Example:

 ogapi.operations.builderFactory.newXXXBuilder().withTimeout(11)