Class Item

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    CustomItem, Event, GeonameEntry, ImportExportConfiguration, JsonSchemaWrapper, MetadataItem, Patch, Profile, ProfileAlias, RuleStatistics, Session, SFDCConfiguration, Topic

    public abstract class Item
    extends Object
    implements Serializable
    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:
    Serialized Form
    • Constructor Detail

      • Item

        public Item()
      • Item

        public Item​(String itemId)
    • Method Detail

      • getItemType

        public static String getItemType​(Class clazz)
      • getItemId

        public String 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

        public void setItemId​(String itemId)
      • getItemType

        public String 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's ITEM_TYPE public constant.
        Returns:
        a String representation of this Item's type, must equal the ITEM_TYPE value
      • setItemType

        public void setItemType​(String itemType)
      • getScope

        public String getScope()
        Retrieves the Item's scope.
        Returns:
        the Item's scope name
      • setScope

        public void setScope​(String scope)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getVersion

        public Long getVersion()
      • setVersion

        public void setVersion​(Long version)
      • getSystemMetadata

        public Object getSystemMetadata​(String key)
      • setSystemMetadata

        public void setSystemMetadata​(String key,
                                      Object value)