|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.adaptors.AbstractAdaptor
com.adventnet.adaptors.tl1.TL1Adaptor
public class TL1Adaptor
This class acts as a JMX adaptor for TL1 protocol.
It itself acts as a mbean for exposing the TL1 properties. This class extends the SimpleAdaptor which provides the implementation of ServiceInfo interface and acts as the TL1 NE (Agent)
The port number of the service can be specified in the ObjectName with key-value pair as, port=9099(by default). When the port is not specifies in the ObjectName, the TL1 Agent gets started at port 9099.
For example, to start the TL1 agent at 9199, you can specify the following object name:
| Nested Class Summary | |
|---|---|
(package private) class |
TL1Adaptor.MyTL1Agent
|
| Nested classes/interfaces inherited from class com.adventnet.adaptors.AbstractAdaptor |
|---|
AbstractAdaptor.ProcessNotification |
| Field Summary | |
|---|---|
(package private) boolean |
ackSenderFlag
|
(package private) long |
ackTime
|
(package private) boolean |
asyncMode
|
(package private) boolean |
authFlag
|
(package private) static boolean |
builtInFlag
|
(package private) boolean |
craftFlag
|
boolean |
isAllSession
|
(package private) static int |
MAX_THREADS
|
(package private) static boolean |
monitorFlag
|
(package private) TL1MultiProtocolHandler |
mpHandler
|
(package private) boolean |
multiplePortFlag
|
(package private) int |
port
the port in which the service gets started |
(package private) int[] |
ports
|
(package private) int |
respPacketSize
|
(package private) static boolean |
standAloneFlag
|
(package private) int |
THREAD_LIMIT
|
| Fields inherited from class com.adventnet.adaptors.AbstractAdaptor |
|---|
notifications, processnotification, state |
| Constructor Summary | |
|---|---|
TL1Adaptor()
The NoArg constructor used to initialize the TL1Adaptor in forming the MBeanInfo and getting the reference of the MBeanServer using the MBeanServerFactory.findJMXAgent(...) method. |
|
TL1Adaptor(int port)
This constrctor takes tl1Port( where TL1 Agent) should start as input. |
|
TL1Adaptor(int port,
javax.management.MBeanServer server)
This consructor is used to receive the port number where TL1Server has to be started and the mbean server instance. |
|
| Method Summary | |
|---|---|
protected void |
bind()
Must be used to bind to a naming service or to bind to a ServerSocket |
protected void |
countClients()
|
protected void |
destroyAdaptor()
Kills the adaptor and releases all its resources |
void |
enableAuthentication(boolean flag)
Enables authentication. |
void |
enableAuthorisation(boolean flag)
Enables authorisation. |
void |
enableBuiltInCommands(boolean builtInFlag)
Enables the Builtin command support if builtInFlag is true. |
void |
enableCraftInterface(boolean craftFlag)
Enables the craft interface support if it's true. |
void |
enableSelfMonitorSupport(boolean monitorFlag)
Enables the self monitoring support if monitorFlag is true. |
long |
getAckTime()
Used to get the time in long which represents milliseconds after which an acknowledgement has to be sent if the response hasn't been sent. |
javax.management.ObjectName |
getAdaptorObjectName()
Returns the adaptor object name |
java.util.Vector |
getAllSession()
This will return the Vector of sessions present in TL1API. |
boolean |
getAsyncMode()
Getter of the current process mode . |
java.lang.Object |
getAttribute(java.lang.String attribute)
Gets the value of a specific attribute of this MBean. |
javax.management.AttributeList |
getAttributes(java.lang.String[] attributes)
Enables the values of several attributes of this MBean. |
boolean |
getCraftStatus()
Returns true if Craft is enabled. |
int |
getDebugLevel()
Getter for the debug level. |
int |
getMaxThreads()
Getter of the max threads started for Asynchronous processing. |
javax.management.MBeanInfo |
getMBeanInfo()
This method discovers the attributes and operations this MBean exposes for management. |
javax.management.ObjectName |
getObjectName()
Returns the ObjectName of this adaptor with which it has been registered with the MBeanServer. |
int[] |
getPorts()
Returns the port numbers in which the service gets started. |
java.lang.String |
getProtocol()
Gets the protocol supported by this adaptor. |
int |
getResponsePacketSize()
This is used to get the size of the response packet, above which the response will be split and sent. |
java.lang.String |
getTargetId()
Used to get the TargetID string. |
com.adventnet.agent.tl1.TL1Agent |
getTL1Agent()
Returns TL1Agent reference. |
TL1ServerSession |
getTL1ServerSession()
Returns the TL1ServerSession incase the agent is running in the single port. |
TL1ServerSession |
getTL1ServerSession(int port)
Returns the TL1ServerSession for the specified port. |
java.util.Hashtable |
getTL1TcpTableInfo()
This will return the Hashtable containing the TL1TcpTable info. |
java.lang.String |
getVendorName()
Returns vendorName who distributes this TL1 agent |
protected void |
instantiateAdaptor()
This method sets the adaptor reference in TL1Agent. |
java.lang.Object |
invoke(java.lang.String actionName,
java.lang.Object[] params,
java.lang.String[] signature)
Invokes an action on the original MBean associated with this MBean. |
boolean |
isAuthenticationEnabled()
Returns whether TL1 authentication is enabled or not. |
boolean |
isAutoAckEnabled()
Used to get whether the automatic acknowledgement is enabled or not. |
boolean |
isMultiplePortMode()
Used to get whether the agent is running in multiple port mode. |
void |
isSetAllSession(boolean flag)
|
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
This method is an implementation of MBeanRegistration interface. |
void |
processErrorMessage(TL1Session session,
java.lang.String errorMessage)
This method will be called when any TL1 request reaches the session of the tl1 agent. |
boolean |
processTL1Request(TL1Session session,
TL1Message message)
This method will be called when any request reaches the session of the TL1 agent. |
protected void |
receive()
|
void |
sendAckMessage(TL1Session sess,
java.lang.String ack,
java.lang.String cTag)
This method can be called by the user to send an acknowledgement. |
void |
setAckTime(long ackTime)
Used to set the time in long which represents milliseconds after which an acknowledgement has to be sent if the response hasn't been sent. |
void |
setAsyncMode(boolean mode)
Allows agent to process the requests asynchronously. |
void |
setAttribute(javax.management.Attribute attribute)
Sets the value of a specific attribute of this MBean. |
javax.management.AttributeList |
setAttributes(javax.management.AttributeList attributes)
Sets the values of several attributes of this MBean. |
void |
setAutoAckEnabled(boolean autoAckFlag)
Used to set whether the agent should send an acknowledgement of type IN_PROGRESS if the response is not recieved within 2 seconds. |
void |
setChannelSecurityFile(java.lang.String fileName)
Sets Channel Security file location. |
void |
setCommandSecurityFile(java.lang.String fileName)
Sets Command Security file location. |
void |
setDebugLevel(int debugLevel)
This method is used to set the debug level. |
boolean |
setMaxThreads(int a)
Setter for the number of threads to be started for asynchronous processing . |
void |
setMultiplePortMode(boolean multiplePortFlag)
Used to set the agent in multiple port mode. |
void |
setOperationHandlerFileName(java.lang.String fileName)
Sets the Operation handler file name . |
void |
setOperationSecurityFile(java.lang.String fileName)
Sets Operation Security file location. |
void |
setPort(int tl1Port)
Deprecated. Since AdventNet AgentToolkit Release 4.2. Use setPorts(int[]) method instead. |
void |
setPorts(int[] ports)
Sets the port numbers on which the service should get restarted. |
void |
setResourceHandlerFileName(java.lang.String fileName)
Sets the Resource handler file name . |
void |
setResourceSecurityFile(java.lang.String fileName)
sets resource security file location. |
void |
setResponsePacketSize(int size)
This is used to set the size of the response packet, above which the response will be split and sent. |
void |
setSecurityEnabled(boolean authFlag)
Enabled/Disables TL1 authentication |
void |
setSecurityFlags(boolean user,
boolean chan,
boolean command,
boolean oper,
boolean resource)
Sets the status of different security views. |
void |
setSecurityLogFile(java.lang.String file)
Sets the Security log file . |
void |
setSecurityLogSize(int size)
Sets the SecurityLog size. |
void |
setSessionTimeOutInSeconds(int timeOutSeconds)
Sets the session "keep time alive" in seconds. |
void |
setStandAlone(boolean flag)
This method is used to set the standAloneFlag which is used internally for processing the TL1Message depending upon whether it is a stand-alone agent or used in common instrumentation. |
void |
setTargetId(java.lang.String target)
Used to set the TargetID of the agent. |
void |
setTL1MessageFormatterReference(com.adventnet.agent.tl1.TL1MessageFormatter formatter)
Sets the TL1MessageFormatter reference. |
(package private) void |
setTL1TcpTableInfo(java.util.Hashtable table)
Sets the TL1TcpTableInfo. |
void |
setUserRequestHandler(com.adventnet.agent.tl1.UserRequestHandler requestHandler)
Sets the UserRequestHandler |
void |
setUserSecurityFile(java.lang.String fileName)
Sets the User security persistence file. |
void |
setVendorName(java.lang.String vendorName)
Sets the vendorName who distributes this TL1 agent |
(package private) void |
stopAgent(int port)
This method is used for config mib handling. |
protected void |
unbind()
Must be used to unbind from a naming service or to relese a ServerSocket |
| Methods inherited from class com.adventnet.adaptors.AbstractAdaptor |
|---|
addNotificationListener, changeState, getAdaptorVersion, getHost, getNotificationInfo, getPort, getState, getStateInString, handleNotification, isActive, isSecure, postDeregister, postRegister, preDeregister, processNotification, removeNotificationListener, startService, stopService |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
TL1MultiProtocolHandler mpHandler
public boolean isAllSession
static boolean standAloneFlag
int respPacketSize
static boolean builtInFlag
static boolean monitorFlag
int port
int[] ports
boolean multiplePortFlag
boolean ackSenderFlag
long ackTime
static int MAX_THREADS
boolean asyncMode
final int THREAD_LIMIT
boolean craftFlag
boolean authFlag
| Constructor Detail |
|---|
public TL1Adaptor()
public TL1Adaptor(int port)
tl1Port -
public TL1Adaptor(int port,
javax.management.MBeanServer server)
| Method Detail |
|---|
public int getResponsePacketSize()
public void setResponsePacketSize(int size)
size - The size(in bytes) of the response packet as an integer.public com.adventnet.agent.tl1.TL1Agent getTL1Agent()
public void isSetAllSession(boolean flag)
public javax.management.MBeanInfo getMBeanInfo()
getMBeanInfo in interface javax.management.DynamicMBean
public java.lang.Object getAttribute(java.lang.String attribute)
throws javax.management.AttributeNotFoundException,
javax.management.MBeanException,
javax.management.ReflectionException
getAttribute in interface javax.management.DynamicMBeanattribute - A String specifying the name' of the
attribute to be retrieved.
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionExceptionpublic javax.management.AttributeList getAttributes(java.lang.String[] attributes)
getAttributes in interface javax.management.DynamicMBeanattributes - A list of attributes to be retrieved.
public java.lang.Object invoke(java.lang.String actionName,
java.lang.Object[] params,
java.lang.String[] signature)
throws javax.management.MBeanException,
javax.management.ReflectionException
invoke in interface javax.management.DynamicMBeanactionName - The name of the action to be invoked.params - An array containing the parameters to be
set when the action is invokedsignature - An array containing the signature of
the action. The class objects will be loaded using the
same class loader as the one used for loading the MBean
on which the action was invoked.
javax.management.MBeanException
javax.management.ReflectionException
public void setAttribute(javax.management.Attribute attribute)
throws javax.management.AttributeNotFoundException,
javax.management.InvalidAttributeValueException,
javax.management.MBeanException,
javax.management.ReflectionException
setAttribute in interface javax.management.DynamicMBeanattribute - The identification of the attribute to
be set and the value it is to be set to.
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionExceptionpublic javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
setAttributes in interface javax.management.DynamicMBeanattributes - A list of attributes: The identification
of the attributes to be set and the values they are to be set to.
public TL1ServerSession getTL1ServerSession()
public TL1ServerSession getTL1ServerSession(int port)
port - - The port whose TL1ServerSession is to be retrieved.
public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
throws java.lang.Exception
This method is called by the MBeanServer before this mbean getting registered with the server. If the passed objectName is invalid, the returned objectName is taken as valid name to get registered with the server.
The TL1 agent gets actually started only inside this method at the specified port mentioned in the key "port". If the key "port" is absent, then the service gets started at the default port 9099.
preRegister in interface javax.management.MBeanRegistrationpreRegister in class AbstractAdaptorserver - The MBeanServer in which the MBean will be registered.name - The object name of the MBean.
java.lang.Exception - This exception should be caught by the MBeanServer and
re-thrown as an MBeanRegistrationException.void setTL1TcpTableInfo(java.util.Hashtable table)
public java.util.Hashtable getTL1TcpTableInfo()
public void processErrorMessage(TL1Session session, java.lang.String errorMessage)
sess - - TL1Session through which to send message.message - - Input message for which response is to be sent.public boolean processTL1Request(TL1Session session, TL1Message message)
session - the session on which agent is communicating.message - the TL1Message.
public java.util.Vector getAllSession()
public void enableBuiltInCommands(boolean builtInFlag)
public void enableSelfMonitorSupport(boolean monitorFlag)
public void enableCraftInterface(boolean craftFlag)
craftFlag - - craft status.public boolean getCraftStatus()
public void setSessionTimeOutInSeconds(int timeOutSeconds)
seconds - - The session time out seconds.protected void instantiateAdaptor()
instantiateAdaptor in class AbstractAdaptorprotected void bind()
AbstractAdaptor
bind in class AbstractAdaptorprotected void receive()
protected void countClients()
protected void unbind()
AbstractAdaptor
unbind in class AbstractAdaptorprotected void destroyAdaptor()
AbstractAdaptor
destroyAdaptor in class AbstractAdaptorvoid stopAgent(int port)
public javax.management.ObjectName getAdaptorObjectName()
AbstractAdaptor
getAdaptorObjectName in interface AdaptorgetAdaptorObjectName in class AbstractAdaptorpublic int[] getPorts()
public void setPorts(int[] ports)
ports - the new port numbers.setMultiplePortModepublic void setPort(int tl1Port)
setPort in interface AdaptorsetPort in class AbstractAdaptorport - the new port number.public void setMultiplePortMode(boolean multiplePortFlag)
isMultiplePortMode(),
setPorts(int[])public boolean isMultiplePortMode()
setMultiplePortMode()public void setAutoAckEnabled(boolean autoAckFlag)
autoAckFlag - false if it needs to be disabled. true by default.isAutoAckEnabled(),
setPorts(boolean)public boolean isAutoAckEnabled()
setAutoAckEnabled()public void setAckTime(long ackTime)
ackTime - - time in milliseconds as a long value.getAckTime()public long getAckTime()
setAckTime()public void setTargetId(java.lang.String target)
target - - The target Id string. If not the machine name would be taken.getTargetId()public java.lang.String getTargetId()
setTargetId()public void setUserRequestHandler(com.adventnet.agent.tl1.UserRequestHandler requestHandler)
public javax.management.ObjectName getObjectName()
public java.lang.String getProtocol()
getProtocol in interface AdaptorgetProtocol in class AbstractAdaptorpublic java.lang.String getVendorName()
public void setVendorName(java.lang.String vendorName)
vendorName - - The vendor name.public void setSecurityEnabled(boolean authFlag)
authFlag - - The status of TL1 Security.public void setUserSecurityFile(java.lang.String fileName)
fileName - - User Security persistence file.
public void setSecurityFlags(boolean user,
boolean chan,
boolean command,
boolean oper,
boolean resource)
user - - User security flag.chann - - Channel security flag.command - - Command security flag.oper - - Operation security flag.resource - - Resource security flag.public void setCommandSecurityFile(java.lang.String fileName)
fileName - - Command security persistence file.public void setOperationSecurityFile(java.lang.String fileName)
fileName - - The operation security persistence file name.public void setResourceSecurityFile(java.lang.String fileName)
filename - - the resource security persistence file name.public void setChannelSecurityFile(java.lang.String fileName)
fileName - - The Channel security persistence file name.public void setSecurityLogSize(int size)
size - - The security log szie.public void setSecurityLogFile(java.lang.String file)
fileName - - The security log persistence file name.public void setOperationHandlerFileName(java.lang.String fileName)
fileName - - The operation handler (The file instrumented by the user
incase of operation security is enabled)public void setResourceHandlerFileName(java.lang.String fileName)
fileName - - The Resource handler (The file instrumented by the user
incase of resource security is enabled)
public void enableAuthorisation(boolean flag)
throws java.lang.UnsupportedOperationException
enableAuthorisation in interface AdaptorenableAuthorisation in class AbstractAdaptorjava.lang.UnsupportedOperationException - when authorisation is not suppported
public void enableAuthentication(boolean flag)
throws java.lang.UnsupportedOperationException
enableAuthentication in interface AdaptorenableAuthentication in class AbstractAdaptorjava.lang.UnsupportedOperationException - when authentication is not supportedpublic boolean isAuthenticationEnabled()
public void setStandAlone(boolean flag)
flag - - The status of stand alone flag.public void setDebugLevel(int debugLevel)
debugLevel - Any one of the static variables defined in
com.adventnet.utils.tl1.TL1Utils.public int getDebugLevel()
public void sendAckMessage(TL1Session sess, java.lang.String ack, java.lang.String cTag)
sess - The TL1Session to which the acknowledgement must be sent.ack - The ack message. One of the static variables in TL1AckMessage.cTag - The Correlation Tag of the acknowledgement.public void setAsyncMode(boolean mode)
mode - process mode (true for asynchronous).getAsyncMode()public boolean getAsyncMode()
setAsyncMode(boolean mode)public boolean setMaxThreads(int a)
a - The number of threads(0 to 20 ).
getMaxThreads()public int getMaxThreads()
setMaxThreads(int a)public void setTL1MessageFormatterReference(com.adventnet.agent.tl1.TL1MessageFormatter formatter)
formatter - - The TL1MessageFormatter reference.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||