com.ibm.able.platform
Class RmiAgentLoggingServiceProxy

java.lang.Object
  |
  +--com.ibm.able.platform.RmiAgentLoggingServiceProxy
All Implemented Interfaces:
AblePlatformService, AblePlatformServiceEventGenerator, AgentLoggingService, java.io.Serializable, javax.agent.service.Service

public class RmiAgentLoggingServiceProxy
extends java.lang.Object
implements AgentLoggingService, java.io.Serializable

The RMIAgentLoggingServiceProxy is a proxy for the RMI implementation of the AgentLoggingService.

An RMI Agent Logging Service proxy contains a reference to an RMI version of an Agent Logging Service. The proxy contains methods identical to the methods in the actual service.

When a method is called on the proxy, the proxy forwards the call on to the actual service. However, the proxy:

In this way, code making use of the proxy does not have to be sensitive to RMI RemoteExceptions and can code to a common Agent Logging Service interface.

See Also:
Serialized Form

Fields inherited from interface com.ibm.able.platform.AgentLoggingService
COLUMN_NAMES, COLUMN_TYPES, HISTORY_LOG_MAX, SERVICE_TYPE
 
Constructor Summary
RmiAgentLoggingServiceProxy(RmiAgentLoggingService theDelegate, java.rmi.registry.Registry theRegistry, java.lang.String theAddress)
          Create a proxy over the specified RMI reference to an Agent Logging Service.
 
Method Summary
 void addAblePlatformServiceEventListener(AblePlatformServiceEventListener observer)
          Adds a service event listener to this service.
 void answerAgentRequest(AbleAgentSituationReport asr, AbleSecureKey key)
          When someone is attempting to answer and existing problem AbleAgentSituationReport, this method will take the answered AbleAgentSituationReport and contact the one who originally logged the request.
static java.lang.String Copyright()
          Determine the copyright of this class.
 java.util.Vector getAblePlatformServiceEventListeners()
          Gets a collection of all service event listeners registered with this service event generator.
 java.util.Vector getAgentHistory(javax.agent.AgentName agentName)
          Returns all of the AbleAgentSituationReports from the Logging Service that belong to a certain agent that are not in the problem state.
 java.util.Vector getAgentProblems(javax.agent.AgentName agentName)
          Returns all of the AbleAgentSituationReports from the Logging Service that belong to a certain agent that are in the problem state.
 java.util.Vector getAllLogs()
          Return a Vector of all the AbleAgentSituationReports from the Logging Service.
 java.util.Vector getAllProblems()
          Returns all of the AbleAgentSituationReports from the Logging Service that are in the problem state.
 javax.agent.service.ServiceProperties getServiceProperties()
          Retrieve the service properties of the underlying service.
 int getState()
          Returns the state of this service.
 void logAgentSituationReport(AbleAgentSituationReport asr, AbleSecureKey key)
          Log an AbleAgentSituationReport to the Logging Service, and notify all interested listeners about this added log.
 void removeAblePlatformServiceEventListener(AblePlatformServiceEventListener observer)
          Removes a service event listener from this service.
 void removeAgentLogs(javax.agent.AgentName agentName, AbleSecureKey key)
          Removes all of the AbleAgentSituationReports that belong to a certain agent.
 void removeAgentSituationReports(java.util.Vector asrs, AbleSecureKey key)
          Removes AbleAgentSituationReports from the Logging Service, and notify all interested listeners about these removals.
 java.util.Vector search(AbleAgentSituationReport asr)
          Return a Vector of all of the AbleAgentSituationReports that match the criteria supplied in the passed in AbleAgentSituationReport.
 void setServiceProperties(javax.agent.service.ServiceProperties theServiceProperties)
          Set the service properties of the underlying service.
 void terminateService(AbleSecureKey theSecureKey)
          Terminates this service in a controlled way; the service is removed from the service root and, if necessary, unbound from the RMI registry and unexported as a remote RMI object.
 java.lang.String toString()
          Retrieve a string describing (the contents of) the object.
 void updateAgentSituationReport(AbleAgentSituationReport old, AbleAgentSituationReport replacement, AbleSecureKey key)
          Update an AbleAgentSituationReport in the Logging Service, and notify all interested listeners about this update.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RmiAgentLoggingServiceProxy

public RmiAgentLoggingServiceProxy(RmiAgentLoggingService theDelegate,
                                   java.rmi.registry.Registry theRegistry,
                                   java.lang.String theAddress)
Create a proxy over the specified RMI reference to an Agent Logging Service.
Parameters:
theDelegate - A reference to an RMI version of an Agent Logging Service.

theRegistry - The RMI registry at which the above Agent Logging Service is registered.

theAddress - The RMI address at which the above Agent Logging Service is registered.

Method Detail

addAblePlatformServiceEventListener

public void addAblePlatformServiceEventListener(AblePlatformServiceEventListener observer)
                                         throws com.ibm.able.AbleException
Description copied from interface: AblePlatformServiceEventGenerator
Adds a service event listener to this service.
Specified by:
addAblePlatformServiceEventListener in interface AblePlatformServiceEventGenerator
Following copied from interface: com.ibm.able.platform.AblePlatformServiceEventGenerator
Parameters:
theListener - Any object interested in listening for service events generated by this service.

Throws:
AbleException -

If the listener to be added is null.

On any error.


removeAblePlatformServiceEventListener

public void removeAblePlatformServiceEventListener(AblePlatformServiceEventListener observer)
                                            throws com.ibm.able.AbleException
Description copied from interface: AblePlatformServiceEventGenerator
Removes a service event listener from this service.
Specified by:
removeAblePlatformServiceEventListener in interface AblePlatformServiceEventGenerator
Following copied from interface: com.ibm.able.platform.AblePlatformServiceEventGenerator
Parameters:
theListener - A previously registered object that is no longer interested in listening for service events generated by this service.

Throws:
AbleException -

If the listener to be removed is null.

On any error.


getAblePlatformServiceEventListeners

public java.util.Vector getAblePlatformServiceEventListeners()
                                                      throws com.ibm.able.AbleException
Description copied from interface: AblePlatformServiceEventGenerator
Gets a collection of all service event listeners registered with this service event generator.
Specified by:
getAblePlatformServiceEventListeners in interface AblePlatformServiceEventGenerator
Following copied from interface: com.ibm.able.platform.AblePlatformServiceEventGenerator
Returns:
All registered AblePlatformServiceEventListener objects.
Throws:
AbleException - On any error.

terminateService

public void terminateService(AbleSecureKey theSecureKey)
                      throws com.ibm.able.AbleException,
                             javax.agent.service.naming.NamingException
Description copied from interface: AblePlatformService
Terminates this service in a controlled way; the service is removed from the service root and, if necessary, unbound from the RMI registry and unexported as a remote RMI object.
Specified by:
terminateService in interface AblePlatformService
Following copied from interface: com.ibm.able.platform.AblePlatformService
Parameters:
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.

Throws:
AbleException - On any remote error or Able error.
javax.agent.service.naming.NamingException - On any naming error.

getState

public int getState()
             throws com.ibm.able.AbleException
Description copied from interface: AblePlatformService
Returns the state of this service.
Specified by:
getState in interface AblePlatformService
Following copied from interface: com.ibm.able.platform.AblePlatformService
Returns:
The state of this service.
Throws:
AbleException - On any remote error or Able error.

logAgentSituationReport

public void logAgentSituationReport(AbleAgentSituationReport asr,
                                    AbleSecureKey key)
                             throws AgentLoggingException
Description copied from interface: AgentLoggingService
Log an AbleAgentSituationReport to the Logging Service, and notify all interested listeners about this added log.

If secure, the log request will proceed as long as the caller is authenticated.

The logging of duplicate AbleAgentSituationReports will fail.

Specified by:
logAgentSituationReport in interface AgentLoggingService
Following copied from interface: com.ibm.able.platform.AgentLoggingService
Parameters:
theAbleAgentSituationReport - The AbleAgentSituationReport that is to be logged.

key - The AbleSecureKey that secures communication.

Throws:
AgentLoggingException -

If the AbleAgentSituationReport to be logged is null.

If the caller is not authenticated.

