com.ibm.xcap.base
Class BaseXcapRequest

java.lang.Object
  extended by com.ibm.xcap.base.BaseXcapRequest
All Implemented Interfaces:
XcapConstants, XcapRequest
Direct Known Subclasses:
XcapClientRequest

public abstract class BaseXcapRequest
extends java.lang.Object
implements XcapRequest

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
protected  java.lang.String auid
           
static java.lang.String CLASSNAME
          Classname
protected  DocumentSelector documentSelector
           
protected  java.lang.String httpMethod
           
static java.util.logging.Logger LOGGER
          Logger for this class
protected  NodeSelector nodeSelector
           
protected static java.util.ResourceBundle rb
           
protected  java.lang.String xcapRoot
           
protected  java.net.URL xcapURI
           
protected  java.lang.String xml
           
protected  java.lang.String xmlName
           
protected  java.lang.String xui
           
 
Fields inherited from interface com.ibm.xcap.XcapConstants
ANONYMOUS_USER, APPEND_CONTENT_TYPE_CHARSET_UTF8, AUID_ACCESS_RULES, AUID_ACCESS_RULES_ACLS, AUID_GROUP_USAGE_LIST, AUID_GROUP_USAGE_LIST_ACLS, AUID_GROUPS, AUID_GROUPS_ACLS, AUID_LOCKED_USER_PROFILE, AUID_LOCKED_USER_PROFILE_ACLS, AUID_OMA_SEARCH, AUID_PRES_RULES, AUID_PRES_RULES_ACLS, AUID_RESOURCE_LISTS, AUID_RESOURCE_LISTS_ACLS, AUID_RLS_SERVICES, AUID_RLS_SERVICES_ACLS, AUID_USER_PROFILE, AUID_USER_PROFILE_ACLS, AUID_XCAP_CAPS, AUID_XCAP_DIRECTORY, CHARSET_UTF8, CLIENT_RESOURCE_BUNDLE, CLOSE_BRACKET, COMPARE_TO_IS_EQUAL, COMPARE_TO_IS_NOT_EQUAL, COMPARE_TO_IS_SUBSET, COMPARE_TO_IS_SUPERSET, CONTENT_TYPE_ACCESS_RULES, CONTENT_TYPE_APPLICATION_ERROR_XML, CONTENT_TYPE_AUTH_POLICY, CONTENT_TYPE_GROUP_USAGE_LIST, CONTENT_TYPE_GROUPS, CONTENT_TYPE_LOCKED_USER_PROFILE, CONTENT_TYPE_NAMESPACE_BINDING, CONTENT_TYPE_OMA_DIRECTORY, CONTENT_TYPE_OMA_SEARCH, CONTENT_TYPE_PRES_RULES, CONTENT_TYPE_RESOURCE_LISTS, CONTENT_TYPE_RLS_SERVICES, CONTENT_TYPE_USER_PROFILE, CONTENT_TYPE_XCAP_CAPS, CONTENT_TYPE_XCAP_DIFF, CONTENT_TYPE_XCAP_ERROR, CONTENT_TYPE_XML_ATTRIBUTE, CONTENT_TYPE_XML_ELEMENT, DOC_GLOBAL_DIRECTORY, DOC_GLOBAL_INDEX, DOC_USER_DIRECTORY, DOC_XCAP_CAPS, DOUBLE_FORWARD_SLASH, EMPTY, ENCODED_SINGLE_QUOTE, ENCODED_SLASH_CLOSE_BRACKET, ENCODED_SLASH_OPEN_BRACKET, EXTENSION_LOCAL_CONSTRAINT_FAILURE, FORWARD_SLASH, GLOBAL, GLOBAL_DOC_DIRECTORY_PREFIX, GLOBAL_DOC_DIRECTORY_SUFFIX, HEADER_ACCEPT, HEADER_ALLOW, HEADER_CONTENT_TYPE, HEADER_ETAG, HEADER_IF_MATCH, HEADER_IF_NONE_MATCH, HEADER_LAST_MODIFIED, HEADER_X_3GPP_ASSERTED_IDENTITY, HEADER_X_3GPP_INTENDED_IDENTITY, HEADER_X_XCAP_ASSERTED_IDENTITY, HTTP_METHOD_DELETE, HTTP_METHOD_GET, HTTP_METHOD_POST, HTTP_METHOD_PUT, NS_ACCESS_RULES, NS_COMMON_POLICY, NS_GROUPS, NS_LOCKED_USER_PROFILE, NS_OMA_APPUSAGE, NS_OMA_COMMON_POLICY, NS_OMA_URIUSAGE, NS_OMA_XCAP_ERROR, NS_PRES_RULES, NS_RESOURCE_LISTS, NS_RLS_SERVICES, NS_USER_PROFILE, NS_XCAP_CAPS, NS_XCAP_DIRECTORY, NS_XCAP_ERROR, NS_XDM_EXTENSIONS, OPEN_BRACKET, PATH_SEARCH, RC_100_CONTINUE, RC_101_SWITCHING_PROTOCOLS, RC_200_OK, RC_201_CREATED, RC_202_ACCEPTED, RC_203_NON_AUTHORITATIVE_INFO, RC_204_NO_CONTENT, RC_205_RESET_CONTENT, RC_206_PARTIAL_CONTENT, RC_300_MULTIPLE_CHOICES, RC_301_MOVED_PERMANANTLY, RC_302_FOUND, RC_303_SEE_OTHER, RC_304_NOT_MODIFIED, RC_305_USE_PROXY, RC_307_TEMPORARY_REDIRECT, RC_400_BAD_REQUEST, RC_401_UNAUTHORIZED, RC_402_PAYMENT_REQUIRED, RC_403_FORBIDDEN, RC_404_NOT_FOUND, RC_405_METHOD_NOT_ALLOWED, RC_406_NOT_ACCEPTABLE, RC_407_PROXY_AUTHENTICATION_REQUIRED, RC_408_REQUEST_TIMEOUT, RC_409_CONFLICT, RC_410_GONE, RC_411_LENGTH_REQUIRED, RC_412_PRECONDITION_FAILED, RC_413_REQUEST_ENTITY_TOO_LARGE, RC_414_REQUEST_URI_TOO_LONG, RC_415_UNSUPPORTED_MEDIA_TYPE, RC_416_REQUESTED_RANGE_NOT_SATISFIABLE, RC_417_EXPECTATION_FAILED, RC_500_INTERNAL_SERVER_ERROR, RC_501_NOT_IMPLEMENTED, RC_502_BAD_GATEWAY, RC_503_SERVICES_UNAVAILABLE, RC_504_GATEWAY_TIMEOUT, RC_505_HTTP_VERSION_NOT_SUPPORTED, SINGLE_QUOTE, SINGLE_SPACE, SLASH_CLOSE_BRACKET, SLASH_OPEN_BRACKET, USERS, UTF_8, UTF8_BYTE_ORDER_MARKER, XML_DECLARATION, XPATH_SEPARATOR
 
