org.hackystat.telemetry.analyzer.configuration
Class NonPersistentTelemetryDefinitionManager

java.lang.Object
  extended by org.hackystat.telemetry.analyzer.configuration.TelemetryDefinitionManager
      extended by org.hackystat.telemetry.analyzer.configuration.NonPersistentTelemetryDefinitionManager

 class NonPersistentTelemetryDefinitionManager
extends TelemetryDefinitionManager

Implements the non-persistent TelemetryDefinitionManager. This class can be made to merge its repository with the global singleton instance of PersistentTelemetryDefinitionManager. The effect is that (1) All telemetry definitions in this instance and in the global instance share one single name space. (2) When searching, both the repository managed by this instance and the repository managed by the global instance will be searched. (3) Adding and deleting are only performed on the repository managed by this instance. (4) The repository managed by this instance only exists in memory, it will not be persisted.

V8 Notes: Not sure if this class is needed for the initial implementation. It may be useful later on when someone wants to send a Telemetry definition via REST for execution.

Author:
(Cedric) Qin Zhang

Constructor Summary
NonPersistentTelemetryDefinitionManager(boolean linkToGlobalSingleton)
          Constructs this instance.
 
Method Summary
 void add(TelemetryDefinitionInfo defInfo)
          Adds information about a definition.
 TelemetryDefinitionInfo get(org.hackystat.sensorbase.resource.users.jaxb.User owner, java.lang.String name, boolean includeShared, TelemetryDefinitionType type)
          Gets the telemetry definition information by name.
 java.util.Collection<TelemetryDefinitionInfo> getAll(org.hackystat.sensorbase.resource.users.jaxb.User owner, boolean includeShared, TelemetryDefinitionType type)
          Gets all telemetry definitions that this user has access to.
 java.util.List<TelemetryDefinition> getDefinitions()
          Not yet implemented.
 void remove(org.hackystat.sensorbase.resource.users.jaxb.User owner, java.lang.String name, TelemetryDefinitionType type)
          Deletes a telemetry object definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonPersistentTelemetryDefinitionManager

NonPersistentTelemetryDefinitionManager(boolean linkToGlobalSingleton)
Constructs this instance.

Parameters:
linkToGlobalSingleton - True if the definitions in global singleton telemetry manager should be merged to this instance.
Method Detail

get

public TelemetryDefinitionInfo get(org.hackystat.sensorbase.resource.users.jaxb.User owner,
                                   java.lang.String name,
                                   boolean includeShared,
                                   TelemetryDefinitionType type)
Gets the telemetry definition information by name.

Specified by:
get in class TelemetryDefinitionManager
Parameters:
owner - The owner under which to find the telemetry definition object.
name - The name of the telemetry definition.
includeShared - If true, then those telemetry definitions owned by other users, but is shared will also be returned.
type - The definition type.
Returns:
The object if found, or null.

getAll

public java.util.Collection<TelemetryDefinitionInfo> getAll(org.hackystat.sensorbase.resource.users.jaxb.User owner,
                                                            boolean includeShared,
                                                            TelemetryDefinitionType type)
Gets all telemetry definitions that this user has access to.

Specified by:
getAll in class TelemetryDefinitionManager
Parameters:
owner - The owner of the telemetry definitions returned.
includeShared - If true, then those telemetry definitions owned by other users, but is shared will also be returned.
type - The definition type.
Returns:
A collection of found objects.

add

public void add(TelemetryDefinitionInfo defInfo)
         throws TelemetryConfigurationException
Adds information about a definition.

Specified by:
add in class TelemetryDefinitionManager
Parameters:
defInfo - Information about the definition to be added.
Throws:
TelemetryConfigurationException - If there is duplicated definition.

remove

public void remove(org.hackystat.sensorbase.resource.users.jaxb.User owner,
                   java.lang.String name,
                   TelemetryDefinitionType type)
Deletes a telemetry object definition. Does nothing if the definition does not exist.

Specified by:
remove in class TelemetryDefinitionManager
Parameters:
owner - The owner of the definition.
name - The name of the definition.
type - The definition type.

getDefinitions

public java.util.List<TelemetryDefinition> getDefinitions()
Not yet implemented.

Specified by:
getDefinitions in class TelemetryDefinitionManager
Returns:
Returns null.