com.universaldevices.soap
Class UDHTTPSRequest

java.lang.Object
  extended by com.universaldevices.soap.AbstractHTTPRequest
      extended by com.universaldevices.soap.UDHTTPSRequest

public class UDHTTPSRequest
extends AbstractHTTPRequest

UDHTTPSPRequest class encapsulates an HTTPS request to ISY. This class may also be used for other types of HTTPS request and it's the superclass to UDSOAPRequest

Author:
UD Architect
See Also:
UDSOAPRequest

Field Summary
protected  javax.net.ssl.SSLSocket s
          The socket, which in some cases, remains open even after the request is completed
 
Fields inherited from class com.universaldevices.soap.AbstractHTTPRequest
address, ba, closed, credentials, is, method, os, sc, SEND_BUFFER_SIZE, url_path
 
Constructor Summary
protected UDHTTPSRequest(java.net.InetSocketAddress address, java.lang.String url_path)
          Constructor
protected UDHTTPSRequest(java.net.InetSocketAddress address, java.lang.String method, java.lang.String url_path)
          Constructor
 
Method Summary
static void cleanUp()
           
 void close(int status)
          Releases all the resources
 java.lang.String getProtocol()
           
 UDHTTPResponse getServerResponse(java.lang.StringBuffer header, java.lang.StringBuffer body, boolean keep_alive, java.lang.Object device)
          Issues the request to the server and returns the response
 java.net.Socket getSocket()
           
static void initHTTPS()
           
 boolean isSSL()
           
 UDHTTPResponse post(java.lang.StringBuffer header, byte[] body, boolean keep_alive, java.lang.Object device, IUpdaterClient view)
          Simple post
 
Methods inherited from class com.universaldevices.soap.AbstractHTTPRequest
create, create, create, get, getFile, getHeader, getHost, getHostAndPort, getPort, getServerResponse, getSocketTimeoutMillis, getURL, post, setSendBufferSize, setSocketTimeoutMillis
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s

protected javax.net.ssl.SSLSocket s
The socket, which in some cases, remains open even after the request is completed

Constructor Detail

UDHTTPSRequest

protected UDHTTPSRequest(java.net.InetSocketAddress address,
                         java.lang.String method,
                         java.lang.String url_path)
Constructor

Parameters:
address - - the address segment of the URL including port
method - - the method either GET or POST
url_path - - the path segment of the URL (i.e. /web/nodescnf.xml)

UDHTTPSRequest

protected UDHTTPSRequest(java.net.InetSocketAddress address,
                         java.lang.String url_path)
Constructor

Note: the method is defaulted to "GET"

Parameters:
address - - the address segment of the URL including port
url_path - - the path segment of the URL (i.e. /web/nodescnf.xml)
Method Detail

cleanUp

public static void cleanUp()

initHTTPS

public static void initHTTPS()

getProtocol

public java.lang.String getProtocol()
Specified by:
getProtocol in class AbstractHTTPRequest
Returns:
- returns https

getServerResponse

public UDHTTPResponse getServerResponse(java.lang.StringBuffer header,
                                        java.lang.StringBuffer body,
                                        boolean keep_alive,
                                        java.lang.Object device)
Issues the request to the server and returns the response

The response is of type UDHTTPResponse
Use this method to encapuslate requests to ISY

Specified by:
getServerResponse in class AbstractHTTPRequest
Parameters:
header - - the header for the request
body - - the body for the request if any (in case of POST)
keep_alive - - whether or not the connection should be kept alive
device - - the UDProxyDevice object
Returns:
- the response from the server encapsulated in UDHTTPResponse
See Also:
UDHTTPResponse, UDProxyDevice

post

public UDHTTPResponse post(java.lang.StringBuffer header,
                           byte[] body,
                           boolean keep_alive,
                           java.lang.Object device,
                           IUpdaterClient view)
Description copied from class: AbstractHTTPRequest
Simple post

The response is of type UDHTTPResponse
Use this method to encapuslate requests to ISY

Specified by:
post in class AbstractHTTPRequest
Parameters:
header - - the header for the request
body - - the body for the request if any (in case of POST)
keep_alive - - whether or not the connection should be kept alive
device - - the UDProxyDevice object
Returns:
- the response from the server encapsulated in UDHTTPResponse
See Also:
UDHTTPResponse, UDProxyDevice

close

public void close(int status)
Releases all the resources

Releases all resources and closes all the connection which this object holds

Specified by:
close in class AbstractHTTPRequest
Parameters:
status - - @depracated

getSocket

public java.net.Socket getSocket()
Specified by:
getSocket in class AbstractHTTPRequest
Returns:
- returns the socket

isSSL

public boolean isSSL()
Specified by:
isSSL in class AbstractHTTPRequest
Returns:
- whether or not this request is SSL based