|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.xcap.base.BaseXcapRequest
com.ibm.xcap.client.XcapClientRequest
public class XcapClientRequest
XcapClientRequest is constructed to send an XCAP request to an XDMS. The XcapClientRequest supports digest authentication. If the password is empty then it will try to send an asserted identity in the headers. The default asserted identity header that is used is X-Xcap-Asserted-Identity. If another header should be used, call the setDefaultIdentityHeader(String) method.
Field Summary | |
---|---|
static java.lang.String |
CLASSNAME
Classname |
static java.util.logging.Logger |
LOGGER
Logger for this class |
Fields inherited from class com.ibm.xcap.base.BaseXcapRequest |
---|
auid, documentSelector, httpMethod, nodeSelector, xcapRoot, xcapURI, xml, xmlName, xui |
Constructor Summary | |
---|---|
XcapClientRequest(java.lang.String httpMethod,
java.lang.String userName,
java.lang.String password,
java.lang.String xcapRoot,
java.lang.String auid,
java.lang.String xui,
java.lang.String xmlName,
java.lang.String nodeSelector,
java.lang.String xml)
Constructs the XcapClientRequest. |
|
XcapClientRequest(java.lang.String httpMethod,
java.lang.String userName,
java.lang.String password,
java.net.URL xcapURI,
java.lang.String xml)
Constructs the XcapClientRequest. |
Method Summary | |
---|---|
void |
addHeader(java.lang.String header,
java.lang.String value)
Adds the header value. |
java.lang.String |
getHeader(java.lang.String header)
Get the value associated with a header name. |
java.util.Enumeration |
getHeaderNames()
Returns an Enumeration of request header names that has been set. |
java.util.Enumeration |
getHeaders(java.lang.String header)
Returns an Enumeration if there are multiple headers with the same name. |
java.lang.String |
getPassword()
Returns the password associated with the user. |
java.lang.String |
getUserName()
Returns the current user name to authenticate with. |
XcapClientResponse |
send()
Sends the XCAP request to the XDMS. |
void |
send(ThreadedRequestHandler requestHandler)
Send an XDMS Request via a threaded handler using the callers own thread to process the request. |
void |
sendAsync(ThreadedRequestHandler requestHandler)
Send an XDMS Request via a threaded handler attempting to use a thread on the threadpool to support multithreaded requests. |
static void |
setDefaultIdentityHeader(java.lang.String identityHeader)
Sets the default identity header used if no password is specified. |
void |
setHeader(java.lang.String header,
java.lang.String value)
Adds the header if it does not exist or replaces an existing header. |
void |
setPassword(java.lang.String password)
Sets the password associated with the user. |
void |
setUserName(java.lang.String userName)
Sets the current user name to authenticate with. |
java.lang.String |
toString()
|
Methods inherited from class com.ibm.xcap.base.BaseXcapRequest |
---|
getAuid, getContentType, getDocumentSelector, getHttpMethod, getNodeSelector, getXcapRoot, getXcapURI, getXml, getXmlName, getXui, isGlobalDocument, setHttpMethod, setXcapURI, setXcapURI, setXml |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASSNAME
public static final java.util.logging.Logger LOGGER
Constructor Detail |
---|
public XcapClientRequest(java.lang.String httpMethod, java.lang.String userName, java.lang.String password, java.net.URL xcapURI, java.lang.String xml) throws java.net.MalformedURLException
httpMethod
- The HTTP METHOD type.userName
- The username to authenticate with.password
- The password to authenticate with. If null, then assume
that the identity will be asserted.xcapURI
- The full XCAP URI of the form
http(s)://hostname:hostport/contextRoot/AUID/xcapDocSelector/~~/xcapNodeSelectorxml
- The XML document if sending a PUT or POST.
java.net.MalformedURLException
XcapConstants.HTTP_METHOD_GET
,
XcapConstants.HTTP_METHOD_PUT
,
XcapConstants.HTTP_METHOD_DELETE
public XcapClientRequest(java.lang.String httpMethod, java.lang.String userName, java.lang.String password, java.lang.String xcapRoot, java.lang.String auid, java.lang.String xui, java.lang.String xmlName, java.lang.String nodeSelector, java.lang.String xml) throws java.net.MalformedURLException
httpMethod
- The HTTP METHOD type.userName
- The username to authenticate with.password
- The password to authenticate with. If null, then assume
that the identity will be asserted.xcapRoot
- The xcap root of the form
http(s)://hostname:hostport/contextRootauid
- The AUID of the XCAP URI.xui
- The XML User Identifier. If not specified, then assumes a
GLOBAL document.xmlName
- The name used to identify the XML document.nodeSelector
- The nodeSelector that does NOT include the ~~
separator.xml
- The XML document if sending a PUT or POST.
java.net.MalformedURLException
XcapConstants.HTTP_METHOD_GET
,
XcapConstants.HTTP_METHOD_PUT
,
XcapConstants.HTTP_METHOD_DELETE
Method Detail |
---|
public static void setDefaultIdentityHeader(java.lang.String identityHeader)
identityHeader
- The default is HEADER_X_XCAP_ASSERTED_IDENTITYXcapConstants.HEADER_X_3GPP_ASSERTED_IDENTITY
,
XcapConstants.HEADER_X_3GPP_INTENDED_IDENTITY
,
XcapConstants.HEADER_X_XCAP_ASSERTED_IDENTITY
public java.util.Enumeration getHeaderNames()
public java.lang.String getHeader(java.lang.String header)
header
- The name of the header.
public java.util.Enumeration getHeaders(java.lang.String header)
header
- The name of the header.
public void setHeader(java.lang.String header, java.lang.String value)
header
- The name of the header.value
- The value to replace all existing values.addHeader(String, String)
public void addHeader(java.lang.String header, java.lang.String value)
header
- The name of the header.value
- The value of the header to add.public java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- The password associated with the user. If using asserted
identity header, then specify null.public java.lang.String getUserName()
public void setUserName(java.lang.String userName)
userName
- The current user name to authenticate with.public XcapClientResponse send() throws java.io.IOException
java.io.IOException
public void send(ThreadedRequestHandler requestHandler)
XcapClientResponse.getException()
will return the thrown exception that occured during the request.
XcapClientResponse.getException()
public void sendAsync(ThreadedRequestHandler requestHandler)
XcapClientResponse.getException()
will return the thrown exception that occured during the request.
XcapClientResponse.getException()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |