Interface EntityService
public interface EntityService
extends Queryable<Entity,cern.nxcals.api.extraction.metadata.queries.Entities>
Public access to NXCALS entities.
-
Method Summary
Modifier and TypeMethodDescriptioncreateEntities(Set<CreateEntityRequest> entities) Creates entities for the given input requests.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.
-
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 criteriahistoryStartTime- in nanoseconds elapsed since 1970-01-01 00:00:00 in the UTC timezonehistoryEndTime- in nanoseconds elapsed since 1970-01-01 00:00:00 in the UTC timezone- Returns:
- a
Setof 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 (@seeIllegalStateException)- Parameters:
condition- entity search criteriahistoryStartTime- in nanoseconds elapsed since 1970-01-01 00:00:00 in the UTC timezonehistoryEndTime- 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
Updates a set of entities. NOTE: this is a mutative method. It is not thread-safe or meant to be used in parallel -
createEntity
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 existsIllegalArgumentException- if systemId does not exist or entityKey or partitionKey are invalid
-
createEntities
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 ofCreateEntityRequestbased on which new entities should be created- Returns:
- a
Setof created entities - Throws:
cern.nxcals.api.exceptions.FatalDataConflictRuntimeException- if such entity existsIllegalArgumentException- if systemId does not exist or entityKeyValues or partitionKeyValues are invalid
-
findAll
Find all entities which match condition. Can be configured with additional options.- Parameters:
options- query with options, like limit- Returns:
- a
Listof 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. -
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
Listof 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.
-