Brooklyn

brooklyn.event
[Java] Interface Sensor


public interface Sensor
extends java.io.Serializable

The interface implemented by concrete sensors. A sensor is a container for a piece of data of a particular type, and exists in a hierarchical namespace. The name of the sensor is described as a set of tokens separated by dots.

See Also:
SensorEvent


Method Summary
java.lang.String getDescription()

Returns the description of the sensor, for display.

java.lang.String getName()

Returns the name of the sensor, in a dot-separated namespace.

java.util.List getNameParts()

Returns the constituent parts of the sensor name as a java.util.List.

java.lang.Class getType()

Returns the Java java.lang.Class for the sensor data.

java.lang.String getTypeName()

Returns the type of the sensor data, as a java.lang.String representation of the class name.

TypeToken getTypeToken()

Returns the Guava TypeToken (including generics info)

SensorEvent newEvent(Entity entity, java.lang.Object value)

Create a new SensorEvent object for a specific Entity and data point.

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Method Detail

getDescription

public java.lang.String getDescription()
Returns the description of the sensor, for display.


getName

public java.lang.String getName()
Returns the name of the sensor, in a dot-separated namespace.


getNameParts

public java.util.List getNameParts()
Returns the constituent parts of the sensor name as a java.util.List.


getType

public java.lang.Class getType()
Returns the Java java.lang.Class for the sensor data.

This returns a "super" of T only in the case where T is generified, and in such cases it returns the Class instance for the unadorned T --- i.e. for List this returns Class --- this is of course because there is no actual Class> instance.


getTypeName

public java.lang.String getTypeName()
Returns the type of the sensor data, as a java.lang.String representation of the class name. (Useful for contexts where Type is not accessible.)


getTypeToken

public TypeToken getTypeToken()
Returns the Guava TypeToken (including generics info)


newEvent

public SensorEvent newEvent(Entity entity, java.lang.Object value)
Create a new SensorEvent object for a specific Entity and data point.


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.