com.ibm.xcap
Class DocumentSelector

java.lang.Object
  extended by com.ibm.xcap.DocumentSelector
All Implemented Interfaces:
XcapConstants, java.io.Serializable

public class DocumentSelector
extends java.lang.Object
implements XcapConstants, java.io.Serializable

The DocumentSelector is a class which represents the document selector portion of the XCAP URI.

See Also:
Serialized Form

Field Summary
static java.lang.String TYPE_ATTRIBUTE
           
static java.lang.String TYPE_DIRECTORY
           
static java.lang.String TYPE_DOCUMENT
           
static java.lang.String TYPE_ELEMENT
           
 
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
DocumentSelector(java.lang.String xcapURI)
          Finds and constructs the document selector based on the original XCAP URI
DocumentSelector(java.lang.String xcapURI, boolean doNormalizeUID)
          Finds and constructs the document selector based on the original XCAP URI
DocumentSelector(java.lang.String xcapURI, java.lang.String defaultNamespace)
          Finds and constructs the document selector based on the original XCAP URI
DocumentSelector(java.lang.String xcapURI, java.lang.String defaultNamespace, boolean doNormalizeUID)
          Finds and constructs the document selector based on the original XCAP URI
DocumentSelector(java.lang.String auid, java.lang.String xui, java.lang.String documentName)
          Constructs the document selector from parameters
DocumentSelector(java.lang.String auid, java.lang.String xui, java.lang.String documentName, boolean doNormalizeUID)
          Constructs the document selector from parameters
 
Method Summary
 int compareTo(DocumentSelector aDocumentSelector)
          Compares this DocumentSelector to another DocumentSelector.
 boolean equals(java.lang.Object o)
           
static java.lang.String extractAuid(java.lang.String xcapURI)
          Extracts the AUID from an XCAP URI
 java.lang.String getAuid()
          Returns the AUID
 java.lang.String getDocumentName()
          Returns the document name.
 NodeSelector getNodeSelector()
          Returns the NodeSelector if constructed with the XCAP URI.
 java.lang.String getType()
          Returns the type of the document selector.
 java.lang.String getXcapRoot()
          Returns the XcapRoot if constructed with the XCAP URI.
 java.lang.String getXui()
          Returns the XUI of the document selector.
 int hashCode()
           
 boolean isGlobalDocument()
          Returns whether the document selector references a global document
 DocumentSelector substituteAuid(java.lang.String auid)
          Returns a DocumentSelector with the AUID substituted with the specified parameter.
 DocumentSelector substituteDocumentName(java.lang.String documentName)
          Returns a DocumentSelector with the document name substituted with the specified parameter.
 java.lang.String toString()
           
 java.lang.String toStringAll()
          Returns full documentSelector with xcap root
 java.lang.String toStringWithNodeSelector()
          Returns the DocumentSelector String including the NodeSelector portion
protected  java.lang.String trim(java.lang.String segment)
          Trims white spaces and slashes
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_DIRECTORY

public static final java.lang.String TYPE_DIRECTORY
See Also:
Constant Field Values

TYPE_DOCUMENT

public static final java.lang.String TYPE_DOCUMENT
See Also:
Constant Field Values

TYPE_ELEMENT

public static final java.lang.String TYPE_ELEMENT
See Also:
Constant Field Values

TYPE_ATTRIBUTE

public static final java.lang.String TYPE_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

DocumentSelector

public DocumentSelector(java.lang.String auid,
                        java.lang.String xui,
                        java.lang.String documentName)
Constructs the document selector from parameters

Parameters:
auid - The AUID.
xui - The XUI if under the users tree.
documentName - The document name.

DocumentSelector

public DocumentSelector(java.lang.String auid,
                        java.lang.String xui,
                        java.lang.String documentName,
                        boolean doNormalizeUID)
Constructs the document selector from parameters

Parameters:
auid - The AUID.
xui - The XUI if under the users tree.
documentName - The document name.
doNormalizeUID - Normalize the XUI based on the normalization configuration settings

