|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.usergrid.persistence.cassandra.EntityManagerImpl
public class EntityManagerImpl
Cassandra-specific implementation of Datastore
Field Summary | |
---|---|
static String |
APPLICATION_COLLECTION
|
static String |
APPLICATION_ENTITIES
|
static me.prettyprint.cassandra.serializers.ByteBufferSerializer |
be
|
static me.prettyprint.cassandra.serializers.LongSerializer |
le
|
static long |
ONE_COUNT
|
static me.prettyprint.cassandra.serializers.StringSerializer |
se
|
static me.prettyprint.cassandra.serializers.UUIDSerializer |
ue
|
Constructor Summary | |
---|---|
EntityManagerImpl()
|
Method Summary | ||
---|---|---|
void |
addGroupToRole(UUID groupId,
String roleName)
|
|
void |
addMapToDictionary(EntityRef entityRef,
String dictionaryName,
Map<?,?> elementValues)
|
|
void |
addSetToDictionary(EntityRef entityRef,
String dictionaryName,
Set<?> elementValues)
|
|
Entity |
addToCollection(EntityRef entityRef,
String collectionName,
EntityRef itemRef)
Adds an entity to the specified collection belonging to the specified entity entity. |
|
Entity |
addToCollections(List<EntityRef> ownerEntities,
String collectionName,
EntityRef itemRef)
|
|
void |
addToDictionary(EntityRef entityRef,
String dictionaryName,
Object elementValue)
Adds the specified value to the named entity list property. |
|
void |
addToDictionary(EntityRef entityRef,
String dictionaryName,
Object elementValue,
Object elementCoValue)
|
|
void |
addUserToGroupRole(UUID userId,
UUID groupId,
String roleName)
|
|
void |
addUserToRole(UUID userId,
String roleName)
|
|
|
batchCreate(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> m,
String entityType,
Class<A> entityClass,
Map<String,Object> properties,
UUID importId,
UUID timestampUuid)
|
|
void |
batchCreateRole(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batch,
UUID groupId,
String roleName,
String roleTitle,
long inactivity,
RoleRef roleRef,
UUID timestampUuid)
|
|
me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> |
batchSetProperty(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batch,
Entity entity,
String propertyName,
Object propertyValue,
boolean force,
boolean noRead,
UUID timestampUuid)
|
|
me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> |
batchSetProperty(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batch,
Entity entity,
String propertyName,
Object propertyValue,
UUID timestampUuid)
Batch dictionary property. |
|
me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> |
batchUpdateDictionary(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batch,
Entity entity,
String dictionaryName,
Object elementValue,
boolean removeFromDictionary,
UUID timestampUuid)
Batch update set. |
|
me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> |
batchUpdateDictionary(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batch,
Entity entity,
String dictionaryName,
Object elementValue,
Object elementCoValue,
boolean removeFromDictionary,
UUID timestampUuid)
|
|
me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> |
batchUpdateProperties(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batch,
Entity entity,
Map<String,Object> properties,
UUID timestampUuid)
Batch update properties. |
|
me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> |
batchUpdateProperties(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batch,
UUID entityId,
Map<String,Object> properties,
UUID timestampUuid)
Batch update properties. |
|
boolean |
connectionExists(ConnectionRef connectionRef)
Returns true if there is a connection between these entities, optionally matching the specified connection type and/or entity type. |
|
ConnectionRef |
connectionRef(EntityRef connectingEntity,
ConnectedEntityRef... connections)
|
|
ConnectionRef |
connectionRef(EntityRef connectingEntity,
String connectionType,
EntityRef connectedEntityRef)
|
|
ConnectionRef |
connectionRef(EntityRef connectingEntity,
String pairedConnectionType,
EntityRef pairedEntity,
String connectionType,
EntityRef connectedEntityRef)
|
|
void |
copyRelationships(EntityRef srcEntityRef,
String srcRelationName,
EntityRef dstEntityRef,
String dstRelationName)
|
|
|
create(A entity)
|
|
|
create(String entityType,
Class<A> entityClass,
Map<String,Object> properties)
|
|
|
create(String entityType,
Class<A> entityClass,
Map<String,Object> properties,
UUID importId)
Creates a new entity. |
|
Entity |
create(String entityType,
Map<String,Object> properties)
Creates an entity of the specified type attached to the specified application. |
|
Entity |
create(UUID importId,
String entityType,
Map<String,Object> properties)
Creates an entity of the specified type attached to the specified application. |
|
UUID |
createAlias(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> mutator,
UUID ownerId,
EntityRef ref,
String aliasType,
String alias,
long timestamp)
|
|
void |
createApplicationCollection(String entityType)
|
|
ConnectionRef |
createConnection(ConnectionRef connection)
Connect the specified entity to another entity with the specified connection type. |
|
ConnectionRef |
createConnection(EntityRef connectingEntity,
ConnectedEntityRef... connections)
|
|
ConnectionRef |
createConnection(EntityRef connectingEntity,
String connectionType,
EntityRef connectedEntityRef)
|
|
ConnectionRef |
createConnection(EntityRef connectingEntity,
String pairedConnectionType,
EntityRef pairedEntity,
String connectionType,
EntityRef connectedEntityRef)
|
|
Entity |
createGroupRole(UUID groupId,
String roleName,
long inactivity)
Create a group role with the group id, roleName, and inactivity |
|
Entity |
createItemInCollection(EntityRef entityRef,
String collectionName,
String itemType,
Map<String,Object> properties)
|
|
Entity |
createRole(String roleName,
String roleTitle,
long inactivity)
Create the role with the title and inactivity |
|
void |
decrementEntityCollection(String collection_name)
|
|
void |
decrementEntityCollection(String collection_name,
long cassandraTimestamp)
|
|
void |
delete(EntityRef entityRef)
Deletes the specified entity. |
|
void |
deleteAlias(String aliasType,
String alias)
|
|
void |
deleteAlias(UUID ownerId,
String aliasType,
String alias)
|
|
void |
deleteAliasesForEntity(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> mutator,
UUID entityId,
long timestamp)
|
|
void |
deleteConnection(ConnectionRef connectionRef)
Disconnects two connected entities with the specified connection type. |
|
void |
deleteEntity(UUID entityId)
|
|
void |
deleteGroupRole(UUID groupId,
String roleName)
|
|
void |
deleteProperty(EntityRef entityRef,
String propertyName)
|
|
void |
deleteRole(String roleName)
|
|
Entity |
get(EntityRef entityRef)
Retrieves the entity for the specified entity reference. |
|
|
get(EntityRef entityRef,
Class<A> entityClass)
|
|
Results |
get(List<UUID> entityIds,
Class<? extends Entity> entityClass,
Results.Level resultsLevel)
Retrieves a set of Entitues cast to the specified class type. |
|
Results |
get(List<UUID> entityIds,
Results.Level resultsLevel)
Retrieves a set of Entities. |
|
Results |
get(List<UUID> entityIds,
String entityType,
Class<? extends Entity> entityClass,
Results.Level resultsLevel)
Retrieves a set of Entities cast to the specified class type. |
|
Entity |
get(UUID entityid)
|
|
|
get(UUID entityId,
Class<A> entityClass)
|
|
Results |
getAggregateCounters(Query query)
|
|
Results |
getAggregateCounters(UUID userId,
UUID groupId,
String category,
String counterName,
CounterResolution resolution,
long start,
long finish,
boolean pad)
|
|
Results |
getAggregateCounters(UUID userId,
UUID groupId,
UUID queueId,
String category,
String counterName,
CounterResolution resolution,
long start,
long finish,
boolean pad)
|
|
Map<String,EntityRef> |
getAlias(String aliasType,
List<String> aliases)
|
|
EntityRef |
getAlias(String aliasType,
String alias)
|
|
Map<String,EntityRef> |
getAlias(UUID ownerId,
String aliasType,
List<String> aliases)
|
|
EntityRef |
getAlias(UUID ownerId,
String aliasType,
String alias)
|
|
List<UUID> |
getAliases(UUID entityId)
|
|
Application |
getApplication()
|
|
Map<String,Object> |
getApplicationCollectionMetadata()
|
|
Set<String> |
getApplicationCollections()
Get all collections for the application. |
|
long |
getApplicationCollectionSize(String collectionName)
|
|
org.springframework.context.ApplicationContext |
getApplicationContext()
|
|
Map<String,Long> |
getApplicationCounters()
|
|
UUID |
getApplicationId()
|
|
EntityRef |
getApplicationRef()
|
|
Map<String,Object> |
getAssociatedProperties(AssociatedEntityRef associatedEntityRef)
Gets the connection properties for this entity. |
|
Object |
getAssociatedProperty(AssociatedEntityRef associatedEntityRef,
String propertyName)
Gets the value for a named connection property. |
|
CassandraService |
getCass()
|
|
Results |
getCollection(EntityRef entityRef,
String collectionName,
UUID startResult,
int count,
Results.Level resultsLevel,
boolean reversed)
Gets a list of entities in the specified collection belonging to the specified entity. |
|
Results |
getCollection(UUID entityId,
String collectionName,
Query query,
Results.Level resultsLevel)
|
|
Set<String> |
getCollectionIndexes(EntityRef entity,
String collectionName)
|
|
Set<String> |
getCollections(EntityRef entityRef)
Gets the collections for the specified entity. |
|
Results |
getConnectedEntities(UUID entityId,
String connectionType,
String connectedEntityType,
Results.Level resultsLevel)
Gets the entities of the specified type connected to the specified entity, optionally matching the specified connection types and/or entity types. |
|
Results |
getConnectingEntities(UUID entityId,
String connectionType,
String connectedEntityType,
Results.Level resultsLevel)
Gets the entities connecting to this entity, optionally with the specified connection type and/or entity type. |
|
Set<String> |
getConnectionIndexes(EntityRef entity,
String connectionType)
|
|
List<ConnectedEntityRef> |
getConnections(UUID entityId,
Query query)
|
|
Set<String> |
getConnectionTypes(EntityRef ref)
|
|
Set<String> |
getConnectionTypes(EntityRef ref,
boolean filterConnection)
|
|
Set<String> |
getConnectionTypes(UUID entityId,
UUID connectedEntityId)
Gets the types of connections between two entities. |
|
Set<String> |
getCounterNames()
|
|
Set<String> |
getDictionaries(EntityRef entity)
|
|
Map<Object,Object> |
getDictionaryAsMap(EntityRef entity,
String dictionaryName)
Gets the set. |
|
Set<Object> |
getDictionaryAsSet(EntityRef entity,
String dictionaryName)
Gets the values from an entity list property. |
|
Object |
getDictionaryElementValue(EntityRef entity,
String dictionaryName,
String elementName)
|
|
Map<String,Object> |
getDictionaryElementValues(EntityRef entity,
String dictionaryName,
String... elementNames)
|
|
Set<String> |
getDictionaryNames(EntityRef entity)
|
|
|
getEntities(List<UUID> entityIds,
String entityType,
Class<A> entityClass)
Gets the specified list of entities. |
|
|
getEntity(UUID entityId,
String entityType,
Class<A> entityClass)
Gets the specified entity. |
|
Map<String,Long> |
getEntityCounters(UUID entityId)
|
|
String |
getEntityType(UUID entityId)
Gets the type. |
|
GeoIndexManager |
getGeoIndexManager()
|
|
EntityRef |
getGroupByIdentifier(Identifier identifier)
|
|
Set<String> |
getGroupPermissions(UUID groupId)
|
|
Set<String> |
getGroupRolePermissions(UUID groupId,
String roleName)
|
|
Map<String,String> |
getGroupRoles(UUID groupId)
|
|
Map<String,Role> |
getGroupRolesWithTitles(UUID groupId)
|
|
IndexBucketLocator |
getIndexBucketLocator()
|
|
Map<String,Map<UUID,Set<String>>> |
getOwners(EntityRef entityRef)
Gets the entities and collections that the specified entity is a member of. |
|
Map<String,Object> |
getProperties(EntityRef entityRef)
Gets the properties for the specified entity property. |
|
Object |
getProperty(EntityRef entityRef,
String propertyName)
Gets the value for a named entity property. |
|
Set<String> |
getPropertyNames(EntityRef entity)
|
|
EntityRef |
getRef(UUID entityId)
|
|
RelationManagerImpl |
getRelationManager(EntityRef entityRef)
|
|
Set<String> |
getRolePermissions(String roleName)
|
|
Object |
getRolePermissionsKey(String roleName)
|
|
Object |
getRolePermissionsKey(UUID groupId,
String roleName)
|
|
Map<String,String> |
getRoles()
|
|
Map<String,Role> |
getRolesWithTitles(Set<String> roleNames)
|
|
String |
getRoleTitle(String roleName)
|
|
String |
getType(EntityRef entity)
|
|
String |
getType(UUID entityid)
|
|
EntityRef |
getUserByIdentifier(Identifier identifier)
|
|
Map<String,String> |
getUserGroupRoles(UUID userId,
UUID groupId)
|
|
Set<String> |
getUserPermissions(UUID userId)
|
|
Set<String> |
getUserRoles(UUID userId)
|
|
Map<String,Role> |
getUserRolesWithTitles(UUID userId)
|
|
Results |
getUsersInGroupRole(UUID groupId,
String roleName,
Results.Level level)
|
|
void |
grantGroupPermission(UUID groupId,
String permission)
|
|
void |
grantGroupRolePermission(UUID groupId,
String roleName,
String permission)
|
|
void |
grantRolePermission(String roleName,
String permission)
|
|
void |
grantRolePermissions(String roleName,
Collection<String> permissions)
|
|
void |
grantUserPermission(UUID userId,
String permission)
|
|
EntityRef |
groupRef(UUID groupId)
|
|
void |
incrementAggregateCounters(UUID userId,
UUID groupId,
String category,
Map<String,Long> counters)
|
|
void |
incrementAggregateCounters(UUID userId,
UUID groupId,
String category,
String counterName,
long value)
|
|
EntityManagerImpl |
init(EntityManagerFactoryImpl emf,
CassandraService cass,
CounterUtils counterUtils,
UUID applicationId,
boolean skipAggregateCounters)
|
|
void |
insertEntity(String type,
UUID entityId)
|
|
boolean |
isPropertyValueUniqueForEntity(String entityType,
String propertyName,
Object propertyValue)
|
|
boolean |
isPropertyValueUniqueForEntity(UUID thisEntity,
String entityType,
String propertyName,
Object propertyValue)
Returns true if the property is unique, and the entity can be saved. |
|
Results |
loadEntities(Results results,
Results.Level resultsLevel,
int count)
|
|
Results |
loadEntities(Results results,
Results.Level resultsLevel,
Map<UUID,UUID> associatedMap,
int count)
|
|
DynamicEntity |
loadPartialEntity(UUID entityId,
String... propertyNames)
Gets the entity info. |
|
CollectionRef |
memberRef(UUID groupId,
UUID userId)
|
|
void |
removeFromCollection(EntityRef entityRef,
String collectionName,
EntityRef itemRef)
Removes an entity to the specified collection belonging to the specified entity. |
|
void |
removeFromDictionary(EntityRef entityRef,
String dictionaryName,
Object elementValue)
Removes the specified value to the named entity list property. |
|
void |
removeGroupFromRole(UUID groupId,
String roleName)
|
|
void |
removeUserFromGroupRole(UUID userId,
UUID groupId,
String roleName)
|
|
void |
removeUserFromRole(UUID userId,
String roleName)
|
|
void |
resetRoles()
|
|
void |
revokeGroupPermission(UUID groupId,
String permission)
|
|
void |
revokeGroupRolePermission(UUID groupId,
String roleName,
String permission)
|
|
void |
revokeRolePermission(String roleName,
String permission)
|
|
void |
revokeUserPermission(UUID userId,
String permission)
|
|
EntityRef |
roleRef(String roleName)
|
|
EntityRef |
roleRef(UUID groupId,
String roleName)
|
|
Results |
searchCollection(EntityRef entityRef,
String collectionName,
Query query)
|
|
Results |
searchConnectedEntities(EntityRef connectingEntity,
Query query)
|
|
List<ConnectionRef> |
searchConnections(EntityRef connectingEntity,
Query query)
|
|
void |
setApplicationId(UUID applicationId)
|
|
void |
setAssociatedProperty(AssociatedEntityRef associatedEntityRef,
String propertyName,
Object propertyValue)
Sets the value for a named connection property. |
|
void |
setProperty(EntityRef entityRef,
String propertyName,
Object propertyValue)
Sets the value for a named entity property. |
|
void |
setProperty(EntityRef entityRef,
String propertyName,
Object propertyValue,
boolean override)
You should only use this method if you are absolutely sure what you're doing. |
|
Message |
storeEventAsMessage(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> m,
Event event,
long timestamp)
|
|
void |
update(Entity entity)
Updates the entity with the properties and values in the Entity Object. |
|
void |
updateApplication(Application app)
|
|
void |
updateApplication(Map<String,Object> properties)
|
|
void |
updateProperties(EntityRef entityRef,
Map<String,Object> properties)
Updates the properties for the specified entity. |
|
void |
updateProperties(UUID entityId,
Map<String,Object> properties)
Update properties. |
|
EntityRef |
userRef(UUID userId)
|
|
EntityRef |
validate(EntityRef entityRef)
Validates that the entity exists in the datastore meaning that it exists and the type has been loaded if not already provided. |
|
EntityRef |
validate(EntityRef entityRef,
boolean verify)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String APPLICATION_COLLECTION
public static final String APPLICATION_ENTITIES
public static final long ONE_COUNT
public static final me.prettyprint.cassandra.serializers.StringSerializer se
public static final me.prettyprint.cassandra.serializers.ByteBufferSerializer be
public static final me.prettyprint.cassandra.serializers.UUIDSerializer ue
public static final me.prettyprint.cassandra.serializers.LongSerializer le
Constructor Detail |
---|
public EntityManagerImpl()
Method Detail |
---|
public EntityManagerImpl init(EntityManagerFactoryImpl emf, CassandraService cass, CounterUtils counterUtils, UUID applicationId, boolean skipAggregateCounters)
public void setApplicationId(UUID applicationId)
setApplicationId
in interface EntityManager
public org.springframework.context.ApplicationContext getApplicationContext()
public EntityRef getApplicationRef()
getApplicationRef
in interface EntityManager
public Application getApplication() throws Exception
getApplication
in interface EntityManager
Exception
public void updateApplication(Application app) throws Exception
updateApplication
in interface EntityManager
Exception
public void updateApplication(Map<String,Object> properties) throws Exception
updateApplication
in interface EntityManager
Exception
public RelationManagerImpl getRelationManager(EntityRef entityRef)
getRelationManager
in interface EntityManager
public me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batchSetProperty(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batch, Entity entity, String propertyName, Object propertyValue, UUID timestampUuid) throws Exception
batch
- the batchapplicationId
- the application identityType
- the entity typeentityId
- the entity idproperties
- the propertiespropertyName
- the property namepropertyValue
- the property valuetimestamp
- the timestamp
Exception
- the exceptionpublic me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batchSetProperty(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batch, Entity entity, String propertyName, Object propertyValue, boolean force, boolean noRead, UUID timestampUuid) throws Exception
Exception
public me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batchUpdateProperties(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batch, Entity entity, Map<String,Object> properties, UUID timestampUuid) throws Exception
batch
- the batchapplicationId
- the application identityType
- the entity typeentityId
- the entity identityProperties
- the entity propertiesproperties
- the propertiestimestamp
- the timestamp
Exception
- the exceptionpublic me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batchUpdateProperties(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batch, UUID entityId, Map<String,Object> properties, UUID timestampUuid) throws Exception
batch
- the batchapplicationId
- the application identityId
- the entity idproperties
- the propertiestimestamp
- the timestamp
Exception
- the exceptionpublic me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batchUpdateDictionary(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batch, Entity entity, String dictionaryName, Object elementValue, boolean removeFromDictionary, UUID timestampUuid) throws Exception
batch
- the batchapplicationId
- the application identityType
- the entity typeentityId
- the entity idproperties
- the propertiesdictionaryName
- the dictionary nameproperty
- the propertyelementValue
- the dictionary valueremoveFromSet
- the remove from settimestamp
- the timestamp
Exception
- the exceptionpublic me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batchUpdateDictionary(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batch, Entity entity, String dictionaryName, Object elementValue, Object elementCoValue, boolean removeFromDictionary, UUID timestampUuid) throws Exception
Exception
public boolean isPropertyValueUniqueForEntity(UUID thisEntity, String entityType, String propertyName, Object propertyValue) throws Exception
thisEntity
- entityType
- propertyName
- propertyValue
-
Exception
public UUID createAlias(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> mutator, UUID ownerId, EntityRef ref, String aliasType, String alias, long timestamp) throws Exception
Exception
public void deleteAlias(UUID ownerId, String aliasType, String alias) throws Exception
deleteAlias
in interface EntityManager
Exception
public EntityRef getAlias(UUID ownerId, String aliasType, String alias) throws Exception
getAlias
in interface EntityManager
Exception
public Map<String,EntityRef> getAlias(String aliasType, List<String> aliases) throws Exception
getAlias
in interface EntityManager
Exception
public Map<String,EntityRef> getAlias(UUID ownerId, String aliasType, List<String> aliases) throws Exception
getAlias
in interface EntityManager
Exception
public List<UUID> getAliases(UUID entityId)
public void deleteAliasesForEntity(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> mutator, UUID entityId, long timestamp) throws Exception
Exception
public <A extends Entity> A create(String entityType, Class<A> entityClass, Map<String,Object> properties) throws Exception
create
in interface EntityManager
Exception
public Entity create(UUID importId, String entityType, Map<String,Object> properties) throws Exception
EntityManager
create
in interface EntityManager
importId
- the UUID to assign to the imported entityproperties
- property values to create in the new entity or null.
Exception
- the exceptionpublic <A extends TypedEntity> A create(A entity) throws Exception
create
in interface EntityManager
Exception
public Entity create(String entityType, Map<String,Object> properties) throws Exception
EntityManager
create
in interface EntityManager
properties
- property values to create in the new entity or null.
Exception
public <A extends Entity> A create(String entityType, Class<A> entityClass, Map<String,Object> properties, UUID importId) throws Exception
A
- the generic typeapplicationId
- the application identityType
- the entity typeentityClass
- the entity classproperties
- the propertiesimportId
- an existing external uuid to use as the id for the new entity
Exception
- the exceptionpublic <A extends Entity> A batchCreate(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> m, String entityType, Class<A> entityClass, Map<String,Object> properties, UUID importId, UUID timestampUuid) throws Exception
Exception
public void decrementEntityCollection(String collection_name)
public void decrementEntityCollection(String collection_name, long cassandraTimestamp)
public void insertEntity(String type, UUID entityId) throws Exception
Exception
public Message storeEventAsMessage(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> m, Event event, long timestamp)
public String getEntityType(UUID entityId) throws Exception
applicationId
- the application identityId
- the entity id
Exception
- the exceptionpublic DynamicEntity loadPartialEntity(UUID entityId, String... propertyNames) throws Exception
applicationId
- the application identityId
- the entity idpropertyNames
- the property names
Exception
- the exceptionpublic <A extends Entity> A getEntity(UUID entityId, String entityType, Class<A> entityClass) throws Exception
A
- the generic typeapplicationId
- the application identityId
- the entity identityType
- the entity typeentityClass
- the entity class
Exception
- the exceptionpublic <A extends Entity> List<A> getEntities(List<UUID> entityIds, String entityType, Class<A> entityClass) throws Exception
A
- the generic typeapplicationId
- the application identityIds
- the entity idsincludeProperties
- the include propertiesentityType
- the entity typeentityClass
- the entity class
Exception
- the exceptionpublic Set<String> getPropertyNames(EntityRef entity) throws Exception
Exception
public Set<String> getDictionaryNames(EntityRef entity) throws Exception
Exception
public Object getDictionaryElementValue(EntityRef entity, String dictionaryName, String elementName) throws Exception
getDictionaryElementValue
in interface EntityManager
Exception
public Map<String,Object> getDictionaryElementValues(EntityRef entity, String dictionaryName, String... elementNames) throws Exception
Exception
public Map<Object,Object> getDictionaryAsMap(EntityRef entity, String dictionaryName) throws Exception
getDictionaryAsMap
in interface EntityManager
applicationId
- the application identityType
- the entity typeentityId
- the entity iddictionaryName
- the dictionary namejoint
- the jointproperty
- the property
Exception
- the exceptionpublic Set<Object> getDictionaryAsSet(EntityRef entity, String dictionaryName) throws Exception
EntityManager
getDictionaryAsSet
in interface EntityManager
dictionaryName
- the property list name to retrieve.
Exception
- the exceptionpublic void updateProperties(UUID entityId, Map<String,Object> properties) throws Exception
applicationId
- the application identityId
- the entity idproperties
- the properties
Exception
- the exceptionpublic void deleteEntity(UUID entityId) throws Exception
Exception
public void delete(EntityRef entityRef) throws Exception
EntityManager
delete
in interface EntityManager
Exception
- the exceptionpublic void batchCreateRole(me.prettyprint.hector.api.mutation.Mutator<ByteBuffer> batch, UUID groupId, String roleName, String roleTitle, long inactivity, RoleRef roleRef, UUID timestampUuid) throws Exception
Exception
public EntityRef getUserByIdentifier(Identifier identifier) throws Exception
getUserByIdentifier
in interface EntityManager
Exception
public EntityRef getGroupByIdentifier(Identifier identifier) throws Exception
getGroupByIdentifier
in interface EntityManager
Exception
public Results getAggregateCounters(UUID userId, UUID groupId, String category, String counterName, CounterResolution resolution, long start, long finish, boolean pad)
getAggregateCounters
in interface EntityManager
public Results getAggregateCounters(UUID userId, UUID groupId, UUID queueId, String category, String counterName, CounterResolution resolution, long start, long finish, boolean pad)
getAggregateCounters
in interface EntityManager
public Results getAggregateCounters(Query query) throws Exception
getAggregateCounters
in interface EntityManager
Exception
public Map<String,Long> getEntityCounters(UUID entityId) throws Exception
getEntityCounters
in interface EntityManager
Exception
public Map<String,Long> getApplicationCounters() throws Exception
getApplicationCounters
in interface EntityManager
Exception
public void createApplicationCollection(String entityType) throws Exception
createApplicationCollection
in interface EntityManager
Exception
public void deleteAlias(String aliasType, String alias) throws Exception
deleteAlias
in interface EntityManager
Exception
public EntityRef getAlias(String aliasType, String alias) throws Exception
getAlias
in interface EntityManager
Exception
public EntityRef validate(EntityRef entityRef) throws Exception
EntityManager
validate
in interface EntityManager
Exception
public EntityRef validate(EntityRef entityRef, boolean verify) throws Exception
Exception
public String getType(UUID entityid) throws Exception
getType
in interface EntityManager
Exception
public String getType(EntityRef entity) throws Exception
Exception
public Entity get(UUID entityid) throws Exception
get
in interface EntityManager
Exception
public EntityRef getRef(UUID entityId) throws Exception
getRef
in interface EntityManager
Exception
public Entity get(EntityRef entityRef) throws Exception
EntityManager
get
in interface EntityManager
Exception
public <A extends Entity> A get(EntityRef entityRef, Class<A> entityClass) throws Exception
get
in interface EntityManager
Exception
public <A extends Entity> A get(UUID entityId, Class<A> entityClass) throws Exception
get
in interface EntityManager
Exception
public Results get(List<UUID> entityIds, Results.Level resultsLevel) throws Exception
EntityManager
This method will be deprecated in future releases in favor of a version that supports paging.
get
in interface EntityManager
entityIds
- a list of entity UUIDs.
Exception
public Results get(List<UUID> entityIds, Class<? extends Entity> entityClass, Results.Level resultsLevel) throws Exception
EntityManager
get
in interface EntityManager
Exception
public Results get(List<UUID> entityIds, String entityType, Class<? extends Entity> entityClass, Results.Level resultsLevel) throws Exception
EntityManager
get
in interface EntityManager
Exception
public Results loadEntities(Results results, Results.Level resultsLevel, int count) throws Exception
Exception
public Results loadEntities(Results results, Results.Level resultsLevel, Map<UUID,UUID> associatedMap, int count) throws Exception
Exception
public void update(Entity entity) throws Exception
EntityManager
update
in interface EntityManager
entity
- an Entity object.
Exception
public Object getProperty(EntityRef entityRef, String propertyName) throws Exception
EntityManager
getProperty
in interface EntityManager
propertyName
- the property name to retrieve.
Exception
- the exceptionpublic Map<String,Object> getProperties(EntityRef entityRef) throws Exception
EntityManager
getProperties
in interface EntityManager
Exception
- the exceptionpublic void setProperty(EntityRef entityRef, String propertyName, Object propertyValue) throws Exception
EntityManager
setProperty
in interface EntityManager
propertyName
- the property to set.propertyValue
- new value for property.
Exception
- the exceptionpublic void setProperty(EntityRef entityRef, String propertyName, Object propertyValue, boolean override) throws Exception
EntityManager
setProperty
in interface EntityManager
override
- set to true to force this value to persist. This will ignore
all mutable attributes as well as validation. Use with care
Exception
public void updateProperties(EntityRef entityRef, Map<String,Object> properties) throws Exception
EntityManager
updateProperties
in interface EntityManager
properties
- the properties
Exception
- the exceptionpublic void addToDictionary(EntityRef entityRef, String dictionaryName, Object elementValue) throws Exception
EntityManager
addToDictionary
in interface EntityManager
dictionaryName
- the property to set.elementValue
- new value for property.
Exception
- the exceptionpublic void addToDictionary(EntityRef entityRef, String dictionaryName, Object elementValue, Object elementCoValue) throws Exception
addToDictionary
in interface EntityManager
Exception
public void addSetToDictionary(EntityRef entityRef, String dictionaryName, Set<?> elementValues) throws Exception
addSetToDictionary
in interface EntityManager
Exception
public void addMapToDictionary(EntityRef entityRef, String dictionaryName, Map<?,?> elementValues) throws Exception
addMapToDictionary
in interface EntityManager
Exception
public void removeFromDictionary(EntityRef entityRef, String dictionaryName, Object elementValue) throws Exception
EntityManager
removeFromDictionary
in interface EntityManager
dictionaryName
- the property to set.elementValue
- new value for property.
Exception
- the exceptionpublic Set<String> getDictionaries(EntityRef entity) throws Exception
getDictionaries
in interface EntityManager
Exception
public void deleteProperty(EntityRef entityRef, String propertyName) throws Exception
deleteProperty
in interface EntityManager
Exception
public Set<String> getApplicationCollections() throws Exception
EntityManager
getApplicationCollections
in interface EntityManager
Exception
public long getApplicationCollectionSize(String collectionName) throws Exception
getApplicationCollectionSize
in interface EntityManager
Exception
public Map<String,Object> getApplicationCollectionMetadata() throws Exception
getApplicationCollectionMetadata
in interface EntityManager
Exception
public Object getRolePermissionsKey(String roleName)
public Object getRolePermissionsKey(UUID groupId, String roleName)
public EntityRef userRef(UUID userId)
public EntityRef groupRef(UUID groupId)
public EntityRef roleRef(String roleName)
public EntityRef roleRef(UUID groupId, String roleName)
public Map<String,String> getRoles() throws Exception
getRoles
in interface EntityManager
Exception
public String getRoleTitle(String roleName) throws Exception
getRoleTitle
in interface EntityManager
Exception
public Map<String,Role> getRolesWithTitles(Set<String> roleNames) throws Exception
getRolesWithTitles
in interface EntityManager
Exception
public Entity createRole(String roleName, String roleTitle, long inactivity) throws Exception
EntityManager
createRole
in interface EntityManager
roleName
- The name of the roleroleTitle
- The human readable titleinactivity
- The amount of inactivity time to have the role expire. 0 is
infinity, I.E no expiration
Exception
public void grantRolePermission(String roleName, String permission) throws Exception
grantRolePermission
in interface EntityManager
Exception
public void grantRolePermissions(String roleName, Collection<String> permissions) throws Exception
grantRolePermissions
in interface EntityManager
Exception
public void revokeRolePermission(String roleName, String permission) throws Exception
revokeRolePermission
in interface EntityManager
Exception
public Set<String> getRolePermissions(String roleName) throws Exception
getRolePermissions
in interface EntityManager
Exception
public void deleteRole(String roleName) throws Exception
deleteRole
in interface EntityManager
Exception
public CollectionRef memberRef(UUID groupId, UUID userId)
public Map<String,String> getGroupRoles(UUID groupId) throws Exception
getGroupRoles
in interface EntityManager
Exception
public Entity createGroupRole(UUID groupId, String roleName, long inactivity) throws Exception
EntityManager
createGroupRole
in interface EntityManager
Exception
public void grantGroupRolePermission(UUID groupId, String roleName, String permission) throws Exception
grantGroupRolePermission
in interface EntityManager
Exception
public void revokeGroupRolePermission(UUID groupId, String roleName, String permission) throws Exception
revokeGroupRolePermission
in interface EntityManager
Exception
public Set<String> getGroupRolePermissions(UUID groupId, String roleName) throws Exception
getGroupRolePermissions
in interface EntityManager
Exception
public void deleteGroupRole(UUID groupId, String roleName) throws Exception
deleteGroupRole
in interface EntityManager
Exception
public Set<String> getUserRoles(UUID userId) throws Exception
getUserRoles
in interface EntityManager
Exception
public Map<String,Role> getUserRolesWithTitles(UUID userId) throws Exception
getUserRolesWithTitles
in interface EntityManager
Exception
public void addUserToRole(UUID userId, String roleName) throws Exception
addUserToRole
in interface EntityManager
Exception
public void removeUserFromRole(UUID userId, String roleName) throws Exception
removeUserFromRole
in interface EntityManager
Exception
public Set<String> getUserPermissions(UUID userId) throws Exception
getUserPermissions
in interface EntityManager
Exception
public void grantUserPermission(UUID userId, String permission) throws Exception
grantUserPermission
in interface EntityManager
Exception
public void revokeUserPermission(UUID userId, String permission) throws Exception
revokeUserPermission
in interface EntityManager
Exception
public Map<String,String> getUserGroupRoles(UUID userId, UUID groupId) throws Exception
getUserGroupRoles
in interface EntityManager
Exception
public void addUserToGroupRole(UUID userId, UUID groupId, String roleName) throws Exception
addUserToGroupRole
in interface EntityManager
Exception
public void removeUserFromGroupRole(UUID userId, UUID groupId, String roleName) throws Exception
removeUserFromGroupRole
in interface EntityManager
Exception
public Results getUsersInGroupRole(UUID groupId, String roleName, Results.Level level) throws Exception
getUsersInGroupRole
in interface EntityManager
Exception
public void incrementAggregateCounters(UUID userId, UUID groupId, String category, String counterName, long value)
incrementAggregateCounters
in interface EntityManager
public void incrementAggregateCounters(UUID userId, UUID groupId, String category, Map<String,Long> counters)
incrementAggregateCounters
in interface EntityManager
public Set<String> getCounterNames() throws Exception
getCounterNames
in interface EntityManager
Exception
public boolean isPropertyValueUniqueForEntity(String entityType, String propertyName, Object propertyValue) throws Exception
isPropertyValueUniqueForEntity
in interface EntityManager
Exception
public Map<String,Map<UUID,Set<String>>> getOwners(EntityRef entityRef) throws Exception
EntityManager
getOwners
in interface EntityManager
Exception
- the exceptionpublic Set<String> getCollections(EntityRef entityRef) throws Exception
EntityManager
getCollections
in interface EntityManager
Exception
- the exceptionpublic Results getCollection(EntityRef entityRef, String collectionName, UUID startResult, int count, Results.Level resultsLevel, boolean reversed) throws Exception
EntityManager
getCollection
in interface EntityManager
collectionName
- the collection name.startResult
- the start resultcount
- the count
Exception
- the exceptionpublic Results getCollection(UUID entityId, String collectionName, Query query, Results.Level resultsLevel) throws Exception
getCollection
in interface EntityManager
Exception
public Entity addToCollection(EntityRef entityRef, String collectionName, EntityRef itemRef) throws Exception
EntityManager
addToCollection
in interface EntityManager
collectionName
- the collection name.
Exception
- the exceptionpublic Entity addToCollections(List<EntityRef> ownerEntities, String collectionName, EntityRef itemRef) throws Exception
addToCollections
in interface EntityManager
Exception
public Entity createItemInCollection(EntityRef entityRef, String collectionName, String itemType, Map<String,Object> properties) throws Exception
createItemInCollection
in interface EntityManager
Exception
public void removeFromCollection(EntityRef entityRef, String collectionName, EntityRef itemRef) throws Exception
EntityManager
removeFromCollection
in interface EntityManager
collectionName
- the collection name.
Exception
- the exceptionpublic void copyRelationships(EntityRef srcEntityRef, String srcRelationName, EntityRef dstEntityRef, String dstRelationName) throws Exception
copyRelationships
in interface EntityManager
Exception
public Results searchCollection(EntityRef entityRef, String collectionName, Query query) throws Exception
searchCollection
in interface EntityManager
Exception
public Set<String> getCollectionIndexes(EntityRef entity, String collectionName) throws Exception
getCollectionIndexes
in interface EntityManager
Exception
public ConnectionRef createConnection(ConnectionRef connection) throws Exception
EntityManager
createConnection
in interface EntityManager
Exception
- the exceptionpublic ConnectionRef createConnection(EntityRef connectingEntity, String connectionType, EntityRef connectedEntityRef) throws Exception
createConnection
in interface EntityManager
Exception
public ConnectionRef createConnection(EntityRef connectingEntity, String pairedConnectionType, EntityRef pairedEntity, String connectionType, EntityRef connectedEntityRef) throws Exception
createConnection
in interface EntityManager
Exception
public ConnectionRef createConnection(EntityRef connectingEntity, ConnectedEntityRef... connections) throws Exception
createConnection
in interface EntityManager
Exception
public ConnectionRef connectionRef(EntityRef connectingEntity, String connectionType, EntityRef connectedEntityRef) throws Exception
connectionRef
in interface EntityManager
Exception
public ConnectionRef connectionRef(EntityRef connectingEntity, String pairedConnectionType, EntityRef pairedEntity, String connectionType, EntityRef connectedEntityRef) throws Exception
connectionRef
in interface EntityManager
Exception
public ConnectionRef connectionRef(EntityRef connectingEntity, ConnectedEntityRef... connections)
connectionRef
in interface EntityManager
public void deleteConnection(ConnectionRef connectionRef) throws Exception
EntityManager
deleteConnection
in interface EntityManager
Exception
- the exceptionpublic boolean connectionExists(ConnectionRef connectionRef) throws Exception
EntityManager
connectionExists
in interface EntityManager
Exception
- the exceptionpublic Set<String> getConnectionTypes(UUID entityId, UUID connectedEntityId) throws Exception
EntityManager
getConnectionTypes
in interface EntityManager
Exception
- the exceptionpublic Set<String> getConnectionTypes(EntityRef ref) throws Exception
getConnectionTypes
in interface EntityManager
Exception
public Set<String> getConnectionTypes(EntityRef ref, boolean filterConnection) throws Exception
getConnectionTypes
in interface EntityManager
Exception
public Results getConnectedEntities(UUID entityId, String connectionType, String connectedEntityType, Results.Level resultsLevel) throws Exception
EntityManager
getConnectedEntities
in interface EntityManager
connectionType
- type of connection or null.connectedEntityType
- type of entity or null.
Exception
- the exceptionpublic Results getConnectingEntities(UUID entityId, String connectionType, String connectedEntityType, Results.Level resultsLevel) throws Exception
EntityManager
e.g. "get users who have favorited this place"
getConnectingEntities
in interface EntityManager
connectionType
- type of connection or null.
Exception
- the exceptionpublic List<ConnectedEntityRef> getConnections(UUID entityId, Query query) throws Exception
getConnections
in interface EntityManager
Exception
public Results searchConnectedEntities(EntityRef connectingEntity, Query query) throws Exception
searchConnectedEntities
in interface EntityManager
Exception
public Object getAssociatedProperty(AssociatedEntityRef associatedEntityRef, String propertyName) throws Exception
EntityManager
getAssociatedProperty
in interface EntityManager
propertyName
- the property name to retrieve.
Exception
- the exceptionpublic Map<String,Object> getAssociatedProperties(AssociatedEntityRef associatedEntityRef) throws Exception
EntityManager
getAssociatedProperties
in interface EntityManager
Exception
- the exceptionpublic void setAssociatedProperty(AssociatedEntityRef associatedEntityRef, String propertyName, Object propertyValue) throws Exception
EntityManager
setAssociatedProperty
in interface EntityManager
propertyName
- the property to set.propertyValue
- new value for property.
Exception
- the exceptionpublic List<ConnectionRef> searchConnections(EntityRef connectingEntity, Query query) throws Exception
searchConnections
in interface EntityManager
Exception
public Set<String> getConnectionIndexes(EntityRef entity, String connectionType) throws Exception
getConnectionIndexes
in interface EntityManager
Exception
public void resetRoles() throws Exception
resetRoles
in interface EntityManager
Exception
public UUID getApplicationId()
public CassandraService getCass()
public GeoIndexManager getGeoIndexManager()
getGeoIndexManager
in interface EntityManager
public IndexBucketLocator getIndexBucketLocator()
public Map<String,Role> getGroupRolesWithTitles(UUID groupId) throws Exception
getGroupRolesWithTitles
in interface EntityManager
Exception
public void addGroupToRole(UUID groupId, String roleName) throws Exception
addGroupToRole
in interface EntityManager
Exception
public void removeGroupFromRole(UUID groupId, String roleName) throws Exception
removeGroupFromRole
in interface EntityManager
Exception
public Set<String> getGroupPermissions(UUID groupId) throws Exception
getGroupPermissions
in interface EntityManager
Exception
public void grantGroupPermission(UUID groupId, String permission) throws Exception
grantGroupPermission
in interface EntityManager
Exception
public void revokeGroupPermission(UUID groupId, String permission) throws Exception
revokeGroupPermission
in interface EntityManager
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |