org.springframework.cloud.dataflow.registry.service

## Interface AppRegistryService

- All Known Implementing Classes:
    DefaultAppRegistryService

      public interface AppRegistryService

  Author:
    Christian Tzolov, Chris Schaefer, Ilayaperumal Gopinathan

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `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 an `AppRegistration` with this name, type and version exists.
    `void` | `delete(String name, ApplicationType type, String version)` Deletes an `AppRegistration`.
    `void` | `deleteAll(Iterable<AppRegistration> appRegistrations)` Deletes all provided `AppRegistration`'s.
    `AppRegistration` | `find(String name, ApplicationType type)`
    `default AppRegistration` | `find(String name, ApplicationType type, String version)`
    `List<AppRegistration>` | `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.
    `org.springframework.core.io.Resource` | `getAppMetadataResource(AppRegistration appRegistration)` Converts application's metadata URI into Spring resource object.
    `org.springframework.core.io.Resource` | `getAppResource(AppRegistration appRegistration)` Converts application's URI into Spring resource object.
    `AppRegistration` | `getDefaultApp(String name, ApplicationType type)`
    `String` | `getResourceVersion(org.springframework.core.io.Resource resource)`
    `String` | `getResourceVersion(String uriString)` Returns the version for the given resource URI string.
    `String` | `getResourceWithoutVersion(org.springframework.core.io.Resource resource)` Returns a string representing the resource with version subtracted
    `List<AppRegistration>` | `importAll(boolean overwrite, org.springframework.core.io.Resource... resources)` Import bulk of applications from input load files
    `AppRegistration` | `save(AppRegistration app)` Save an `AppRegistration` instance.
    `AppRegistration` | `save(String name, ApplicationType type, String version, URI uri, URI metadataUri)` Saves a new `AppRegistration` identified by its name, type, version and URIs.
    `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 Detail

    - #### 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 `AppRegistration`s 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 `AppRegistration`s 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

          AppRegistration find(String name,
                               ApplicationType type)

      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,
                                          org.springframework.core.io.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

          org.springframework.core.io.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

          org.springframework.core.io.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

          AppRegistration save(AppRegistration app)

      Save an `AppRegistration` instance.
      Parameters:
        `app` - appRegistration to save
      Returns:
        the saved appRegistration

    - #### getResourceVersion

          String getResourceVersion(org.springframework.core.io.Resource resource)

      Parameters:
        `resource` - to retrieve the version for
      Returns:
        Returns the version for the provided resource

    - #### getResourceWithoutVersion

          String getResourceWithoutVersion(org.springframework.core.io.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.

Copyright © 2021 Pivotal Software, Inc.. All rights reserved.