# Class: Job

## jala.IndexManager.Job(id, type, data)

Instances of this class represent a single index manipulation job to be processed by the index manager.

## Constructor

#### new Job(id, type, data)

Creates a new Job instance.

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | Number | The Id of the job
`type` | Number | The type of job, which can be either jala.IndexManager.Job.ADD, jala.IndexManager.Job.REMOVE or jala.IndexManager.Job.OPTIMIZE.
`data` | Object | The data needed to process the job.

Source:
  - jala/code/IndexManager.js, line 708
See:
  - jala.IndexManager.Job

##### Returns:

A newly created Job instance.

### Members

#### callback

The data needed to process this job. For adding jobs this property must contain the helma.Search.Document instance to add to the index. For removal job this property must contain the unique identifier of the document that should be removed from the index. For optimizing jobs this property is null.

Source:
  - jala/code/IndexManager.js, line 722

#### createtime :Date

The date and time at which this job was created.

##### Type:

- Date

Source:
  - jala/code/IndexManager.js, line 736

#### errors :Number

An internal error counter which is increased whenever processing the job failed.

##### Type:

- Number

Source:
  - jala/code/IndexManager.js, line 730
See:
  - jala.IndexManager.MAXTRIES

#### type :Number

The type of the job

##### Type:

- Number

Source:
  - jala/code/IndexManager.js, line 713

#### (static, readonly) ADD :Number

Constant defining an add job

##### Type:

- Number

Source:
  - jala/code/IndexManager.js, line 751

#### (static, readonly) OPTIMIZE :Number

Constant defining an optimizing job

##### Type:

- Number

Source:
  - jala/code/IndexManager.js, line 765

#### (static, readonly) REMOVE :Number

Constant defining a removal job

##### Type:

- Number

Source:
  - jala/code/IndexManager.js, line 758