com.sdm.quasar.client.core.common.sysinfo
Interface SystemInfoOptions

All Known Implementing Classes:
DefaultSystemInfoOptions

public interface SystemInfoOptions

This interface is used to describe options given to system information collection methods, like SystemInfoProvider.collectSystemInfo(SystemInfoNode, SystemInfoOptions).

Author:
Thomas Wolf
See Also:
SystemInfoProvider

Field Summary
static int DETAIL_LEVEL_DETAILED
          Detail level constant: detailed
static int DETAIL_LEVEL_FULL
          Detail level constant: full
static int DETAIL_LEVEL_NORMAL
          Detail level constant: normal
static int DETAIL_LEVEL_SIMPLE
          Detail level constant: simple
 
Method Summary
 java.lang.String createId(java.lang.Object object)
          Creates a unique id for the object given (unique while this application runs).
 int getDetailLevel()
          Returns the detail level of informations to collect (can be any of DETAIL_LEVEL_SIMPLE, DETAIL_LEVEL_NORMAL, DETAIL_LEVEL_DETAILED, DETAIL_LEVEL_FULL).
 java.lang.Object getOption(java.lang.String key)
          Returns a previously set option object for the given key.
 java.lang.String getTraversedId(java.lang.Object object)
          Returns the stored traveres id for the object given.
 boolean isDetailLevelAtLeast(int min_level)
          Returns true, if this SystemInfoOptions detail level is least min_level or more detailed.
 boolean isTraversed(java.lang.Object object)
          Returns true, if the object given was already traversed within the current run of collecting system information.
 void markTraversed(java.lang.Object object, java.lang.String id)
          Marks the given object as traversed.
 boolean markTraversedAndSetId(SystemInfoNode node, java.lang.Object object)
          Marks the given object as traversed and sets a created id to the given SystemInfoNode.
 void setOption(java.lang.String key, java.lang.Object option)
          Sets an additional option object for the key given.
 

Field Detail

DETAIL_LEVEL_SIMPLE

public static final int DETAIL_LEVEL_SIMPLE
Detail level constant: simple

See Also:
Constant Field Values

DETAIL_LEVEL_NORMAL

public static final int DETAIL_LEVEL_NORMAL
Detail level constant: normal

See Also:
Constant Field Values

DETAIL_LEVEL_DETAILED

public static final int DETAIL_LEVEL_DETAILED
Detail level constant: detailed

See Also:
Constant Field Values

DETAIL_LEVEL_FULL

public static final int DETAIL_LEVEL_FULL
Detail level constant: full

See Also:
Constant Field Values
Method Detail

getDetailLevel

public int getDetailLevel()
Returns the detail level of informations to collect (can be any of DETAIL_LEVEL_SIMPLE, DETAIL_LEVEL_NORMAL, DETAIL_LEVEL_DETAILED, DETAIL_LEVEL_FULL).


isDetailLevelAtLeast

public boolean isDetailLevelAtLeast(int min_level)
Returns true, if this SystemInfoOptions detail level is least min_level or more detailed.

Parameters:
min_level - the minimum detail level to check against

setOption

public void setOption(java.lang.String key,
                      java.lang.Object option)
Sets an additional option object for the key given.

Parameters:
key - the option key (not null)
option - the option object to set (if null, will be removed)

getOption

public java.lang.Object getOption(java.lang.String key)
Returns a previously set option object for the given key.

Parameters:
key - the key of the option to return (not null)
Returns:
the option object for the key (if not found, null is returned)

createId

public java.lang.String createId(java.lang.Object object)
Creates a unique id for the object given (unique while this application runs). The id is build of three parts:
  1. the full qualified class name of the object,
  2. the at-sign ("@") and
  3. the system identity hash code (see System.identityHashCode(Object)) in hexadecimal representation.

markTraversed

public void markTraversed(java.lang.Object object,
                          java.lang.String id)
Marks the given object as traversed. This is done by storing the id given in a map.

Parameters:
object - an object beeing traversed (may be null)
id - the id to set (if null, a unique id will be set using createId(Object))

isTraversed

public boolean isTraversed(java.lang.Object object)
Returns true, if the object given was already traversed within the current run of collecting system information.

Parameters:
object - the object beeing checked (if null, always false will be returned)

getTraversedId

public java.lang.String getTraversedId(java.lang.Object object)
Returns the stored traveres id for the object given.

Parameters:
object - the object to get an id for (may be null, then always null will be returned)
Returns:
the traversed id or null if the object was not yet traversed and so no traverse-id was stored

markTraversedAndSetId

public boolean markTraversedAndSetId(SystemInfoNode node,
                                     java.lang.Object object)
Marks the given object as traversed and sets a created id to the given SystemInfoNode. If the object already was traversed, the id will set as reference id.

Parameters:
node - the SystemInfoNode to set id or idref (if null, no id will be set)
object - the object traversing (may be null; the id for null will be "<null>")
Returns:
true if object is traversed the first time, false otherwise