|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.snmp.snmp2.agent.XMLToVector
public class XMLToVector
This class contains the Persistency data handling of the V1V2TrapForwardingTable in XML and Text format
| Field Summary | |
|---|---|
(package private) static java.lang.String[] |
columnNames
All the column names as present in the persistent file |
(package private) static int |
COMMUNITY
|
protected java.lang.String |
fieldSeparator
Separator between Table parameters in FToV format. |
protected ForwardingTable |
forTable
The forwarding Table associated with this XMLToVector |
protected boolean |
fToVPersistence
FileToVector persistence flag |
protected SimpleTrapForwardingTable |
handler
The Handler associated with this |
(package private) long |
lastModified
|
(package private) static int |
MANAGERHOST
Int value of the column managerHost |
(package private) static int |
MANAGERHOSTTYPE
|
(package private) static int |
MANAGERPORT
Int value of the column managerPort |
protected java.lang.String |
name
The filename with the location |
(package private) int |
refreshTime
|
(package private) static int |
RETRIES
|
(package private) static int |
ROWSTATUS
|
protected java.util.Vector |
tableVector
The Table Vector holding the entries. |
(package private) static int |
TIMEOUT
|
(package private) static int |
VERSION
Int value of the column rowStatus |
| Constructor Summary | |
|---|---|
XMLToVector()
Primary constructor |
|
XMLToVector(java.lang.String dirStr,
java.lang.String fileName)
This is the primary constructor with speification of directory name and fileName |
|
XMLToVector(java.lang.String dirStr,
java.lang.String fileName,
ForwardingTable table,
boolean ftov)
This constructor with speification of directory name, fileName, ForwardingTable and the Storage Type. |
|
| Method Summary | |
|---|---|
static int |
getColumnId(java.lang.String name)
To get the column subid from the names |
java.lang.String |
getColumnValue(ForwardingEntry entry,
java.lang.String columnName)
To get the value for each column from the Entry provided |
void |
initTableVector()
Initializes a new Table Vector |
protected void |
readFromFile()
Method to read from the persistent file in the fileSystem |
void |
refreshTrapTable(int refreshTime)
Method to refresh the TrapForwardingTable with the refreshTime |
void |
run()
This is the actual run method of the Thread used for refreshing the TrapForwardingTable |
void |
setForwardingTableRequestHandler(SimpleTrapForwardingTable handler)
Sets the SimpleTrapForwardingTable with the values parsed from the file. |
void |
setFToVPersistence(boolean fToVPersistence)
Setter for FToVPersistence. |
void |
writeIntoFile()
This method writes the entry values from the TrapForwardingTable to the file in XML format |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ForwardingTable forTable
static final int MANAGERHOSTTYPE
static final int MANAGERHOST
static final int MANAGERPORT
static final int VERSION
static final int COMMUNITY
static final int TIMEOUT
static final int RETRIES
static final int ROWSTATUS
static final java.lang.String[] columnNames
protected java.util.Vector tableVector
int refreshTime
long lastModified
protected java.lang.String name
protected java.lang.String fieldSeparator
protected SimpleTrapForwardingTable handler
protected boolean fToVPersistence
| Constructor Detail |
|---|
public XMLToVector()
public XMLToVector(java.lang.String dirStr,
java.lang.String fileName,
ForwardingTable table,
boolean ftov)
dirStr - the directory location of the storage file.fileName - the fileName.table - the ForwardingTable whose entries are to be stored.ftv - boolean to specify text or xml format true for text format.
public XMLToVector(java.lang.String dirStr,
java.lang.String fileName)
dirStr - the directory location of the storage file.fileName - the fileName.| Method Detail |
|---|
public static int getColumnId(java.lang.String name)
name - The column name
public java.lang.String getColumnValue(ForwardingEntry entry,
java.lang.String columnName)
entry - The row EntrycolumnName - The column name
protected void readFromFile()
throws java.lang.Exception
java.lang.Exception - on error while parsing filepublic void writeIntoFile()
writeIntoFile in interface UpdateListenerpublic void initTableVector()
public void refreshTrapTable(int refreshTime)
refreshTime - The refresh time in secs.public void run()
run in interface java.lang.Runnablepublic void setForwardingTableRequestHandler(SimpleTrapForwardingTable handler)
public void setFToVPersistence(boolean fToVPersistence)
fToVPersistence - true to set Text file Storage.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||