Interface EntityService

  • All Superinterfaces:
    Queryable<Entity,​cern.nxcals.api.extraction.metadata.queries.Entities>

    public interface EntityService
    extends Queryable<Entity,​cern.nxcals.api.extraction.metadata.queries.Entities>
    Public access to NXCALS entities.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.Set<Entity> createEntities​(java.util.Set<CreateEntityRequest> entities)
      Creates entities for the given input requests.
      Entity createEntity​(long systemId, java.util.Map<java.lang.String,​java.lang.Object> entityKey, java.util.Map<java.lang.String,​java.lang.Object> partitionKey)
      Creates an entity for the given input criteria.
      java.util.Set<Entity> findAllWithHistory​(com.github.rutledgepaulv.qbuilders.conditions.Condition<cern.nxcals.api.extraction.metadata.queries.Entities> condition, long historyStartTime, long historyEndTime)
      Searching for multiple values.
      java.util.Optional<Entity> findOneWithHistory​(com.github.rutledgepaulv.qbuilders.conditions.Condition<cern.nxcals.api.extraction.metadata.queries.Entities> condition, long historyStartTime, long historyEndTime)
      Searching for one value.
      java.util.Set<Entity> updateEntities​(java.util.Set<Entity> entityDataList)
      Updates a set of entities.
    • Method Detail

      • findAllWithHistory

        java.util.Set<Entity> findAllWithHistory​(com.github.rutledgepaulv.qbuilders.conditions.Condition<cern.nxcals.api.extraction.metadata.queries.Entities> condition,
                                                 long historyStartTime,
                                                 long historyEndTime)
        Searching for multiple values.
        Parameters:
        condition - entity search criteria
        historyStartTime - in nanoseconds elapsed since 1970-01-01 00:00:00 in the UTC timezone
        historyEndTime - in nanoseconds elapsed since 1970-01-01 00:00:00 in the UTC timezone
        Returns:
        a Set of found entities.
      • findOneWithHistory

        java.util.Optional<Entity> findOneWithHistory​(com.github.rutledgepaulv.qbuilders.conditions.Condition<cern.nxcals.api.extraction.metadata.queries.Entities> condition,
                                                      long historyStartTime,
                                                      long historyEndTime)
        Searching for one value. If the metadata returns multiple values the exception is thrown (@see IllegalStateException)
        Parameters:
        condition - entity search criteria
        historyStartTime - in nanoseconds elapsed since 1970-01-01 00:00:00 in the UTC timezone
        historyEndTime - in nanoseconds elapsed since 1970-01-01 00:00:00 in the UTC timezone
        Returns:
        Optional with value or empty.
        Throws:
        java.lang.IllegalStateException - if found multiple values.
      • updateEntities

        java.util.Set<Entity> updateEntities​(java.util.Set<Entity> entityDataList)
        Updates a set of entities. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel
        Parameters:
        entityDataList - a Set of Entitys that identify the entities to be updated. We only allow change of the keyValues and lock/unlock for operation.
        Returns:
        a Set of updated entities.
      • createEntity

        Entity createEntity​(long systemId,
                            java.util.Map<java.lang.String,​java.lang.Object> entityKey,
                            java.util.Map<java.lang.String,​java.lang.Object> partitionKey)
        Creates an entity for the given input criteria. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel
        Parameters:
        systemId -
        entityKey -
        partitionKey -
        Returns:
        created entity
        Throws:
        cern.nxcals.api.exceptions.FatalDataConflictRuntimeException - if such entity exists
        java.lang.IllegalArgumentException - if systemId does not exist or entityKey or partitionKey are invalid
      • createEntities

        java.util.Set<Entity> createEntities​(java.util.Set<CreateEntityRequest> entities)
        Creates entities for the given input requests. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel
        Parameters:
        entities - a set of CreateEntityRequest based on which new entities should be created
        Returns:
        a Set of created entities
        Throws:
        cern.nxcals.api.exceptions.FatalDataConflictRuntimeException - if such entity exists
        java.lang.IllegalArgumentException - if systemId does not exist or entityKeyValues or partitionKeyValues are invalid