Interface OrganizationDatabase

All Known Implementing Classes:
OrganizationDatabaseImpl

public interface OrganizationDatabase
API that defines persistent storage of organizations.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if the given organization by its identifier is found or false if not
    int
    Counts all organizations in persistent storage
    void
    Removes an organization from persistent storage.
    org.opencastproject.security.api.Organization
    Gets a single organization by its identifier.
    org.opencastproject.security.api.Organization
    getOrganizationByHost(String host, int port)
    Gets a single organization by host and port.
    List<org.opencastproject.security.api.Organization>
    Returns all organizations in persistent storage.
    void
    storeOrganization(org.opencastproject.security.api.Organization organization)
    Stores (or updates) an organization.
  • Method Details

    • getOrganizations

      List<org.opencastproject.security.api.Organization> getOrganizations() throws OrganizationDatabaseException
      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

      int countOrganizations() throws OrganizationDatabaseException
      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 store
      org.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 host
      port - the organization's port
      Returns:
      the organization
      Throws:
      OrganizationDatabaseException - if there is a problem communicating with the underlying data store
      org.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 store
      org.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

      boolean containsOrganization(String orgId) throws OrganizationDatabaseException
      Returns true if the given organization by its identifier is found or false if not
      Parameters:
      orgId - the organization's identifier
      Returns:
      true if found or false if not
      Throws:
      OrganizationDatabaseException - if there is a problem communicating with the underlying data store