Constructor Summary
BaseXcapRequest(java.lang.String httpMethod, 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.
BaseXcapRequest(java.lang.String httpMethod, java.net.URL xcapURI, java.lang.String xml)
          Constructs the XcapClientRequest.
 
Method Summary
 java.lang.String getAuid()
          Returns the AUID.
 java.lang.String getContentType()
          Returns the Content-Type.
 DocumentSelector getDocumentSelector()
          Returns the document selector for this XCAP URI
 java.lang.String getHttpMethod()
          Returns the HTTP METHOD.
 NodeSelector getNodeSelector()
          Returns the nodeSelector.
 java.lang.String getXcapRoot()
          Returns the XCAP Root.
 java.net.URL getXcapURI()
          Returns the XCAP URI of the request.
 java.lang.String getXml()
          Returns the xml.
 java.lang.String getXmlName()
          Returns the xmlName.
 java.lang.String getXui()
          Returns the XUI.
 boolean isGlobalDocument()
          Returns whether the document is global or not.
 void setHttpMethod(java.lang.String httpMethod)
          Sets the HTTP METHOD.
 void setXcapURI(java.lang.String xcapURI)
          Sets the full XCAP URI used to send the XCAP request.
 void setXcapURI(java.net.URL xcapURI)
          Sets the full XCAP URI used to send the XCAP request.
 void setXml(java.lang.String xml)
          Sets the xml.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.xcap.XcapRequest
getHeader, getHeaderNames, getHeaders
 

Field Detail

CLASSNAME

public static final java.lang.String CLASSNAME
Classname


LOGGER

public static final java.util.logging.Logger LOGGER
Logger for this class


rb

protected static final java.util.ResourceBundle rb

httpMethod

protected java.lang.String httpMethod

xcapRoot

protected java.lang.String xcapRoot

auid

protected java.lang.String auid

xui

protected java.lang.String xui

xmlName

protected java.lang.String xmlName

nodeSelector

protected NodeSelector nodeSelector

documentSelector

protected DocumentSelector documentSelector

xml

protected java.lang.String xml

xcapURI

protected java.net.URL xcapURI
Constructor Detail

BaseXcapRequest

public BaseXcapRequest(java.lang.String httpMethod,
                       java.net.URL xcapURI,
                       java.lang.String xml)
                throws java.net.MalformedURLException
Constructs the XcapClientRequest.

Parameters:
httpMethod - The HTTP METHOD type.
xcapURI - The full XCAP URI of the form http(s)://hostname:hostport/contextRoot/AUID/xcapDocSelector/~~/xcapNodeSelector
xml - The XML document if sending a PUT or POST.
Throws:
java.net.MalformedURLException
See Also:
XcapConstants.HTTP_METHOD_GET, XcapConstants.HTTP_METHOD_PUT, XcapConstants.HTTP_METHOD_DELETE

BaseXcapRequest

public BaseXcapRequest(java.lang.String httpMethod,
                       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
Constructs the XcapClientRequest.

Parameters:
httpMethod - The HTTP METHOD type.
xcapRoot - The xcap root of the form http(s)://hostname:hostport/contextRoot
auid - 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.
Throws:
java.net.MalformedURLException
See Also:
XcapConstants.HTTP_METHOD_GET, XcapConstants.HTTP_METHOD_PUT, XcapConstants.HTTP_METHOD_DELETE
Method Detail

getXcapURI

public java.net.URL getXcapURI()
Returns the XCAP URI of the request.

Specified by:
getXcapURI in interface XcapRequest
Returns:
Returns the XCAP URI of the request.

getXcapRoot

public java.lang.String getXcapRoot()
Returns the XCAP Root.

Specified by:
getXcapRoot in interface XcapRequest
Returns:
String Returns the XCAP Root.

getAuid

public java.lang.String getAuid()
Returns the AUID.

Specified by:
getAuid in interface XcapRequest
Returns:
String Returns the AUID.

getContentType

public java.lang.String getContentType()
Returns the Content-Type.

Specified by:
getContentType in interface XcapRequest
Returns:
String Returns the Content-Type.

isGlobalDocument

public boolean isGlobalDocument()
Returns whether the document is global or not.

Specified by:
isGlobalDocument in interface XcapRequest
Returns:
boolean Returns true if global, false if a user document.

getXui

public java.lang.String getXui()
Returns the XUI.

Specified by:
getXui in interface XcapRequest
Returns:
String Returns the XUI.

getXmlName

public java.lang.String getXmlName()
Returns the xmlName.

Specified by:
getXmlName in interface XcapRequest
Returns:
String Returns the xmlName.

getNodeSelector

public NodeSelector getNodeSelector()
Returns the nodeSelector.

Specified by:
getNodeSelector in interface XcapRequest
Returns:
String Returns the nodeSelector.

getXml

public java.lang.String getXml()
Returns the xml.

Specified by:
getXml in interface XcapRequest
Returns:
String Returns the xml.

setXml

public void setXml(java.lang.String xml)
Sets the xml.

Parameters:
xml - The xml to set

getHttpMethod

public java.lang.String getHttpMethod()
Returns the HTTP METHOD. Either GET, PUT, POST, or DELETE.

Returns:
Returns the HTTP METHOD. Either GET, PUT, POST, or DELETE.

setHttpMethod

public void setHttpMethod(java.lang.String httpMethod)
Sets the HTTP METHOD. Either GET, PUT, POST, or DELETE.


setXcapURI

public void setXcapURI(java.net.URL xcapURI)
                throws java.net.MalformedURLException
Sets the full XCAP URI used to send the XCAP request. Must be of the form: http(s)://hostname:hostport/contextRoot/AUID/xcapDocSelector/~~/xcapNodeSelector

Parameters:
xcapURI - The full XCAP URI used to send the XCAP request.
Throws:
java.net.MalformedURLException

setXcapURI

public void setXcapURI(java.lang.String xcapURI)
                throws java.net.MalformedURLException
Sets the full XCAP URI used to send the XCAP request. Must be of the form: http(s)://hostname:hostport/contextRoot/AUID/xcapDocSelector/~~/xcapNodeSelector

Parameters:
xcapURI - The full XCAP URI used to send the XCAP request.
Throws:
java.net.MalformedURLException

getDocumentSelector

public DocumentSelector getDocumentSelector()
Returns the document selector for this XCAP URI

Returns:
Returns the document selector for this XCAP URI