public class UDSOAPRequest
extends java.lang.Object
UDSOAPRequest
encapsulates all the necessary methods for
sending Web Services/SOAP requests to ISY.
It also takes care of all the security level related tasks
Modifier | Constructor and Description |
---|---|
protected |
UDSOAPRequest(AbstractHTTPRequest request,
UDProxyDevice dev)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static UDSOAPRequest |
create(boolean isSSL,
java.lang.String hostName,
java.net.InetSocketAddress address,
java.lang.String method,
java.lang.String url_path,
java.lang.String httpCredentials,
UDProxyDevice dev)
UDSOAPRequest factory method
|
java.lang.StringBuffer |
getSOAPEnvelope(short signatureType,
java.lang.String soapAction,
java.lang.StringBuffer body)
Same as getSOAPEnvelope with no attributes
|
java.lang.StringBuffer |
getSOAPEnvelope(short signatureType,
java.lang.String soapAction,
java.lang.String attributes,
java.lang.StringBuffer body)
Returns the SOAPEnvelope
|
void |
setSocketTimeoutMillis(int v)
Sets the number of milliseconds before the socket times out.
|
UDHTTPResponse |
submit(java.lang.StringBuffer body,
java.lang.String soapAction,
short signatureType,
boolean encrypt,
boolean keep_alive)
Same as submit without attributes
|
UDHTTPResponse |
submit(java.lang.StringBuffer body,
java.lang.String soapAction,
java.lang.String attributes,
short signatureType,
boolean encrypt,
boolean keep_alive)
Submits a SOAP Web Services request to ISY
|
UDHTTPResponse |
subscribe(boolean keep_alive,
java.lang.String local_host,
int port)
Subscribe to ISY events
|
UDHTTPResponse |
unsubscribe()
Unsubscribe from ISY events
|
protected UDSOAPRequest(AbstractHTTPRequest request, UDProxyDevice dev)
request
- - the pre-built AbstractHTTPRequestdev
- - the UDProxyDevice
which this request is being issued
againstpublic void setSocketTimeoutMillis(int v)
public UDHTTPResponse subscribe(boolean keep_alive, java.lang.String local_host, int port)
keep_alive
- - whether or not the socket should be kept alive: ISY event
notification engine shall use this same socket to notify the client of
changeslocal_host
- - if keep_alive is false, then this is the IP of the local
host which is to be notified of changes. Otherwise, this parameter has no
significanceport
- if keep_alive is false, then this is the port of the local
host which is to be notified of changes. Otherwise, this parameter has no
significanceUDHTTPResponse
UDHTTPResponse
,
UDProxyDevice
public UDHTTPResponse unsubscribe()
UDHTTPResponse
UDHTTPResponse
public java.lang.StringBuffer getSOAPEnvelope(short signatureType, java.lang.String soapAction, java.lang.String attributes, java.lang.StringBuffer body)
signatureType
- - the type of signature to be used (all defined in
UPnPSecurity
:
NO_SIGNATURE = 0;
SIGN_WITH_PUBLIC_KEY = 1;
SIGN_WITH_HMAC_KEY = 2;soapAction
- - the SOAP Actionattributes
- - attributes for the message. Note that attribute are added as isbody
- - the body to be included in the s:Body element of SOAPEnvelopepublic java.lang.StringBuffer getSOAPEnvelope(short signatureType, java.lang.String soapAction, java.lang.StringBuffer body)
signatureType
- soapAction
- body
- public UDHTTPResponse submit(java.lang.StringBuffer body, java.lang.String soapAction, java.lang.String attributes, short signatureType, boolean encrypt, boolean keep_alive)
body
- - the body to be included in the s:Body element of SOAPEnvelopesoapAction
- - the SOAP Actionattributes
- signatureType
- - the type of signature to be used (all defined in
UPnPSecurity
:
NO_SIGNATURE = 0;
SIGN_WITH_PUBLIC_KEY = 1;
SIGN_WITH_HMAC_KEY = 2;Dencrypt
- - whether or not to encrypt the contents (of payload)keep_alive
- - whether or not to keep the socket openUDHTTPResponse
public UDHTTPResponse submit(java.lang.StringBuffer body, java.lang.String soapAction, short signatureType, boolean encrypt, boolean keep_alive)
body
- soapAction
- signatureType
- encrypt
- keep_alive
- UDHTTPResponse
public static UDSOAPRequest create(boolean isSSL, java.lang.String hostName, java.net.InetSocketAddress address, java.lang.String method, java.lang.String url_path, java.lang.String httpCredentials, UDProxyDevice dev)
UDSOAPRequest factory method
isSSL
- - whether or not to return UDHTTPRequest or UDHTTPSRequesthostName
- - the actual HOST header name to be used in the calladdress
- - the address segment of the URL including portmethod
- - the method either GET or POSTurl_path
- - the path segment of the URL (i.e. /web/nodescnf.xml)httpCredentials
- - the Authorization header (use UDHTTPUtil.getHTTPAuthorization())dev
- - the UDProxyDevice representing an instance of ISY