Interface OrganizationDatabase
- All Known Implementing Classes:
OrganizationDatabaseImpl
public interface OrganizationDatabase
API that defines persistent storage of organizations.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsOrganization(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.OrganizationgetOrganization(String orgId) Gets 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.voidstoreOrganization(org.opencastproject.security.api.Organization organization) Stores (or updates) an organization.
-
Method Details
-
getOrganizations
List<org.opencastproject.security.api.Organization> getOrganizations() throws OrganizationDatabaseExceptionReturns all organizations in persistent storage.- Returns:
- the list of stored organizations
- Throws:
OrganizationDatabaseException- if there is a problem communicating with the underlying data store
-
countOrganizations
Counts all organizations in persistent storage- Returns:
- the number of organizations
- Throws:
OrganizationDatabaseException- if there is a problem communicating with the underlying data store
-
getOrganization
org.opencastproject.security.api.Organization getOrganization(String orgId) throws OrganizationDatabaseException, org.opencastproject.util.NotFoundException Gets a single organization by its identifier.- Parameters:
orgId- the organization's identifier- Returns:
- the organization
- 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
-
getOrganizationByHost
org.opencastproject.security.api.Organization getOrganizationByHost(String host, int port) throws OrganizationDatabaseException, org.opencastproject.util.NotFoundException Gets a single organization by host and port.- 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
-
deleteOrganization
void deleteOrganization(String orgId) throws OrganizationDatabaseException, org.opencastproject.util.NotFoundException Removes an organization from persistent storage.- 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
-
storeOrganization
void storeOrganization(org.opencastproject.security.api.Organization organization) throws OrganizationDatabaseException Stores (or updates) an organization.- Parameters:
organization- the organization to store- Throws:
OrganizationDatabaseException- if there is a problem communicating with the underlying data store
-
containsOrganization
Returnstrueif the given organization by its identifier is found orfalseif not- Parameters:
orgId- the organization's identifier- Returns:
trueif found orfalseif not- Throws:
OrganizationDatabaseException- if there is a problem communicating with the underlying data store
-