Class GenericEntity<T extends Path<T>>

  • Type Parameters:
    T - the entity identifier type
    All Implemented Interfaces:
    Serializable, Identifiable<T>
    Direct Known Subclasses:
    DOMEntity, Entity

    public class GenericEntity<T extends Path<T>>
    extends Object
    implements Serializable, Identifiable<T>
    A clustered Entity is something which is shared by multiple applications across a cluster. An Entity has a type and an identifier.

    The type describes the type of the Entity where examples of a type maybe "openflow" or "netconf" etc. An Entity type could be tied to how exactly an application shares and "owns" an entity. For example we may want an application which deals with the openflow entity to be assigned ownership of that entity based on a first come first served basis. On the other hand for netconf entity types we may want applications to gain ownership based on a load balancing approach. While this mechanism of assigning a ownership acquisition strategy is not finalized the intention is that the entity type will play a role in determining the strategy and thus should be put in place.

    The identifier is an instance identifier path. The reason for the choice of instance identifier path is because it can easily be used to represent a data node. For example an inventory node represents a shared entity and it is best referenced by its instance identifier path if the inventory node is stored in the data store.

    Note that an entity identifier must conform to a valid yang schema. If there is no existing yang schema to represent an entity, the general-entity yang model can be used.

    Author:
    Thomas Pantelis
    See Also:
    Serialized Form
    • Constructor Detail

      • GenericEntity

        protected GenericEntity​(@NonNull String type,
                                @NonNull T id)
    • Method Detail

      • getIdentifier

        public final @NonNull T getIdentifier()
        Gets the id of the entity.
        Specified by:
        getIdentifier in interface Identifiable<T extends Path<T>>
        Returns:
        the id.
      • getType

        public final @NonNull String getType()
        Gets the type of the entity.
        Returns:
        the type.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object