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.getOrganization(String orgId) Gets a single organization by its identifier.getOrganizationByHost(String host, int port) Gets a single organization by host and port.Returns all organizations in persistent storage.voidstoreOrganization(Organization organization) Stores (or updates) an organization.
-
Method Details
-
getOrganizations
Returns 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
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 storeNotFoundException- if the organization with specified ID is not found
-
getOrganizationByHost
Organization getOrganizationByHost(String host, int port) throws OrganizationDatabaseException, 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 storeNotFoundException- if the organization with specified URL is not found
-
deleteOrganization
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 storeNotFoundException- if the organization with specified ID is not found
-
storeOrganization
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
-