Package step.core.accessors
Interface Accessor<T extends step.core.accessors.AbstractIdentifiableObject>
-
- All Known Implementing Classes:
AbstractAccessor,CachedAccessor,InMemoryAccessor,LayeredAccessor
public interface Accessor<T extends step.core.accessors.AbstractIdentifiableObject>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TfindByAttributes(Map<String,String> attributes)Find an object by default attributes.TfindByAttributes(Map<String,String> attributes, String attributesMapKey)Find an object by attributes.TfindByCriteria(Map<String,String> criteria)Find an object by criteria.Spliterator<T>findManyByAttributes(Map<String,String> attributes)Find objects by attributes.Spliterator<T>findManyByAttributes(Map<String,String> attributes, String attributesMapKey)Find objects by attributes.Stream<T>findManyByCriteria(Map<String,String> criteria)Find objects by criteria.Tget(String id)Get an object by idTget(org.bson.types.ObjectId id)Get an object by idIterator<T>getAll()List<T>getRange(int skip, int limit)Get the range of objects specified by the skip/limit parameters browsing the collection sorted by ID in the descending ordervoidremove(org.bson.types.ObjectId id)Remove an entity.voidsave(Iterable<T> entities)Save a list of entities.Tsave(T entity)Save an entity.Stream<T>stream()
-
-
-
Method Detail
-
get
T get(org.bson.types.ObjectId id)
Get an object by id- Parameters:
id- the UID of the object- Returns:
- the object
-
get
T get(String id)
Get an object by id- Parameters:
id- the UID of the object- Returns:
- the object
-
findByCriteria
T findByCriteria(Map<String,String> criteria)
Find an object by criteria. If multiple objects match these criteria, the first one will be returned- Parameters:
criteria- the map of mandatory criteria of the object to be found- Returns:
- the object
-
findManyByCriteria
Stream<T> findManyByCriteria(Map<String,String> criteria)
Find objects by criteria.- Parameters:
criteria- the map of mandatory criteria of the object to be found- Returns:
- an
Iteratorfor the objects found
-
findByAttributes
T findByAttributes(Map<String,String> attributes)
Find an object by default attributes. If multiple objects match these attributes, the first one will be returned- Parameters:
attributes- the map of mandatory attributes of the object to be found- Returns:
- the object
-
findManyByAttributes
Spliterator<T> findManyByAttributes(Map<String,String> attributes)
Find objects by attributes.- Parameters:
attributes- the map of mandatory attributes of the object to be found- Returns:
- an
Iteratorfor the objects found
-
findByAttributes
T findByAttributes(Map<String,String> attributes, String attributesMapKey)
Find an object by attributes. If multiple objects match these attributes, the first one will be returned- Parameters:
attributes- the map of mandatory attributes of the object to be foundattributesMapKey- the string representing the name (or "key") of the attribute map- Returns:
- the object
-
findManyByAttributes
Spliterator<T> findManyByAttributes(Map<String,String> attributes, String attributesMapKey)
Find objects by attributes.- Parameters:
attributes- the map of mandatory attributes of the object to be foundattributesMapKey- the string representing the name (or "key") of the attribute map- Returns:
- an
Iteratorfor the objects found
-
getRange
List<T> getRange(int skip, int limit)
Get the range of objects specified by the skip/limit parameters browsing the collection sorted by ID in the descending order- Parameters:
skip- the start index (inclusive) of the rangelimit- the size of the range- Returns:
- a
Listcontaining the objects of the specified range
-
remove
void remove(org.bson.types.ObjectId id)
Remove an entity.- Parameters:
id- id the entity
-
save
T save(T entity)
Save an entity. If an entity with the same id exists, it will be updated otherwise inserted.- Parameters:
entity- the entity instance to be saved- Returns:
- the saved entity
-
-