|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.adaptors.clients.AbstractClient
public abstract class AbstractClient
This Abstract class must be extended by All Adaptor Clients This class abstracts the common behaviour of Adaptor Clients such as RMI,IIOP and HTTP
Client| Nested Class Summary | |
|---|---|
(package private) class |
AbstractClient.HeartBeatDiagnoser
This Active class checks to see if an event needs to be send and then invokes the heartBeat generator |
| Field Summary | |
|---|---|
protected java.lang.Object |
adaptorInfo
|
protected java.util.Properties |
clientProp
|
(package private) AbstractClient.HeartBeatDiagnoser |
heartBeatDiagnoser
|
(package private) boolean |
heartBeatEnabled
|
protected int |
heartBeatRate
|
protected java.lang.String |
host
|
protected boolean |
isSubAgentAlive
|
protected java.util.ArrayList |
listeners
|
protected int |
port
|
| Constructor Summary | |
|---|---|
AbstractClient()
|
|
| Method Summary | |
|---|---|
void |
addHeartBeatListener(HeartBeatListener heartBeatListener)
This method is used to add a heart beat listener |
java.lang.Object |
asyncGetAttribute(javax.management.ObjectName name,
java.lang.String attribute)
Gets the value of a specific attribute of a named MBean. |
java.lang.Object |
asyncGetAttributes(javax.management.ObjectName name,
java.lang.String[] attributes)
Gets the values of several attributes of a named MBean. |
java.lang.Object |
asyncInvoke(javax.management.ObjectName name,
java.lang.String actionName,
java.lang.Object[] params,
java.lang.String[] signature)
Dummy implementation of AsyncClient interface, subclasses can override to provide their own implementations |
java.lang.Object |
asyncSetAttributes(javax.management.ObjectName name,
javax.management.AttributeList attributes)
Sets the values of several attributes of a named MBean. |
void |
authenticate(com.adventnet.agent.security.UserContext userContext)
Dummy implementation for Authentication will do nothing, subclasses can override to provide their own implementations |
abstract void |
connect(java.lang.String host,
int port,
java.lang.Object adaptorInfo)
This method is used to connect to the adaptor |
abstract void |
disconnect()
This method disconnects the client from the adaptor |
void |
enableHeartBeat(boolean enable)
This method is used to enableHeartBeat mechanism |
int |
getHeartBeatRate()
This method returns the heart beat rate |
boolean |
isAuthenticationEnabled()
Dummy implementation to check if Authentication is enabled will return false, subclasses can override to provide their own implementations |
abstract java.lang.Boolean |
isConnectedWithAdaptor()
This method returns true if the client is connected with the adaptor |
boolean |
isHeartBeatEnabled()
This method returns true if the heartBeat is already enabled |
void |
removeHeartBeatListener(HeartBeatListener heartBeatListener)
This method is used to remove a heart beat listener |
protected abstract void |
sendHeartBeatEvent()
This abstract method is the Heart Beat Event Generator |
void |
setHeartBeatRate(int heartBeatRate)
This method sets the heart beat rate |
void |
setProperty(java.lang.String key,
java.lang.String value)
Method to set additional properties required by client |
void |
startHeartBeat()
This method starts the heartbeat mechanism |
void |
stopHeartBeat()
This method stops the heartbeat mechanism |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.management.MBeanServer |
|---|
addNotificationListener, addNotificationListener, createMBean, createMBean, createMBean, createMBean, deserialize, deserialize, deserialize, getAttribute, getAttributes, getClassLoader, getClassLoaderFor, getClassLoaderRepository, getDefaultDomain, getDomains, getMBeanCount, getMBeanInfo, getObjectInstance, instantiate, instantiate, instantiate, instantiate, invoke, isInstanceOf, isRegistered, queryMBeans, queryNames, registerMBean, removeNotificationListener, removeNotificationListener, removeNotificationListener, removeNotificationListener, setAttribute, setAttributes, unregisterMBean |
| Field Detail |
|---|
boolean heartBeatEnabled
protected int heartBeatRate
protected java.util.ArrayList listeners
AbstractClient.HeartBeatDiagnoser heartBeatDiagnoser
protected boolean isSubAgentAlive
protected java.lang.String host
protected int port
protected java.lang.Object adaptorInfo
protected java.util.Properties clientProp
| Constructor Detail |
|---|
public AbstractClient()
| Method Detail |
|---|
public abstract void connect(java.lang.String host,
int port,
java.lang.Object adaptorInfo)
throws java.net.ConnectException
connect in interface Clienthost - The host name of the adaptor.port - The port number of the adaptor.adaptorInfo - The information object specific to the adaptor.
java.net.ConnectException - if the client could not connect to the adaptorpublic abstract void disconnect()
disconnect in interface Client
public abstract java.lang.Boolean isConnectedWithAdaptor()
throws java.net.NoRouteToHostException
isConnectedWithAdaptor in interface Clientjava.net.NoRouteToHostExceptionpublic void startHeartBeat()
public void stopHeartBeat()
stopHeartBeat in interface Clientpublic void enableHeartBeat(boolean enable)
enableHeartBeat in interface Clientenable - true to enable the heartbeatpublic boolean isHeartBeatEnabled()
isHeartBeatEnabled in interface Clientpublic int getHeartBeatRate()
getHeartBeatRate in interface Clientpublic void setHeartBeatRate(int heartBeatRate)
setHeartBeatRate in interface ClientheartBeatRate - the heart beat rate time interval at the connector client
Default is 2000 msec i.e 2 secondspublic void addHeartBeatListener(HeartBeatListener heartBeatListener)
addHeartBeatListener in interface ClientheartBeatListener - the heartbeat listenerpublic void removeHeartBeatListener(HeartBeatListener heartBeatListener)
removeHeartBeatListener in interface ClientheartBeatListener - the heartbeat listenerprotected abstract void sendHeartBeatEvent()
public boolean isAuthenticationEnabled()
isAuthenticationEnabled in interface Client
public void authenticate(com.adventnet.agent.security.UserContext userContext)
throws com.adventnet.agent.security.AuthenticationException
authenticate in interface Clientcom.adventnet.agent.security.AuthenticationException
public java.lang.Object asyncInvoke(javax.management.ObjectName name,
java.lang.String actionName,
java.lang.Object[] params,
java.lang.String[] signature)
throws java.lang.Exception
asyncInvoke in interface AsyncClientname - - The object name of the MBean on which the method is to be invoked.actionName - - The name of the operation to be invoked.params - - An array containing the parameters to be set when the operation is invokedsignature - - An array containing the signature of the operation. The class objects will
be loaded using the same class loader as the one used for loading the MBean on which the operation was invoked.
java.lang.Exception
public java.lang.Object asyncGetAttribute(javax.management.ObjectName name,
java.lang.String attribute)
throws java.lang.Exception
AsyncClient
asyncGetAttribute in interface AsyncClientname - - The object name of the MBean from which the attribute is to be retrieved.attribute - - A String specifying the name of the attribute to be retrieved.
java.lang.Exception
public java.lang.Object asyncGetAttributes(javax.management.ObjectName name,
java.lang.String[] attributes)
throws java.lang.Exception
AsyncClient
asyncGetAttributes in interface AsyncClientname - - The object name of the MBean from which the attributes are retrieved.attributes - - A list of the attributes to be retrieved.
java.lang.Exception
public java.lang.Object asyncSetAttributes(javax.management.ObjectName name,
javax.management.AttributeList attributes)
throws java.lang.Exception
AsyncClient
asyncSetAttributes in interface AsyncClientname - - The object name of the MBean within which the attributes are to be set.attributes - - A list of attributes: The identification of the attributes to be set and the values they are to be set to.
java.lang.Exception
public void setProperty(java.lang.String key,
java.lang.String value)
Client
setProperty in interface Clientkey - key for the propertyvalue - value of the property
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||