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

    Modifier and Type
    Method
    Description
    Creates entities for the given input requests.
    createEntity(long systemId, Map<String,Object> entityKey, Map<String,Object> partitionKey)
    Creates an entity for the given input criteria.
    findAll(cern.nxcals.api.metadata.queries.ConditionWithOptions<cern.nxcals.api.metadata.queries.Entities,cern.nxcals.api.metadata.queries.EntityQueryWithOptions> condition)
    Find all entities which match condition.
    findAll(cern.nxcals.api.metadata.queries.EntityQueryWithOptions options)
    Find all entities which match condition.
    findAllWithHistory(com.github.rutledgepaulv.qbuilders.conditions.Condition<cern.nxcals.api.extraction.metadata.queries.Entities> condition, long historyStartTime, long historyEndTime)
    Searching for multiple values.
    findOne(cern.nxcals.api.metadata.queries.ConditionWithOptions<cern.nxcals.api.metadata.queries.Entities,cern.nxcals.api.metadata.queries.EntityQueryWithOptions> condition)
    Find one entity which match condition.
    findOne(cern.nxcals.api.metadata.queries.EntityQueryWithOptions options)
    Find one entity which match condition.
    findOneWithHistory(com.github.rutledgepaulv.qbuilders.conditions.Condition<cern.nxcals.api.extraction.metadata.queries.Entities> condition, long historyStartTime, long historyEndTime)
    Searching for one value.
    updateEntities(Set<Entity> entityDataList)
    Updates a set of entities.

    Methods inherited from interface cern.nxcals.api.extraction.metadata.Queryable

    findAll, findById, findOne
  • Method Details

    • findAllWithHistory

      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

      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:
      IllegalStateException - if found multiple values.
    • updateEntities

      Set<Entity> updateEntities(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, Map<String,Object> entityKey, Map<String,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
      IllegalArgumentException - if systemId does not exist or entityKey or partitionKey are invalid
    • createEntities

      Set<Entity> createEntities(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
      IllegalArgumentException - if systemId does not exist or entityKeyValues or partitionKeyValues are invalid
    • findAll

      @Experimental List<Entity> findAll(cern.nxcals.api.metadata.queries.EntityQueryWithOptions options)
      Find all entities which match condition. Can be configured with additional options.
      Parameters:
      options - query with options, like limit
      Returns:
      a List of found entities.
    • findOne

      @Experimental Optional<Entity> findOne(cern.nxcals.api.metadata.queries.EntityQueryWithOptions options)
      Find one entity which match condition. Can be configured with additional options.
      Parameters:
      options - query with options, like limit
      Returns:
      an Optional with Entity
    • findAll

      @Experimental Set<Entity> findAll(cern.nxcals.api.metadata.queries.ConditionWithOptions<cern.nxcals.api.metadata.queries.Entities,cern.nxcals.api.metadata.queries.EntityQueryWithOptions> condition)
      Find all entities which match condition.
      Parameters:
      condition - query
      Returns:
      a List of found entities.
    • findOne

      @Experimental Optional<Entity> findOne(cern.nxcals.api.metadata.queries.ConditionWithOptions<cern.nxcals.api.metadata.queries.Entities,cern.nxcals.api.metadata.queries.EntityQueryWithOptions> condition)
      Find one entity which match condition.
      Parameters:
      condition - query, must match zero or one entity
      Returns:
      an Optional with Entity