Interface AppRegistryService
- All Known Implementing Classes:
DefaultAppRegistryService
public interface AppRegistryService
- Author:
- Christian Tzolov, Chris Schaefer, Ilayaperumal Gopinathan
-
Method Summary
Modifier and TypeMethodDescriptionboolean
appExist
(String name, ApplicationType type) Checks if an application with such name and type exists and is set as default.boolean
appExist
(String name, ApplicationType type, String version) Checks if anAppRegistration
with this name, type and version exists.void
delete
(String name, ApplicationType type, String version) Deletes anAppRegistration
.void
deleteAll
(Iterable<AppRegistration> appRegistrations) Deletes all providedAppRegistration
's.find
(String name, ApplicationType type) default AppRegistration
find
(String name, ApplicationType type, String version) findAll()
org.springframework.data.domain.Page<AppRegistration>
findAll
(org.springframework.data.domain.Pageable pageable) org.springframework.data.domain.Page<AppRegistration>
findAllByTypeAndNameIsLike
(ApplicationType type, String name, org.springframework.data.domain.Pageable pageable) org.springframework.data.domain.Page<AppRegistration>
findAllByTypeAndNameIsLikeAndDefaultVersionIsTrue
(ApplicationType type, String name, org.springframework.data.domain.Pageable pageable) org.springframework.data.domain.Page<AppRegistration>
findAllByTypeAndNameIsLikeAndVersionAndDefaultVersion
(ApplicationType type, String name, String version, boolean defaultVersion, org.springframework.data.domain.Pageable pageable) Returns all app registrations based on various optional parameters.getAppMetadataResource
(AppRegistration appRegistration) Converts application's metadata URI into Spring resource object.getAppResource
(AppRegistration appRegistration) Converts application's URI into Spring resource object.getDefaultApp
(String name, ApplicationType type) getResourceVersion
(String uriString) Returns the version for the given resource URI string.getResourceVersion
(Resource resource) getResourceWithoutVersion
(Resource resource) Returns a string representing the resource with version subtractedImport bulk of applications from input load filesSaves a newAppRegistration
identified by its name, type, version and URIs.save
(AppRegistration app) Save anAppRegistration
instance.void
setDefaultApp
(String name, ApplicationType type, String version) Set an application with name, type and version as the default for all name:type applications.void
validate
(AppRegistration registration, String uri, String version) Validate given registration with given uri and version.
-
Method Details
-
getDefaultApp
- Parameters:
name
- application nametype
- application version- Returns:
- the default application for this name:type pair. Returns null if no name:type application exists or if none of the name:type applications is set as default.
-
validate
Validate given registration with given uri and version. Validation will fail if given uri logically impossible to use with further expected logic with using versions.- Parameters:
registration
- app registrationuri
- uri of the registrationversion
- version of the registration
-
setDefaultApp
Set an application with name, type and version as the default for all name:type applications. The previous default name:type application is set to non-default.- Parameters:
name
- application nametype
- application typeversion
- application version.
-
save
Saves a newAppRegistration
identified by its name, type, version and URIs.- Parameters:
name
- Name of the AppRegistration to savetype
- Type of the AppRegistration to saveversion
- Version of the AppRegistration to saveuri
- Resource uri of the AppRegistration to savemetadataUri
- metadata of the AppRegistration to save- Returns:
- the saved AppRegistration
-
delete
Deletes anAppRegistration
. If theAppRegistration
does not exist, aNoSuchAppRegistrationException
will be thrown.- Parameters:
name
- Name of the AppRegistration to deletetype
- Type of the AppRegistration to deleteversion
- Version of the AppRegistration to delete
-
deleteAll
Deletes all providedAppRegistration
's.- Parameters:
appRegistrations
- theAppRegistration
s that will be deleted
-
appExist
Checks if anAppRegistration
with this name, type and version exists.- Parameters:
name
- application nametype
- application typeversion
- application version.- Returns:
- true if the AppRegistration exists, false otherwise.
-
findAll
org.springframework.data.domain.Page<AppRegistration> findAll(org.springframework.data.domain.Pageable pageable) - Parameters:
pageable
- Pagination information- Returns:
- returns all
AppRegistration
's including multiple version for the same application. Uses the pagination.
-
findAllByTypeAndNameIsLike
org.springframework.data.domain.Page<AppRegistration> findAllByTypeAndNameIsLike(ApplicationType type, String name, org.springframework.data.domain.Pageable pageable) - Parameters:
type
- appliation typename
- application namepageable
- Pagination information- Returns:
- returns all
AppRegistration
versions for given name and type. Uses the pagination.
-
findAllByTypeAndNameIsLikeAndDefaultVersionIsTrue
org.springframework.data.domain.Page<AppRegistration> findAllByTypeAndNameIsLikeAndDefaultVersionIsTrue(ApplicationType type, String name, org.springframework.data.domain.Pageable pageable) - Parameters:
type
- appliation typename
- application namepageable
- Pagination information- Returns:
- returns the
AppRegistration
s that have the default version set to `true` and matches the given name and type. Uses the pagination.
-
appExist
Checks if an application with such name and type exists and is set as default.- Parameters:
name
- applicaiton nametype
- applicaiton type- Returns:
- true if a default application with this name and type exists.
-
findAll
List<AppRegistration> findAll()- Returns:
- returns all
AppRegistration
's including multiple version for the same application.
-
find
- Parameters:
name
- application nametype
- application typ- Returns:
- the application with those name and type and default version
-
find
- Parameters:
name
- application nametype
- application typeversion
- application version- Returns:
- the application with those name and type and default version
-
importAll
Import bulk of applications from input load files- Parameters:
overwrite
- if set to true this command will override and existing application with same name:type:version If set to false operation will throw an exception in the application already exists.resources
- list of input load files- Returns:
- list of application being imported
-
getAppResource
Converts application's URI into Spring resource object. Supports File:, Http:, Maven: and Docker: schemas- Parameters:
appRegistration
- the application registration- Returns:
- Returns
Resource
instance that corresponds to application's URI
-
getAppMetadataResource
Converts application's metadata URI into Spring resource object. Supports File:, Http:, Maven: and Docker: schemas- Parameters:
appRegistration
- the application registration- Returns:
- Returns
Resource
instance that corresponds to application's metdata URI
-
save
Save anAppRegistration
instance.- Parameters:
app
- appRegistration to save- Returns:
- the saved appRegistration
-
getResourceVersion
- Parameters:
resource
- to retrieve the version for- Returns:
- Returns the version for the provided resource
-
getResourceWithoutVersion
Returns a string representing the resource with version subtracted- Parameters:
resource
- to be represented as string.- Returns:
- String representation of the resource.
-
getResourceVersion
Returns the version for the given resource URI string.- Parameters:
uriString
- String representation of the resource URI- Returns:
- the resource version
-
findAllByTypeAndNameIsLikeAndVersionAndDefaultVersion
org.springframework.data.domain.Page<AppRegistration> findAllByTypeAndNameIsLikeAndVersionAndDefaultVersion(@Nullable ApplicationType type, @Nullable String name, @Nullable String version, boolean defaultVersion, org.springframework.data.domain.Pageable pageable) Returns all app registrations based on various optional parameters.- Parameters:
type
- application typename
- application nameversion
- application versiondefaultVersion
- application default versionpageable
- Pagination information- Returns:
- returns all
AppRegistration
versions for given name and type. Uses the pagination.
-