A running instance of an agent definition for one particular user. The definition it runs is named rather than referenced, and any per instance changes to it are held as a JSON override that is merged over the definition to produce the agent's effective configuration. An agent carries its own timers: the next due time is kept in the timer date so the background scanner can pick it up, and while it is being processed the started date is set and cleared again on completion.

Group: Database Entities

Implements: Serializable, Relational


Properties

PropertyReturnsDescription
adminOrgOrganisationThe organisation that owns this agent, which scopes it to a single account and decides which cluster processes its timers.
agentDefNameStringThe name of the agent definition this agent runs. The definition is looked up by this name rather than joined to, so an agent survives its definition being edited.
completedProcessingAtDateWhen this agent's timer last finished processing. Null until the first run completes.
createdDateDateWhen this agent was created for its owner.
idlongThe database identifier of this agent.
jsonOverridesStringPer agent changes to its definition, as JSON in the same shape as the agent definition. These are merged over the named definition to give the configuration this agent actually runs with. Null when the agent uses its definition unchanged.
nextTimersStringThe due time of each of the agent's named timers, written as name=date pairs separated by semicolons. The soonest of these is what the timer date holds.
ownerProfileThe user this agent runs for. Agents are per user, so the same definition will have one agent per person using it.
startedProcessingAtDateWhen the current run of this agent's timer started. It is set as the agent is claimed for processing and cleared when the run finishes, so a value here means the agent is in flight and the scanner will leave it alone.
timerDateDateWhen this agent next needs attention. Once the current time reaches it the background scanner picks the agent up, provided it is not already being processed. Null means the agent has nothing scheduled and will not be scanned.
titleStringFree text label for this agent, shown to the user. Unlike the agent definition name it is a display value only and carries no uniqueness guarantee.

Methods

getId() · setId(long id) · getAgentDefName() · setAgentDefName(String agentDefName) · getTitle() · setTitle(String title) · getAdminOrg() · setAdminOrg(Organisation adminOrg) · getOwner() · setOwner(Profile owner) · getJsonOverrides() · getNextTimers() · setNextTimers(String nextTimerName) · getTimerDate() · setTimerDate(Date timerDate) · getStartedProcessingAt() · setStartedProcessingAt(Date startedProcessingAt) · getCompletedProcessingAt() · setCompletedProcessingAt(Date completedProcessingAt) · getCreatedDate() · setCreatedDate(Date createdDate) · rowId()

getId()

Returns: long

The database identifier of this agent.

setId(long id)

Returns: void

Sets the database identifier of this agent. Normally left to Hibernate to assign.

ParameterDescription
idthe primary key of this agent

getAgentDefName()

Returns: String

The name of the agent definition this agent runs. The definition is looked up by this name rather than joined to, so an agent survives its definition being edited.

setAgentDefName(String agentDefName)

Returns: void

Sets the name of the agent definition this agent runs.

ParameterDescription
agentDefNamethe name of the agent definition

getTitle()

Returns: String

Free text label for this agent, shown to the user. Unlike the agent definition name it is a display value only and carries no uniqueness guarantee.

setTitle(String title)

Returns: void

Sets the free text label shown for this agent.

ParameterDescription
titlethe display title of this agent

getAdminOrg()

Returns: Organisation

The organisation that owns this agent, which scopes it to a single account and decides which cluster processes its timers.

setAdminOrg(Organisation adminOrg)

Returns: void

Sets the organisation that owns this agent.

ParameterDescription
adminOrgthe owning organisation

getOwner()

Returns: Profile

The user this agent runs for. Agents are per user, so the same definition will have one agent per person using it.

setOwner(Profile owner)

Returns: void

Sets the user this agent runs for.

ParameterDescription
ownerthe profile this agent belongs to

getJsonOverrides()

Returns: String

Per agent changes to its definition, as JSON in the same shape as the agent definition. These are merged over the named definition to give the configuration this agent actually runs with. Null when the agent uses its definition unchanged.

getNextTimers()

Returns: String

The due time of each of the agent's named timers, written as name=date pairs separated by semicolons. The soonest of these is what the timer date holds.

setNextTimers(String nextTimerName)

Returns: void

Sets the due time of each of the agent's named timers.

ParameterDescription
nextTimerNamethe encoded list of timer names and their due dates

getTimerDate()

Returns: Date

When this agent next needs attention. Once the current time reaches it the background scanner picks the agent up, provided it is not already being processed. Null means the agent has nothing scheduled and will not be scanned.

setTimerDate(Date timerDate)

Returns: void

Sets when this agent next needs attention.

ParameterDescription
timerDatethe date the next timer is due, or null to stop it being scanned

getStartedProcessingAt()

Returns: Date

When the current run of this agent's timer started. It is set as the agent is claimed for processing and cleared when the run finishes, so a value here means the agent is in flight and the scanner will leave it alone.

setStartedProcessingAt(Date startedProcessingAt)

Returns: void

Sets when the current run of this agent's timer started.

ParameterDescription
startedProcessingAtthe date processing started, or null once it has finished

getCompletedProcessingAt()

Returns: Date

When this agent's timer last finished processing. Null until the first run completes.

setCompletedProcessingAt(Date completedProcessingAt)

Returns: void

Sets when this agent's timer last finished processing.

ParameterDescription
completedProcessingAtthe date processing last completed

getCreatedDate()

Returns: Date

When this agent was created for its owner.

setCreatedDate(Date createdDate)

Returns: void

Sets when this agent was created.

ParameterDescription
createdDatethe date this agent was created

rowId()

Returns: Long

The agent's primary key, exposed under the common name used by relational lookups.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.