If a duplicate AbleAgentSituationReport is already logged.


updateAgentSituationReport

public void updateAgentSituationReport(AbleAgentSituationReport old,
                                       AbleAgentSituationReport replacement,
                                       AbleSecureKey key)
                                throws AgentLoggingException
Description copied from interface: AgentLoggingService
Update an AbleAgentSituationReport in the Logging Service, and notify all interested listeners about this update.

An AbleAgentSituationReport can only be updated if it is in the problem state. History logs may never be changed.

When secure, an AbleAgentSituationReport in the problem state can only be updated by its own VerifiableAgentName.

This method call cannot be delegated. The VerifiableAgentName of the AbleAgentSituationReport that is to be updated must directly make the call.

Specified by:
updateAgentSituationReport in interface AgentLoggingService
Following copied from interface: com.ibm.able.platform.AgentLoggingService
Parameters:
oldLog - The AbleAgentSituationReport that is to be updated.

updatedLog - The AbleAgentSituationReport that is to replace the old AbleAgentSituationReport.

key - The AbleSecureKey that secures communication.

Throws:
AgentLoggingException -

If the updated AbleAgentSituationReport is null.

If the caller is not authenticated.

If the log to be updated does not exist.

If the log being updated to already exists.

If the log we are updating is a history log.

If the caller is not the one who originally logged the log being updated.


removeAgentSituationReports

public void removeAgentSituationReports(java.util.Vector asrs,
                                        AbleSecureKey key)
                                 throws AgentLoggingException
Description copied from interface: AgentLoggingService
Removes AbleAgentSituationReports from the Logging Service, and notify all interested listeners about these removals.

When secure and the AbleAgentSituationReport is verifiable, an AbleAgentSituationReport in the problem state can only be removed by it own VerifiableAgentName, so this method call cannot be delegated in this case.

An AbleAgentSituationReport in the history state can be removed by anyone with equal or greater authority to the VerifiableAgentName of the AbleAgentSituationReport. This call can be delegated in this case.

Specified by:
removeAgentSituationReports in interface AgentLoggingService
Following copied from interface: com.ibm.able.platform.AgentLoggingService
Parameters:
asrsToRemove - A Vector of all the AbleAgentSituationReports that should be removed.

key - The AbleSecureKey that secures communication.

Throws:
AgentLoggingException -

If the remove Vector is null.

If an AbleAgentSituationReport that is to be removed does not exist.

If the caller is not authenticated.

If attempting to remove a problem log, and the caller is not the one who originally logged it.

If attempting to remove a history log, and the caller does not have equal to or greater authority as the one who originally logged it.


getAllLogs

public java.util.Vector getAllLogs()
                            throws AgentLoggingException
Description copied from interface: AgentLoggingService
Return a Vector of all the AbleAgentSituationReports from the Logging Service.

Specified by:
getAllLogs in interface AgentLoggingService
Following copied from interface: com.ibm.able.platform.AgentLoggingService
Returns:
Vector of all AbleAgentSituationReports logged to this service.

Throws:
AgentLoggingException - on all remote errors.

getAllProblems

public java.util.Vector getAllProblems()
                                throws AgentLoggingException
Description copied from interface: AgentLoggingService
Returns all of the AbleAgentSituationReports from the Logging Service that are in the problem state.

Specified by:
getAllProblems in interface AgentLoggingService
Following copied from interface: com.ibm.able.platform.AgentLoggingService
Returns:
Vector of all the problem state AbleAgentSituationReports.

Throws:
AgentLoggingException - on all remote errors.

getAgentHistory

public java.util.Vector getAgentHistory(javax.agent.AgentName agentName)
                                 throws AgentLoggingException
Description copied from interface: AgentLoggingService
Returns all of the AbleAgentSituationReports from the Logging Service that belong to a certain agent that are not in the problem state.

Specified by:
getAgentHistory in interface AgentLoggingService
Following copied from interface: com.ibm.able.platform.AgentLoggingService
Parameters:
agentName - The AgentName of the agent whose history logs will be returned.

Returns:
Vector of all the history AbleAgentSituationReports for the supplied agent.

