Interface ApplicationDao

All Known Implementing Classes:
MongoApplicationDao

public interface ApplicationDao
Created by patricktwohig on 7/10/15.
  • Method Details

    • createOrUpdateInactiveApplication

      Application createOrUpdateInactiveApplication(Application application)
      Creates a new application and inserts it into the database. The returned value represents the Application as it was inserted into the database.

      If the existing Application objects is int eh database however is flagged as hidden or inactive this will simply reinstate the old record.

      Parameters:
      application - the application
      Returns:
      the application instance as it was created
    • getActiveApplications

      Pagination<Application> getActiveApplications()
      Gets all active applications.
      Returns:
      a Pagination<Application> of all active Application instances
    • getActiveApplications

      Pagination<Application> getActiveApplications(int offset, int count)
      Gets the active applications registered in the databse given the offset and count.
      Parameters:
      offset - the offset
      count - the count
      Returns:
      a Pagination of Application instances
    • getActiveApplications

      Pagination<Application> getActiveApplications(int offset, int count, String search)
      Gets the active applications registered in the databse given the offset and count.
      Parameters:
      offset - the offset
      count - the count
      search - a query to filter the results
      Returns:
      a Pagination of Application instances
    • getActiveApplication

      default Application getActiveApplication(String nameOrId)
      Gets an application with the specific name or identifier. This will throw an instance of NotFoundException if the object cannot be found, or is inactive.
      Returns:
      an Application instance, never null
      Throws:
      NotFoundException - if the application is inactive or non-existent
    • findActiveApplication

      Optional<Application> findActiveApplication(String nameOrId)
      Finds an active Application with the supplied name or id.
      Parameters:
      nameOrId - the name or id
      Returns:
      an Optional of the Application
    • getActiveApplicationWithoutAttributes

      Application getActiveApplicationWithoutAttributes(String nameOrId)
      Extension of getActiveApplication with no attributes set. of NotFoundException if the object cannot be found, or is inactive.
      Returns:
      an Application instance, never null
      Throws:
      NotFoundException - if the application is inactive or non-existent
    • updateActiveApplication

      Application updateActiveApplication(String nameOrId, Application application)
      Updates an application with the specific name/identifiers. When changing the application name the ID must be specified.
      Parameters:
      nameOrId - the name, or id
      application - the Application object to write
      Returns:
      the Application object as it was persisted to the database.
      Throws:
      NotFoundException - if the application does not exist.
    • softDeleteApplication

      void softDeleteApplication(String nameOrId)
      Deletes an Application with the specific name or identifier. The application is no actually removed, but rather it is flagged as inactive to preserve any consistency with dependent data.
      Parameters:
      nameOrId - the name, or id