Package org.apache.unomi.api
Class Item
java.lang.Object
org.apache.unomi.api.Item
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ClusterNode
,CustomItem
,Event
,GeonameEntry
,ImportExportConfiguration
,JsonSchemaWrapper
,MetadataItem
,Patch
,Profile
,ProfileAlias
,RuleStatistics
,Session
,SFDCConfiguration
,Topic
A context server tracked entity. All tracked entities need to extend this class so as to provide the minimal information the context server needs to be able to track such
entities and operate on them. Items are persisted according to their type (structure) and identifier (identity). Of note, all Item subclasses must define a
public String constant named
ITEM_TYPE
that is used to identify the type of a specific Item via getItemType(java.lang.Class)
. It is therefore important that
ITEM_TYPE
be unique across all persisted type of Items. Similarly, since Items are persisted according to their type, an Item's identifier must be unique among
Items of the same type.
Additionally, Items are also gathered by scope allowing the context server to group together related Items (usually pertaining to a given site being analyzed,
though scopes could span across sites depending on the desired analysis granularity). Scopes allow clients accessing the context server to filter data. The context server
defines a built-in scope (Metadata.SYSTEM_SCOPE
) that clients can use to share data across scopes.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Retrieves the Item's identifier used to uniquely identify this Item when persisted or when referred to.Retrieves the Item's type used to assert metadata and structure common to Items of this type, notably for persistence purposes.static String
getItemType
(Class clazz) getScope()
Retrieves the Item's scope.getSystemMetadata
(String key) int
hashCode()
void
void
setItemType
(String itemType) void
void
setSystemMetadata
(String key, Object value) void
setVersion
(Long version)
-
Field Details
-
itemId
-
itemType
-
scope
-
version
-
systemMetadata
-
-
Constructor Details
-
Item
public Item() -
Item
-
-
Method Details
-
getItemType
-
getItemId
Retrieves the Item's identifier used to uniquely identify this Item when persisted or when referred to. An Item's identifier must be unique among Items with the same type.- Returns:
- a String representation of the identifier, no particular format is prescribed as long as it is guaranteed unique for this particular Item.
-
setItemId
-
getItemType
Retrieves the Item's type used to assert metadata and structure common to Items of this type, notably for persistence purposes. The Item's type must match the value defined by the implementation'sITEM_TYPE
public constant.- Returns:
- a String representation of this Item's type, must equal the
ITEM_TYPE
value
-
setItemType
-
getScope
Retrieves the Item's scope.- Returns:
- the Item's scope name
-
setScope
-
equals
-
hashCode
public int hashCode() -
getVersion
-
setVersion
-
getSystemMetadata
-
setSystemMetadata
-