public class ControllerState extends TieRuntimeState
RuntimeState.Status
Modifier and Type | Field and Description |
---|---|
static String |
CHALLENGERACKNOWLEDGEDATE_ATTRIBUTE
The name of the Attribute representing
The date of the last acknowledge by the Node challenging to act as the controller.
|
static String |
CHALLENGERNODESTATE_ATTRIBUTE
The name of the Attribute representing
The NodeState that is is challenging to act as the runtime controller.
|
static String |
CLASS_NAME
The name of the ClassObject representing this class.
|
static String |
CONTROLLERACKNOWLEDGEDATE_ATTRIBUTE
The name of the Attribute representing
The date of the last acknowledge by the Node acting as the controller.
|
static String |
CONTROLLERNODESTATE_ATTRIBUTE
The name of the Attribute representing
The NodeState that is acting as the runtime controller.
|
CONFIGURATIONBUNDLE_ATTRIBUTE, CONFIGURATIONNAME_ATTRIBUTE, CONFIGURATIONOVERRIDEBUNDLE_ATTRIBUTE, CONTROLLERALERT_ATTRIBUTE, CONTROLLERREPLY_ATTRIBUTE, CONTROLLERREQUEST_ATTRIBUTE, CREATEDATE_ATTRIBUTE, DISPOSEDATE_ATTRIBUTE, MANAGINGNODESTATE_ATTRIBUTE, NAME_ATTRIBUTE, RUNTIMESTATEBUNDLE_ATTRIBUTE, STATEPROPERTYTABLE_ATTRIBUTE, STATUS_ATTRIBUTE, STATUSCODE_DISPOSED, STATUSCODE_FINALIZED, STATUSCODE_RUNNING, STATUSCODE_STARTING, STATUSCODE_STOPPED, STATUSCODE_STOPPING, STATUSCODE_SUSPENDED, STATUSCODE_UNKNOWN, STATUSDATE_ATTRIBUTE
ACTIVE_ATTRIBUTE, POLICYBUNDLE_ATTRIBUTE, POLICYLISTS_ATTRIBUTE, PROPERTYBUNDLE_ATTRIBUTE
DOMAIN_UNIQUENAME_DEFAULT_DELIMITER, m_ClassId, m_Id, m_Session
Modifier | Constructor and Description |
---|---|
protected |
ControllerState(LibrarySession session,
Long id,
Long classId,
S_LibraryObjectData data)
Construct a ControllerState object.
|
Modifier and Type | Method and Description |
---|---|
void |
acknowledgeChallenger()
Acknowledge as Challenger.
|
void |
acknowledgeController()
Acknowledge as Controller.
|
void |
checkControllerActions(RuntimeState rs)
Checks the specified RuntimeState for any required Controller actions.
|
protected void |
clearChallenger()
Clear the current Challenger.
|
void |
clearController()
Clear the Controller.
|
static ControllerState |
create(LibrarySession sess,
String name,
List<AttributeValueTable> propsList)
Create a ControllerState based on the specified inputs.
|
static ControllerState |
get(LibrarySession session)
Gets the singleton ControllerState instance.
|
long |
getAcknowledgeDateExpirationPeriod()
Gets the acknowledge date expiration period, expressed as a number
of milliseconds such as 40000.
|
String |
getAcknowledgeDateExpirationPeriodString()
Gets the acknowledge date expiration period, expressed as a String
such as "40S".
|
Date |
getChallengerAcknowledgeDate()
Gets The date of the last acknowledge by the Node challenging to act as the controller.
|
NodeState |
getChallengerNodeState()
Gets The NodeState that is is challenging to act as the runtime controller.
|
Date |
getControllerAcknowledgeDate()
Gets The date of the last acknowledge by the Node acting as the controller.
|
NodeState |
getControllerNodeState()
Gets The NodeState that is acting as the runtime controller.
|
ControllerPlan |
getControllerPlan()
Get the current ControllerPlan.
|
ControllerPlanExecution |
getControllerPlanExecution()
Get the current ControllerPlanExecution.
|
static String |
getRuntimeSystemSummary(LibrarySession session,
boolean showDates)
Gets a basic printable Runtime system summary.
|
void |
handleEvent(IfsEvent event)
Handles the specified event.
|
boolean |
hasChallengerDuties(NodeState callingNode)
Detects if there are any regular challenge duties.
|
boolean |
isAcknowledgeDateExpired(Date ackDate)
Checks if the specified acknowledge date is non-null and
representing a date that is older than the specified time period
associated with this object.
|
void |
performTimedChallengerDuties(NodeState callingNode)
Handles the regular challenge duties.
|
void |
performTimedControllerDuties(NodeState callingNode)
Perform timed Controller duties.
|
void |
setControllerPlan(ControllerPlan cplan)
Set the current ControllerPlan.
|
void |
setControllerPlanExecution(ControllerPlanExecution cplanExec)
Set the current ControllerPlanExecution.
|
void |
takeoverChallenger(NodeState callingNode)
Take over as Challenger.
|
protected void |
takeoverController(NodeState callingNode)
Take over as Controller.
|
addStateProperty, getAuditEvents, getConfigurationBundle, getConfigurationName, getConfigurationOverrideAuditEventKey, getConfigurationOverrideBundle, getConfigurationOverridePropertyValue, getConfigurationPropertyValue, getControllerAlert, getControllerReply, getControllerRequest, getCreateDate, getDisposeDate, getManagingNodeState, getNodeState, getRuntimeClassification, getRuntimeStateBundle, getRuntimeStatePropertyValue, getRuntimeStates, getStateProperty, getStatePropertyTable, getStatePropertyTableSnapshot, getStatus, getStatusCode, getStatusDate, getStatusName, hasNameAttribute, isAssigned, isControllerReplyActive, isControllerRequestActive, isDisposed, isFinalized, isRunning, isStopped, isStopping, postAuditEvent, postAuditEvent, postAuditEvent, postAuditEvent, postAuditEvent, postConfigurationOverrideRequest, preFree, putConfigurationOverrideProperty, putConfigurationProperty, putRuntimeStateProperty, removeAllConfigurationOverrideProperties, removeAllConfigurationProperties, removeAllRuntimeStateProperties, removeAllStateProperties, removeConfigurationOverrideProperty, removeConfigurationProperty, removeRuntimeStateProperty, removeStateProperty, setConfigurationBundle, setConfigurationOverrideBundle, setStatus, setStatusCode, setStatusDisposed, setStatusFinalized, setStatusRunning, setStatusStarting, setStatusStopped, setStatusStopping, setStatusSuspended, updateControllerReplyForAcknowledge, updateControllerReplyForNonAcknowledge, updateForSimpleControllerAlert, updateForSimpleControllerAlert, updateForSimpleControllerJob, updateForSimpleControllerReply, updateForSimpleControllerRequest, updateForSimpleControllerRequest
addCategory, constructSystemObject, constructSystemObjectVector, free, freeCategories, getCategories, getCategories, getCategories, getCategories, getPolicyBundle, getPolicyLists, handleCreate, hasPropertyBundleAttribute, isActive, postCreate, postUpdate, preCreate, preUpdate, putPolicy, removeAllPolicies, removePolicy, removePolicy, setActive, setPolicyBundle, setPolicyLists
added, addSimpleProperty, addSimpleProperty, applyProperties, auditCreated, auditUpdated, canPurge, checkIfPropertyBundleSupported, checkRequiredAttributeSet, clearCopyContext, clearFreeContext, clearUpdateContext, compareTo, constructIdArray, constructIdArray, constructLibraryObject, constructLibraryObjectVector, createDedicatedPropertyBundle, createInstance, deriveDomainUniqueName, dispose, equals, equals, free, freeAll, get, getAttribute, getAttributeByUpperCaseName, getAttributes, getAttributesByUpperCaseNames, getAuditDomainContext, getAuditEventFolderContext, getClassId, getClassname, getClassName, getClassObject, getCommonName, getCommonNameAndClass, getCopyContext, getCreateContext, getData, getDefinition, getDefinitionForSimplePropertyUpdates, getEffectivePolicyListElements, getEventualAttributeByUpperCaseName, getFreeContext, getId, getLabel, getName, getObjectReferenceAttribute, getOperationActionSpecificationContext, getPropertyBundle, getPropertyValue, getPublicObjectAttribute, getResourceString, getResourceString, getSchemaObjectAttribute, getSession, getSessionInterface, getSharedStateFactory, getSimpleObjectAttribute, getSimpleProperties, getSimpleProperty, getSimplePropertyValue, getStringIdentifier, getSystemObjectAttribute, getTraceLogger, getUpdateContext, handleAdminModeChange, handleFree, handleUpdate, hashCode, invalidateState, invokeOperation, invokeOperation, invokeServerMethod, isConnected, isCoreEventPostingEnabled, isInstanceOf, isPersistent, isTraced, isValidEventType, lockRows, lookupInstanceLabel, performPostCreateExtensions, performPostFreeExtensions, performPostUpdateExtensions, performPreCreateExtensions, performPreFreeExtensions, performPreUpdateExtensions, postEvent, postEvent, postFree, prePostAuditEvent, putProperty, putProperty, removeAllProperties, removeAllSimpleProperties, removeAllSimpleProperties, removed, removeProperty, removeSimpleProperty, removeSimpleProperty, renderAsRandomAccessContent, renderAsReader, renderAsStream, setAttribute, setAttribute, setAttributes, setAttributes, setCopyContext, setFreeContext, setId, setName, setPropertyBundle, setPropertyValue, setUpdateContext, toString, trace, trustHandleCreate, trustHandleCreateAsAdmin, trustHandleFree, trustHandleFreeAsAdmin, trustHandleUpdate, trustHandleUpdateAsAdmin, update, updateAndExposeDefinition, validatePropertyValues, vectorLibraryObjectElement, vectorToLibraryObjectArray, verifyAdministrationMode, verifyConnected, verifyPersistent, verifySystemUserAccess, verifyTargetObject
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAttributeByUpperCaseName, getClassId, getId, getSessionInterface
getTraceLogger, isTraced, trace
public static final String CLASS_NAME
public static final String CONTROLLERNODESTATE_ATTRIBUTE
public static final String CONTROLLERACKNOWLEDGEDATE_ATTRIBUTE
public static final String CHALLENGERNODESTATE_ATTRIBUTE
public static final String CHALLENGERACKNOWLEDGEDATE_ATTRIBUTE
protected ControllerState(LibrarySession session, Long id, Long classId, S_LibraryObjectData data) throws IfsException
session
- current LibrarySessionid
- object idclassId
- class iddata
- data componentIfsException
- if the operation failspublic static ControllerState create(LibrarySession sess, String name, List<AttributeValueTable> propsList) throws IfsException
sess
- the session contextname
- the name to use for the instancepropsList
- the initial state propertiesIfsException
- if the operation failspublic NodeState getControllerNodeState() throws IfsException
IfsException
- if the operation failspublic Date getControllerAcknowledgeDate() throws IfsException
IfsException
- if the operation failspublic NodeState getChallengerNodeState() throws IfsException
IfsException
- if the operation failspublic Date getChallengerAcknowledgeDate() throws IfsException
IfsException
- if the operation failspublic static ControllerState get(LibrarySession session) throws IfsException
session
- the session contextIfsException
- if the operation fails,
or if the singleton object does not existpublic static String getRuntimeSystemSummary(LibrarySession session, boolean showDates) throws IfsException
session
- the session contextshowDates
- whether to show the date valuesIfsException
- if the operation failspublic void performTimedControllerDuties(NodeState callingNode) throws IfsException
Called from the Node that is currently listed as the Controller. First check to see if that Node has been challenged as the Controller - the current implementation assumes that the challenger had a good reason to challenge (e.g. the current Controller was not acknowledging in a timely manner), so it gives up the Controller role, allowing the challenger to take over.
callingNode
- the NodeState for the callerIfsException
- if the operation failspublic boolean hasChallengerDuties(NodeState callingNode) throws IfsException
callingNode
- the NodeState for the callerIfsException
- if the operation failspublic void performTimedChallengerDuties(NodeState callingNode) throws IfsException
callingNode
- the NodeState for the callerIfsException
- if the operation failspublic void acknowledgeController() throws IfsException
IfsException
- if the operation failsprotected void takeoverController(NodeState callingNode) throws IfsException
callingNode
- the NodeState for the callerIfsException
- if the operation failspublic void clearController() throws IfsException
IfsException
- if the operation failspublic void acknowledgeChallenger() throws IfsException
IfsException
- if the operation failspublic void takeoverChallenger(NodeState callingNode) throws IfsException
callingNode
- the NodeState for the callerIfsException
- if the operation failsprotected void clearChallenger() throws IfsException
IfsException
- if the operation failspublic boolean isAcknowledgeDateExpired(Date ackDate) throws IfsException
If the specified Date object is null, false is returned. Note: this time period is currently hardcoded to be 30 seconds.
ackDate
- the Date of last ack (or null if none)IfsException
- if the operation failspublic void checkControllerActions(RuntimeState rs) throws IfsException
This is also called by Node when a special IfsEvent is received.
rs
- the RuntimeState to checkIfsException
- if the operation failspublic ControllerPlan getControllerPlan() throws IfsException
IfsException
- if the operation failspublic void setControllerPlan(ControllerPlan cplan) throws IfsException
cplan
- the ControllerPlanIfsException
- if the operation failspublic ControllerPlanExecution getControllerPlanExecution() throws IfsException
IfsException
- if the operation failspublic void setControllerPlanExecution(ControllerPlanExecution cplanExec) throws IfsException
cplanExec
- the current ControllerPlanExecutionIfsException
- if the operation failspublic String getAcknowledgeDateExpirationPeriodString() throws IfsException
IfsException
- if the operation failspublic long getAcknowledgeDateExpirationPeriod() throws IfsException
IfsException
- if the operation failspublic void handleEvent(IfsEvent event) throws IfsException
LibraryObject
handleEvent
in interface IfsEventHandler
handleEvent
in class LibraryObject
event
- the eventIfsException
- if the operation failsCopyright © 2023. All rights reserved.