org.springframework.cloud.dataflow.rest.client

## Class AppRegistryTemplate

- java.lang.Object
- - org.springframework.cloud.dataflow.rest.client.AppRegistryTemplate

- All Implemented Interfaces:
    AppRegistryOperations

      public class AppRegistryTemplate
      extends Object
      implements AppRegistryOperations

  Implementation of `AppRegistryOperations` that uses `RestTemplate` to issue commands to the Data Flow server.
  Author:
    Eric Bottard, Glenn Renfro, Mark Fisher, Gunnar Hillert, Patrick Peralta, Christian Tzolov, Chris Schaefer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected org.springframework.web.client.RestTemplate` | `restTemplate` Template used for http interaction.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AppRegistryTemplate(org.springframework.web.client.RestTemplate restTemplate, org.springframework.hateoas.RepresentationModel<?> resourceSupport)` Construct a `AppRegistryTemplate` object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.springframework.hateoas.PagedModel<AppRegistrationResource>` | `importFromResource(String uri, boolean force)` Register all applications listed in a properties file.
    `DetailedAppRegistrationResource` | `info(String name, ApplicationType type, boolean exhaustive)` Retrieve information about an application registration.
    `DetailedAppRegistrationResource` | `info(String name, ApplicationType type, String version, boolean exhaustive)` Retrieve information about an application registration.
    `org.springframework.hateoas.PagedModel<AppRegistrationResource>` | `list()` Return a list of all application registrations.
    `org.springframework.hateoas.PagedModel<AppRegistrationResource>` | `list(ApplicationType type)` Return a list of all application registrations for the given `ApplicationType`.
    `void` | `makeDefault(String name, ApplicationType type, String version)` Set application version to default
    `AppRegistrationResource` | `register(String name, ApplicationType type, String uri, String metadataUri, boolean force)` Register an application name and type with its Maven coordinates.
    `AppRegistrationResource` | `register(String name, ApplicationType type, String version, String uri, String metadataUri, boolean force)` Register an application name, type and version with its Maven coordinates.
    `org.springframework.hateoas.PagedModel<AppRegistrationResource>` | `registerAll(Properties apps, boolean force)` Register all applications provided as key/value pairs.
    `void` | `unregister(String name, ApplicationType applicationType)` Unregister an application name and type.
    `void` | `unregister(String name, ApplicationType applicationType, String version)` Unregister an application by name type and version
    `void` | `unregisterAll()` Unregister all applications.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### restTemplate

          protected org.springframework.web.client.RestTemplate restTemplate

      Template used for http interaction.

  - ### Constructor Detail

    - #### AppRegistryTemplate

          public AppRegistryTemplate(org.springframework.web.client.RestTemplate restTemplate,
                                     org.springframework.hateoas.RepresentationModel<?> resourceSupport)

      Construct a `AppRegistryTemplate` object.
      Parameters:
        `restTemplate` - template for HTTP/rest commands
        `resourceSupport` - HATEOAS link support

  - ### Method Detail

    - #### list

          public org.springframework.hateoas.PagedModel<AppRegistrationResource> list()

      Description copied from interface: `AppRegistryOperations`
      Return a list of all application registrations.
      Specified by:
        `list` in interface `AppRegistryOperations`
      Returns:
        list of all application registrations

    - #### list

          public org.springframework.hateoas.PagedModel<AppRegistrationResource> list(ApplicationType type)

      Description copied from interface: `AppRegistryOperations`
      Return a list of all application registrations for the given `ApplicationType`.
      Specified by:
        `list` in interface `AppRegistryOperations`
      Parameters:
        `type` - application type for which to return a list of registrations
      Returns:
        list of all application registrations for the given application type

    - #### unregister

          public void unregister(String name,
                                 ApplicationType applicationType)

      Description copied from interface: `AppRegistryOperations`
      Unregister an application name and type.
      Specified by:
        `unregister` in interface `AppRegistryOperations`
      Parameters:
        `name` - application name
        `applicationType` - application type

    - #### unregister

          public void unregister(String name,
                                 ApplicationType applicationType,
                                 String version)

      Description copied from interface: `AppRegistryOperations`
      Unregister an application by name type and version
      Specified by:
        `unregister` in interface `AppRegistryOperations`
      Parameters:
        `name` - application name
        `applicationType` - application type
        `version` - application version

    - #### unregisterAll

          public void unregisterAll()

      Description copied from interface: `AppRegistryOperations`
      Unregister all applications.
      Specified by:
        `unregisterAll` in interface `AppRegistryOperations`

    - #### info

          public DetailedAppRegistrationResource info(String name,
                                                      ApplicationType type,
                                                      boolean exhaustive)

      Description copied from interface: `AppRegistryOperations`
      Retrieve information about an application registration.
      Specified by:
        `info` in interface `AppRegistryOperations`
      Parameters:
        `name` - name of application
        `type` - application type
        `exhaustive` - return all metadata, including common Spring Boot properties
      Returns:
        detailed information about an application registration

    - #### info

          public DetailedAppRegistrationResource info(String name,
                                                      ApplicationType type,
                                                      String version,
                                                      boolean exhaustive)

      Description copied from interface: `AppRegistryOperations`
      Retrieve information about an application registration.
      Specified by:
        `info` in interface `AppRegistryOperations`
      Parameters:
        `name` - name of application
        `type` - application type
        `version` - application version
        `exhaustive` - return all metadata, including common Spring Boot properties
      Returns:
        detailed information about an application registration

    - #### register

          public AppRegistrationResource register(String name,
                                                  ApplicationType type,
                                                  String uri,
                                                  String metadataUri,
                                                  boolean force)

      Description copied from interface: `AppRegistryOperations`
      Register an application name and type with its Maven coordinates.
      Specified by:
        `register` in interface `AppRegistryOperations`
      Parameters:
        `name` - application name
        `type` - application type
        `uri` - URI for the application artifact
        `metadataUri` - URI for the application metadata artifact
        `force` - if `true`, overwrites a pre-existing registration
      Returns:
        the new app registration

    - #### register

          public AppRegistrationResource register(String name,
                                                  ApplicationType type,
                                                  String version,
                                                  String uri,
                                                  String metadataUri,
                                                  boolean force)

      Description copied from interface: `AppRegistryOperations`
      Register an application name, type and version with its Maven coordinates.
      Specified by:
        `register` in interface `AppRegistryOperations`
      Parameters:
        `name` - application name
        `type` - application type
        `version` - application version
        `uri` - URI for the application artifact
        `metadataUri` - URI for the application metadata artifact
        `force` - if `true`, overwrites a pre-existing registration
      Returns:
        the new app registration

    - #### importFromResource

          public org.springframework.hateoas.PagedModel<AppRegistrationResource> importFromResource(String uri,
                                                                                                    boolean force)

      Description copied from interface: `AppRegistryOperations`
      Register all applications listed in a properties file.
      Specified by:
        `importFromResource` in interface `AppRegistryOperations`
      Parameters:
        `uri` - URI for the properties file
        `force` - if `true`, overwrites any pre-existing registrations
      Returns:
        the paged list of new app registrations

    - #### registerAll

          public org.springframework.hateoas.PagedModel<AppRegistrationResource> registerAll(Properties apps,
                                                                                             boolean force)

      Description copied from interface: `AppRegistryOperations`
      Register all applications provided as key/value pairs.
      Specified by:
        `registerAll` in interface `AppRegistryOperations`
      Parameters:
        `apps` - the apps as key/value pairs where key is "type.name" and value is a URI
        `force` - if `true`, overwrites any pre-existing registrations
      Returns:
        the paged list of new app registrations

    - #### makeDefault

          public void makeDefault(String name,
                                  ApplicationType type,
                                  String version)

      Description copied from interface: `AppRegistryOperations`
      Set application version to default
      Specified by:
        `makeDefault` in interface `AppRegistryOperations`
      Parameters:
        `name` - application name
        `type` - application type
        `version` - application version

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