DocumentSelector

public DocumentSelector(java.lang.String xcapURI)
                 throws java.net.MalformedURLException
Finds and constructs the document selector based on the original XCAP URI

Parameters:
xcapURI -
Throws:
java.net.MalformedURLException

DocumentSelector

public DocumentSelector(java.lang.String xcapURI,
                        java.lang.String defaultNamespace)
                 throws java.net.MalformedURLException
Finds and constructs the document selector based on the original XCAP URI

Parameters:
xcapURI -
defaultNamespace -
Throws:
java.net.MalformedURLException

DocumentSelector

public DocumentSelector(java.lang.String xcapURI,
                        boolean doNormalizeUID)
                 throws java.net.MalformedURLException
Finds and constructs the document selector based on the original XCAP URI

Parameters:
xcapURI -
doNormalizeUID - Normalize the XUI based on the normalization configuration settings
Throws:
java.net.MalformedURLException

DocumentSelector

public DocumentSelector(java.lang.String xcapURI,
                        java.lang.String defaultNamespace,
                        boolean doNormalizeUID)
                 throws java.net.MalformedURLException
Finds and constructs the document selector based on the original XCAP URI

Parameters:
xcapURI -
defaultNamespace -
doNormalizeUID - Normalize the XUI based on the normalization configuration settings
Throws:
java.net.MalformedURLException
Method Detail

trim

protected java.lang.String trim(java.lang.String segment)
Trims white spaces and slashes

Parameters:
segment - A segment
Returns:
Returns the trimmed segment

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toStringWithNodeSelector

public java.lang.String toStringWithNodeSelector()
Returns the DocumentSelector String including the NodeSelector portion

Returns:
Returns the DocumentSelector String including the NodeSelector portion

toStringAll

public java.lang.String toStringAll()
Returns full documentSelector with xcap root


getAuid

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

Returns:
Returns the AUID

getDocumentName

public java.lang.String getDocumentName()
Returns the document name.

Returns:
Returns the document name.

getNodeSelector

public NodeSelector getNodeSelector()
Returns the NodeSelector if constructed with the XCAP URI.

Returns:
Returns the NodeSelector if constructed with the XCAP URI.

getXcapRoot

public java.lang.String getXcapRoot()
Returns the XcapRoot if constructed with the XCAP URI.

Returns:
Returns the XcapRoot if constructed with the XCAP URI.

getXui

public java.lang.String getXui()
Returns the XUI of the document selector.

Returns:
Returns the XUI of the document selector.

getType

public java.lang.String getType()
Returns the type of the document selector.

Returns:
Returns the type of the document selector.

isGlobalDocument

public boolean isGlobalDocument()
Returns whether the document selector references a global document

Returns:
Returns true if global and false if users document

substituteAuid

public DocumentSelector substituteAuid(java.lang.String auid)
Returns a DocumentSelector with the AUID substituted with the specified parameter.

Parameters:
auid - The AUID used for substitution.
Returns:
Returns a DocumentSelector with the AUID substituted with the specified parameter.

substituteDocumentName

public DocumentSelector substituteDocumentName(java.lang.String documentName)
Returns a DocumentSelector with the document name substituted with the specified parameter.

Parameters:
documentName - The document name used for substitution.
Returns:
Returns a DocumentSelector with the document name substituted with the specified parameter.

extractAuid

public static java.lang.String extractAuid(java.lang.String xcapURI)
                                    throws java.net.MalformedURLException
Extracts the AUID from an XCAP URI

Parameters:
xcapURI - XCAP URI
Returns:
The AUID in this XCAP URI
Throws:
java.net.MalformedURLException - If the AUID was not found

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(DocumentSelector aDocumentSelector)
Compares this DocumentSelector to another DocumentSelector. If the two DocumentSelectors are different then return -1. If they are the same then return 0. If this DocumentSelector is contained in the other DocumentSelector then 1. If the other DocumentSelector is contained in this DocumentSelector then 2.

Parameters:
aDocumentSelector -
Returns: