|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable blackboard.LanNode
A node on the network, typically a computer. This class stores information on whether or not this particular node is "up" (ie responding to pings) and also any number of OID properties obtained through SNMP. The class also automatically keeps track of the time it was last updated, the time that it was first discovered that the node was down (ie not responding to pings), and whether or not the node has been checked out (ie write-lock). This class should be thread-safe. TO DO: - allow inserting a Map of OID-value's instead of using the setOID() individually. ( ie setOID(Map) ) Testing: - test to make sure that if writing and reading occur at the same time that there is no non-sensical output on the reads.
Field Summary | |
boolean |
isTrap
|
static boolean |
READONLY
|
static boolean |
WRITEABLE
|
Constructor Summary | |
LanNode()
Creates a LanNode with default values and an IP of "0.0.0.0". |
|
LanNode(InetAddress ip)
Creates a LanNode with default values and an IP defined by the passed InetAddress. |
|
LanNode(InetAddress ip,
Set OIDs)
Creates a LanNode with default values, an IP defined by the passed InetAddress, and will add the set of OIDs passed to it to the table for the backend to query. |
Method Summary | |
void |
addOID(String OID)
Adds an OID key into the table for the backend to update with information |
protected void |
checkIn()
Run this method before placing a LanNode into the BlackBoard. |
protected LanNode |
checkOut(boolean write)
After retreiving this LanNode, the BlackBoard will call this method before giving this node to the calling program. |
void |
clearUAND()
Deprecated. use Observable methods instead. |
Object |
clone()
Produces a shallow copy of the LanNode. |
protected void |
deleteNode()
|
Date |
downSince()
Returns the time that this node was first discovered to be down. |
boolean |
equals(Object obj)
Two LanNodes are considered equal if they both point to the same IP address. |
Object |
getFrontEndInfo(Object key)
Returns a reference to the value associated with the key for use by the frontend. |
InetAddress |
getIp()
returns a copy of the IP of this node. |
String |
getLastTrapEvent()
|
Object |
getOID(String OID)
Returns the value associated with the OID as an Object. |
boolean |
getServerStatus()
Getter for property isServer. |
Set |
getSetOfOID()
Returns a Set of OID String's that contains all of the OID's that require polling for this LanNode. |
void |
giveFocus()
|
int |
hashCode()
Since the hashCode method must return the same hashCode during an execution, this method will return the hashCode produced by the InetAddress held within this node. |
protected boolean |
isCheckedOut()
|
boolean |
isDeleted()
Returns whether or not this node has been deleted. |
protected boolean |
isInBlackBoard()
Returns whether or not this LanNode has been added to the BlackBoard. |
boolean |
isLocked()
Returns true if this LanNode has been locked (ie read-only), true otherwise. |
boolean |
isPolling()
Getter for property polling. |
boolean |
isSnmpEnabled()
Getter for property snmpEnabled. |
boolean |
isUp()
Getter for property isUp. |
boolean |
isUpdatedAndNotDisplayed()
Deprecated. use hasChanged() instead. |
boolean |
isUpStatusPending()
Getter for property upStatusPending. |
Date |
lastUpdated()
Getter for property lastUpdated. |
void |
setFrontEndInfo(Object key,
Object value)
This method is to be used exclusively by the frontend to store information on how to display this particular LanNode. |
void |
setIp(InetAddress ip)
Changes this LanNode's IP address. |
void |
setIsUp(boolean isUp)
Setter for property isUp. |
void |
setOID(String OID,
Object value)
Set's a value for the associated OID key. |
void |
setPolling(boolean polling)
Setter for property polling. |
void |
setServerStatus(boolean newServerStatus)
Setter for property isServer. |
void |
setSnmpEnabled(boolean snmpEnabled)
Setter for property snmpEnabled. |
void |
takeFocus()
|
String |
toString()
|
void |
trapEvent(String description)
|
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final boolean WRITEABLE
public static final boolean READONLY
public boolean isTrap
Constructor Detail |
public LanNode()
public LanNode(InetAddress ip)
ip
- IP address of this particular LanNode.public LanNode(InetAddress ip, Set OIDs)
ip
- IP address of this particular LanNode.OIDs
- Set of OID keys in String format.Method Detail |
protected LanNode checkOut(boolean write) throws LanNodeAlreadyCheckedOut, LanNodeIsDeleted
write
- if this is true then it will return a writable LanNode
LanNodeAlreadyCheckedOut
LanNodeIsDeleted
protected void checkIn()
protected boolean isInBlackBoard()
protected void deleteNode()
protected boolean isCheckedOut()
public Object clone()
CloneNotSupportedException
- only when a copy of an unlocked LanNode is madepublic boolean isLocked()
public Date lastUpdated()
public Date downSince()
public boolean isUpdatedAndNotDisplayed()
hasChanged()
instead.
public void clearUAND()
Observable
methods instead.
public boolean isUp()
public void setIsUp(boolean isUp) throws LanNodeIsDeleted
isUp
- set to true if this node is responding to pings
LanNodeIsDeleted
public void setOID(String OID, Object value) throws LanNodeIsDeleted
OID
- String representing the OIDvalue
- Object representing the value for this particular OID
LanNodeIsDeleted
public Object getOID(String OID) throws LanNodeIsDeleted
OID
- String representing the OID to be retrieved
LanNodeIsDeleted
public Set getSetOfOID() throws LanNodeIsDeleted
LanNodeIsDeleted
- when this node has been deletedpublic void setFrontEndInfo(Object key, Object value) throws LanNodeIsDeleted
key
- arbitrary frontend property keyvalue
- value associated with the key
LanNodeIsDeleted
public Object getFrontEndInfo(Object key) throws LanNodeIsDeleted
null
will be returned.
key
- key associated with the value you wish returned
LanNodeIsDeleted
public InetAddress getIp()
public void setIp(InetAddress ip) throws LanNodeIsDeleted
ip
- New IP address.
LanNodeIsDeleted
public boolean isDeleted()
public boolean equals(Object obj)
Also, a subclass of LanNode can not be considered equal to a LanNode under any circumstances and will automatically return a false
public int hashCode()
public String toString()
public boolean getServerStatus()
public void setServerStatus(boolean newServerStatus)
newServerStatus
- New value of property isServer.public boolean isSnmpEnabled()
public void setSnmpEnabled(boolean snmpEnabled)
snmpEnabled
- New value of property snmpEnabled.public boolean isPolling()
public void setPolling(boolean polling)
polling
- New value of property polling.public void giveFocus()
public void takeFocus()
public void trapEvent(String description) throws LanNodeIsDeleted
LanNodeIsDeleted
public String getLastTrapEvent()
public void addOID(String OID)
OID
- key to add to the table for backend to do an SNMP query on.public boolean isUpStatusPending()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |