|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.adventnet.agent.tl1.TL1Agent
TL1 Agent implementation class.
| Inner Class Summary | |
(package private) class |
TL1Agent.SessionTimeOutMaintainer
This class does the two function. |
| Field Summary | |
(package private) boolean |
ackFlag
|
(package private) AutoAcknowledge |
acknow
|
(package private) boolean |
ackSenderFlag
|
(package private) long |
ackTime
|
(package private) TL1API |
api
|
(package private) boolean |
authFlag
|
(package private) java.util.Hashtable |
autoTable
|
(package private) java.util.Vector |
autoVec
|
(package private) TL1BuiltInCommand |
builtCommands
|
(package private) java.lang.String |
builtCommandsName
|
(package private) boolean |
builtInFlag
|
(package private) boolean |
channelFlag
|
(package private) static TL1Session |
craftSession
|
(package private) DelayActivation |
delay
|
(package private) TL1MessageFormatter |
formatter
|
(package private) boolean |
inhibitFlag
|
(package private) static boolean |
isAutoAlreadySent
|
(package private) boolean |
isCraftSessionAlive
|
(package private) static boolean |
isResponseSent
|
(package private) boolean |
isSent
|
SecurityView |
mainView
|
(package private) static MonitorData |
monitor
|
(package private) boolean |
monitorFlag
|
(package private) java.util.Vector |
requestVector
|
(package private) boolean |
securityFlag
|
(package private) SelfMonitor |
selfMonitor
|
(package private) TL1ServerSession[] |
server
|
(package private) java.util.Hashtable |
sessionTimeOutTable
|
(package private) boolean |
standAloneFlag
|
(package private) int |
timeOutSeconds
|
static Log |
tl1Log
|
java.lang.String |
vendorName
|
| Constructor Summary | |
TL1Agent()
Constructor for creating TL1Agent. |
|
| Method Summary | |
(package private) static void |
|
void |
addMultiProtocolCommand(java.lang.String command)
Adds the Multi protocol related commands in the registry. |
void |
callback(TL1Session session,
java.lang.String message,
java.lang.String ctag,
byte type)
This method will be invoked whenever a message is received from the agent and parsing is disabled. |
boolean |
callback(TL1Session session,
TL1Message message,
java.lang.String ctag)
This is implemented for sending response messages for the input message got through the session. |
boolean |
checkValidAckCode(java.lang.String ackCode)
Returns true is the ack code is valid one. |
(package private) boolean |
clearAutoMessages(TL1Session session)
This method is used to clear all the autonomous messages present in the queue for the given session. |
(package private) void |
displayAutoMessages(TL1Session sess)
This method will be called from TL1BuiltIncommand(ALW-AUTMSG). |
void |
enableBuiltInCommands(boolean tl1BulitInStatus)
Sets the status of TL1BuiltInCommand. |
(package private) void |
enableCraftInterface()
This method enable the craft interface support. |
void |
enableSelfMonitorSupport(boolean selfMonitorStatus)
Sets the status of SelfMonitor. |
TL1AgentResponseInfo |
exceptionToResponseInfo(TL1AgentException exception)
This method is used to pass any TL1AgentExceptions occur while creating responseInfo. |
long |
getAckTime()
Returns the Ack time in milliseconds. |
java.util.Vector |
getAllSession()
This will return the Vector of sessions present in TL1API. |
boolean |
getAsyncMode()
Getter of the current process mode . |
double |
getATag(TL1Session sess)
Returns the ATag of the last autonomous sent in this session. |
(package private) java.lang.String[] |
getBuiltInCommands()
Returs the array of Built in commands. |
(package private) java.util.Hashtable |
getCommandRegistry()
Returns the Command Registry. |
int |
getDebugLevel()
Returns the DebugLevel. |
TL1RequestHandler |
getInstanceOfCommand(java.lang.String commandCode)
Returns the Instance for the given command. |
int |
getMaxThreads()
Getter of the max threads started for Asynchronous processing. |
MonitorData |
getMonitorDataReference()
Returns the Monitor Data Object. |
java.util.Vector |
getMultiProtocolCommand()
Returns the Vector of multi protocol related commands. |
int |
getResponsePacketSize()
Gets the Response packet size. |
TL1ServerSession |
getServerSession()
Returns the TL1ServerSession. |
TL1ServerSession |
getServerSession(int port)
Returns the TL1ServerSession of specified port. |
java.util.Vector |
getSessionList()
Returns the Vector of currently connected sessions with the agent. |
boolean |
getStandAlone()
Returns the status of the stand alone flag. |
java.lang.String |
getTargetId()
Returns the target id. |
TL1MessageFormatter |
getTL1MessageFormatterReference()
Returns the TL1MessageFormatter reference. |
java.util.Hashtable |
getTL1TcpTableInfo()
This will return the Hashtable containing the TL1TcpTable info. |
boolean |
isActive(int port)
Returns true if the specified port is alive. |
boolean |
isAuthenticationEnabled()
Returns true if Authentication is enabled. |
boolean |
isAutoAckEnabled()
Returns true if auto acknowledgement is enabled. |
boolean |
isAutoInhibitMode(TL1Session session)
Returns true if the given session is in autonomous inhibiting mode. |
(package private) boolean |
isBuiltIncommand(java.lang.String command)
Returns true if the command is Builtin command. |
static boolean |
isCraftSession(TL1Session sess)
Checks if the given session is Craft session. |
boolean |
isCraftSessionAlive()
Returns true if the craft session is alive. |
boolean |
isValidSyntax(TL1InputMessage inputMessage)
Checks if the input message is valid one as per syntax basis. |
boolean |
processAutonomous(TL1AgentResponseInfo autoInfo,
TL1Session sess)
This method is used to process and send the autonomous message. |
void |
processErrorMessage(TL1Session session,
java.lang.String errorMesg)
This method will be invoked, if the syntax of the message received from the agent is not compliant to TL1 standards. |
(package private) boolean |
processMessage(TL1Session sess,
TL1Message message,
byte messageType,
TL1AgentResponseInfo autoInfo)
This method is the key one for processing TL1InputMessage. |
boolean |
processModule(TL1Session session,
TL1Message message)
|
void |
registerRRCommandsWithCommandRegistry(java.lang.String verb,
java.lang.String firstModifier,
java.lang.String rrCommand)
Registers the RR commands with the command registry. |
void |
registerSecondModifierWithCommandRegistry(java.lang.String verb,
java.lang.String firstModifier,
java.lang.String secondModifier)
Registers the second modifier with the command registry. |
void |
registerWithCommandRegistry(java.lang.String command,
TL1RequestHandler instance)
Registers the Command with the command Registry. |
(package private) boolean |
sendAckMessage(java.lang.String ackStr,
TL1AgentRequestInfo requestInfo)
Used for sendinf ack message. |
void |
sendAutonomousMessage(TL1AgentResponseInfo autoInfo)
Sends the Autonomous to all the sessions. |
static boolean |
sendMessage(TL1Session session,
TL1Message mess,
TL1AgentRequestInfo request)
This is used to send the message. |
void |
setAckTime(long ackTime)
Sets the ack time. |
void |
setAsyncMode(boolean mode)
Allows agent to process the requests asynchronously. |
void |
setATag(TL1Session sess,
double tag)
Set the new ATag for the given session. |
void |
setAutoAckEnabled(boolean ackFlag)
Enable or dissable the auto acknowledgement. |
void |
setAutoInhibitMode(TL1Session session)
This method sets the the given session in autonomous inhit mode. |
void |
setChannelSecurityFile(java.lang.String fileName)
Sets Channel Security file location. |
void |
setCommandSecurityFile(java.lang.String fileName)
Sets Command Security file location. |
void |
setCraftFlag(boolean craftFlag)
Sets the status of Craft interface. |
(package private) static void |
setCraftSession(TL1Session sess)
Set the session of the craft interface. |
void |
setDebugLevel(int debug)
Sets the debuglevel. |
boolean |
setMaxThreads(int a)
Setter for the number of threads to be started for asynchronous processing . |
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 port)
Sets the port and that will in turn starts the Agent. |
void |
setPorts(int[] ports)
Sets the array of ports where tl1 agent has to start. |
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 packetSize)
Sets the Response packet size . |
void |
setSecurityEnabled(boolean authFlag)
Sets the authentication file name which is used when the authentication for TL1 is enabled. |
void |
setSecurityFlags(boolean user,
boolean chann,
boolean command,
boolean oper,
boolean resource)
Sets the status of different security views. |
void |
setSecurityLogFile(java.lang.String fileName)
Sets the Security log file . |
void |
setSecurityLogSize(int size)
Sets the SecurityLog size. |
(package private) void |
setSessionsWithATag(java.util.Vector sessions)
This method is called only once.i.e while sending autonomous at the first time. |
void |
setSessionTimeOutInSeconds(int seconds)
Sets the session time out seconds. |
(package private) void |
setSessionTimeTable(TL1Session sess)
Sets the session as a key in the sessionTimeOutTable and value is the the no of seconds remaining to reach the "keep time alive" period. |
void |
setStandAlone(boolean standAloneFlag)
Sets the status of the stand alone flag. |
void |
setTargetId(java.lang.String target)
Sets the target id. |
void |
setUserRequestHandler(UserRequestHandler requestHandler)
Sets the UserRequestHandler |
void |
setUserSecurityFile(java.lang.String fileName)
Sets the User security persistence file. |
void |
startAgents(int[] ports)
Starts the agent at multiple ports specified in the array. |
void |
stopAgent(int port)
Stops the agent running in the specified port. |
void |
stopAgents()
Stops the agent. |
void |
storeAutoInfo(TL1AgentResponseInfo info,
TL1Session sess)
This method receives the Autonomous info (TL1AgentResponseInfo) and put it in the autoTable. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
TL1ServerSession[] server
boolean authFlag
boolean securityFlag
TL1API api
public java.lang.String vendorName
TL1BuiltInCommand builtCommands
java.lang.String builtCommandsName
static MonitorData monitor
SelfMonitor selfMonitor
static boolean isAutoAlreadySent
boolean ackSenderFlag
boolean isSent
static boolean isResponseSent
long ackTime
java.util.Vector requestVector
volatile AutoAcknowledge acknow
boolean ackFlag
static TL1Session craftSession
boolean isCraftSessionAlive
DelayActivation delay
TL1MessageFormatter formatter
java.util.Vector autoVec
java.util.Hashtable autoTable
boolean inhibitFlag
boolean builtInFlag
boolean monitorFlag
int timeOutSeconds
java.util.Hashtable sessionTimeOutTable
boolean channelFlag
boolean standAloneFlag
public SecurityView mainView
public static Log tl1Log
| Constructor Detail |
public TL1Agent()
| Method Detail |
static void()
public void setDebugLevel(int debug)
debug - - The debug level.public int getDebugLevel()
java.lang.String[] getBuiltInCommands()
boolean isBuiltIncommand(java.lang.String command)
public void enableBuiltInCommands(boolean tl1BulitInStatus)
tl1BulitInStatus - - The status of the TL1BuiltInCommand.public void enableSelfMonitorSupport(boolean selfMonitorStatus)
selfMonitorStatus - - The status of Self Monitor
public void registerWithCommandRegistry(java.lang.String command,
TL1RequestHandler instance)
command - - The command to be registered.instance - - The object to be invoked when the command is executed.
public void registerRRCommandsWithCommandRegistry(java.lang.String verb,
java.lang.String firstModifier,
java.lang.String rrCommand)
verb - - The command Verb.firstModifier - - The first modifierof the command. If rr commnads comes
under first modifier level then it will be null.rrCommand - - The rr Command.
public void registerSecondModifierWithCommandRegistry(java.lang.String verb,
java.lang.String firstModifier,
java.lang.String secondModifier)
verb - - The command Verb.firstModifier - - The first modifierof the command.secondModifier - - The second modifier of the command.public void setUserRequestHandler(UserRequestHandler requestHandler)
public boolean callback(TL1Session session,
TL1Message message,
java.lang.String ctag)
session - - TL1Session through which to send message.message - - Input message for which response is to be sent.
public void callback(TL1Session session,
java.lang.String message,
java.lang.String ctag,
byte type)
session - TL1Session instance.responseString - The raw/unparsed data received in the form of a
String.tag - This tag is the Correlation Tag of the responseString which
could be either an acknowledgement/response message.
message
mesgType - Type of message as byte.
This byte constant can be any one of the four bytes, viz
TL1API.INPUT_MESSAGE ,
TL1API.ACK_MESSAGE ,
TL1API.RESPONSE_MESSAGE and
TL1API.AUTONOMOUS_MESSAGE.
If it is an invalid message this byte constant value is -1.
public void processErrorMessage(TL1Session session,
java.lang.String errorMesg)
session - TL1Session instance.errorMsg - Error String.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 java.util.Vector getAllSession()
public int getMaxThreads()
setMaxThreads(int a)public void setResponsePacketSize(int packetSize)
packetSize - - The response packet size.public int getResponsePacketSize()
public void addMultiProtocolCommand(java.lang.String command)
public java.util.Vector getMultiProtocolCommand()
public boolean processModule(TL1Session session,
TL1Message message)
boolean processMessage(TL1Session sess,
TL1Message message,
byte messageType,
TL1AgentResponseInfo autoInfo)
public boolean processAutonomous(TL1AgentResponseInfo autoInfo,
TL1Session sess)
autoInfo - - TL1AgentResponseInfo which has the autonomous details.sess - - TL1Session , where the autonomous is to be sent.public boolean isValidSyntax(TL1InputMessage inputMessage)
inputMessage - - TL1InputMessage to be checked for it's validity
in syntax basis.public void sendAutonomousMessage(TL1AgentResponseInfo autoInfo)
autoInfo - - The TL1AgentResponseInfo having autonomous details.public TL1RequestHandler getInstanceOfCommand(java.lang.String commandCode)
commandCode - -The comand code whoes Instance has to be retieved.java.util.Hashtable getCommandRegistry()
public void setStandAlone(boolean standAloneFlag)
standAloneFlag - - The status of the stand alone.public boolean getStandAlone()
public void setCraftFlag(boolean craftFlag)
craftFlag - - craft status.void enableCraftInterface()
static void setCraftSession(TL1Session sess)
sess - - The craft session.public static boolean isCraftSession(TL1Session sess)
sess - - The session to be checked whether it is the craft session or not.public boolean isCraftSessionAlive()
public MonitorData getMonitorDataReference()
public java.lang.String getTargetId()
public void setTargetId(java.lang.String target)
target - - The target id.public boolean isAuthenticationEnabled()
void setSessionTimeTable(TL1Session sess)
boolean sendAckMessage(java.lang.String ackStr,
TL1AgentRequestInfo requestInfo)
ackStr - - The acknowledegement string. It should be valid one.requestInfo - - The TL1AgentRequestInfo of the command which needs acknowledgement.public boolean checkValidAckCode(java.lang.String ackCode)
ackCode - - The ackCode to be checked for it's validity.public void setAutoInhibitMode(TL1Session session)
session - - TL1Session whose autonomous are to be blocked.public boolean isAutoInhibitMode(TL1Session session)
session - - TL1Session whose inhibit status is to viewed.
public void storeAutoInfo(TL1AgentResponseInfo info,
TL1Session sess)
void displayAutoMessages(TL1Session sess)
boolean clearAutoMessages(TL1Session session)
public void setPort(int port)
throws java.lang.Exception
port - - The port where tl1 agent has to start.
public void setPorts(int[] ports)
throws java.lang.Exception
ports - - The array of ports where tl1 agent should Start.
public void startAgents(int[] ports)
throws java.lang.Exception
ports - - port numbers where the agent is to be started.public void stopAgents()
public void stopAgent(int port)
port - - The port where the agent is running.public java.util.Hashtable getTL1TcpTableInfo()
public TL1ServerSession getServerSession(int port)
port - - The port whose TL1ServerSession is to be retrieved.public TL1ServerSession getServerSession()
public boolean isActive(int port)
port - - The port which is to be verified if it is
alive or not.void setSessionsWithATag(java.util.Vector sessions)
public double getATag(TL1Session sess)
sess - - TL1Session ,whose ATag has to be retrieved.
public void setATag(TL1Session sess,
double tag)
sess - - TL1Session whose ATag has to be set.tag - - The ATag to be set.public java.util.Vector getSessionList()
public void setSessionTimeOutInSeconds(int seconds)
seconds - - The session time out seconds.public void setUserSecurityFile(java.lang.String fileName)
fileName - - User Security persistence file.
public void setSecurityFlags(boolean user,
boolean chann,
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 setSecurityLogFile(java.lang.String fileName)
fileName - - The security log persistence file name.public void setSecurityLogSize(int size)
size - - The security log szie.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 operation security is enabled)public void setSecurityEnabled(boolean authFlag)
authFlag - - The status of the TL1 Security.setAuthenticationEnabled(boolean)public TL1MessageFormatter getTL1MessageFormatterReference()
public void setAckTime(long ackTime)
ackTime - - Ack time in milli seconds.public long getAckTime()
public void setAutoAckEnabled(boolean ackFlag)
ackFlag - - The status of the auto acknowledgement.public boolean isAutoAckEnabled()
public TL1AgentResponseInfo exceptionToResponseInfo(TL1AgentException exception)
exception - - The TL1AgentException comprising TL1Error info.
public static boolean sendMessage(TL1Session session,
TL1Message mess,
TL1AgentRequestInfo request)
session - - TL1Session through which the message has to be sent.mess - - message may be Response,Acknowledge and Autonomous.request - - TL1AgentRequestInfo .This has a flag ackFlag and that is made true
here so as to facillitate the acknowledgement sending incase the execution of the
command exceeds certain time(2 secs).This is applicable only for ResponseMessages
for other messages it will be null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||