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 StringAT_IOT_COUNTstatic StringAT_IOT_NAVIGATION_LINKstatic StringAT_IOT_NEXT_LINKstatic StringAT_IOT_SELF_LINKprotected Ididstatic StringIOT_COUNTstatic StringIOT_NAVIGATION_LINKstatic StringIOT_NEXT_LINKstatic StringIOT_SELF_LINKprotected URIselfLink
-
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 voidensureServiceOnChildren(SensorThingsService service)booleanequals(Object obj)abstract BaseDao<T>getDao(SensorThingsService service)IdgetId()URIgetSelfLink()SensorThingsServicegetService()EntityTypegetType()voidhandleNamespacedProperties(String name, Object value)inthashCode()voidsetId(Id id)voidsetSelfLink(String selfLink)voidsetSelfLink(URI selfLink)voidsetService(SensorThingsService service)MqttSubscriptionsubscribe(Consumer<T> handler)<U> MqttSubscriptionsubscribeRelative(Consumer<U> handler, EntityType... path)StringtoString()abstract TwithOnlyId()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
-
-