"WEBNMS_5 API Docs"

com.adventnet.nms.severity
Class SeverityIterator

java.lang.Object
  extended by com.adventnet.nms.severity.SeverityIterator

public class SeverityIterator
extends java.lang.Object

This is an iterator class which can be used to traverse the severity nodes which are having criticality. ie., This iterator will not include the severity values from the nodes which are having the attribute called NO_CRITICALITY with the value true.

Suppose if you want to traverse all the criticality leaf nodes from high criticality to low criticality, you need to get SeverityIterator and write the code as follows,


    SeverityIterator iterator = SeverityInfo.getInstance().getIterator();
 
iterator points the first element with high criticality.

    int severity = iterator.getNext(); // return highest criticality severity value
    severity = iterator.getNext();   //return second highest severity value 
    severity = iterator.getNext(3); //return 3rd next severity from the current severity
    and so on.
 

Suppose if you want to traverse all the criticality leaf nodes from clear to high criticality, you need to write the code as follows,


      SeverityIterator iterator = SeverityInfo.getInstance().getIterator();
 
Now the iterator points to first element with high criticality.

       iterator.moveToClear();// move to clear node.
       int severity = iterator.getCurrent(); // return clear severity value 
       severity = iterator.getPrevious();    //return second severity value from Clear
       severity = iterator.getPrevious(3); //return 3rd previous severity from the current severity.
      and so on.
 

The above methods getNext(), getNext(int), getPrevious(), getPrevious(int) will throw java.util.NoSuchElementElementException if there is no next or previous element is avaliable.

See Also:
SeverityInfo

Method Summary
 int getCurrent()
          This method can be used to get the current severity value.
 SeverityNode getCurrentNode()
          This method can be used to get the SeverityNode of current severity.
 int getDirection()
          This method will be used for future release.
 int getNext()
          This method can be used to get the next severity value from current severity.
 int getNext(int nth)
          This method can be used to get the next n'th severity value from current severity.
 int getNextCriticality()
          This method can be used to get next higher criticality than the current criticality.
 int getNextCriticality(int nth)
          This method can be used to get next n'th higher criticality than the current criticality.
 SeverityNode getNextNode()
          This method can be used to get the SeverityNode of next severity.
 SeverityNode getNextNode(int nth)
          This method can be used to get the SeverityNode of next n'th severity.
 int getPrevious()
          This method can be used to get the previous severity value from current severity.
 int getPrevious(int nth)
          This method can be used to get the previous n'th severity value from current severity.
 int getPreviousCriticality()
          This method can be used to get next lower criticality than the current criticality.
 int getPreviousCriticality(int nth)
          This method can be used to get next lower n'th criticality than the current criticality.
 SeverityNode getPreviousNode()
          This method can be used to get the SeverityNode of previous severity.
 SeverityNode getPreviousNode(int nth)
          This method can be used to get the SeverityNode of previous n'th severity.
 boolean moveToClear()
          This method moves the pointer to the clear severity.
 boolean moveToHighest()
          This method moves the pointer to maximum criticality severity node.
 boolean moveToHighest(int direction)
          This method moves the pointer to point the maximum criticality in the given direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

moveToHighest

public boolean moveToHighest()
This method moves the pointer to maximum criticality severity node.

Returns:
true on success.
See Also:
moveToHighest(int direction)

moveToHighest

public boolean moveToHighest(int direction)
This method moves the pointer to point the maximum criticality in the given direction. The direction will be used for future release.

Returns:
true on success.
See Also:
moveToHighest()

moveToClear

public boolean moveToClear()
This method moves the pointer to the clear severity. If there is more than one clear nodes are present in the configuration file, the pointer will point the first clear node in the current direction.

Returns:
true on success.

getNext

public int getNext()
This method can be used to get the next severity value from current severity.

Returns:
the next severity value.
Throws:
java.util.NoSuchElementException - if there is no next element.

getNext

public int getNext(int nth)
This method can be used to get the next n'th severity value from current severity.

Parameters:
integer - the nth value to get the next n'th severity.
Returns:
the next n'th severity value.
Throws:
java.util.NoSuchElementException - if there is no next n'th element.

getPrevious

public int getPrevious()
This method can be used to get the previous severity value from current severity.

Returns:
the previous severity.
Throws:
java.util.NoSuchElementException - if there is no previous element.

getPrevious

public int getPrevious(int nth)
This method can be used to get the previous n'th severity value from current severity.

Parameters:
integer - the nth value to get the previous n'th severity.
Returns:
the previous n'th severity.
Throws:
java.util.NoSuchElementException - if there is no previous n'th element.

getCurrent

public int getCurrent()
This method can be used to get the current severity value.

Returns:
the current severity value.

getNextCriticality

public int getNextCriticality()
This method can be used to get next higher criticality than the current criticality. If there is no next higher criticality in the current direction, it returns the severity value which has the most highest criticality in the current direction.

Returns:
severity value which has next higher criticality.

getNextCriticality

public int getNextCriticality(int nth)
This method can be used to get next n'th higher criticality than the current criticality. If there is no next n'th higher criticality in the current direction, it returns the severity value which has the most highest criticality in the current direction.

Parameters:
integer - the nth value to get the n'th higher criticality.
Returns:
severity value which has next higher criticality.

getPreviousCriticality

public int getPreviousCriticality()
This method can be used to get next lower criticality than the current criticality. If there is no next lower criticality in the current direction, it returns the severity value which has the most lowest criticality in the current direction.

Returns:
severity value which has next lower criticality.

getPreviousCriticality

public int getPreviousCriticality(int nth)
This method can be used to get next lower n'th criticality than the current criticality. If there is no next n'th lower criticality in the current direction, it returns the severity value which has the most lowest criticality in the current direction.

Parameters:
integer - the nth value to get the n'th lower criticality.
Returns:
severity value which has next n'th lower criticality.

getNextNode

public SeverityNode getNextNode()
This method can be used to get the SeverityNode of next severity.

Returns:
SeverityNode of the next severity.
See Also:
SeverityNode

getNextNode

public SeverityNode getNextNode(int nth)
This method can be used to get the SeverityNode of next n'th severity.

Returns:
SeverityNode of the next n'th severity.
See Also:
SeverityNode

getPreviousNode

public SeverityNode getPreviousNode()
This method can be used to get the SeverityNode of previous severity.

Returns:
SeverityNode of the previous severity.
See Also:
SeverityNode

getPreviousNode

public SeverityNode getPreviousNode(int nth)
This method can be used to get the SeverityNode of previous n'th severity.

Returns:
SeverityNode of the previous n'th severity.
See Also:
SeverityNode

getCurrentNode

public SeverityNode getCurrentNode()
This method can be used to get the SeverityNode of current severity.

Returns:
SeverityNode of current severity.
See Also:
SeverityNode

getDirection

public int getDirection()
This method will be used for future release.

Returns:
direction.

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.