Novell exteNd
Director 5.2 API

com.sssw.fw.api
Interface EbiResponse

All Known Subinterfaces:
EbiActionResponse, EbiHttpResponse, EbiRenderResponse

public interface EbiResponse

Defines constants for response phrase and response status.

A response type indicates the type of value the component will find in the response phrase. Values are are CONTENT, HTML, TEXT, and URL.

A response status is an HTTP status code, the same values that are defined as named constants in javax.servlet.http.HttpServletResponse.

1xx: Informational - Request received, continuing process

2xx: Success - The action was successfully received, understood, and accepted

3xx: Redirection - Further action must be taken in order to complete the request

4xx: Client Error - The request contains bad syntax or cannot be fulfilled

5xx: Server Error - The server failed to fulfill an apparently valid request

See Also:

Field Summary
static int CONTENT
          HTTP status code: Content.
static int HTML
          HTTP status code: HTML.
static int R000
          HTTP status code: unknown.
static int R100
          HTTP status code: unknown.
static int R101
          HTTP status code: Switching Protocols.
static int R200
          HTTP status code: OK, request succeeded.
static int R201
          HTTP status code: OK, new content created ( POST command ).
static int R202
          HTTP status code: Request accepted but processing not completed.
static int R203
          HTTP status code: OK, Non-Authoritative Information.
static int R204
          HTTP status code: OK, but no uri to return.
static int R205
          HTTP status code: OK, reset uri.
static int R206
          HTTP status code: OK, partial uri.
static int R300
          HTTP status code: Multiple Choices.
static int R301
          HTTP status code: Request content has been assigned a new permanent URL.
static int R302
          HTTP status code: Request content resides temporarily under a different URL.
static int R303
          HTTP status code: Document has not been modified ( conditional GET ).
static int R304
          HTTP status code: Not modified.
static int R305
          HTTP status code: Use proxy.
static int R307
          HTTP status code: Temporary redirect.
static int R400
          HTTP status code: Bad request.
static int R401
          HTTP status code: Unauthorized, request requires authorization.
static int R402
          HTTP status code: Payment required.
static int R403
          HTTP status code: Forbidden for unspecified reason.
static int R404
          HTTP status code: Not found.
static int R405
          HTTP status code: Method not allowed.
static int R406
          HTTP status code: Not acceptable.
static int R407
          HTTP status code: Proxy Authentication Requried.
static int R408
          HTTP status code: Request Time-out.
static int R409
          HTTP status code: Conflict.
static int R410
          HTTP status code: Gone.
static int R411
          HTTP status code: Length required.
static int R412
          HTTP status code: Precondition failed.
static int R413
          HTTP status code: Request entity too large.
static int R414
          HTTP status code: Request-URI too large.
static int R415
          HTTP status code: Unsupported media type.
static int R416
          HTTP status code: Requested range not satisfiable.
static int R417
          HTTP status code: Expectation failed.
static int R500
          HTTP status code: Internal server error.
static int R501
          HTTP status code: Not implemented.
static int R502
          HTTP status code: Bad gateway; invalid response from gateway or upstream server.
static int R503
          HTTP status code: Service temporarily unavailable.
static int R504
          HTTP status code: Gateway Time-out.
static int R505
          HTTP status code: HTTP Version not supported.
static int TEXT
          HTTP status code: Text.
static int URL
          HTTP status code: URL.
 
Method Summary
 boolean containsHeader(String key)
          Returns true if the specified key is found on the HttpServletResponseHeader.
 String getContentType()
          Returns the response content type
 EbiContext getContext()
          Deprecated. (since v5.0)
 HttpServletResponse getHttpServletResponse()
          Deprecated. (since v5.0) Use EbiHttpResponse.getHttpServletResponse()
 int getResponseType()
          Deprecated. (since v5.0)
 int getStatus()
          Deprecated. (since v5.0)
 String getType()
          Returns the type of respons
 boolean getUpdateHttpServletResponse()
          Deprecated.  
 boolean hasHttpServletResponse()
          Checks to see if this response has an HttpServletResponse.
 boolean isResponseType(int responseType)
          Deprecated. (since v5.0)
 boolean isStatus(int status)
          Deprecated. (since v5.0)
 void sendRedirect(String url)
          Sets the response to redirect to the passed in URL.
 void setContentType(String contentType)
          Sets the response content type.
 void setContext(EbiContext context)
          Deprecated. (since v5.0)
 void setDateHeader(String key, long value)
          Deprecated. (since v5.0)
 void setHeader(String key, String value)
          Set a key/value pair on the HttpServletResponse header.
 void setHttpServletResponse(HttpServletResponse httpServletResponse)
          Deprecated. (since v5.0)
 void setResponse(int responseCode, String responsePhrase)
          Set the response status and phrase Ignored by Portlet Reponses
 void setResponsePhrase(String responsePhrase)
          Deprecated. (Since v5.0) use EbiRequestContext.setResponsePhrase(String)
 void setResponseType(int responseType)
          Set the response type note: Ignored by Portlet Reponses
 void setStatus(int status)
          Sets the response status.
 void setUpdateHttpServletResponse(boolean updateHttpServletResponse)
          Deprecated. (since v5.0)
 

Field Detail

R000

public static final int R000
HTTP status code: unknown.
See Also:
javax.servlet.http.HttpServletResponse.

R100

public static final int R100
HTTP status code: unknown. Informational code, request was received, continuing process.
See Also:
javax.servlet.http.HttpServletResponse.

R101

public static final int R101
HTTP status code: Switching Protocols.
See Also:
javax.servlet.http.HttpServletResponse.

R200

public static final int R200
HTTP status code: OK, request succeeded. The action was successfully received, understood, and accepted.
See Also:
javax.servlet.http.HttpServletResponse.

R201

public static final int R201
HTTP status code: OK, new content created ( POST command ).
See Also:
javax.servlet.http.HttpServletResponse.

R202

public static final int R202
HTTP status code: Request accepted but processing not completed.
See Also:
javax.servlet.http.HttpServletResponse.

R203

public static final int R203
HTTP status code: OK, Non-Authoritative Information.
See Also:
javax.servlet.http.HttpServletResponse.

R204

public static final int R204
HTTP status code: OK, but no uri to return.
See Also:
javax.servlet.http.HttpServletResponse.

R205

public static final int R205
HTTP status code: OK, reset uri.
See Also:
javax.servlet.http.HttpServletResponse.

R206

public static final int R206
HTTP status code: OK, partial uri.
See Also:
javax.servlet.http.HttpServletResponse.

R300

public static final int R300
HTTP status code: Multiple Choices. Further action must be taken in order to complete the request.
See Also:
javax.servlet.http.HttpServletResponse.

R301

public static final int R301
HTTP status code: Request content has been assigned a new permanent URL.
See Also:
javax.servlet.http.HttpServletResponse.

R302

public static final int R302
HTTP status code: Request content resides temporarily under a different URL.
See Also:
javax.servlet.http.HttpServletResponse.

R303

public static final int R303
HTTP status code: Document has not been modified ( conditional GET ).
See Also:
javax.servlet.http.HttpServletResponse.

R304

public static final int R304
HTTP status code: Not modified.
See Also:
javax.servlet.http.HttpServletResponse.

R305

public static final int R305
HTTP status code: Use proxy.
See Also:
javax.servlet.http.HttpServletResponse.

R307

public static final int R307
HTTP status code: Temporary redirect.
See Also:
javax.servlet.http.HttpServletResponse.

R400

public static final int R400
HTTP status code: Bad request. Client Error - The request contains bad syntax or cannot be fulfilled.
See Also:
javax.servlet.http.HttpServletResponse.

R401

public static final int R401
HTTP status code: Unauthorized, request requires authorization.
See Also:
javax.servlet.http.HttpServletResponse.

R402

public static final int R402
HTTP status code: Payment required.
See Also:
javax.servlet.http.HttpServletResponse.

R403

public static final int R403
HTTP status code: Forbidden for unspecified reason.
See Also:
javax.servlet.http.HttpServletResponse.

R404

public static final int R404
HTTP status code: Not found.
See Also:
javax.servlet.http.HttpServletResponse.

R405

public static final int R405
HTTP status code: Method not allowed.
See Also:
javax.servlet.http.HttpServletResponse.

R406

public static final int R406
HTTP status code: Not acceptable.
See Also:
javax.servlet.http.HttpServletResponse.

R407

public static final int R407
HTTP status code: Proxy Authentication Requried.
See Also:
javax.servlet.http.HttpServletResponse.

R408

public static final int R408
HTTP status code: Request Time-out.
See Also:
javax.servlet.http.HttpServletResponse.

R409

public static final int R409
HTTP status code: Conflict.
See Also:
javax.servlet.http.HttpServletResponse.

R410

public static final int R410
HTTP status code: Gone.
See Also:
javax.servlet.http.HttpServletResponse.

R411

public static final int R411
HTTP status code: Length required.
See Also:
javax.servlet.http.HttpServletResponse.

R412

public static final int R412
HTTP status code: Precondition failed.
See Also:
javax.servlet.http.HttpServletResponse.

R413

public static final int R413
HTTP status code: Request entity too large.
See Also:
javax.servlet.http.HttpServletResponse.

R414

public static final int R414
HTTP status code: Request-URI too large.
See Also:
javax.servlet.http.HttpServletResponse.

R415

public static final int R415
HTTP status code: Unsupported media type.
See Also:
javax.servlet.http.HttpServletResponse.

R416

public static final int R416
HTTP status code: Requested range not satisfiable.
See Also:
javax.servlet.http.HttpServletResponse.

R417

public static final int R417
HTTP status code: Expectation failed.
See Also:
javax.servlet.http.HttpServletResponse.

R500

public static final int R500
HTTP status code: Internal server error. Server Error - The server failed to fulfill an apparently valid request.
See Also:
javax.servlet.http.HttpServletResponse.

R501

public static final int R501
HTTP status code: Not implemented.
See Also:
javax.servlet.http.HttpServletResponse.

R502

public static final int R502
HTTP status code: Bad gateway; invalid response from gateway or upstream server.
See Also:
javax.servlet.http.HttpServletResponse.

R503

public static final int R503
HTTP status code: Service temporarily unavailable.
See Also:
javax.servlet.http.HttpServletResponse.

R504

public static final int R504
HTTP status code: Gateway Time-out.
See Also:
javax.servlet.http.HttpServletResponse.

R505

public static final int R505
HTTP status code: HTTP Version not supported.
See Also:
javax.servlet.http.HttpServletResponse.

CONTENT

public static final int CONTENT
HTTP status code: Content.
See Also:
javax.servlet.http.HttpServletResponse.

TEXT

public static final int TEXT
HTTP status code: Text.
See Also:
javax.servlet.http.HttpServletResponse.

URL

public static final int URL
HTTP status code: URL.
See Also:
javax.servlet.http.HttpServletResponse.

HTML

public static final int HTML
HTTP status code: HTML.
See Also:
javax.servlet.http.HttpServletResponse.
Method Detail

getHttpServletResponse

public HttpServletResponse getHttpServletResponse()
Deprecated. (since v5.0) Use EbiHttpResponse.getHttpServletResponse()

Returns the HttpServletResponse

The wrapped response may not implement EbiHttpResponse here is an example of the proper code to use:

   EbiResponse res = ctxt.getEbiResponse();
   if (res instanceof EbiHttpResponse){
     HttpServletResponse hres = ((EbiHttpResponse)res).getHttpServletResponse();
   }
 
Returns:
HttpServletResponse

setHttpServletResponse

public void setHttpServletResponse(HttpServletResponse httpServletResponse)
Deprecated. (since v5.0)

Sets the HttpServletResponse from passed parameter.

Use the proper factory to create and set the response. for example

com.sssw.fw.factory.EboFactory.createEbinContext(req,res)
Parameters:
httpServletResponse -  

hasHttpServletResponse

public boolean hasHttpServletResponse()
Checks to see if this response has an HttpServletResponse.

returns true if the response object implement EbiHttpResponse and the wrapped HttpServletResponse is not null

Returns:
true if this response has an HttpServletResponse.

getType

public String getType()
Returns the type of respons

TYPE_RENDER, TYPE_ACTION, TYPE_HTTP

Returns:
a string represnetation of the type of response

getUpdateHttpServletResponse

public boolean getUpdateHttpServletResponse()
Deprecated.  

Returns true if HttpServletResponse is updated.

Out dated and no longer used

Returns:
true if HttpServletResponse is updated.

setUpdateHttpServletResponse

public void setUpdateHttpServletResponse(boolean updateHttpServletResponse)
Deprecated. (since v5.0)

Set the updateHttpServletResponse flag
Parameters:
updateHttpServletResponse - indicator of status for updateHttpServletResponse flag.

sendRedirect

public void sendRedirect(String url)
Sets the response to redirect to the passed in URL.

To be sure that the response supports a redirect use the following code

   EbiResponse res = ctxt.getEbiResponse();
   if (!res instanceof EbiRenderResponse}){
     res.sendRedirect
   }
 
javax.poretlet.RenderResponse does not support a redirect
Parameters:
url - Redirects user to given URL

setContentType

public void setContentType(String contentType)
Sets the response content type.
Parameters:
contentType - the responses content type.

getContentType

public String getContentType()
Returns the response content type

Note: EbiActionResponse does not support this method and will throw an Unsupported exception

Returns:
name of the response content type.

getContext

public EbiContext getContext()
Deprecated. (since v5.0)

Return the EbiContext for the response.

Note: EbiActionResponse does not support this method and will throw an Unsupported exception

Returns:
An EbiContext associated with the response.

setContext

public void setContext(EbiContext context)
Deprecated. (since v5.0)

Sets the EbiContext for the response
Parameters:
context - to associate with the response.

setHeader

public void setHeader(String key,
                      String value)
Set a key/value pair on the HttpServletResponse header. Portlet responses are handled using properties.
Parameters:
key -  
value -  

setDateHeader

public void setDateHeader(String key,
                          long value)
Deprecated. (since v5.0)

Set a key/ date value pair on the HttpServletResponse header. If the response does not have a HttpServletResponse, the setting is ignored. Use the EbiHttpResponse.getHttpServletResponse() to set http specific headers
Parameters:
key -  
value -  

containsHeader

public boolean containsHeader(String key)
Returns true if the specified key is found on the HttpServletResponseHeader. If the request is portlet action or render then the header is treated as a property.
Returns:
true if the specified key if found

setStatus

public void setStatus(int status)
Sets the response status. This is ignored by the portlet responses.
Parameters:
status - of response status.

getStatus

public int getStatus()
Deprecated. (since v5.0)

Value of response status.
Returns:
value of response status.

isStatus

public boolean isStatus(int status)
Deprecated. (since v5.0)

Returns true if response status matches status value passed.
Parameters:
status - value used in comparison.
Returns:
true if response status matches parameter value.

setResponse

public void setResponse(int responseCode,
                        String responsePhrase)
Set the response status and phrase Ignored by Portlet Reponses
Parameters:
responseCode - status.
responsePhrase - phrase.

setResponseType

public void setResponseType(int responseType)
Set the response type note: Ignored by Portlet Reponses
Parameters:
responseType - of response type.

getResponseType

public int getResponseType()
Deprecated. (since v5.0)

Returns the response type.
Returns:
the value of the response type.

isResponseType

public boolean isResponseType(int responseType)
Deprecated. (since v5.0)

Compares response type with parameter value passed.
Parameters:
response - type value for comparison.
Returns:
true if response type is the same as value passed.

setResponsePhrase

public void setResponsePhrase(String responsePhrase)
Deprecated. (Since v5.0) use EbiRequestContext.setResponsePhrase(String)

Sets the response phrase
Parameters:
responsePhrase - phrase value.

Novell exteNd
Director 5.2 API