com.adventnet.snmp.mibs.agent
Class FileCommand

java.lang.Object
  |
  +--com.adventnet.snmp.mibs.AgentClauseCommandUtil
        |
        +--com.adventnet.snmp.mibs.FileCommandUtil
              |
              +--com.adventnet.snmp.mibs.agent.FileCommand

public class FileCommand
extends FileCommandUtil

FileCommand class is used to implement the FILE-COMMAND construct in the AGENTCLAUSE. The associated OID can refer to a simple file or a table. Rowstatus supported(to create a new row , rowstatus column must be there). To add an new entry into a table,all columner object should have a READ-CREATE access and RowStatus column is set to be 4.


Field Summary
(package private)  java.lang.String fieldSeparator
           
 
Fields inherited from class com.adventnet.snmp.mibs.FileCommandUtil
fieldSeparator
 
Fields inherited from class com.adventnet.snmp.mibs.AgentClauseCommandUtil
AT_START, command_string, EACH_TIME, FIRST_TIME, instantiate, mibOperations, name, node, runTime, timeout
 
Constructor Summary
FileCommand()
           
 
Method Summary
 boolean checkForRowStatusColumnValue(SnmpVarBind varbind, int rowStatusIndex, boolean getNext)
          This function check the value of the "RowStatus" column of a table (if available).
(package private)  boolean createRow(java.util.Vector varbinds)
           
 java.lang.String getAgentClauseString()
          Returns the String having AgentClause object details .
(package private)  java.lang.String getExecCommand(java.lang.String command, long timeout)
          Executes the command string till it times out.
 java.lang.String getFieldSeparator()
          Getter for FieldSeperator used in FILE-COMMAND API users will not require this method etc.
 java.lang.String getFileName()
          getter for FileName.
(package private)  java.lang.String getReqMesg(byte type)
           
(package private)  java.lang.String getReqMesg(SnmpVarBind varbind, byte req)
           
(package private) static boolean isCreateRow(java.util.Vector varbinds, AgentMibOperations mibOps)
           
 java.util.Vector makeInstances(AgentMibNode leafNode)
          This method makes instances of the leafNode and returns a vector which is stored as instances in AgentMibNode.
(package private)  boolean modifyTableElement(SnmpVarBind varbind)
           
 java.io.RandomAccessFile openRandomFile()
          opens the file , which is specified in the name string.
 void parseCommand(java.util.StringTokenizer strTok, java.lang.String str)
           
 void setFieldSeparator(java.lang.String sep)
          Setter for FieldSeperator used in FILE-COMMAND API users will not require this method etc.
(package private)  java.lang.String setReqMesg(SnmpVarBind varbind, java.util.Vector args)
           
(package private)  java.lang.String setReqMesg(java.util.Vector arguments)
           
 
Methods inherited from class com.adventnet.snmp.mibs.AgentClauseCommandUtil
getCommandString, getName, getTimeout, initialize, isRunTime, setAgentMibOperations, setCommandString, setName, setRunTime, setTimeout
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldSeparator

java.lang.String fieldSeparator
Constructor Detail

FileCommand

public FileCommand()
Method Detail

setFieldSeparator

public void setFieldSeparator(java.lang.String sep)
Setter for FieldSeperator used in FILE-COMMAND API users will not require this method etc.
Overrides:
setFieldSeparator in class FileCommandUtil
Parameters:
sep - having string used as a seperator.
See Also:
()

getFieldSeparator

public java.lang.String getFieldSeparator()
Getter for FieldSeperator used in FILE-COMMAND API users will not require this method etc.
Overrides:
getFieldSeparator in class FileCommandUtil
Returns:
String the field seperator string.
See Also:
()

getReqMesg

java.lang.String getReqMesg(byte type)
                      throws AgentSnmpException

getReqMesg

java.lang.String getReqMesg(SnmpVarBind varbind,
                            byte req)
                      throws AgentSnmpException

setReqMesg

java.lang.String setReqMesg(java.util.Vector arguments)
                      throws AgentSnmpException

setReqMesg

java.lang.String setReqMesg(SnmpVarBind varbind,
                            java.util.Vector args)
                      throws AgentSnmpException

modifyTableElement

boolean modifyTableElement(SnmpVarBind varbind)
                     throws AgentSnmpException

createRow

boolean createRow(java.util.Vector varbinds)
            throws AgentSnmpException

isCreateRow

static boolean isCreateRow(java.util.Vector varbinds,
                           AgentMibOperations mibOps)
                    throws AgentSnmpException

openRandomFile

public java.io.RandomAccessFile openRandomFile()
                                        throws AgentSnmpException
opens the file , which is specified in the name string.

getExecCommand

java.lang.String getExecCommand(java.lang.String command,
                                long timeout)
                          throws AgentSnmpException
Executes the command string till it times out.
Parameters:
command - command to be executed
timeout - time in millisecs after which the process is terminated
Returns:
returns the output of the executed program

parseCommand

public void parseCommand(java.util.StringTokenizer strTok,
                         java.lang.String str)
                  throws MibException
Overrides:
parseCommand in class FileCommandUtil
Returns:
returns filled FileCommand class to be put in the hashtable

getAgentClauseString

public java.lang.String getAgentClauseString()
Returns the String having AgentClause object details .
Overrides:
getAgentClauseString in class FileCommandUtil

makeInstances

public java.util.Vector makeInstances(AgentMibNode leafNode)
                               throws MibException
This method makes instances of the leafNode and returns a vector which is stored as instances in AgentMibNode. If the node is a part of table then it parses the associated file-table and fills the instances variable. Used by the Agent for initialising and making instances from DEFVAL or
Overrides:
makeInstances in class FileCommandUtil
Parameters:
leafNode - Node where the instances are created
Returns:
vector of InstanceTypes

checkForRowStatusColumnValue

public boolean checkForRowStatusColumnValue(SnmpVarBind varbind,
                                            int rowStatusIndex,
                                            boolean getNext)
                                     throws AgentSnmpException
This function check the value of the "RowStatus" column of a table (if available). Depending upon the value of row satus column the corresponding instance will be allowed to the manager.

Parameters:
varbind - given from the manager.
index - of the RowStatus column of a table.
Returns:
Nothing.
Throws:
AgentSnmpException. -  

getFileName

public java.lang.String getFileName()
getter for FileName.
Overrides:
getFileName in class FileCommandUtil
Returns:
String having name of the file.