Package dev.getelements.elements.sdk.dao
Interface ApplicationDao
- All Known Implementing Classes:
MongoApplicationDao
public interface ApplicationDao
Created by patricktwohig on 7/10/15.
-
Method Summary
Modifier and TypeMethodDescriptioncreateOrUpdateInactiveApplication(Application application) Creates a new application and inserts it into the database.findActiveApplication(String nameOrId) Finds an activeApplicationwith the supplied name or id.default ApplicationgetActiveApplication(String nameOrId) Gets an application with the specific name or identifier.Gets all active applications.getActiveApplications(int offset, int count) Gets the active applications registered in the databse given the offset and count.getActiveApplications(int offset, int count, String search) Gets the active applications registered in the databse given the offset and count.getActiveApplicationWithoutAttributes(String nameOrId) Extension of getActiveApplication with no attributes set.voidsoftDeleteApplication(String nameOrId) Deletes an Application with the specific name or identifier.updateActiveApplication(String nameOrId, Application application) Updates an application with the specific name/identifiers.
-
Method Details
-
createOrUpdateInactiveApplication
Creates a new application and inserts it into the database. The returned value represents theApplicationas it was inserted into the database.If the existing
Applicationobjects 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 activeApplicationinstances
-
getActiveApplications
Gets the active applications registered in the databse given the offset and count.- Parameters:
offset- the offsetcount- the count- Returns:
- a
PaginationofApplicationinstances
-
getActiveApplications
Gets the active applications registered in the databse given the offset and count.- Parameters:
offset- the offsetcount- the countsearch- a query to filter the results- Returns:
- a
PaginationofApplicationinstances
-
getActiveApplication
Gets an application with the specific name or identifier. This will throw an instance ofNotFoundExceptionif 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
Finds an activeApplicationwith the supplied name or id.- Parameters:
nameOrId- the name or id- Returns:
- an
Optionalof theApplication
-
getActiveApplicationWithoutAttributes
Extension of getActiveApplication with no attributes set. ofNotFoundExceptionif 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
Updates an application with the specific name/identifiers. When changing the application name the ID must be specified.- Parameters:
nameOrId- the name, or idapplication- theApplicationobject to write- Returns:
- the
Applicationobject as it was persisted to the database. - Throws:
NotFoundException- if the application does not exist.
-
softDeleteApplication
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
-