Interface AppRegistryService

All Known Implementing Classes:
DefaultAppRegistryService

public interface AppRegistryService
Author:
Christian Tzolov, Chris Schaefer, Ilayaperumal Gopinathan
  • Method Details

    • getDefaultApp

      AppRegistration getDefaultApp(String name, ApplicationType type)
      Parameters:
      name - application name
      type - 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

      void validate(AppRegistration registration, String uri, String version)
      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 registration
      uri - uri of the registration
      version - version of the registration
    • setDefaultApp

      void setDefaultApp(String name, ApplicationType type, String version)
      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 name
      type - application type
      version - application version.
    • save

      AppRegistration save(String name, ApplicationType type, String version, URI uri, URI metadataUri)
      Saves a new AppRegistration identified by its name, type, version and URIs.
      Parameters:
      name - Name of the AppRegistration to save
      type - Type of the AppRegistration to save
      version - Version of the AppRegistration to save
      uri - Resource uri of the AppRegistration to save
      metadataUri - metadata of the AppRegistration to save
      Returns:
      the saved AppRegistration
    • delete

      void delete(String name, ApplicationType type, String version)
      Deletes an AppRegistration. If the AppRegistration does not exist, a NoSuchAppRegistrationException will be thrown.
      Parameters:
      name - Name of the AppRegistration to delete
      type - Type of the AppRegistration to delete
      version - Version of the AppRegistration to delete
    • deleteAll

      void deleteAll(Iterable<AppRegistration> appRegistrations)
      Deletes all provided AppRegistration's.
      Parameters:
      appRegistrations - the AppRegistrations that will be deleted
    • appExist

      boolean appExist(String name, ApplicationType type, String version)
      Checks if an AppRegistration with this name, type and version exists.
      Parameters:
      name - application name
      type - application type
      version - 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 type
      name - application name
      pageable - 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 type
      name - application name
      pageable - Pagination information
      Returns:
      returns the AppRegistrations that have the default version set to `true` and matches the given name and type. Uses the pagination.
    • appExist

      boolean appExist(String name, ApplicationType type)
      Checks if an application with such name and type exists and is set as default.
      Parameters:
      name - applicaiton name
      type - 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 name
      type - application typ
      Returns:
      the application with those name and type and default version
    • find

      default AppRegistration find(String name, ApplicationType type, String version)
      Parameters:
      name - application name
      type - application type
      version - application version
      Returns:
      the application with those name and type and default version
    • importAll

      List<AppRegistration> importAll(boolean overwrite, Resource... resources)
      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

      Resource getAppResource(AppRegistration appRegistration)
      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

      Resource getAppMetadataResource(AppRegistration appRegistration)
      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 an AppRegistration instance.
      Parameters:
      app - appRegistration to save
      Returns:
      the saved appRegistration
    • getResourceVersion

      String getResourceVersion(Resource resource)
      Parameters:
      resource - to retrieve the version for
      Returns:
      Returns the version for the provided resource
    • getResourceWithoutVersion

      String getResourceWithoutVersion(Resource resource)
      Returns a string representing the resource with version subtracted
      Parameters:
      resource - to be represented as string.
      Returns:
      String representation of the resource.
    • getResourceVersion

      String getResourceVersion(String uriString)
      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 type
      name - application name
      version - application version
      defaultVersion - application default version
      pageable - Pagination information
      Returns:
      returns all AppRegistration versions for given name and type. Uses the pagination.