Package de.fraunhofer.iosb.ilt.sta.model
Class Entity<T extends Entity<T>>
- java.lang.Object
-
- de.fraunhofer.iosb.ilt.sta.model.Entity<T>
-
- Type Parameters:
T
- The type of the entity implementing this interface
- Direct Known Subclasses:
Actuator
,Datastream
,FeatureOfInterest
,HistoricalLocation
,Location
,MultiDatastream
,Observation
,ObservedProperty
,Sensor
,Task
,TaskingCapability
,Thing
public abstract class Entity<T extends Entity<T>> extends Object
An abstract representation of an entity. Entities are considered equal when all entity properties (non-navigation properties) are equal.- Author:
- Nils Sommer, Hylke van der Schaaf, MIchael Jacoby
-
-
Field Summary
Fields Modifier and Type Field Description static String
AT_IOT_COUNT
static String
AT_IOT_NAVIGATION_LINK
static String
AT_IOT_NEXT_LINK
static String
AT_IOT_SELF_LINK
protected Id
id
static String
IOT_COUNT
static String
IOT_NAVIGATION_LINK
static String
IOT_NEXT_LINK
static String
IOT_SELF_LINK
protected URI
selfLink
-
Constructor Summary
Constructors Constructor Description Entity(EntityType type)
Entity(EntityType type, Id id)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
ensureServiceOnChildren(SensorThingsService service)
boolean
equals(Object obj)
abstract BaseDao<T>
getDao(SensorThingsService service)
Id
getId()
URI
getSelfLink()
SensorThingsService
getService()
EntityType
getType()
void
handleNamespacedProperties(String name, Object value)
int
hashCode()
void
setId(Id id)
void
setSelfLink(String selfLink)
void
setSelfLink(URI selfLink)
void
setService(SensorThingsService service)
MqttSubscription
subscribe(Consumer<T> handler)
<U> MqttSubscription
subscribeRelative(Consumer<U> handler, EntityType... path)
String
toString()
abstract T
withOnlyId()
Creates a copy of the entity, with only the ID field set.
-
-
-
Field Detail
-
IOT_COUNT
public static final String IOT_COUNT
- See Also:
- Constant Field Values
-
AT_IOT_COUNT
public static final String AT_IOT_COUNT
- See Also:
- Constant Field Values
-
IOT_NAVIGATION_LINK
public static final String IOT_NAVIGATION_LINK
- See Also:
- Constant Field Values
-
AT_IOT_NAVIGATION_LINK
public static final String AT_IOT_NAVIGATION_LINK
- See Also:
- Constant Field Values
-
IOT_NEXT_LINK
public static final String IOT_NEXT_LINK
- See Also:
- Constant Field Values
-
AT_IOT_NEXT_LINK
public static final String AT_IOT_NEXT_LINK
- See Also:
- Constant Field Values
-
IOT_SELF_LINK
public static final String IOT_SELF_LINK
- See Also:
- Constant Field Values
-
AT_IOT_SELF_LINK
public static final String AT_IOT_SELF_LINK
- See Also:
- Constant Field Values
-
id
protected Id id
-
selfLink
protected URI selfLink
-
-
Constructor Detail
-
Entity
public Entity(EntityType type)
-
Entity
public Entity(EntityType type, Id id)
-
-
Method Detail
-
getType
public EntityType getType()
-
getId
public Id getId()
-
setId
public void setId(Id id)
-
getSelfLink
public URI getSelfLink()
-
setSelfLink
public void setSelfLink(String selfLink)
-
setSelfLink
public void setSelfLink(URI selfLink)
-
setService
public void setService(SensorThingsService service)
-
ensureServiceOnChildren
protected abstract void ensureServiceOnChildren(SensorThingsService service)
-
getService
public SensorThingsService getService()
-
getDao
public abstract BaseDao<T> getDao(SensorThingsService service)
-
withOnlyId
public abstract T withOnlyId()
Creates a copy of the entity, with only the ID field set. Useful when creating a new entity that links to this entity.- Returns:
- a copy with only the ID field set.
-
subscribe
public MqttSubscription subscribe(Consumer<T> handler) throws MqttException
- Throws:
MqttException
-
subscribeRelative
public <U> MqttSubscription subscribeRelative(Consumer<U> handler, EntityType... path) throws MqttException
- Throws:
MqttException
-
-