Throws:
AgentLoggingException - on all remote errors.

getAgentProblems

public java.util.Vector getAgentProblems(javax.agent.AgentName agentName)
                                  throws AgentLoggingException
Description copied from interface: AgentLoggingService
Returns all of the AbleAgentSituationReports from the Logging Service that belong to a certain agent that are in the problem state.

Specified by:
getAgentProblems in interface AgentLoggingService
Following copied from interface: com.ibm.able.platform.AgentLoggingService
Parameters:
agentName - The AgentName of the agent whose problem logs will be returned.

Returns:
Vector of all the problem AbleAgentSituationReports of the supplied agent.

Throws:
AgentLoggingException - on all remote errors.

answerAgentRequest

public void answerAgentRequest(AbleAgentSituationReport asr,
                               AbleSecureKey key)
                        throws com.ibm.able.AbleException,
                               AgentLoggingException
Description copied from interface: AgentLoggingService
When someone is attempting to answer and existing problem AbleAgentSituationReport, this method will take the answered AbleAgentSituationReport and contact the one who originally logged the request.

Specified by:
answerAgentRequest in interface AgentLoggingService
Following copied from interface: com.ibm.able.platform.AgentLoggingService
Parameters:
answeredAbleAgentSituationReport - The answered problem AbleAgentSituationReport.

key - The key that is used to secure this communication

Throws:
AgentLoggingException -

If the answered AbleAgentSituationReport is null.

If the caller is not authenticated.

If the AbleAgentSituationReport that is being answered does not exist.

If unable to locate the agent who originally logged the request.

If using a History log to answer a request.

On any remote error calling the agent.

AbleException - On errors coming back from the agent.

removeAgentLogs

public void removeAgentLogs(javax.agent.AgentName agentName,
                            AbleSecureKey key)
                     throws AgentLoggingException
Description copied from interface: AgentLoggingService
Removes all of the AbleAgentSituationReports that belong to a certain agent.

When secure, this method can only be called by the actaul agent that logged these logs. This method call cannot be delegated.

Specified by:
removeAgentLogs in interface AgentLoggingService
Following copied from interface: com.ibm.able.platform.AgentLoggingService
Parameters:
agentName - The AgentName of the agent that is to have all of it's AbleAgentSituationReports removed.

key - The key that is used to secure this communication.

Throws:
AgentLoggingException -

If the agentName parameter is null.

If the caller is not authenticated.


search

public java.util.Vector search(AbleAgentSituationReport asr)
                        throws AgentLoggingException
Description copied from interface: AgentLoggingService
Return a Vector of all of the AbleAgentSituationReports that match the criteria supplied in the passed in AbleAgentSituationReport.

If fields in the AbleAgentSituationReport are left as null, a match can contain anything in this field. There is no way to wildcard the search for the state and timeSent fields since they are primitive types.

Specified by:
search in interface AgentLoggingService
Following copied from interface: com.ibm.able.platform.AgentLoggingService
Parameters:
searchAsr - The AbleAgentSituationReport which represents the criteria that will be searched for.

Returns:
Vector of all the logs that match the supplied AbleAgentSituationReport.

Throws:
AgentLoggingException - If the search AbleAgentSituationReport is null.

getServiceProperties

public javax.agent.service.ServiceProperties getServiceProperties()
Retrieve the service properties of the underlying service.

Note: In this implementation, the method call is not forwarded on to the service; null is always returned.

Specified by:
getServiceProperties in interface javax.agent.service.Service
Returns:
null at all times.

setServiceProperties

public void setServiceProperties(javax.agent.service.ServiceProperties theServiceProperties)
Set the service properties of the underlying service.

Note: In this implementation, the method call is not forwarded on to the service; the call is simply ignored.

Specified by:
setServiceProperties in interface javax.agent.service.Service
Parameters:
theServiceProperties - The service properties to be used by the service.


toString

public java.lang.String toString()
Retrieve a string describing (the contents of) the object.
Overrides:
toString in class java.lang.Object
Returns:
A String containing the current contents of the object.

Copyright

public static java.lang.String Copyright()
Determine the copyright of this class.
Returns:
A String containing this class's copyright statement.