|
Awake SQL v1.2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.awakefw.commons.api.client.HttpProtocolParameters
public final class HttpProtocolParameters
Allows to define some parameters for the Awake session:
true
.(For Awake SQL
only).DefaultHttpClient
class of the Jakarta HttpClient
Library library.
Use this class only if you want to change the default values of the
HttpClient library and pass the created instance to
AwakeFileSession
or AwakeConnection
.
For example, the following change the default connection timeout to 10 seconds and the default socket timeout to 60 seconds:
See HttpComponents Tutorial for more info on HTTP parameters.String url = "https://www.acme.org/AwakeFileManager"; String username = "myUsername"; char [] password = {'m', 'y', 'P', 'a', 's', 's', 'w', 'o', 'r', 'd'}; HttpProtocolParameters httpProtocolParameters = new HttpProtocolParameters(); // Sets the timeout until a connection is established to 10 seconds httpProtocolParameters.setHttpClientParameter( "http.connection.timeout", new Integer(10 * 1000)); // Sets the socket timeout (SO_TIMEOUT) to 60 seconds httpProtocolParameters.setHttpClientParameter("http.socket.timeout", new Integer(60 * 1000)); // We will use no proxy HttpProxy httpProxy = null; AwakeFileSession awakeFileSession = new AwakeFileSession(url, username, password, httpProxy, httpProtocolParameters); // Etc.
Field Summary | |
---|---|
static boolean |
ACCEPT_ALL_SSL_CERTIFICATES
The default acceptance for self signed SSL certificates |
static int |
DEFAULT_DOWNLOAD_BUFFER_SIZE
The default Buffer size for download and copy |
static boolean |
DEFAULT_HTML_ENCODING_ON
The default behavior for html encoding |
static int |
DEFAULT_MAX_LENGTH_FOR_STRING
The default maximum authorized length for a string for upload or download |
static int |
DEFAULT_UPLOAD_BUFFER_SIZE
The default buffer size when uploading a file |
Constructor Summary | |
---|---|
HttpProtocolParameters()
Constructor. |
Method Summary | |
---|---|
void |
clearHttpClientParameters()
Removes all parameters from this collection. |
int |
getDownloadBufferSize()
Returns the buffer size when downloading files. |
char[] |
getEncryptionPassword()
Returns the encryption Password that encrypts http request parameters. |
Object |
getHttpClientParameter(String name)
Gets the value of this HttpClient Library parameter. |
Set<String> |
getHttpClientParameterNames()
Returns the new parameters key set. |
Map<String,Object> |
getHttpClientParameters()
Returns the HttpClient Parameters. |
int |
getMaxLengthForString()
Returns the maximum authorized length for a string for upload or download (in order to avoid OutOfMemoryException on client and server side). |
int |
getUploadBufferSize()
Returns the buffer size when uploading files. |
boolean |
isAcceptAllSslCertificates()
Says if client sides allows HTTPS call with all SSL Certificates, including "invalid" or self-signed Certificates. |
boolean |
isHtmlEncodingOn()
Says if the upload/download of Clob using character stream or ASCII stream is html encoded. |
void |
setAcceptAllSslCertificates(boolean acceptAllSslCertificates)
Sets if client sides must allow HTTPS call with all SSL Certificates, including "invalid" or self-signed Certificates. |
void |
setDownloadBufferSize(int downloadBufferSize)
Sets the buffer size when downloading files. |
void |
setEncryptionPassword(char[] encryptionPassword)
Sets the encryption Password that encrypts http request parameters. |
void |
setHtmlEncodingOn(boolean htmlEncodeOn)
Says if the upload/download of Clob using character stream or ASCII stream must be html encoded. |
void |
setHttpClientParameter(String name,
Object value)
Sets the value of this HttpClient Library parameter. |
void |
setHttpClientParameters(Map<String,Object> httpClientParameters)
Sets the HttpClient Parameters. |
void |
setMaxLengthForString(int maxLengthForString)
Sets the maximum authorized length for a string for upload or download (in order to avoid OutOfMemoryException on client and server side). |
void |
setUploadBufferSize(int uploadBufferSize)
Sets the buffer size when uploading files. |
String |
toString()
Returns a clean representation of the HttpProtocolParameters
instance. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final boolean ACCEPT_ALL_SSL_CERTIFICATES
public static final int DEFAULT_DOWNLOAD_BUFFER_SIZE
public static final boolean DEFAULT_HTML_ENCODING_ON
public static final int DEFAULT_MAX_LENGTH_FOR_STRING
public static final int DEFAULT_UPLOAD_BUFFER_SIZE
Constructor Detail |
---|
public HttpProtocolParameters()
Method Detail |
---|
public void clearHttpClientParameters()
public int getDownloadBufferSize()
public char[] getEncryptionPassword()
public Object getHttpClientParameter(String name)
name
- the parameter name *
IllegalArgumentException
- if name is nullpublic Set<String> getHttpClientParameterNames()
Map.keySet()
public Map<String,Object> getHttpClientParameters()
public int getMaxLengthForString()
public int getUploadBufferSize()
public boolean isAcceptAllSslCertificates()
public boolean isHtmlEncodingOn()
public void setAcceptAllSslCertificates(boolean acceptAllSslCertificates)
acceptAllSslCertificates
- true if we want client client sides to allow HTTPS call with all SSL Certificatespublic void setDownloadBufferSize(int downloadBufferSize)
downloadBufferSize
- the buffer size when downloading files to setpublic void setEncryptionPassword(char[] encryptionPassword)
encryptionPassword
- the encryption Password that encrypts http request parameterspublic void setHtmlEncodingOn(boolean htmlEncodeOn)
htmlEncodeOn
- true to html encode the upload/download of Clob, else falsepublic void setHttpClientParameter(String name, Object value)
name
- the parameter namevalue
- the parameter value
IllegalArgumentException
- if name is nullpublic void setHttpClientParameters(Map<String,Object> httpClientParameters)
httpClientParameters
- the HttpClient Parameters to setpublic void setMaxLengthForString(int maxLengthForString)
maxLengthForString
- the maximum authorized length for a string for upload or
downloadpublic void setUploadBufferSize(int uploadBufferSize)
uploadBufferSize
- the buffer size when uploading filespublic String toString()
HttpProtocolParameters
instance.
toString
in class Object
HttpProtocolParameters
instance
|
Awake SQL v1.2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |