Class OrganizationDatabaseImpl
java.lang.Object
org.opencastproject.kernel.security.persistence.OrganizationDatabaseImpl
- All Implemented Interfaces:
OrganizationDatabase
Implements
OrganizationDatabase. Defines permanent storage for series.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.opencastproject.db.DBSessionprotected org.opencastproject.db.DBSessionFactoryprotected javax.persistence.EntityManagerFactoryFactory used to createEntityManagers for transactionsprotected org.opencastproject.security.api.SecurityServiceThe security service -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) CreatesEntityManagerFactoryusing persistence provider and properties passed via OSGi.booleancontainsOrganization(String orgId) Returnstrueif the given organization by its identifier is found orfalseif notintCounts all organizations in persistent storagevoiddeleteOrganization(String orgId) Removes an organization from persistent storage.org.opencastproject.security.api.OrganizationGets a single organization by its identifier.org.opencastproject.security.api.OrganizationgetOrganizationByHost(String host, int port) Gets a single organization by host and port.List<org.opencastproject.security.api.Organization> Returns all organizations in persistent storage.voidsetDBSessionFactory(org.opencastproject.db.DBSessionFactory dbSessionFactory) voidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) OSGi callback to set the security service.voidstoreOrganization(org.opencastproject.security.api.Organization org) Stores (or updates) an organization.
-
Field Details
-
emf
protected javax.persistence.EntityManagerFactory emfFactory used to createEntityManagers for transactions -
dbSessionFactory
protected org.opencastproject.db.DBSessionFactory dbSessionFactory -
db
protected org.opencastproject.db.DBSession db -
securityService
protected org.opencastproject.security.api.SecurityService securityServiceThe security service
-
-
Constructor Details
-
OrganizationDatabaseImpl
public OrganizationDatabaseImpl()
-
-
Method Details
-
setDBSessionFactory
public void setDBSessionFactory(org.opencastproject.db.DBSessionFactory dbSessionFactory) -
activate
public void activate(org.osgi.service.component.ComponentContext cc) CreatesEntityManagerFactoryusing persistence provider and properties passed via OSGi.- Parameters:
cc-
-
setSecurityService
public void setSecurityService(org.opencastproject.security.api.SecurityService securityService) OSGi callback to set the security service.- Parameters:
securityService- the securityService to set
-
deleteOrganization
public void deleteOrganization(String orgId) throws OrganizationDatabaseException, org.opencastproject.util.NotFoundException Description copied from interface:OrganizationDatabaseRemoves an organization from persistent storage.- Specified by:
deleteOrganizationin interfaceOrganizationDatabase- Parameters:
orgId- ID of the organization to be removed- Throws:
OrganizationDatabaseException- if there is a problem communicating with the underlying data storeorg.opencastproject.util.NotFoundException- if the organization with specified ID is not found- See Also:
-
storeOrganization
public void storeOrganization(org.opencastproject.security.api.Organization org) throws OrganizationDatabaseException Description copied from interface:OrganizationDatabaseStores (or updates) an organization.- Specified by:
storeOrganizationin interfaceOrganizationDatabase- Parameters:
org- the organization to store- Throws:
OrganizationDatabaseException- if there is a problem communicating with the underlying data store- See Also:
-
getOrganization
public org.opencastproject.security.api.Organization getOrganization(String id) throws org.opencastproject.util.NotFoundException, OrganizationDatabaseException Description copied from interface:OrganizationDatabaseGets a single organization by its identifier.- Specified by:
getOrganizationin interfaceOrganizationDatabase- Parameters:
id- the organization's identifier- Returns:
- the organization
- Throws:
org.opencastproject.util.NotFoundException- if the organization with specified ID is not foundOrganizationDatabaseException- if there is a problem communicating with the underlying data store- See Also:
-
countOrganizations
Description copied from interface:OrganizationDatabaseCounts all organizations in persistent storage- Specified by:
countOrganizationsin interfaceOrganizationDatabase- Returns:
- the number of organizations
- Throws:
OrganizationDatabaseException- if there is a problem communicating with the underlying data store- See Also:
-
getOrganizationByHost
public org.opencastproject.security.api.Organization getOrganizationByHost(String host, int port) throws OrganizationDatabaseException, org.opencastproject.util.NotFoundException Description copied from interface:OrganizationDatabaseGets a single organization by host and port.- Specified by:
getOrganizationByHostin interfaceOrganizationDatabase- Parameters:
host- the organization's hostport- the organization's port- Returns:
- the organization
- Throws:
OrganizationDatabaseException- if there is a problem communicating with the underlying data storeorg.opencastproject.util.NotFoundException- if the organization with specified URL is not found
-
getOrganizations
public List<org.opencastproject.security.api.Organization> getOrganizations() throws OrganizationDatabaseExceptionDescription copied from interface:OrganizationDatabaseReturns all organizations in persistent storage.- Specified by:
getOrganizationsin interfaceOrganizationDatabase- Returns:
- the list of stored organizations
- Throws:
OrganizationDatabaseException- if there is a problem communicating with the underlying data store- See Also:
-
containsOrganization
Description copied from interface:OrganizationDatabaseReturnstrueif the given organization by its identifier is found orfalseif not- Specified by:
containsOrganizationin interfaceOrganizationDatabase- Parameters:
orgId- the organization's identifier- Returns:
trueif found orfalseif not- Throws:
OrganizationDatabaseException- if there is a problem communicating with the underlying data store- See Also:
-