|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.ibm.able.AbleObject
com.ibm.able.AbleDefaultAgent
com.ibm.able.AbleRemoteDefaultAgent
com.ibm.able.platform.AblePlatformDefaultAgent
This class provides an enhanced implementation of a JSR 87 (Java Agent Services or JAS) compliant agent, but also inherits all the capabilities of an AbleDefaultAgent; as a JAS agent, the agent obtains a globally unique AgentName from the Agent Naming Service, registers a description with the Agent Directory Service, and is able to send and receive messages through the Message Transport System.
Typically, an agent's lifecycle is as follws:
preInit() method, which causes the agent
to look up several platform Services and obtain a unique AgentName
for itself from the Agent Naming Service.
Note that if the agent is created by something other than the
Agent Lifecycle Service, preInit() must be called
immediately after creation, but if security is on,
setPrincipal(String) must be called first.
initializeAgent(AbleSecureKey) method. This causes the
agent to obtain an AgentDescription, load it up with the attributes
and Locators it wants to advertise, and registers the description
with the Agent Directory Service. The agent may also, if
configured to do so, bind with RMI.
quitAgent(AbleSecureKey) method, at which time the agent
will free its resources.
| Field Summary | |
|---|---|
protected java.util.Date |
agentLastUpdate
The date and time when the agent's description was last updated with the Agent Directory Service. |
protected boolean |
agentMovable
Specifies whether the agent is movable from one agent pool to another; must be set before the agent is initialized, at which time it is placed into the agent's registered description. |
protected java.lang.String |
agentStatus
The agent's status at the last time the agent's description was updated with the Agent Directory Service. |
protected AbleMessageContainer |
agentSummary
The agent's last set summary text. |
protected boolean |
agentToAutoRegister
Specifies whether the agent is to register an AgentDescription of itself with the Agent Directory Service; must be set before the agent is initialized. |
protected boolean |
agentToBindToRmi
Specifies whether the agent is to bind itself to the RMI Naming service; must be set before the agent is initialized. |
protected java.lang.String |
agentType
The textual description of the type of agent; must be set before the agent is initialized, at which time it is placed into the agent's registered description; for documentation only. |
protected java.lang.String |
agentVendor
The agent's vendor; must be set before the agent is initialized, at which time it is placed into the agent's registered description; for documentation only. |
protected java.lang.String |
agentVersion
The agent's current version; must be set before the agent is initialized, at which time it is placed into the agent's registered description; for documentation only. |
protected java.util.Vector |
myAgentInboxes
Locators/MessageListeners/Inboxes for this agent. |
protected AgentLoggingService |
myAgentLoggingService
The AgentLoggingService for this agent. |
protected java.util.Map |
myCapabilities
The capabilities of this agent. |
protected java.util.Vector |
myCapabilityOrder
The order that the capabilities are displayed in might be important. |
protected java.util.Map |
myCustomCapabilityAutonomyLevels
The autonomy levels of the custom capability. |
protected java.util.Map |
myHighCapabilityAutonomyLevels
The HIGH pre-defined autonomy levels for the capabilities of this agent. |
protected javax.agent.Locator |
myJasAbleLocator
An ABLE direct communication locator that contains an RMI reference to this agent so that methods on the agent can be called directly. |
protected java.util.Hashtable |
myJasAgentAttributes
User-defined attributes for this agent. |
protected javax.agent.service.directory.AgentDescription |
myJasAgentDescription
The JAS description for this agent, set at initialization time. |
protected javax.agent.service.directory.AgentDirectoryService |
myJasAgentDirectoryService
A cached reference to the JAS Agent Directory service for this agent, set during pre-initialization. |
protected javax.agent.AgentName |
myJasAgentName
The JAS globally unique Id for this agent, set during pre-initialization. |
protected javax.agent.service.naming.AgentNamingService |
myJasAgentNamingService
A cached reference to the JAS Agent Naming service for this agent, set during pre-initialization. |
protected javax.agent.Locator |
myJasDefaultLocator
A default locator, set by init() to the first of the generated Locators. |
protected javax.agent.service.transport.MessageTransportService |
myJasMessageTransportService
A cached reference to the JAS Message Transport Service, if there is one; set at initialization time. |
protected javax.agent.service.ServiceRoot |
myJasServiceRoot
A cached reference to the JAS Service Root for this agent, from which other services can be obtained; set during pre-initialization. |
protected javax.agent.service.transport.TransportSystem |
myJasTransportSystem
The JAS Transport System for this agent, set during pre-initialization. |
protected VerifiableAgentDirectoryService |
myJasVerifiableDirectoryService
The IBM Verifiable Agent Directory service for this agent, set during pre-initialization. |
protected VerifiableAgentNamingService |
myJasVerifiableNamingService
The IBM Verifiable Agent Naming service for this agent, set during pre-initialization. |
protected java.security.KeyPair |
myKeyPair
Public and Private keys, created by the constructors, but only if security is on. |
protected java.util.Map |
myLowCapabilityAutonomyLevels
The LOW pre-defined autonomy levels for the capabilities of this agent. |
protected java.util.Map |
myMediumCapabilityAutonomyLevels
Yhe MEDIUM pre-defined autonomy levels for the capabilities of this agent. |
protected java.lang.String |
myPrincipal
This field is used ONLY in a secure environment and ONLY when the agent is not started through the Agent Lifecycle Service; that is, the agent is started through a command line or by another agent. |
protected AbleUserDefinedFunction |
myReceiveMessageMethod
The encapsulated default "receiveMessage()" method; this is the default method called by JAS Message Transport Service when a message arrives for the agent, but the agent can change this to some other method before init() is called. |
protected AbleSecureKey |
myRequestKey
On secure platforms, having a loaded key of the Platform Support code that created an agent is very important to the agent. |
protected AbleSecuritySupport |
mySecSppt
A helper object to assist with security related matters. |
protected java.lang.String |
myTrustLevel
The Trust Level cached from the VerifiableAgentName (VAN) for this agent; set during pre-initialization. |
protected VerifiableAgentName |
myVerifiableAgentName
A globally unique verifiable Id for this agent, set during pre-initialization. |
| Fields inherited from class com.ibm.able.AbleRemoteDefaultAgent |
|---|
agentAddr, agentHost, agentName, defaultName, myRemoteStub |
| Fields inherited from class com.ibm.able.AbleDefaultAgent |
|---|
activeDataSource, eventConnections, myBeans, numEpochs, processList, processListOK, userDefinedFunctions |
| Fields inherited from class com.ibm.able.AbleObject |
|---|
changed, chgSupport, comment, dataFlowEnabled, destBufferConnections, eventQueue, fileName, inputBuffer, listeners, logger, name, outputBuffer, parent, properties, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace |
| Constructor Summary | |
|---|---|
AblePlatformDefaultAgent()
Creates a new platform agent. |
|
AblePlatformDefaultAgent(java.lang.String theName)
Creates a new platform agent with the specified display name (not to be confused with the agent's globally unique AgentName). |
|
AblePlatformDefaultAgent(java.lang.String theName,
java.lang.String theComment)
Creates a new platform agent with the specified display name (not to be confused with the agent's globally unique AgentName) and comment. |
|
| Method Summary | |
|---|---|
protected void |
_init()
Performs the actual work of initialization. |
protected void |
_init(java.lang.Object theArg)
Does all the initial Java Agent Services (JAS) housekeeping in a manner identical to _init(), but the specified argument
is passed to the super class for handling. |
protected void |
_quitAll()
Performs the actual work of destroying this agent; this method must be used only when security is off, or only when security is on AND an Able SecureKey has already been verified. |
protected void |
_reset()
Performs the actual work of resetting the agent; this method must be used only when security is off, or only when security is on AND an Able SecureKey has already been verified. |
protected void |
_resumeAll()
Performs the actual work of resuming this agent; this method must be used only when security is off, or only when security is on AND an Able SecureKey has already been verified. |
protected void |
_suspendAll()
Performs the actual work of suspending this agent; this method must be used only when security is off, or only when security is on AND an Able SecureKey has already been verified. |
void |
addAgentInbox(java.lang.Object[] theProtocol)
|
void |
addJasAgentAttribute(java.lang.String theKey,
java.lang.Object theAttribute)
Adds a named attribute to the agent's set of attributes. |
protected void |
authenticateAndAuthorizeCaller(AbleAgentSituationReport theAnsweredAgentSituationReport,
AbleSecureKey theSecureKey)
This default implementation, called by handleAnsweredRequest(com.ibm.able.platform.AbleAgentSituationReport, com.ibm.able.platform.AbleSecureKey) in order to determine whether the
answerer of the request is authentic and authorized to answer the
request, does nothing. |
protected void |
authorizeCapabilityChangeRequest(AbleSecureKey theSecureKey)
This default implementation, called by those methods that change an agent's AutonomyLevel or the autonomy levels of its AgentCapabilities to determine whether the caller of the method is authorized to perform the requested change, performs a simple check: all the callers in the chain must have a trust level that is greater than or equal to the trust level of this agent in order for the operation to proceed. |
protected void |
broadcastTransportMessage(java.util.Vector theDestinations,
java.lang.Object theMessageToSend)
Sends a message to a list of agents. |
protected AbleAgentSituationReport |
createAgentSituationReport(java.io.Serializable theIdentifier,
AbleAgentCapability theCapability,
AbleAgentSituation theSituation,
AbleMessageContainer theSuggestedResponse,
AbleMessageContainer theResponseTaken,
AbleMessageContainer theResultsSummary,
boolean theProblemState)
Helper method used to create an AgentSituationReport for this agent. |
protected javax.agent.Locator |
createLocatorAndBindToMethod(java.lang.String theProtocol,
AbleUserDefinedFunction theUserDefinedFunction)
This is a helper method for loadAgentDescriptionWithBaseLocators(). |
java.io.Serializable |
getAboutDataBean()
Gets the data bean from which a console can obtain the information that is displayed on this agent's 'About' panel. |
int |
getAgentAutonomyLevel()
Gets the agent's autonomy level. |
javax.agent.service.directory.AgentDescription |
getAgentDescription()
Retrieves the agent's AgentDescription. |
java.util.Vector |
getAgentInboxes()
|
java.util.Date |
getAgentLastUpdate()
Gets the date and time when the agent's description was last updated with the Agent Directory Service. |
protected void |
getAgentLoggingService(java.lang.String theMsgId,
java.lang.Object[] theSubstitutionText,
java.lang.String theMethod)
Sets myAgentLoggingService to reference the
AgentLoggingService. |
java.lang.String |
getAgentStatus()
Gets the agent's current real time status (state). |
AbleMessageContainer |
getAgentSummary()
Gets the agent's current summary text. |
java.lang.String |
getAgentType()
Gets the agent's type description. |
java.lang.String |
getAgentVendor()
Gets the agent's vendor. |
java.lang.String |
getAgentVersion()
Gets the agent's version. |
protected void |
getAndSetAgentDescription()
Calls getNewAgentDescription() to get a new, empty Agent
Description and then
Calls loadAgentDescriptionWithAgentName() to set
the agent's names into the description
Calls loadAgentDescriptionWithPublicKey() to set
the agent's public key into the description
Calls loadAgentDescriptionWithAbleAttributes() to set
built-in Able attributes into the description
Calls loadAgentDescriptionWithUserAttributes() to set
any user-defined attributes into the description. |
protected void |
getAndSetAgentNames()
Gets this agent's Globally Unique ID (GUID or AgentName) from the Agent Naming Service and saves it away in the data member myJasAgentName; additionally, if security is on, a
verifiable agent name is obtained and saved in the data
member myVerifiableAgentName, and the data members
myTrustLevel,
myPrincipal, and
mySecSppt
are also set. |
protected void |
getAndSetTransportServices()
Gets all available Message Transport Services from the Message Transport System, selects the first one, and saves it away in the data member myJasMessageTransportService. |
protected void |
getAndValidateServiceRoot()
Gets addressability to the JAS Service Root, and makes sure the Agent Naming Service, the Agent Directory Service, and the Message Transport System are all available. |
java.util.Map |
getCapabilities()
Gets a Map of this agent's AgentCapability objects. |
AbleAgentCapability |
getCapability(java.lang.Object theCapabilityIdentifier)
Gets a specific AgentCapability of this agent. |
java.util.Map |
getCapabilityAutonomyLevels()
Gets, based on the agent's current AutonomyLevel setting, the appropriate set of capability autonomy levels. |
java.util.Vector |
getCapabilityOrder()
The order of an agent's AgentCapabilities may be important. |
java.util.Map[] |
getCapabilityPresets()
Returns an array of four Maps. |
AbleMessageContainer |
getCapabilitySummaryByAgentAutonomyLevel(int theAgentAutonomyLevel)
Gets an NLS text summary of the agent's capabilities based on the specified agent AutonomyLevel. |
AbleMessageContainer |
getCapabilitySummaryByCapabilityAutonomyLevels(java.util.Map theCapabilityAutonomyLevels)
Gets an NLS text summary of the agent's capabilities based on the specified capability autonomy levels. |
java.io.Serializable |
getCustomizerDataBean()
Gets the data bean from which a console can obtain this agent's customizable data so that the data can be displayed on this agent's 'Customize' panel. |
java.lang.String[] |
getCustomizerInfo()
Gets information about this agent's 'Customize' and 'About' GUIs. |
java.util.Hashtable |
getJasAgentAttributes()
Gets the agent's JAS attributes. |
java.lang.String |
getJasAgentName()
Gets the agent's globally unique ID (GUID or AgentName) in text form. |
protected void |
getNewAgentDescription()
Gets a new, empty Agent Description and saves it away in the data member myJasAgentDescription. |
javax.agent.AgentName |
getPlatformAgentName()
Gets the agent's AgentName object. |
java.lang.String |
getPrincipal()
|
protected java.lang.Object |
getTransportMessageContent(javax.agent.TransportMessage theTransportMessage)
Extracts and returns the content of the specified transport message. |
protected java.lang.Object |
getTransportMessageContent2(javax.agent.TransportMessage theTransportMessage)
Extracts and returns the content of the specified transport message. |
void |
handleAnsweredRequest(AbleAgentSituationReport theAgentSituationReport,
AbleSecureKey theSecureKey)
This method is called to answer a request that this agent had previously logged to the AgentLoggingService. |
void |
init()
Initializes and configures the bean, but only if security is off; when security is on, calls to this method are ignored -- the method initializeAgent(AbleSecureKey)
must be used instead. |
void |
init(java.lang.Object theArg)
Initializes and configures the bean, using the specified Object, but only if security is off; when security is on, calls to this method are ignored -- the method initializeAgent(Object,AbleSecureKey)
must be used instead. |
protected void |
initAgentCapabilities(java.util.Map[] theCapabilities)
Initializes the agent with the specified AgentCapabilities. |
protected void |
initCommonCode(java.lang.Object theArg)
Initializes the agent with the specified argument. |
void |
initializeAgent(AbleSecureKey theSecureKey)
Initializes and configures the agent. |
void |
initializeAgent(java.lang.Object theInitArg,
AbleSecureKey theSecureKey)
Initializes and configures the agent using the specified parameter, which is typically an Object[], but may be anything that the agent is coded to expect. |
boolean |
isAgentMovable()
Specifies whether the agent is movable from one agent pool to another. |
boolean |
isAgentToAutoRegister()
Specifies whether the agent is to register with an RMI Registry at initialization time. |
boolean |
isAgentToBindToRmi()
Specifies whether the agent is to bind to RMI Naming at initialization time. |
protected void |
loadAgentDescriptionWithAbleAttributes()
Loads this agent's description with the built-in Able attributes, which must be set before initialization time. |
protected void |
loadAgentDescriptionWithAbleLocator()
Loads this agent's description with a special Able Locator, found in the data member myJasAbleLocator, which is a locator
that contains an RMI reference to this agent, and which can be
used to call those public, "remotable" methods found in this
agent. |
protected void |
loadAgentDescriptionWithAgentName()
Loads this agent's description with the agent's Globally Unique ID (GUID) or AgentName as contained in the data member myJasAgentName. |
protected void |
loadAgentDescriptionWithBaseLocators()
Loads this agent's description with Locators created from the selected Message Transport Service. |
protected void |
loadAgentDescriptionWithPublicKey()
Loads this agent's description with the agent's public key, but only if security is on. |
protected void |
loadAgentDescriptionWithUserAttributes()
Loads this agent's description with those user-defined attributes that have been placed into the data member myJasAgentAttributes. |
protected void |
logAgentSituationReport(AbleAgentSituationReport theAgentSituationReport)
This method handles the details of logging an AgentSituationReport to the AgentLoggingService for this agent. |
protected void |
logException(java.lang.String theMethodName,
java.lang.Exception theException)
Logs an exception. |
protected void |
logHistory(AbleMessageContainer theDescription,
AbleMessageContainer theAction,
AbleMessageContainer theSummary)
Helper method used to log a History log. |
protected javax.agent.service.directory.AgentDescription[] |
lookUpAgent(java.util.Hashtable theSearchAttributesAndValues)
Finds all agents registered with the Agent Directory whose agent description contains the specified attributes and values. |
protected javax.agent.service.directory.AgentDescription[] |
lookUpAgent(java.lang.String theSearchAttribute,
java.lang.Object theSearchValue)
Finds all agents registered with the Agent Directory whose agent description contains the specified attribute and value. |
static void |
main(java.lang.String[] args)
|
protected AbleMessageContainer |
makeCapabilityAutonomyLevelsSummary(java.util.Map theCapabilityAutonomyLevels)
Returns an AbleMessage Container that describes the overall agent autonomy summary if the agent's capability autonomy levels are set to theCapabilityAutonomyLevels. |
protected void |
maybeDeregisterWithAgentDirectoryService()
Deregisters this agent with the Agent Directory Service, depending on whether the agent is registered. |
protected void |
maybeRebindToRmi(boolean theBindToRmiFlag)
(Re)binds this agent to RMI Naming lookup service, depending on the value of the specified flag. |
protected void |
maybeRegisterWithAgentDirectoryService(boolean theRegisterFlag)
Registers this agent with the Agent Directory Service, depending on the value of the specified flag. |
protected void |
maybeUnbindFromRmi()
Unbinds this agent from RMI Naming, depending on whether it has been bound to RMI. |
void |
preInit()
Pre-initializes the agent immediately after creation, causing the agent to find the Service Root, extract references to various services, obtain a unique AgentName from the Agent Naming Service, and, when security is on, a VerifiableAgentName (VAN). |
void |
preInit(java.lang.String theAgentNameUniqueID)
This version of preInit should be called when this agent is being restarted from persistence. |
java.lang.Object |
process(java.lang.Object theArg)
Performs the main, standard processing function of this platform agent, using the argument. |
protected void |
processAnsweredRequest(AbleAgentSituationReport theAnsweredAgentSituationReport,
AbleSecureKey theSecureKey)
This default implementation of processAnsweredRequest does nothing. |
void |
quitAgent(AbleSecureKey theSecureKey)
Quits the agent, which typically quits all contained beans and agents. |
void |
quitAll()
Stops all of the bean's asynchronous threads of control, but only if security is off; when security is on, calls to this method are ignored -- the method quitAgent(AbleSecureKey)
must be used instead. |
void |
receiveMessage(javax.agent.TransportMessage theTransportMessage)
Receives and handles a message from the JAS Message Transport Service. |
void |
removeAgentInbox(java.lang.Object[] theProtocol)
|
void |
removeAgentInboxes()
|
protected void |
removeAgentSituationReports(java.util.Vector theAgentSituationReportsToRemove)
This method handles the details of removing one of this agent's AgentSituationReports. |
void |
removeJasAgentAttribute(java.lang.String theKey)
Removes a named attribute from the agent's set of attributes. |
void |
reset()
Resets the bean, but only if security is off; when security is on, calls to this method are ignored -- the method resetAgent(AbleSecureKey)
must be used instead. |
void |
resetAgent(AbleSecureKey theSecureKey)
Resets the agent to its "initialized" state. |
void |
resumeAgent(AbleSecureKey theSecureKey)
Resumes all asynchronous threads of control, typically including those in any contained beans and agents. |
void |
resumeAll()
Resumes all of the bean's asynchronous threads of control, but only if security is off; when security is on, calls to this method are ignored -- the method resumeAgent(AbleSecureKey)
must be used instead. |
protected void |
sendTransportMessage(javax.agent.Locator theDestinationLocator,
javax.agent.AgentName theDestinationAgentName,
java.lang.Object theMessageToSend)
Sends a message to the specified agent. |
protected void |
sendTransportMessage(javax.agent.Locator theOriginationLocator,
javax.agent.Locator theDestinationLocator,
javax.agent.AgentName theDestinationAgentName,
java.lang.Object theMessageToSend)
Sends an ACL message to the specified agent. |
void |
setAgentAutonomyLevel(int theAgentAutonomyLevel,
AbleSecureKey theSecureKey)
Sets the agent's autonomy level. |
void |
setAgentMovable(boolean theAgentMovableFlag)
Sets whether the agent is movable from one agent pool to another. |
void |
setAgentNameUniqueID(java.lang.String theAgentNameUniqueID)
|
void |
setAgentSummary(AbleMessageContainer theAgentSummary)
Sets the agent's current summary text. |
void |
setAgentToAutoRegister(boolean theAgentToAutoRegisterFlag)
Sets whether the agent is to register with the Agent Directory Service at initialization time. |
void |
setAgentToBindToRmi(boolean theAgentToBindToRmiFlag)
Sets whether the agent is to bind to the RMI Naming service at initialization time. |
void |
setAgentType(java.lang.String theAgentType)
Sets the agent's type description. |
void |
setAgentVendor(java.lang.String theAgentVendor)
Sets the agent's vendor. |
void |
setAgentVersion(java.lang.String theAgentVersion)
Sets the agent's version. |
void |
setCapabilityAutonomyLevel(java.lang.Object theCapabilityIdentifier,
int theAutonomyLevel,
AbleSecureKey theSecureKey)
Sets the autonomy level of the specified AgentCapability. |
void |
setCapabilityAutonomyLevels(java.util.Map theCapabilityAutonomyLevels,
AbleSecureKey theSecureKey)
Updates the autonomy level of each of this agent's capabilities according to the autonomy levels in the specified Map. |
void |
setCustomizerDataBean(java.io.Serializable theDataBean,
AbleSecureKey theSecureKey)
Sets the data bean from which this agent can retrieve it's updated customizable data. |
void |
setPrincipal(java.lang.String thePrincipal)
|
void |
setRequestKey(AbleSecureKey theRequestKey)
Sets the AbleSecureKey this agent will use to make a VAN request to the VerifiableAgentNamingService. |
void |
setRestartedFromPersistence(boolean isRestartedFromPersistence)
|
void |
suspendAgent(AbleSecureKey theSecureKey)
Temporarily suspends all asynchronous threads of control, typically including those in any contained beans and agents. |
void |
suspendAll()
Suspends all of the bean's asynchronous threads of control, but only if security is off; when security is on, calls to this method are ignored -- the method suspendAgent(AbleSecureKey)
must be used instead. |
java.lang.String |
toString()
Gets a string describing (the contents of) the object. |
protected void |
updateAgentSituationReport(AbleAgentSituationReport theOldAgentSituationReport,
AbleAgentSituationReport theNewAgentSituationReport)
This method handles the details of updating one of this agent's AgentSituationReports. |
protected void |
updateDescriptionWithAgentDirectoryService()
Updates this agent's description with the Agent Directory Service. |
protected void |
validateAnsweredRequest(AbleAgentSituationReport theAnsweredAgentSituationReport)
This default implementation, called by handleAnsweredRequest(com.ibm.able.platform.AbleAgentSituationReport, com.ibm.able.platform.AbleSecureKey) in order to determine whether
the specified request is still valid, does nothing. |
protected void |
verifyCapabilities()
All subclasses using AgentCapabilities must define their own capabilities and each capability's autonomy level. |
protected void |
verifyKey(AbleSecureKey theSecureKey,
java.lang.String theMethod)
Helper method used to verify a secure key. |
| Methods inherited from class com.ibm.able.AbleRemoteDefaultAgent |
|---|
getAgentAddr, getAgentHost, getAgentName, rmiRebind, rmiUnbind |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.ibm.able.platform.AblePlatformAgent |
|---|
getComment |
| Methods inherited from interface com.ibm.able.AbleRemoteAgent |
|---|
addEventConnection, getAgentAddr, getAgentHost, getAgentName, getDataSource, isActiveDataSource, removeEventConnection, setActiveDataSource |
| Methods inherited from interface com.ibm.able.AbleRemoteBean |
|---|
getName, getProperties, getProperty, getState, process, removeProperty, setProperties, setProperty |
| Methods inherited from interface com.ibm.able.AbleRemoteEventListener |
|---|
handleAbleEvent |
| Methods inherited from interface com.ibm.able.AbleEventListenerRemoteManager |
|---|
addAbleEventListener, notifyAbleEventListeners, removeAbleEventListener |
| Methods inherited from interface com.ibm.able.AbleBeanRemoteContainer |
|---|
addBean, containsBean, containsBean, getBean, getBeans, removeAllBeans, removeBean, removeBean |
| Methods inherited from interface com.ibm.able.AbleUserDefinedFunctionRemoteManager |
|---|
addUserDefinedFunction, containsUserDefinedFunction, getUserDefinedFunction, getUserDefinedFunctions, invokeUserDefinedFunction, removeUserDefinedFunction, setUserDefinedFunctions |
| Methods inherited from interface javax.agent.service.transport.MessageListener |
|---|
equals, hashCode |
| Methods inherited from interface com.ibm.able.AbleBean |
|---|
getComment, getLogger, getName, getParent, getProperties, getProperty, getState, getTraceLogger, isChanged, removeProperty, setChanged, setComment, setLogger, setName, setParent, setProperties, setProperty, setState, setTraceLogger |
| Methods inherited from interface com.ibm.able.AbleEventListenerManager |
|---|
addAbleEventListener, dataChanged, getAbleEventListeners, notifyAbleEventListeners, removeAbleEventListener |
| Methods inherited from interface com.ibm.able.AbleEventQueueProcessor |
|---|
processAbleEvent, processNoEventProcessingEnabledSituation, processTimerEvent |
| Methods inherited from interface com.ibm.able.AblePropertyChangeManager |
|---|
addPropertyChangeListener, addPropertyConnection, getPropertyChangeListeners, getPropertyConnectionManager, removeAllPropertyConnections, removePropertyChangeListener, removePropertyConnection |
| Methods inherited from interface com.ibm.able.AbleSerializable |
|---|
getFileName, restoreFromFile, restoreFromFile, saveToFile, saveToFile, setFileName |
| Methods inherited from interface com.ibm.able.AbleBeanContainer |
|---|
getName |
| Field Detail |
protected java.util.Date agentLastUpdate
protected java.lang.String agentStatus
protected AbleMessageContainer agentSummary
protected java.lang.String agentType
protected java.lang.String agentVendor
protected java.lang.String agentVersion
protected boolean agentToAutoRegister
protected boolean agentToBindToRmi
protected boolean agentMovable
protected java.util.Hashtable myJasAgentAttributes
protected java.util.Vector myAgentInboxes
This field must be set before the agent is initialized. At
initialization time, one Locator/AbleJasMessageListener pair is
created for each entry found in this collection and the Locater
is added to the agent's AgentDescription. The first entry here
becomes a "default" Locator. If there are no entries here, a
default Locator, tied to this agent's
receiveMessage(TransportMessage) method is created.
Each element of the inbox collection is an array of Object[2]. The first element (index 0) of each subarray is the protocol designated for that inbox; this is simply a string that will appear in the Locator and its associated AbleJasMessageListener. Specify the empty string ("") if the agent doesn't care about tagging each inbox with a protocol. The second element (index 1) is the UDF the message listener will call when a message arrives. For example,
( ( "carBuyerSeller" UDF:receiveCarBuyerSellerMsg(TransportMessage) ) ( "creditCheck" UDF:receiveCreditCheckMsg(TransportMessage) ) )
AbleJasMessageListenerprotected java.lang.String myPrincipal
protected javax.agent.service.ServiceRoot myJasServiceRoot
preInit()protected javax.agent.service.directory.AgentDirectoryService myJasAgentDirectoryService
preInit()protected VerifiableAgentDirectoryService myJasVerifiableDirectoryService
myJasAgentDirectoryService, but
with additional methods.
preInit()protected javax.agent.service.naming.AgentNamingService myJasAgentNamingService
preInit()protected VerifiableAgentNamingService myJasVerifiableNamingService
myJasAgentNamingService, but with additional
methods.
preInit()protected javax.agent.service.transport.TransportSystem myJasTransportSystem
preInit()protected javax.agent.AgentName myJasAgentName
preInit()protected VerifiableAgentName myVerifiableAgentName
myJasAgentName. When security is off, the field is
null.
preInit()protected java.lang.String myTrustLevel
preInit()protected javax.agent.service.directory.AgentDescription myJasAgentDescription
myJasAgentAttributes.
protected javax.agent.service.transport.MessageTransportService myJasMessageTransportService
protected javax.agent.Locator myJasDefaultLocator
myAgentInboxesprotected javax.agent.Locator myJasAbleLocator
protected AbleUserDefinedFunction myReceiveMessageMethod
protected java.security.KeyPair myKeyPair
protected AbleSecureKey myRequestKey
This field tells the agent what AbleSecureKey to use to request a VAN.
protected transient AbleSecuritySupport mySecSppt
This object is null unless security is on.
When security is on, this object is created during the preinitialization process, and thereafter is used as a helper object to generate and verify secure keys and trust levels.
On deserialization, this object must be recreated!
protected AgentLoggingService myAgentLoggingService
getAgentLoggingService if necessary.
protected java.util.Map myCapabilities
Key: ((Object) aCapabilityIdentifier) Value: ((AbleAgentCapability) anAgentCapability )
This is where all of the capabilities of an agent are
defined. It is the agent's responsibility to set its
capabilities along with the three capability autonomy level Maps:
highCapabilityAutonomyLevels, mediumCapabilityAutonomyLevels and
lowCapabilityAutonomyLevels, and the capabilityOrder when the
agent is instantiated. The agent must then call its verifyCapabilities() method to verify that its capabilities and
autonomy levels are valid, and the order vector contains
appropriate identifiers. If these are not set correctly, the
agent when fail when initialized.
The only other way to set the capabilities is by passing an AbleAgentCapability[] as the init arguments. Using the init arguments overwrites any capability and autonomy levels that might have already been set.
protected java.util.Vector myCapabilityOrder
protected java.util.Map myHighCapabilityAutonomyLevels
Each entry of the Map is:
Key: ((Object) aCapabilityIdentifier) Value: ((Integer) anAutonomyLevel )
myCapabilitiesprotected java.util.Map myMediumCapabilityAutonomyLevels
Each entry of the Map is:
Key: ((Object) aCapabilityIdentifier) Value: ((Integer) anAutonomyLevel )
myCapabilitiesprotected java.util.Map myLowCapabilityAutonomyLevels
Each entry of the Map is:
Key: ((Object) aCapabilityIdentifier) Value: ((Integer) anAutonomyLevel )
myCapabilitiesprotected java.util.Map myCustomCapabilityAutonomyLevels
Each entry of the Map is:
Key: ((Object) aCapabilityIdentifier) Value: ((Integer) anAutonomyLevel )
| Constructor Detail |
public AblePlatformDefaultAgent()
throws java.rmi.RemoteException,
AbleException
java.rmi.RemoteException - On any RMI error.
AbleException - On any error.
public AblePlatformDefaultAgent(java.lang.String theName)
throws java.rmi.RemoteException,
AbleException
theName - A string containing the Able display name of this new
agent.
java.rmi.RemoteException - On any RMI error.
AbleException - On any error.
public AblePlatformDefaultAgent(java.lang.String theName,
java.lang.String theComment)
throws java.rmi.RemoteException,
AbleException
theName - A string containing the Able display name of this new
agent.
theComment - A string containing a comment for this new agent.
java.rmi.RemoteException - On any RMI error.
AbleException - On any error.| Method Detail |
public int getAgentAutonomyLevel()
throws AbleException
AblePlatformAgent
getAgentAutonomyLevel in interface AblePlatformAgentAblePlatform.
AbleException
public void setAgentAutonomyLevel(int theAgentAutonomyLevel,
AbleSecureKey theSecureKey)
throws AbleException
setAgentAutonomyLevel in interface AblePlatformAgenttheAgentAutonomyLevel - An autonomy level as defined in AblePlatform.
theSecureKey - If security is on, a key that can be used to authenticate
and authorize the caller; otherwise, may be null.
AbleException - If the specified autonomy level isn't a level defined in
AblePlatform or if the caller isn't authorized.
public java.util.Date getAgentLastUpdate()
throws AbleException
AblePlatformAgent
getAgentLastUpdate in interface AblePlatformAgentAbleException
public java.lang.String getAgentStatus()
throws AbleException
AblePlatformAgent
getAgentStatus in interface AblePlatformAgentAbleExceptionpublic void setAgentSummary(AbleMessageContainer theAgentSummary)
theAgentSummary - The agent's summary text.
public AbleMessageContainer getAgentSummary()
throws AbleException
AblePlatformAgent
getAgentSummary in interface AblePlatformAgentAbleExceptionpublic void setAgentType(java.lang.String theAgentType)
theAgentType - The agent's type description.
public java.lang.String getAgentType()
throws AbleException
AblePlatformAgent
getAgentType in interface AblePlatformAgentAbleExceptionpublic void setAgentVendor(java.lang.String theAgentVendor)
theAgentVendor - The agent's vendor.
public java.lang.String getAgentVendor()
throws AbleException
AblePlatformAgent
getAgentVendor in interface AblePlatformAgentAbleExceptionpublic void setAgentVersion(java.lang.String theAgentVersion)
theAgentVersion - The agent's version.
public java.lang.String getAgentVersion()
throws AbleException
AblePlatformAgent
getAgentVersion in interface AblePlatformAgentAbleExceptionpublic void setAgentToAutoRegister(boolean theAgentToAutoRegisterFlag)
theAgentToAutoRegisterFlag - Use true (default) if the agent is to register an
AgentDescription with the Agent Directory Service;
false otherwise.
public boolean isAgentToAutoRegister()
throws AbleException
AblePlatformAgent
isAgentToAutoRegister in interface AblePlatformAgentAbleExceptionpublic void setAgentToBindToRmi(boolean theAgentToBindToRmiFlag)
theAgentToBindToRmiFlag - Use true if the agent is to bind to RMI
Naming;
false (default) otherwise.
public boolean isAgentToBindToRmi()
throws AbleException
AblePlatformAgent
isAgentToBindToRmi in interface AblePlatformAgentAbleExceptionpublic void setAgentMovable(boolean theAgentMovableFlag)
theAgentMovableFlag - Use true if the agent is movable;
false otherwise.
public boolean isAgentMovable()
throws AbleException
AblePlatformAgent
isAgentMovable in interface AblePlatformAgentAbleException
public void addJasAgentAttribute(java.lang.String theKey,
java.lang.Object theAttribute)
theKey - the name of the attribute.theAttribute - the attribute to add to the set.public void removeJasAgentAttribute(java.lang.String theKey)
theKey - the name of the attribute to remove.
public java.util.Hashtable getJasAgentAttributes()
throws AbleException
AblePlatformAgent
getJasAgentAttributes in interface AblePlatformAgentAbleException
public java.lang.String getJasAgentName()
throws AbleException
AblePlatformAgent
getJasAgentName in interface AblePlatformAgenttoString() version of the agent's
unique AgentName.
AbleException
public javax.agent.AgentName getPlatformAgentName()
throws AbleException
AblePlatformAgent
getPlatformAgentName in interface AblePlatformAgentAbleExceptionpublic java.util.Vector getAgentInboxes()
public void addAgentInbox(java.lang.Object[] theProtocol)
public void removeAgentInbox(java.lang.Object[] theProtocol)
public void removeAgentInboxes()
public void setPrincipal(java.lang.String thePrincipal)
public java.lang.String getPrincipal()
public void preInit()
throws AbleException
AblePlatformAgent
preInit in interface AblePlatformAgentAbleException
public void preInit(java.lang.String theAgentNameUniqueID)
throws AbleException
AblePlatformAgenttheAgentNameUniqueID when
requesting the AgentName for this agent. This method will then
also remove all previously persisted AgentDescriptions from the
Directory Service since this agent is being restarted from
persistence.
preInit in interface AblePlatformAgenttheAgentNameUniqueID - When an agent is being restarted from persistence, it
will want to have an AgentName that matches the one it
had in it's previous life. This way the recreated
agent can still get at logs and it's agent
description. So instead of having the NamingService
create a new unique identifier for the AgentName of
this recreated agent, this old uniqueID will be used.
AbleException
public void setAgentNameUniqueID(java.lang.String theAgentNameUniqueID)
throws AbleException
AbleException
public void setRestartedFromPersistence(boolean isRestartedFromPersistence)
throws AbleException
AbleException
public void initializeAgent(AbleSecureKey theSecureKey)
throws AbleException,
javax.agent.service.naming.NamingException
AblePlatformAgent
initializeAgent in interface AblePlatformAgenttheSecureKey - When security if off, this may be null as the
parameter is ignored; when security is on the security
key must be from an object with equal or greater
authority in order for the operation to proceed.
javax.agent.service.naming.NamingException - On any naming error.
AbleException
public void initializeAgent(java.lang.Object theInitArg,
AbleSecureKey theSecureKey)
throws AbleException,
javax.agent.service.naming.NamingException
AblePlatformAgent
initializeAgent in interface AblePlatformAgenttheInitArg - Argument to the initialization method.theSecureKey - When security if off, this may be null as the
parameter is ignored; when security is on the security
key must be from an object with equal or greater
authority in order for the operation to proceed.
javax.agent.service.naming.NamingException - On any naming error.
AbleException
public void quitAgent(AbleSecureKey theSecureKey)
throws AbleException,
javax.agent.service.naming.NamingException
AblePlatformAgent
quitAgent in interface AblePlatformAgenttheSecureKey - When security if off, this may be null as the
parameter is ignored; when security is on the security
key must be from an object with equal or greater
authority in order for the operation to proceed.
javax.agent.service.naming.NamingException - On any naming error.
AbleException
public void suspendAgent(AbleSecureKey theSecureKey)
throws AbleException,
javax.agent.service.naming.NamingException
AblePlatformAgent
suspendAgent in interface AblePlatformAgenttheSecureKey - When security if off, this may be null as the
parameter is ignored; when security is on the security
key must be from an object with equal or greater
authority in order for the operation to proceed.
javax.agent.service.naming.NamingException - On any naming error.
AbleException
public void resumeAgent(AbleSecureKey theSecureKey)
throws AbleException,
javax.agent.service.naming.NamingException
AblePlatformAgent
resumeAgent in interface AblePlatformAgenttheSecureKey - When security if off, this may be null as the
parameter is ignored; when security is on the security
key must be from an object with equal or greater
authority in order for the operation to proceed.
javax.agent.service.naming.NamingException - On any naming error.
AbleException
public void resetAgent(AbleSecureKey theSecureKey)
throws AbleException,
javax.agent.service.naming.NamingException
AblePlatformAgent
resetAgent in interface AblePlatformAgenttheSecureKey - When security if off, this may be null as the
parameter is ignored; when security is on the security
key must be from an object with equal or greater
authority in order for the operation to proceed.
javax.agent.service.naming.NamingException - On any naming error.
AbleExceptionpublic javax.agent.service.directory.AgentDescription getAgentDescription()
AblePlatformAgent
getAgentDescription in interface AblePlatformAgentpublic void receiveMessage(javax.agent.TransportMessage theTransportMessage)
In this implementation, the process(Object) method
is called to process the received message.
receiveMessage in interface javax.agent.service.transport.MessageListenertheTransportMessage - A message from the Message Transport Service.
public void init()
throws AbleException
initializeAgent(AbleSecureKey)
must be used instead.
init in interface AbleRemoteBeaninit in class AbleRemoteDefaultAgentAbleException - On any error.AbleObject.init()
public void init(java.lang.Object theArg)
throws AbleException
initializeAgent(Object,AbleSecureKey)
must be used instead.
In this implementation, the argument parameter is not used, but is passed on up to the super classes.
init in interface AbleRemoteBeaninit in class AbleRemoteDefaultAgenttheArg - An Object used to initialize the bean.
AbleException - On any error.AbleObject.init()
public void reset()
throws AbleException
resetAgent(AbleSecureKey)
must be used instead.
reset in interface AbleRemoteBeanreset in class AbleDefaultAgentAbleException - On any error.
public java.lang.Object process(java.lang.Object theArg)
throws AbleException
Agents derived from this default platform agent must
override this method in order to do anything useful. The default
receiveMessage(TransportMessage) calls this method when
a message is received by the Message Transport Service, but this
method does nothing.
process in interface AbleRemoteBeanprocess in class AbleObjecttheArg - The Object should be a JAS TransportMessage as
received by the receiveMessage() method.
AbleException - In any error situation.AbleObject.inputBuffer,
AbleObject.outputBuffer,
AbleBean.process()
public void quitAll()
throws AbleException
quitAgent(AbleSecureKey)
must be used instead.
quitAll in interface AbleRemoteBeanquitAll in class AbleDefaultAgentAbleExceptionAbleDefaultAgent.quitEnabledEventProcessing()
public void suspendAll()
throws AbleException
suspendAgent(AbleSecureKey)
must be used instead.
suspendAll in interface AbleRemoteBeansuspendAll in class AbleDefaultAgentAbleException
public void resumeAll()
throws AbleException
resumeAgent(AbleSecureKey)
must be used instead.
resumeAll in interface AbleRemoteBeanresumeAll in class AbleDefaultAgentAbleException
protected void _init()
throws AbleException
preInit(), in case it has not been called
before, which, depending on need,
getAndValidateServiceRoot() to get
addressability to the ServiceRoot. All services must be up and
running. If the Naming Service, Directory Service, or the
Transport System is not available, an exception is thrown.getAndSetAgentNames() to get the Globally
Unique ID (GUID, or AgentName) of this agent from the Agent
Naming Service.getAndSetAgentDescription() to get a new,
empty Agent Description and then load it with both the built-in
Able attributes and any user-defined agent attributes as found in
the data member myJasAgentAttributes. getAndSetTransportServices() to get the
Message Transport Services from the Transport System, and then
selects one to use.loadAgentDescriptionWithBaseLocators() to add
Locators to the AgentDescription. The number of locators created
depends on the data member myAgentInboxes, but at least
one locator is always created.loadAgentDescriptionWithAbleLocator() to add
a special Able Locator to the Agent Description. See the data
member myJasAbleLocator.maybeRegisterWithAgentDirectoryService(boolean)
to register the Agent Description with the Agent Directory
Service. See the data member agentToAutoRegister.maybeRebindToRmi(boolean) to (re)bind the
agent to an RMI Naming service, so that the agent can be located
by RMI lookup. See the data member agentToBindToRmi.super.init() to allow the super classes
to initialize.updateAgentDescription() to cause the
agent's AgentDescription to be refreshed with the Agent Directory
Service.
AbleException - In any error situation.
protected void _init(java.lang.Object theArg)
throws AbleException
_init(), but the specified argument
is passed to the super class for handling.
theArg - Usually an Object[] containing data that can be used
to initialize the agent.
AbleException - In any error situation.
protected void _reset()
throws AbleException
reset() in condition 1. resetAgent(AbleSecureKey) in conditions 1 and 2. This method can be overridden, but must not be exposed to the public.
AbleException - In any error situation.protected void _quitAll()
quitAll() in condition 1. quitAgent(AbleSecureKey) in conditions 1 and 2. This method can be overridden, but must not be exposed to the public.
As needed:
super.quitAll() to stop all threads
maybeDeregisterWithAgentDirectoryService() to
deregister from the Agent Directory Service
maybeUnbindFromRmi() to unbind from the RMI
Naming service
protected void _suspendAll()
throws AbleException
suspendAll() in condition 1. suspendAgent(AbleSecureKey) in conditions 1 and 2. This method can be overridden, but must not be exposed to the public.
AbleException - In any error situation.
protected void _resumeAll()
throws AbleException
resumeAll() in condition 1. resumeAgent(AbleSecureKey) in conditions 1 and 2. This method can be overridden, but must not be exposed to the public.
AbleException - In any error situation.
protected void getAndValidateServiceRoot()
throws AbleException
AbleException - In any error situation.
protected void getAndSetAgentNames()
throws AbleException
myJasAgentName; additionally, if security is on, a
verifiable agent name is obtained and saved in the data
member myVerifiableAgentName, and the data members
myTrustLevel,
myPrincipal, and
mySecSppt
are also set.
AbleException - In any error situation.
protected void getAndSetAgentDescription()
throws AbleException
getNewAgentDescription() to get a new, empty Agent
Description and then
loadAgentDescriptionWithAgentName() to set
the agent's names into the description
loadAgentDescriptionWithPublicKey() to set
the agent's public key into the description
loadAgentDescriptionWithAbleAttributes() to set
built-in Able attributes into the description
loadAgentDescriptionWithUserAttributes() to set
any user-defined attributes into the description.
AbleException - In any error situation.
protected void getNewAgentDescription()
throws AbleException
myJasAgentDescription.
AbleException - In any error situation.
protected void loadAgentDescriptionWithAgentName()
throws AbleException
myJasAgentName.
AbleException - In any error situation.protected void loadAgentDescriptionWithPublicKey()
protected void loadAgentDescriptionWithAbleAttributes()
throws AbleException
Note that the agent's built-in attributes, those data members
named with the pattern agentXxxx, can be set
programatically, for example,
setAgentVersion("1.2.3") or through a graphical
customizer (not provided).
Attributes set include
AblePlatform.AbleAgentAutonomyLevel from AblePlatform
JasConstants.AGENT_DISPLAY_NAME from AbleObject.name
AblePlatform.AbleAgentDescription from AbleObject.comment
AblePlatform.AbleAgentMovable from agentMovable
AblePlatform.AbleAgentLastUpdate from agentLastUpdate
AblePlatform.AbleAgentSummary from agentSummary
AblePlatform.AbleAgentType from agentType
AblePlatform.AbleAgentVendor from agentVendor
AblePlatform.AbleAgentVersion from agentVersion
AblePlatform.AbleAgentAgentPool
AbleException - In any error situation.
protected void loadAgentDescriptionWithUserAttributes()
throws AbleException
myJasAgentAttributes.
AbleException - In any error situation.
protected void getAndSetTransportServices()
throws AbleException
myJasMessageTransportService.
AbleException - In any error situation.
protected void loadAgentDescriptionWithBaseLocators()
throws AbleException
At least one Locator, perhaps bound to this agent's
receiveMessage(TransportMessage) method is created.
Note, however, that any number of Locators can be created, and
they can be bound to callback methods other than
receiveMessage().
The number of Locators (inboxes) and the methods to which
they are bound is customizable through the data member
myAgentInboxes. If myAgentInboxes is
empty, then the default Locator is created.
AbleException - In any error situation.
protected javax.agent.Locator createLocatorAndBindToMethod(java.lang.String theProtocol,
AbleUserDefinedFunction theUserDefinedFunction)
throws AbleException
loadAgentDescriptionWithBaseLocators().
theProtocol - The protocol is simply passed to an
AbleJasMessageListener, and set as an identifiable
property in the Locator.
theUserDefinedFunction - The method that is to receive the callback when a
message arrives through the created Locator.
AbleException - In any error situation.
protected void loadAgentDescriptionWithAbleLocator()
throws AbleException
myJasAbleLocator, which is a locator
that contains an RMI reference to this agent, and which can be
used to call those public, "remotable" methods found in this
agent.
AbleException - In any error situation.
protected void maybeRegisterWithAgentDirectoryService(boolean theRegisterFlag)
throws AbleException
This method can also be used to update the agent's already registered agent description.
theRegisterFlag - If true, the agent will register with the
Directory Service. Otherwise, nothing happens.
AbleException - In any error situation.
protected void maybeDeregisterWithAgentDirectoryService()
throws AbleException
AbleException - In any error situation.
protected void updateDescriptionWithAgentDirectoryService()
throws AbleException
AbleException - In any error situation.
protected void maybeRebindToRmi(boolean theBindToRmiFlag)
throws AbleException
theBindToRmiFlag - If true, the agent will rebind itself to RMI
Naming. Otherwise, nothing happens.
AbleException - In any error situation.
protected void maybeUnbindFromRmi()
throws AbleException
AbleException - In any error situation.
protected javax.agent.service.directory.AgentDescription[] lookUpAgent(java.lang.String theSearchAttribute,
java.lang.Object theSearchValue)
throws AbleException
theSearchAttribute - The name of the attribute in the agent description to
search.
theSearchValue - The value that the specified attribute must match.
The equals() method is used.
AbleException - In any error situation.
protected javax.agent.service.directory.AgentDescription[] lookUpAgent(java.util.Hashtable theSearchAttributesAndValues)
throws AbleException
theSearchAttributesAndValues - A set of attributes and associated values for which to
search.
AbleException - In any error situation.
protected void logException(java.lang.String theMethodName,
java.lang.Exception theException)
theException - The exception to log.
protected void broadcastTransportMessage(java.util.Vector theDestinations,
java.lang.Object theMessageToSend)
throws AbleException
theDestinations - A vector of vectors: ( (Locator AgentName) (Locator AgentName) ... )
theMessageToSend - An Object containing the contents of the message to send.
AbleException - In any error situation.sendTransportMessage(Locator, Locator, AgentName, Object)
protected void sendTransportMessage(javax.agent.Locator theDestinationLocator,
javax.agent.AgentName theDestinationAgentName,
java.lang.Object theMessageToSend)
throws AbleException
theDestinationLocator - The Locator of the destination agent.
theDestinationAgentName - The globally unique ID (Agent Name) of the destination agent.
theMessageToSend - An Object containing the contents of the message to send.
AbleException - In any error situation.sendTransportMessage(Locator, Locator, AgentName, Object)
protected void sendTransportMessage(javax.agent.Locator theOriginationLocator,
javax.agent.Locator theDestinationLocator,
javax.agent.AgentName theDestinationAgentName,
java.lang.Object theMessageToSend)
throws AbleException
theOriginationLocator - One of my own Locators, selected by the caller.
theDestinationLocator - The Locator of the destination agent.
theDestinationAgentName - The globally unique ID (Agent Name) of the destination
agent.
theMessageToSend - An Object containing the contents of the message to
send.
The message to send can be any of:
AbleException - In any error situation.
protected java.lang.Object getTransportMessageContent(javax.agent.TransportMessage theTransportMessage)
throws AbleException
Important!
This method assumes that the content of the transport
message's inner ACL message is wrapped in either an AcrObject or
an AcrString object. If the transport message was sent with this
class's implementation of the sendTransportMessage()
method, that will indeed be the case. If the transport message
was sent from some non-Able agent or from an overridden
sendTransportMessage() method, this assumption may
be false, and this method may return an AcrNode that you will
have to decode yourself.
theTransportMessage - The message from which the ACL message and its inner
content is to be extracted.
AbleException - In any error situation.
protected java.lang.Object getTransportMessageContent2(javax.agent.TransportMessage theTransportMessage)
throws AbleException
Important!
This method assumes that the content of the transport
message's inner ACL message is wrapped in either an AcrObject or
an AcrString object. If the transport message was sent with this
class's implementation of the sendTransportMessage()
method, that will indeed be the case. If the transport message
was sent from some non-Able agent or from an overridden
sendTransportMessage() method, this assumption may
be false, and this method may return an AcrNode that you will
have to decode yourself.
theTransportMessage - The message from which the ACL message and its inner
content is to be extracted.
AbleException - In any error situation.public void setRequestKey(AbleSecureKey theRequestKey)
public static void main(java.lang.String[] args)
throws AbleException
AbleExceptionpublic java.lang.String toString()
public AbleAgentCapability getCapability(java.lang.Object theCapabilityIdentifier)
throws AbleException
AblePlatformAgent
getCapability in interface AblePlatformAgenttheCapabilityIdentifier - The identifier of the AgentCapability to return.
AbleException
public java.util.Map getCapabilities()
throws AbleException
AblePlatformAgentKey: ((Object) aCapabilityIdentifier) Value: ((AbleAgentCapability) anAgentCapability )
getCapabilities in interface AblePlatformAgentAbleException
public void setCapabilityAutonomyLevel(java.lang.Object theCapabilityIdentifier,
int theAutonomyLevel,
AbleSecureKey theSecureKey)
throws AbleException
AblePlatformAgent
setCapabilityAutonomyLevel in interface AblePlatformAgenttheCapabilityIdentifier - The identifier of the AgentCapability whose autonomy
level is to be set.theAutonomyLevel - The new autonomy level for the specified
AgentCapability.theSecureKey - When security if off, this may be null as the
parameter is ignored; when security is on the security
key must be from an object with equal or greater
authority in order for the operation to proceed.
AbleException - If the caller cannot be verified by the VerifiableAgentNamingService.
If authorization failed.
If unable to update the capabilities of this agent.
public void setCapabilityAutonomyLevels(java.util.Map theCapabilityAutonomyLevels,
AbleSecureKey theSecureKey)
throws AbleException
AblePlatformAgentKey: ((Object) anExistingCapabilityIdentifier) Value: ((Integer) aNewAutonomyLevel )
setCapabilityAutonomyLevels in interface AblePlatformAgenttheCapabilityAutonomyLevels - Map of capabilityID/autonomyLevel pairs.
Each entry of the Map is:
Key: ((Object) anExistingCapabilityIdentifier)
Value: ((Integer) aNewAutonomyLevel )
theSecureKey - When security if off, this may be null as the
parameter is ignored; when security is on the security
key must be from an object with equal or greater
authority in order for the operation to proceed.
AbleException - If the caller cannot be verified by the VerifiableAgentNamingService.
If authorization failed.
If unable to update the capabilities of this agent.
public java.util.Map getCapabilityAutonomyLevels()
throws AbleException
AblePlatformAgentKey: ((Object) aCapabilityIdentifier) Value: ((Integer) anAutonomyLevel )
getCapabilityAutonomyLevels in interface AblePlatformAgentAbleException
public AbleMessageContainer getCapabilitySummaryByAgentAutonomyLevel(int theAgentAutonomyLevel)
throws AbleException
AblePlatformAgent Returns a MessageContainer that describes the overall agent
autonomy summary if the agent's AutonomyLevel is set to
theAutonomyLevel.
getCapabilitySummaryByAgentAutonomyLevel in interface AblePlatformAgenttheAgentAutonomyLevel - The agent AutonomyLevel that the summary is to
represent. Must be one of:
AbleException - If unable to create the capability autonomy level
summary.
public AbleMessageContainer getCapabilitySummaryByCapabilityAutonomyLevels(java.util.Map theCapabilityAutonomyLevels)
throws AbleException
AblePlatformAgent
getCapabilitySummaryByCapabilityAutonomyLevels in interface AblePlatformAgenttheCapabilityAutonomyLevels - The capability autonomy levels that the summary is to
represent.
Each entry of the Map is:
Key: ((Object) aCapabilityIdentifier)
Value: ((Integer) anAutonomyLevel )
If null, then the summary is created using the
current agent AutonomyLevel of this agent.
theCapabilityAutonomyLevels.
AbleException - If unable to create the autonomy levels summary.
public java.util.Map[] getCapabilityPresets()
throws AbleException
AblePlatformAgent
getCapabilityPresets in interface AblePlatformAgentAbleException
public java.util.Vector getCapabilityOrder()
throws AbleException
AblePlatformAgent
getCapabilityOrder in interface AblePlatformAgentAbleException
public final void handleAnsweredRequest(AbleAgentSituationReport theAgentSituationReport,
AbleSecureKey theSecureKey)
throws AbleException
AblePlatformAgentThe process of handling an answered request is done in several steps:
validateRequest(AbleAgentSituationReport) is
called to determine if the request is still valid.
theSecureKey is checked to make sure that the
caller is trusted by the platform, and using a valid
AbleSecureKey.
authenticateAndAuthorizeCaller(AbleAgentSituationReport,AbleSecureKey)
is called to perform steps 2 and 3.
Note that the Thread that is spawned to do the actual
processing of the answer calls the method
processAnsweredRequest.
handleAnsweredRequest in interface AblePlatformAgenttheAgentSituationReport - The original AgentSituationReport containing an
answer to an outstanding (prevously logged) request.theSecureKey - When security if off, this may be null as the
parameter is ignored; when security is on the security
key must be from an object with equal or greater
authority in order for the operation to proceed.
AbleException - If the caller is not verified by the Naming Service.
If the request is no longer valid.
If authorization failed.
If unable to update the capabilities of this agent.
public java.io.Serializable getAboutDataBean()
throws AbleException
AblePlatformAgent
getAboutDataBean in interface AblePlatformAgentAbleException - On all errors getting the 'About' dataBean.
public void setCustomizerDataBean(java.io.Serializable theDataBean,
AbleSecureKey theSecureKey)
throws AbleException
AblePlatformAgent
setCustomizerDataBean in interface AblePlatformAgenttheDataBean - Contains data from the agent's 'Customize' panel.theSecureKey - When security if off, this may be null as the
parameter is ignored; when security is on the security
key must be from an object with equal or greater
authority in order for the operation to proceed.
AbleException - If the caller is not verified by the Naming Service.
On all errors setting the customizer data bean.
public java.io.Serializable getCustomizerDataBean()
throws AbleException
AblePlatformAgent
getCustomizerDataBean in interface AblePlatformAgentAbleException - On all errors getting the 'Customize' data bean.
public java.lang.String[] getCustomizerInfo()
throws AbleException
AblePlatformAgent
getCustomizerInfo in interface AblePlatformAgentString[0] is the fully qualified name of the customizer class.
String[1] is the fully qualified name of the about class.
Returns null if there is no customizer info for this agent; null is returned by the AblePlatformDefaultAgent implementation.
AbleException - On all errors getting the customizer info.
protected void initCommonCode(java.lang.Object theArg)
throws AbleException
Subclasses that override this method must call this super method.
Note that the last thing this method does is check the
specified argument to see whether it is a Map[4] that can be used
to set up AgentCapabilities. If the argument is a Map[4],
initAgentCapabilities(Map[]) is called. All other
argument types are ignored in this implementation.
If you override this method in order to handle a complex
initialization argument, one from which you might need to extract
several different types of initialization arguments, you can call
initAgentCapabilities(Map[]) directly from your overriding
method at any time, and then pass null to this method on
the super call. Or, you can do all your other initializations
first, and then pass the extracted Map[4] here.
theArg - abc...
AbleException - If the agent is using AgentCapabilities and the
AgentLoggingService cannot be found, or if the
AgentCapabilities are not set up properly.
protected void initAgentCapabilities(java.util.Map[] theCapabilities)
throws AbleException
initCommonCode(Object), but only if the argument is
a Map[4]. If the initialization argument needs to be something
else, call this method directly from on overridden version of
initCommonCode(Object).
theCapabilities - An array of four Maps defining the
capabilities of this agent. The first Map (element
[0]) must contain the actual AgentCapabilities of this
agent, and the next three Maps must be:
highCapabilityAutonomyLevels,
mediumCapabilityAutonomyLevels and
lowCapabilityAutonomyLevels, respectively.
This parameter may be null, in which case no capabilities are set in the agent.
AbleException - If the capabilities are not properly setup.
protected void verifyCapabilities()
throws AbleException
This method, called by
initAgentCapabilities(Map[]), is used to verify that
the autonomy level of each of this agent's capabilities is valid.
The capabilities can be set in one of two ways:
To be verified, the overall capabilities and three individual preset Maps must not be null, and each preset must contain the same keys as the capabilities.
This method is called when init is called, but a subclass should call this method right after it has defined the capabilities and autonomy levels to make sure that they are valid.
AbleException - If any of the four capability Maps are null.
If any of the presets do not have the same keys as the capabilities Map.
If the capability order Vector contains invalid or duplicate capabilities.
If an AgentLoggingService is not available.
protected void authorizeCapabilityChangeRequest(AbleSecureKey theSecureKey)
throws AbleException
Subclasses can override this method to restrict authorization based on the VerifiableAgentName that sent the change request.
This method assumes the SecureKey has already been
verified. In other words, call
verifyKey(AbleSecureKey,String) before calling this
method.
theSecureKey - The AbleSecureKey from the entity attempting to make
the change.
AbleException - If this capability change request is not authorized.
protected AbleMessageContainer makeCapabilityAutonomyLevelsSummary(java.util.Map theCapabilityAutonomyLevels)
throws AbleException
theCapabilityAutonomyLevels.
The default implementation of this method will return a basic string in this format: "Automate {0} capabilities, Ask first for {1} capabilities, never run {2} capabilities." This method can be overridden to create a summary String more specific to the agent subclass.
theCapabilityAutonomyLevels - The capability autonomy levels that you want the
summary to represent.
Each entry of the Map is:
Key: ((Object) aCapabilityIdentifier)
Value: ((Integer) anAutonomyLevel )
AbleException - If an invalid capability was set in
theCapabilityAutonomyLevels.
protected void validateAnsweredRequest(AbleAgentSituationReport theAnsweredAgentSituationReport)
throws AbleException
handleAnsweredRequest(com.ibm.able.platform.AbleAgentSituationReport, com.ibm.able.platform.AbleSecureKey) in order to determine whether
the specified request is still valid, does nothing.
This method should be overridden by all subclasses that have requests that may turn invalid after the requests were logged.
If an agent logged a request a while back, by the time it was answered it may no longer be a valid request. The agent should have removed it from the AgentLoggingService, but if it didn't, this is the last chance to end this process, and notifiy the caller. After this, if authorization succeeds, a new thread will be started to handle the processing of the answered request. Then the only way to notify the caller about anything is to log a history log.
theAnsweredAgentSituationReport - The answered AgentSituationReport that this agent had
previously logged.
AbleException - If the request is no longer valid.
protected void authenticateAndAuthorizeCaller(AbleAgentSituationReport theAnsweredAgentSituationReport,
AbleSecureKey theSecureKey)
throws AbleException
handleAnsweredRequest(com.ibm.able.platform.AbleAgentSituationReport, com.ibm.able.platform.AbleSecureKey) in order to determine whether the
answerer of the request is authentic and authorized to answer the
request, does nothing.
This method should be overridden by all subclasses that care about who is allowed to answer the requests of this agent. It is what handles authorizing an answer to one of the agent's logged requests. Based on the AgentSituationReport that is answering the request, and the VerifiableAgentName that sent this answer, the method must decide if it will proceed with this answer.
theAnsweredAgentSituationReport - The answered AgentSituationReport that this agent had
previously logged.theSecureKey - The AbleSecureKey from the entity answering the
request.
AbleException - If caller failed to authenticate or authorize.
protected void processAnsweredRequest(AbleAgentSituationReport theAnsweredAgentSituationReport,
AbleSecureKey theSecureKey)
processAnsweredRequest does nothing.
This method should be overridden by all subclasses. After the processing of an answered AgentSituationReport has passed Validation, Authentication and Authorization, the thread spawned by the Asynchronous Delegation step calls this method to do the actual processing of the answered AgentSituationReport.
This method does not throw any exceptions since the
processing is on a different thread than the original
handleAnsweredRequest(com.ibm.able.platform.AbleAgentSituationReport, com.ibm.able.platform.AbleSecureKey) call. The only way to notify the
caller of failures now is by logging to the AgentLoggingService.
theAnsweredAgentSituationReport - The answered AgentSituationReport that this agent had
previously logged to the AgentLoggingService.theSecureKey - The AbleSecureKey that was used to answer this
request.
protected void logHistory(AbleMessageContainer theDescription,
AbleMessageContainer theAction,
AbleMessageContainer theSummary)
throws AbleException
theDescription - A description of this event being loggedtheAction - The action of this event being loggedtheSummary - The summary of this event being logged.
AbleException - On errors logging to the AgentLoggingService.
On errors getting the name of this agent.
protected AbleAgentSituationReport createAgentSituationReport(java.io.Serializable theIdentifier,
AbleAgentCapability theCapability,
AbleAgentSituation theSituation,
AbleMessageContainer theSuggestedResponse,
AbleMessageContainer theResponseTaken,
AbleMessageContainer theResultsSummary,
boolean theProblemState)
throws AbleException
This will fill the AgentSituationReport with this agent's:
AbleException - On errors calling getAgentName() to create the agent description.
On errors calling getAgentHost().
protected void logAgentSituationReport(AbleAgentSituationReport theAgentSituationReport)
throws AbleException
theAgentSituationReport - The AgentSituationReport that is to be logged
AbleException - If a reference to the Logging Service does not exist. This is common if the agent has not been initialized yet.
On any errors adding the logs.
protected void updateAgentSituationReport(AbleAgentSituationReport theOldAgentSituationReport,
AbleAgentSituationReport theNewAgentSituationReport)
throws AbleException
theOldAgentSituationReport - The AgentSituationReport that is to be updated.theNewAgentSituationReport - The updated AgentSituationReport.
AbleException - If a reference to the AgentLogging does not exist. This is common if the agent has not been initialized yet.
On any errors removing the logs.
protected void removeAgentSituationReports(java.util.Vector theAgentSituationReportsToRemove)
throws AbleException
theAgentSituationReportsToRemove - The AgentSituationReports that are to be removed.
AbleException - If a reference to the AgentLoggingService does not exist. This is common if the agent has not been initialized yet.
On any errors removing the logs.
protected final void verifyKey(AbleSecureKey theSecureKey,
java.lang.String theMethod)
throws AbleException
AbleException - On any namming error while verifying the
key.
protected final void getAgentLoggingService(java.lang.String theMsgId,
java.lang.Object[] theSubstitutionText,
java.lang.String theMethod)
throws AbleException
myAgentLoggingService to reference the
AgentLoggingService. If a reference cannot be obtained, a
message is logged and an exception is thrown.
theMsgId - The resource bundle ID of the message to report if the
AgentLoggingService cannot be obtained.theSubstitutionText - Text to be substituted into the message specified
above, or null if no text needs to be
substituted.theMethod - the name of the calling method, for logging purposes.
AbleException - If the AgentLoggingService cannot be obtained from the
ServiceRoot.
|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||