Interface EntityService
-
-
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.EntitycreateEntity(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 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
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 (@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:
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- aSetofEntitys that identify the entities to be updated. We only allow change of the keyValues and lock/unlock for operation.- Returns:
- a
Setof 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 existsjava.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 ofCreateEntityRequestbased on which new entities should be created- Returns:
- a
Setof created entities - Throws:
cern.nxcals.api.exceptions.FatalDataConflictRuntimeException- if such entity existsjava.lang.IllegalArgumentException- if systemId does not exist or entityKeyValues or partitionKeyValues are invalid
-
-