org.usergrid.persistence
Interface EntityManagerFactory

All Known Implementing Classes:
EntityManagerFactoryImpl

public interface EntityManagerFactory

The interface class that specifies the operations that can be performed on the Usergrid Datastore. This interface is designed to be implemented by different backends. Although these operations are meant to take advantage of the capabilities of Cassandra, they should be implementable using other relational databases such as MySql or NoSQL databases such as GAE or MongoDB.


Method Summary
 UUID createApplication(String organizationName, String name)
          Creates a new application.
 UUID createApplication(String organizationName, String name, Map<String,Object> properties)
          Creates a Application entity.
 boolean deleteServiceProperty(String name)
           
 Map<String,UUID> getApplications()
          Returns all the applications in the system.
 EntityManager getEntityManager(UUID applicationId)
          Gets the entity manager.
 String getImpementationDescription()
          A string description provided by the implementing class.
 Map<String,String> getServiceProperties()
           
 UUID importApplication(String organization, UUID applicationId, String name, Map<String,Object> properties)
           
 UUID lookupApplication(String name)
          Returns the application id for the application name.
 boolean setServiceProperty(String name, String value)
           
 void setup()
           
 boolean updateServiceProperties(Map<String,String> properties)
           
 

Method Detail

getImpementationDescription

String getImpementationDescription()
                                   throws Exception
A string description provided by the implementing class.

Returns:
description text
Throws:
Exception - the exception

getEntityManager

EntityManager getEntityManager(UUID applicationId)
Gets the entity manager.

Parameters:
applicationId - the application id
Returns:
EntityDao for the specfied parameters

createApplication

UUID createApplication(String organizationName,
                       String name)
                       throws Exception
Creates a new application.

Parameters:
name - a unique application name.
Returns:
the newly created application id.
Throws:
Exception - the exception

createApplication

UUID createApplication(String organizationName,
                       String name,
                       Map<String,Object> properties)
                       throws Exception
Creates a Application entity. All entities except for applications must be attached to a Application.

Parameters:
name - the name of the application to create.
properties - property values to create in the new entity or null.
Returns:
the newly created application id.
Throws:
Exception - the exception

importApplication

UUID importApplication(String organization,
                       UUID applicationId,
                       String name,
                       Map<String,Object> properties)
                       throws Exception
Throws:
Exception

lookupApplication

UUID lookupApplication(String name)
                       throws Exception
Returns the application id for the application name.

Parameters:
name - a unique application name.
Returns:
the Application id or null.
Throws:
Exception - the exception

getApplications

Map<String,UUID> getApplications()
                                 throws Exception
Returns all the applications in the system.

Returns:
all the applications.
Throws:
Exception - the exception

setup

void setup()
           throws Exception
Throws:
Exception

getServiceProperties

Map<String,String> getServiceProperties()

updateServiceProperties

boolean updateServiceProperties(Map<String,String> properties)

setServiceProperty

boolean setServiceProperty(String name,
                           String value)

deleteServiceProperty

boolean deleteServiceProperty(String name)


Copyright © 2013. All Rights Reserved.