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
| Property | Returns | Description |
|---|---|---|
| adminOrg | Organisation | The organisation that owns this agent, which scopes it to a single account and decides which cluster processes its timers. |
| agentDefName | 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. |
| completedProcessingAt | Date | When this agent's timer last finished processing. Null until the first run completes. |
| createdDate | Date | When this agent was created for its owner. |
| id | long | The database identifier of this agent. |
| jsonOverrides | 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. |
| nextTimers | 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. |
| owner | Profile | The user this agent runs for. Agents are per user, so the same definition will have one agent per person using it. |
| startedProcessingAt | 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. |
| timerDate | 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. |
| title | 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. |
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.
| Parameter | Description |
|---|---|
id | the 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.
| Parameter | Description |
|---|---|
agentDefName | the 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.
| Parameter | Description |
|---|---|
title | the 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.
| Parameter | Description |
|---|---|
adminOrg | the 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.
| Parameter | Description |
|---|---|
owner | the 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.
| Parameter | Description |
|---|---|
nextTimerName | the 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.
| Parameter | Description |
|---|---|
timerDate | the 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.
| Parameter | Description |
|---|---|
startedProcessingAt | the 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.
| Parameter | Description |
|---|---|
completedProcessingAt | the 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.
| Parameter | Description |
|---|---|
createdDate | the date this agent was created |
rowId()
Returns: Long
The agent's primary key, exposed under the common name used by relational lookups.