org.springframework.cloud.dataflow.shell.config

## Class DataFlowShell

- java.lang.Object
- - org.springframework.cloud.dataflow.shell.config.DataFlowShell

-     @Component
      public class DataFlowShell
      extends Object

  REST client component that holds all the available operations for communicating with the Spring Cloud Data Flow REST server.
  Author:
    Ilayaperumal Gopinathan, Gunnar Hillert

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataFlowShell()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `DataFlowOperations` | `getDataFlowOperations()`
    `boolean` | `hasAccess(RoleType role, OpsType opsType)` This method performs various access checks and only if `true` is returned, the shell should show the associated commands.
    `void` | `setDataFlowOperations(DataFlowOperations dataFlowOperations)`
    `void` | `setTargetHolder(TargetHolder targetHolder)`

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

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

- - ### Constructor Detail

    - #### DataFlowShell

          public DataFlowShell()

  - ### Method Detail

    - #### getDataFlowOperations

          public DataFlowOperations getDataFlowOperations()

    - #### setDataFlowOperations

          public void setDataFlowOperations(DataFlowOperations dataFlowOperations)

    - #### setTargetHolder

          @Autowired
          public void setTargetHolder(TargetHolder targetHolder)

    - #### hasAccess

          public boolean hasAccess(RoleType role,
                                   OpsType opsType)

      This method performs various access checks and only if `true` is returned, the shell should show the associated commands. 2 checks are performed:
      - Does the desired operation indicated by the `OpsType` exist?
      - If the operation exist, does the user have the necessary credentials?
      What are valid credentials? The way the passed-in `RoleType`s are treated depends on the servers security settings:
      - `Target.isAuthenticationEnabled()` Is authentication enabled?
      - `Target.isAuthenticated()` Is the user authenticated?
      - Only if `Target.isAuthenticated()` is `true` will the `RoleType` checked against `TargetCredentials.getRoles()`.
      Parameters:
        `role` - Can be null.
        `opsType` - Must not be null.
      Returns:
        If true the indicated operation is accessible and the user has all credentials to execute the operation.

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