Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1.9.0)
E52936-01


oracle.adf.view.rich.remote
Class RemoteApplicationResponseGenerator

java.lang.Object
  extended by oracle.adf.view.rich.remote.RemoteApplicationResponseGenerator


public final class RemoteApplicationResponseGenerator
extends java.lang.Object

Generates various types of RemoteApplicationResponses. Sometimes when using the RemoteApplicationFramework, it might be advantagous to pass around the RemoteApplicationResponse object to indicate the result of a particular connection. If things go wrong on the consumer side during this request, however, it would be advantagous to be able to generate a RemoteApplicationResponse indicating the failure. <p/> Additionally, extensions to the Scotty framework on the producer side may generate responses of thier own. This utility will help in the generation of RemoteApplicationResponse objects such that they are implemented consistantly across the framework.

Since:
11.1.1.7.3

Constructor Summary
RemoteApplicationResponseGenerator()
           

 

Method Summary
static RemoteApplicationResponse getEmptyResponse(RemoteApplicationInstance app)
          Returns an empty "OK" response with a given RemoteApplicationInstance
static RemoteApplicationResponse getErrorResponse(ErrorResult.Source source, RemoteApplicationInstance instance, java.lang.String message, java.lang.Throwable cause)
          Returns a RemoteApplicationResponse of RemoteApplicationResponse.Status.ERROR and RemoteApplicationResponse.Type.OBJECT.
static RemoteApplicationResponse getErrorResponse(RemoteApplicationInstance instance, java.lang.String message, java.lang.Throwable cause)
          Returns a RemoteApplicationResponse of RemoteApplicationResponse.Status.ERROR and RemoteApplicationResponse.Type.OBJECT.
static RemoteApplicationResponse getErrorResponse(RemoteApplicationInstance instance, java.lang.Throwable cause)
          Returns a RemoteApplicationResponse of RemoteApplicationResponse.Status.ERROR and RemoteApplicationResponse.Type.OBJECT.
static RemoteApplicationResponse getErrorResponse(RemoteApplicationResponse resp, java.lang.Throwable cause)
          This returns a RemoteApplicationError response given another response and the Error.
static RemoteApplicationResponse getErrorResponse(java.lang.String message, java.lang.Throwable cause)
          Returns a RemoteApplicationResponse of RemoteApplicationResponse.Status.ERROR and RemoteApplicationResponse.Type.OBJECT.
static RemoteApplicationResponse getErrorResponse(java.lang.Throwable cause)
          Returns a RemoteApplicationResponse of RemoteApplicationResponse.Status.ERROR and RemoteApplicationResponse.Type.OBJECT.
static RemoteApplicationResponse getTaskErrorResponse(RemoteApplicationInstance instance, java.lang.String task, java.lang.String message, java.lang.Throwable t)
          Returns a task error response from the producer.
static RemoteApplicationResponse getTaskErrorResponse(RemoteApplicationInstance instance, java.lang.String task, java.lang.Throwable t)
           
static RemoteApplicationResponse getVersionMismatchResponse(java.lang.String version)
          Returns a new VersionMismatchResponse which signigies that the consumer and the producer do not have the same version.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

RemoteApplicationResponseGenerator

public RemoteApplicationResponseGenerator()

Method Detail

getErrorResponse

public static RemoteApplicationResponse getErrorResponse(java.lang.Throwable cause)
Returns a RemoteApplicationResponse of RemoteApplicationResponse.Status.ERROR and RemoteApplicationResponse.Type.OBJECT. This response will return a result of type ErrorResult with the supplied cause and a message which is the result of the localized message on the throwable and then from the normal exception message if any are provided. <p/> The source of the ErrorResult is automatically determined using the result of RemoteApplicationUtils.isRemote().
Parameters:
cause - the cause of the error. This property must not be null
Returns:
the appropriate RemoteApplicationResponse
Throws:
java.lang.IllegalArgumentException - if the cause attribute is null

getErrorResponse

public static RemoteApplicationResponse getErrorResponse(java.lang.String message,
                                                         java.lang.Throwable cause)
Returns a RemoteApplicationResponse of RemoteApplicationResponse.Status.ERROR and RemoteApplicationResponse.Type.OBJECT. This response will return a result of type ErrorResult with the supplied cause and a message which is the result of the localized message on the throwable and then from the normal exception message if any are provided. The source of the ErrorResult is automatically determined using the result of RemoteApplicationUtils.isRemote(). <p/> If the message is null, the result of ErrorResult.getMessage() will be taken first from the localized message on the throwable and then from the normal exception message if any are provided.
Parameters:
message - a special message to include with the error response
cause - the cause of the error. This property must not be null
Returns:
the appropriate RemoteApplicationResponse
Throws:
java.lang.IllegalArgumentException - if the cause attribute is null

getErrorResponse

public static RemoteApplicationResponse getErrorResponse(RemoteApplicationInstance instance,
                                                         java.lang.Throwable cause)
Returns a RemoteApplicationResponse of RemoteApplicationResponse.Status.ERROR and RemoteApplicationResponse.Type.OBJECT. This response will return a result of type ErrorResult with the supplied cause and a message which is the result of the localized message on the throwable and then from the normal exception message if any are provided. The source of the ErrorResult is automatically determined using the result of RemoteApplicationUtils.isRemote().
Parameters:
instance - the current RemoteApplicationInstance if there is one
cause - the cause of the error. This property must not be null
Returns:
the appropriate RemoteApplicationResponse
Throws:
java.lang.IllegalArgumentException - if the cause attribute is null

getErrorResponse

public static RemoteApplicationResponse getErrorResponse(RemoteApplicationInstance instance,
                                                         java.lang.String message,
                                                         java.lang.Throwable cause)
Returns a RemoteApplicationResponse of RemoteApplicationResponse.Status.ERROR and RemoteApplicationResponse.Type.OBJECT. This response will return a result of type ErrorResult with the supplied message and cause. The source of the ErrorResult is automatically determined using the result of RemoteApplicationUtils.isRemote(). <p/> If the message is null, the result of ErrorResult.getMessage() will be taken first from the localized message on the throwable and then from the normal exception message if any are provided.
Parameters:
instance - the current RemoteApplicationInstance if there is one
message - a special message to include with the error response
cause - the cause of the error. This property must not be null
Returns:
the appropriate RemoteApplicationResponse
Throws:
java.lang.IllegalArgumentException - if the cause attribute is null

getErrorResponse

public static RemoteApplicationResponse getErrorResponse(ErrorResult.Source source,
                                                         RemoteApplicationInstance instance,
                                                         java.lang.String message,
                                                         java.lang.Throwable cause)
Returns a RemoteApplicationResponse of RemoteApplicationResponse.Status.ERROR and RemoteApplicationResponse.Type.OBJECT. This response will return a result of type ErrorResult with the supplied source, message and cause. <p/> If the message is null, the result of ErrorResult.getMessage() will be taken first from the localized message on the throwable and then from the normal exception message if any are provided.
Parameters:
source - the source of this error response. This property must not be null
instance - the current RemoteApplicationInstance if there is one
message - a special message to include with the error response
cause - the cause of the error. This property must not be null
Returns:
the appropriate RemoteApplicationResponse
Throws:
java.lang.IllegalArgumentException - if either source or cause attributes are null

getErrorResponse

public static RemoteApplicationResponse getErrorResponse(RemoteApplicationResponse resp,
                                                         java.lang.Throwable cause)
This returns a RemoteApplicationError response given another response and the Error. This response will have all of the task handler responses of the origional.
Parameters:
resp -
t -
Returns:

getVersionMismatchResponse

public static RemoteApplicationResponse getVersionMismatchResponse(java.lang.String version)
Returns a new VersionMismatchResponse which signigies that the consumer and the producer do not have the same version.
Parameters:
version - a string containing the version of the remote container
Returns:
a VerdsionMistmatch type response

getEmptyResponse

public static RemoteApplicationResponse getEmptyResponse(RemoteApplicationInstance app)
Returns an empty "OK" response with a given RemoteApplicationInstance
Parameters:
app -
Returns:

getTaskErrorResponse

public static RemoteApplicationResponse getTaskErrorResponse(RemoteApplicationInstance instance,
                                                             java.lang.String task,
                                                             java.lang.String message,
                                                             java.lang.Throwable t)
Returns a task error response from the producer. This type of response is needed when an exception is raised during task execution.
Parameters:
task - the name of the task that caused the issue
instance - the RemoteApplicationInstance on the producer
message - on the TaskErrorResult
t - the "cause" in the TaskErrorResult
Returns:
a new RemoteApplicationResponse that represents this failure.

getTaskErrorResponse

public static RemoteApplicationResponse getTaskErrorResponse(RemoteApplicationInstance instance,
                                                             java.lang.String task,
                                                             java.lang.Throwable t)

Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1.9.0)
E52936-01


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