oracle.adf.view.rich.remote

## Class RemoteApplicationUtils

- java.lang.Object
- - oracle.adf.view.rich.remote.RemoteApplicationUtils

-     @Exported
      public class RemoteApplicationUtils
      extends Object

  This is the workhorse of the Remote Application subsystem. It allows someone to make a connection to a remote server.
  Since:
    12.1.4.0

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `applyRawResponse(javax.faces.context.FacesContext fc, RemoteApplicationResponse response)` Copies a raw RemoteApplicationResponse to the current response on the external context.
    `static AuthorizationProvider` | `getAuthorizationProvider()` Either instantiates and returns the configured Authorization Provider, a cached AuthorizationProvider, or a defult `null` implementation of an Authorization Provider.
    `static void` | `invalidate(RemoteApplication app)` Invalidate the remote application in the framework by expiring the session.
    `static boolean` | `isRemote()` Returns `true` if the current taskflow is being run as a remote producer.
    `static RemoteApplicationResponse` | `run(RemoteApplicationRequest req)` Executes a RemoteApplicationRequest on a remote server and returns a RemoteApplicationResponse.

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

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

- - ### Method Detail

    - #### isRemote

          public static boolean isRemote()

      Returns `true` if the current taskflow is being run as a remote producer.
      Returns:
        `true` if we are running as a remote producer and `false` if we are not

    - #### run

          public static RemoteApplicationResponse run(RemoteApplicationRequest req)

      Executes a RemoteApplicationRequest on a remote server and returns a RemoteApplicationResponse. This method handles application of the `AuthorizationProvider` as well as some of the complexities of session/sub-session management and should be considered thread-safe.

      There are also a few context paramaters which effect the functioning of this utility method. They are as follows:

      - `oracle.adf.view.rich.remote.CONTENT_COMPRESSION` contains a "on/off" value which tells whether this system supports content compression over the httpRequest. Generally this would be a good thing but may make it harder to debug the stream and might impact performance negatively for testing. The default value for this setting is 'on'.
      - `oracle.adf.view.rich.remote.SERVER_MAX_REDIRECTS` contains the maximum number of redirects that can be followed to retrieve the remote page. Generally speaking I would expect this value to be relatively small. These redirects are redirects needed to actually access the resource, they are not redirects within the taskflow itself. Default is '0'.
      - `oracle.adf.view.rich.remote.AUTH_PROVIDER` specifies the authorization provider that needs to be used. ADF Provides a simple authorization provider or other providers (such as webcenter's authorization provider) may be added here. By default this system will return a `null` authorization provider which does not actually do any authorization.
      Parameters:
        `req` - the RemoteApplicationRequest to run
      Returns:
        a RemoteApplicationResponse containing the response from the producer.

    - #### invalidate

          public static void invalidate(RemoteApplication app)

      Invalidate the remote application in the framework by expiring the session. If the provided Application is a `RemoteApplicationInstance` then only that instance will be invalidated and the session cleaned up. If the provided object is a `RemoteApplication` then every `RemoteApplicationInstance` on that server will be invalidated.
      Parameters:
        `app` - the `RemoteApplication` or `RemoteApplicationInstance` you wish to invalidate

    - #### applyRawResponse

          public static void applyRawResponse(javax.faces.context.FacesContext fc,
                                              RemoteApplicationResponse response)
                                       throws IOException

      Copies a raw RemoteApplicationResponse to the current response on the external context. This is typically used in writing a resource from the producer to the consumer.
      Parameters:
        `fc` - the FacesContext
        `response` - the RAW RemoteApplicationResponse
      Throws:
        `IllegalArgumentException` - if the RemoteApplicationResponse is not of type RAW or if the ExternalContext does not contain an HttpServletRequest.
        `IOException` - if the ExternalContext or the RemoteApplicaitonResponse is null

    - #### getAuthorizationProvider

          public static AuthorizationProvider getAuthorizationProvider()

      Either instantiates and returns the configured Authorization Provider, a cached AuthorizationProvider, or a defult `null` implementation of an Authorization Provider.
      Returns:
        The Authorization Provider.

Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.