|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.ibm.able.platform.AblePlatformDefaultAgent | +--com.ibm.able.platform.AbleEServerDefaultAgent | +--com.ibm.able.platform.examples.EServerTemplateAgent
This class is a simple eServer agent example. It is a time monitor agent. It uses the basics of Able to continusouly monitor the time. Everytime the minute or hour changes the agent will send a history log about the event. The logs could be in one of three formats, and the capability settings will decide how it will act. There will also be a second capability that will check for duplicate request logs. The interval that this agent will check the time at can be customized through a customization panel.
Depending on it's setting, everytime the hour or minute changes, the time capability will either send a history log with no time info, do nothing at all, or ask what it should do. When sending a request with what it should do, it will give the following options:
This class will extend AbleEServerDefaultAgent. Extending this will give you what an agent needs to use the Able Admin Console. It allows you to use the logging service to send logs to, and to get these logs answered. It gives you the capability functionality so the agent can easily set this up and use it to determine how to handle situations. Others can then make use of these too, to change them or just view them. It also allows an agent to have a customization panel that the admin console can use to customize the agent and an about panel that will display information about the agent.
AbleEServerDefaultAgent contains the following variables that a subclass will use: AgentLoggingService myEServerLoggingService HashMap capabilities Vector capabilityOrder HashMap highCapabilitySettings HashMap mediumCapabilitySettings HashMap lowCapabilitySettings HashMap customCapabilitySettings
The follwing methods will be used to work with capabilities, logs and the customization panel. void setCapabilitySettings(Map theCapabilities, AbleSecureKey key) void setCapabilitySetting(Object capabilityName, int autonomyLevel, AbleSecureKey key) Map getCapabilities() Map getCapabilitySettings() AbleEServerCapability getCapability(Object capabilityName) Map[] getCapabilityPresets() AbleMessageContainer getCapabilitySettingsSummary(int autonomyLevel) AbleMessageContainer getCapabilitySettingsSummary(Map capabilities) Vector getCapabilityOrder() void setAgentAutonomyLevel(int agentAutonomyLevel, AbleSecureKey key) int getAutonomyLevel() void answerRequest(AbleAgentSituationReport agentReport, AbleSecureKey key) byte[] getCustomizerResource(String resourceName) void setCustomizerDataBean(Object dataBean, AbleSecureKey key) byte[] getCustomizerDataBean() byte[] getAboutDataBean() String[] getCustomizerInfo()
AbleEServerDefaultAgent extends AblePlatformDefaultAgent which gives you all of the JAS(Java Agent Specification) specific parts an agent needs to be part of a JAS platform.
The Life Cycle Service will use methods from AblePlatformDefaultAgent to perform the actions to an agent: create initialize reinitialize quit suspend reset resume getCreatedAgents quiesce
AblePlatformDefaultAgent also holds most of the attributes of an agent: agentAutonomyLevel agentLastUpdate agentStatus agentSummary agentType agentToAutoRegister agentToBindToRmi agentVendor agentVersion agentMovable agentPrincipal agentTrustLevel agentLocator agentKeyPair agentName agentDescrption
AblePlatformDefaultAgent also hold the important Jas services and parts: ServiceRoot AgentDirectoryService AgentNamingService TransportSystem
AblePlatformDefaultAgent extends AbleRemoteDefaultAgent which contains the following variables: agentAddr agentHost remoteStub
AbleRemoteDefaultAgent extends AbleDefaultAgent which contains the rest of the basic Able Agent functionality: defaultName beans activeDataSource eventConnections processList processListOK numEpochs userDefinedFunctions inputBufferTargetObject outputBufferTargetObject
Fields inherited from class com.ibm.able.platform.AbleEServerDefaultAgent |
capabilities, capabilityOrder, customCapabilitySettings, highCapabilitySettings, lowCapabilitySettings, mediumCapabilitySettings, myEServerLoggingService |
Constructor Summary | |
EServerTemplateAgent()
Create this template Time Agent using the defualt name |
|
EServerTemplateAgent(java.lang.String name)
Create this template Time Agent, setting a name for the agent. |
|
EServerTemplateAgent(java.lang.String name,
java.lang.String comment)
Create this template Time Agent, setting a name for the agent, and a comment. |
Method Summary | |
protected void |
_answerRequest(AbleAgentSituationReport agentReport,
AbleSecureKey key)
When an AbleAgentSituationReport comes into this agent's answerRequest method, if secure, the AbleAgentSituationReport is first authenticated, and then authorized. |
protected java.lang.Object |
_getAboutDataBean()
Get the about databean for this agent. |
protected java.lang.Object |
_getCustomizerDataBean()
Get the databean for this agent. |
protected java.lang.String[] |
_getCustomizerInfo()
Return a String [] array with the following information: --Return null for Strings 0,1, and 2 if there is no Customizer panel-- [0] - Name of Customizer AUIML file and resource bundle class. |
protected void |
_setCustomizerDataBean(java.lang.Object dataBean,
AbleSecureKey key)
The user will enter values into the customizer panel on the client, and the AUIML data bean will get serialized and sent to this agent with this method. |
protected void |
authenticateAndAuthorizeCaller(AbleAgentSituationReport asr,
AbleSecureKey key)
This method is what handles authenticating and authorizing the caller who is answering one of the agent's logged situations. |
protected void |
authorizeCapabilityChangeRequest(AbleSecureKey key)
This method is what handles authorizing a capability change request to this agent. |
protected void |
lclInit(java.lang.Object capabilities)
Initialize the basic ABLE agent processing features. |
void |
process()
The processTimerEvent method will call this main processing method for this agent. |
void |
processTimerEvent()
Since we are using Timer Event processing, this is the method that will be called. |
protected void |
validateRequest(AbleAgentSituationReport reportToValidate)
This method will decide if this request is still a valid request that help is needed on. |
Methods inherited from interface com.ibm.able.platform.AblePlatformAgent |
getAgentAutonomyLevel, getAgentLastUpdate, getAgentStatus, getAgentSummary, getAgentType, getAgentVendor, getAgentVersion, getJasAgentAttributes, getJasAgentName, getPlatformAgentName, initializeAgent, initializeAgent, isAgentMovable, isAgentToAutoRegister, isAgentToBindToRmi, preInit, preInit, quitAgent, resetAgent, resumeAgent, suspendAgent |
Methods inherited from interface javax.agent.service.transport.MessageListener |
equals, hashCode |
Constructor Detail |
public EServerTemplateAgent() throws java.rmi.RemoteException, com.ibm.able.AbleException
java.rmi.RemoteException
- On all remote errors.
AbleException
- On errors setting up the capabilities.public EServerTemplateAgent(java.lang.String name) throws java.rmi.RemoteException, com.ibm.able.AbleException
java.rmi.RemoteException
- On all remote errors.
AbleException
- On errors setting up the capabilities.public EServerTemplateAgent(java.lang.String name, java.lang.String comment) throws java.rmi.RemoteException, com.ibm.able.AbleException
java.rmi.RemoteException
- On all remote errors.
AbleException
- On errors setting up the capabilities.Method Detail |
protected void lclInit(java.lang.Object capabilities) throws com.ibm.able.AbleException
If theCapabilities
are not null, they will be used
to set the current capabilities and settings of this agent.
lclInit
in class AbleEServerDefaultAgent
theCapabilities
- A Map[] that will be used to set the agents capabilities and settings.
On
- all errors calling the super lclInitpublic void processTimerEvent() throws com.ibm.able.AbleException
public void process() throws com.ibm.able.AbleException
AbleException
- On all errors thrown from actOnProblemSituationEncountered.protected void authenticateAndAuthorizeCaller(AbleAgentSituationReport asr, AbleSecureKey key) throws com.ibm.able.AbleException
authenticateAndAuthorizeCaller
in class AbleEServerDefaultAgent
asr
- AbleAgentSituationReport that is the answer to one of the agents logged situations
key
- The AbleSecureKey the answering entity used to answer this situation
AbleException
- If the caller is not authorized.protected void validateRequest(AbleAgentSituationReport reportToValidate) throws com.ibm.able.AbleException
validateRequest
in class AbleEServerDefaultAgent
reportToValidate
- The AbleAgentSituationReport that is to be validated.
AbleException
- When the request is no longer valid.protected void _answerRequest(AbleAgentSituationReport agentReport, AbleSecureKey key)
Any failures in answering the request that came back to this method will get logged to the Logging Service as a History Log.
_answerRequest
in class AbleEServerDefaultAgent
agentReport
- The answered AbleAgentSituationReport that this agent had previoulsy logged.
key
- The AbleSecureKey that was used to answer this requestprotected void authorizeCapabilityChangeRequest(AbleSecureKey key) throws com.ibm.able.AbleException
authorizeCapabilityChangeRequest
in class AbleEServerDefaultAgent
key
- The AbleSecureKey of the entity trying to make the change request.
AbleException
- If the caller is not authorized.protected java.lang.String[] _getCustomizerInfo()
Example: myString [0] = "com.ibm.agent.CustomizerPanel" myString [1] = "com.ibm.agent.CustomizerDataBean" myString [2] = "MainPanel"
Default implementation is to return null. This tells the console that the agent doesn't have a customizer panel.
_getCustomizerInfo
in class AbleEServerDefaultAgent
protected void _setCustomizerDataBean(java.lang.Object dataBean, AbleSecureKey key) throws com.ibm.able.AbleException
_setCustomizerDataBean
in class AbleEServerDefaultAgent
dataBean
- The dataBean that is used to customize this agent.
key
- AbleSecureKey used to secure the call.
AbleException
- On all errors authenticiating and authorizing the caller.protected java.lang.Object _getCustomizerDataBean() throws com.ibm.able.AbleException
_getCustomizerDataBean
in class AbleEServerDefaultAgent
AbleException
- On any error creating the bean.protected java.lang.Object _getAboutDataBean() throws com.ibm.able.AbleException
_getAboutDataBean
in class AbleEServerDefaultAgent
AbleException
- On any error creating the bean.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |