ERXRequest Class Reference

Inherits com::webobjects::appserver::WORequest.

Collaboration diagram for ERXRequest:

Collaboration graph
[legend]

List of all members.

Classes

class  _LanguageComparator

Public Member Functions

void _completeURLPrefix (StringBuffer stringbuffer, boolean secure, int port)
ERXBrowser browser ()
NSArray< StringbrowserLanguages ()
WOContext context ()
NSDictionary cookieValues ()
 ERXRequest (String string, String string0, String string1, NSDictionary nsdictionary, NSData nsdata, NSDictionary nsdictionary2)
void finalize () throws Throwable
boolean isBrowserFormValueEncodingOverrideEnabled ()
boolean isSecure ()
boolean isSecureDisabled ()
boolean isSessionIDInRequest ()
NSMutableDictionary< String,
Object > 
mutableUserInfo ()
String remoteHost ()
String remoteHostAddress ()
String remoteHostName ()
void setCredentials (String userName, String password)
String stringFormValueForKey (String key)

Static Public Member Functions

static boolean _isSecureDisabled ()
static boolean isRequestSecure (WORequest request)

Static Public Attributes

static final Logger log = Logger.getLogger(ERXRequest.class)
static final String UNKNOWN_HOST = "UNKNOWN"
static final String X_FORWARDED_PROTO_FOR_SSL = ERXProperties.stringForKeyWithDefault("er.extensions.appserver.ERXRequest.xForwardedProtoForSsl", "https")

Protected Member Functions

String _getSessionIDFromValuesOrCookie (boolean inCookiesFirst)
NSArray< StringfixAbbreviationArray (NSArray< String > languages)

Protected Attributes

ERXBrowser _browser
NSArray< String_browserLanguages
boolean _secureDisabled

Static Protected Attributes

static final NSArray< StringHOST_ADDRESS_KEYS = new NSArray<String>(new String[]{"pc-remote-addr", "remote_host", "remote_addr", "remote_user", "x-webobjects-remote-addr"})
static final NSArray< StringHOST_NAME_KEYS = new NSArray<String>(new String[]{"x-forwarded-host", "Host", "x-webobjects-server-name", "server_name", "http_host"})
static Boolean isBrowserFormValueEncodingOverrideEnabled

Static Private Attributes

static final NSComparator COMPARE_Qs = new _LanguageComparator()


Detailed Description

Subclass of WORequest that fixes several Bugs. The ID's are #2924761 and #2961017. It can also be extended to handle #2957558 ("de-at" is converted to "German" instead of "German_Austria"). The request is created via ERXApplication#createRequest(String,String,String, NSDictionary,NSData,NSDictionary).

Constructor & Destructor Documentation

ERXRequest ( String  string,
String  string0,
String  string1,
NSDictionary  nsdictionary,
NSData  nsdata,
NSDictionary  nsdictionary2 
)

Simply call superclass constructor


Member Function Documentation

void _completeURLPrefix ( StringBuffer  stringbuffer,
boolean  secure,
int  port 
)

String _getSessionIDFromValuesOrCookie ( boolean  inCookiesFirst  )  [protected]

Overridden because the super implementation would pull in all content even if the request is supposed to be streaming and thus very large. Will now look for the session ID only in the cookie values.

static boolean _isSecureDisabled (  )  [static]

Returns true if er.extensions.ERXRequest.secureDisabled is true.

Returns:
true if er.extensions.ERXRequest.secureDisabled is true

ERXBrowser browser (  ) 

Gets the ERXBrowser associated with the user-agent of the request.

Returns:
browser object for the request

NSArray<String> browserLanguages (  ) 

Returns a cooked version of the languages the user has set in his Browser. Adds "Nonlocalized" and ERXLocalizer#defaultLanguage() if not already present. Transforms regionalized en_us to English_US as a key.

Returns:
cooked version of user's languages

WOContext context (  ) 

NSDictionary cookieValues (  ) 

Overridden because malformed cookie to return an empty dictionary if the super implementation throws an exception. This will happen if the request contains malformed cookie values.

void finalize (  )  throws Throwable

Cleaning up retian count on the browser.

NSArray<String> fixAbbreviationArray ( NSArray< String languages  )  [protected]

static boolean isRequestSecure ( WORequest  request  )  [static]

Returns whether or not the given request is secure. MS: I found this somewhere else a while ago, but I have no idea where or I'd give attribution.

Parameters:
request the request to check
Returns:
whether or not the given request is secure.

boolean isSecure (  ) 

Returns whether or not this request is secure.

Returns:
whether or not this request is secure

boolean isSecureDisabled (  ) 

Returns true if er.extensions.ERXRequest.secureDisabled is true.

Returns:
true if er.extensions.ERXRequest.secureDisabled is true

boolean isSessionIDInRequest (  ) 

Overridden because the super implementation would pull in all content even if the request is supposed to be streaming and thus very large. Will now return false if the request handler is streaming.

NSMutableDictionary<String, Object> mutableUserInfo (  ) 

String remoteHost (  ) 

String remoteHostAddress (  ) 

Returns the remote client host address. Works in various setups, like direct connect, deployed etc. If no host name can be found, returns "UNKNOWN".

Returns:
remote client host address

String remoteHostName (  ) 

Returns the remote client host name. If no host name can be found, returns "UNKNOWN".

Returns:
remote client host name

void setCredentials ( String  userName,
String  password 
)

Utility method to set credentials for basic authorization.

String stringFormValueForKey ( String  key  ) 


Member Data Documentation

ERXBrowser _browser [protected]

holds a reference to the browser object

NSArray<String> _browserLanguages [protected]

NSArray to keep browserLanguages in.

boolean _secureDisabled [protected]

Specifies whether https should be overridden to be enabled or disabled app-wide. This is useful if you are developing with DirectConnect and you want to be able to specif secure forms and links, but you want to be able to continue testing them without setting up SSL.

Defaults to false, set er.extensions.ERXRequest.secureDisabled=true to turn it off.

final NSComparator COMPARE_Qs = new _LanguageComparator() [static, private]

Translates ("de", "en-us;q=0.33", "en", "en-gb;q=0.66") to ("de", "en_gb", "en-us", "en").

Parameters:
languages NSArray of Strings
Returns:
sorted NSArray of normalized Strings

final NSArray<String> HOST_ADDRESS_KEYS = new NSArray<String>(new String[]{"pc-remote-addr", "remote_host", "remote_addr", "remote_user", "x-webobjects-remote-addr"}) [static, protected]

final NSArray<String> HOST_NAME_KEYS = new NSArray<String>(new String[]{"x-forwarded-host", "Host", "x-webobjects-server-name", "server_name", "http_host"}) [static, protected]

Boolean isBrowserFormValueEncodingOverrideEnabled [static, protected]

final Logger log = Logger.getLogger(ERXRequest.class) [static]

logging support

final String UNKNOWN_HOST = "UNKNOWN" [static]

final String X_FORWARDED_PROTO_FOR_SSL = ERXProperties.stringForKeyWithDefault("er.extensions.appserver.ERXRequest.xForwardedProtoForSsl", "https") [static]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:02 2012 for Project Wonder by  doxygen 1.5.8