|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.novell.nds.dirxml.util.XdsDN
public class XdsDN
XdsDN
is an abstract representation of a distinguished name
Nested Class Summary | |
---|---|
static class |
XdsDN.DNComponent
|
Field Summary | |
---|---|
static int |
CUSTOM_FORM
Integer constant representing DN "custom" format. |
static char |
DELIM_CFG_FALSE
|
static char |
DELIM_CFG_TRUE
|
static int |
DI_CFG_ESC_STRINGS
|
static int |
DI_CFG_TYPED
|
static int |
DI_DV
|
static int |
DI_ESC
|
static int |
DI_EXTRA_QUOTED
|
static int |
DI_RDN
|
static int |
DI_REL
|
static int |
DI_SIZE
|
static int |
DI_VALUE
|
static int |
DI_WILD
|
static String |
DOT_DELIMS
Delimiter set for "dot" DN format. |
static int |
DOT_FORM
Integer constant representing DN "dot" format. |
static int |
ERR_INVALID_CHAR
|
static int |
ERR_NONE
|
static String |
illegalChars
|
static String |
LDAP_DELIMS
Delimiter set for "ldap" DN format. |
static int |
LDAP_FORM
Integer constant representing DN "ldap" format. |
static String |
QDOT_DELIMS
Delimiter set for "qualified-dot" DN format. |
static int |
QDOT_FORM
Integer constant representing DN "qualified-dot" format. |
static String |
QSLASH_DELIMS
Delimiter set for "qualified-slash" DN format. |
static int |
QSLASH_FORM
Integer constant representing DN "qualified-slash" format. |
static int |
SCOPE_ENTRY
|
static int |
SCOPE_SUBORDINATES
|
static int |
SCOPE_SUBTREE
|
static String |
SLASH_DELIMS
Delimiter set for " slash" DN format. |
static int |
SLASH_FORM
Integer constant representing DN "slash" format. |
Constructor Summary | |
---|---|
XdsDN(String srcDN,
char[] delims)
constructor |
|
XdsDN(XdsDN original)
copy constructor |
Method Summary | |
---|---|
static void |
appendComponent(StringBuffer sb,
XdsDN.DNComponent component,
char[] delims,
boolean typed)
Append a DN component to a StringBuffer. |
boolean |
checkScope(XdsDN base,
int scope)
check if dn is in a particular scope |
void |
copyTreeName(XdsDN src)
copyTreeName copies the tree name from another DN to this one |
static String |
decodeURL(String s)
Decode x-www-form-urlEncoded string. |
static String |
encodeURL(String s)
Encode x-www-form-urlEncoded string. |
boolean |
equals(XdsDN dn)
check if dn is equivalent |
XdsDN.DNComponent |
getComponent(int n)
get the nth component |
int |
getComponentCount()
getComponentCount return the number of components |
static String |
getDelims(int dnForm)
Return a String containing the delimiter set for
the passed DN format. |
static String |
getDelims(String dnForm)
Return a String containing the delimiter set for
the passed DN format. |
String |
getDN(char[] delims)
getDN get the whole DN |
String |
getDNFragment(char[] delims,
int loIndex,
int count,
boolean includeRoot)
getDNFragment return a fragment of the dn |
static String |
getFormString(char[] delims)
Return a human-readable string representing the name of the passed DN delimiter. |
static String |
getFormString(int dnForm)
Return a human-readable string representing the name of the passed DN format. |
String |
getName(char[] delims)
getName return the unqualified "name" of the object (without path, but escaped) |
String |
getNDSStreamURL()
getNDSStreamURL get the vnd.nds.stream URL representation of the URL |
String |
getNDSURLForm()
getNDSURLForm get the form of the DN suitable for use in vnd.nds.* URL |
int |
getParseErr()
Return any error that occurred while parsing a string as a DN. |
String |
getRDN(char[] delims,
int count)
getRDN return an rdn containing the last count components |
String |
getRelativeDN(XdsDN baseDN,
char[] delims)
getRelativeDN get DN relative to another DN |
String |
getTreeName()
getTreeName gets the treename for the dn |
boolean |
hasAncestor(XdsDN root)
check to see if root is an ancestor of this dn |
boolean |
hasTreeName()
hasTreeName returns whether or not the dn includes the tree name |
static void |
main(String[] args)
|
boolean |
matchComponent(XdsDN.DNComponent c1,
XdsDN.DNComponent c2)
check to see if two components match |
protected int |
parseDN(String dn,
char[] delims)
parses DN according to the delimiters |
static XdsDN |
parseNDSURLForm(String urlFile)
parseNDSURLForm Create an XdsDN from filespec from a vnd.nds.* URL |
static String |
quote(String string,
char[] d)
quote the special characters in a string |
void |
removeTreeName()
removeTreeName remove the tree name component if it is there |
void |
setHasTreeName(boolean hasTreeName)
setHasTreeName sets whether or not the dn includes the tree name
this is used to override the flag that was set by the parsing of the DN |
void |
setTreeName(String name)
setTreeName sets the treename for the dn |
String[] |
split(char[] delims)
split return the parent and the rdn |
static boolean |
validateDelims(char[] d)
check a delimiter string to see if it could be valid |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SLASH_FORM
"slash"
format.
public static final int QSLASH_FORM
"qualified-slash"
format.
public static final int DOT_FORM
"dot"
format.
public static final int QDOT_FORM
"qualified-dot"
format.
public static final int LDAP_FORM
"ldap"
format.
public static final int CUSTOM_FORM
"custom"
format.
public static final String SLASH_DELIMS
slash"
DN format.
public static final String QSLASH_DELIMS
"qualified-slash"
DN format.
public static final String DOT_DELIMS
"dot"
DN format.
public static final String QDOT_DELIMS
"qualified-dot"
DN format.
public static final String LDAP_DELIMS
"ldap"
DN format.
public static final int DI_CFG_TYPED
public static final int DI_CFG_ESC_STRINGS
public static final int DI_REL
public static final int DI_RDN
public static final int DI_DV
public static final int DI_VALUE
public static final int DI_WILD
public static final int DI_ESC
public static final int DI_SIZE
public static final int DI_EXTRA_QUOTED
public static final char DELIM_CFG_TRUE
public static final char DELIM_CFG_FALSE
public static final String illegalChars
public static final int SCOPE_SUBTREE
public static final int SCOPE_SUBORDINATES
public static final int SCOPE_ENTRY
public static final int ERR_NONE
public static final int ERR_INVALID_CHAR
Constructor Detail |
---|
public XdsDN(String srcDN, char[] delims)
srcDN
- dn to parsedelims
- delimiter to use for parsepublic XdsDN(XdsDN original)
original
- dn to copyMethod Detail |
---|
public static String getDelims(int dnForm)
String
containing the delimiter set for
the passed DN format.
dnForm
- SLASH_FORM, QSLASH_FORM, DOT_FORM, QDOT_FORM, LDAP_FORM.
String
containing delimiter set or null
, if argument is invalid.public static String getDelims(String dnForm)
String
containing the delimiter set for
the passed DN format.
dnForm
- "slash"
, "qualified-slash"
,
"dot"
, "qualified-dot"
, "ldap"
.
String
containing delimiter set or null
, if argument is invalid.public static String getFormString(int dnForm)
dnForm
- SLASH_FORM, QSLASH_FORM, DOT_FORM, QDOT_FORM, LDAP_FORM, CUSTOM_FORM.
String
containing the name, or "unknown"
if argument is invalid.public static String getFormString(char[] delims)
delims
- delimiters.
String
containing the namepublic int getParseErr()
public int getComponentCount()
getComponentCount
return the number of components
public boolean hasTreeName()
hasTreeName
returns whether or not the dn includes the tree name
public void setHasTreeName(boolean hasTreeName)
setHasTreeName
sets whether or not the dn includes the tree name
this is used to override the flag that was set by the parsing of the DN
hasTreeName
- true if dn includes a tree namepublic void removeTreeName()
removeTreeName
remove the tree name component if it is there
public void copyTreeName(XdsDN src)
copyTreeName
copies the tree name from another DN to this one
src
- the other DNpublic void setTreeName(String name)
setTreeName
sets the treename for the dn
name
- the tree namepublic String getTreeName()
getTreeName
gets the treename for the dn
null
otherwisepublic String getName(char[] delims)
getName
return the unqualified "name" of the object (without path, but escaped)
delims
- the delimiter set to use for escaping
public String getRDN(char[] delims, int count)
getRDN
return an rdn containing the last count components
delims
- the delimiter set for returned the namecount
- number of components to include in the suffix
public String[] split(char[] delims)
split
return the parent and the rdn
delims
- the delimiter set for returned the name
public String getDNFragment(char[] delims, int loIndex, int count, boolean includeRoot)
getDNFragment
return a fragment of the dn
delims
- the delimiter set for returned the nameloIndex
- index of the rootmost component to get (0 is rootmost component,
negative numbersstart at leaf node and work towards the root)count
- number of components to getincludeRoot
- include the root if doing all components and has tree name
public String getDN(char[] delims)
getDN
get the whole DN
delims
- the delimiter set for returned the name
public String getRelativeDN(XdsDN baseDN, char[] delims)
getRelativeDN
get DN relative to another DN
delims
- the delimiter set for returned the name
protected int parseDN(String dn, char[] delims)
dn
- the format desired to return the name in (DOT, SLASH, or LDAP)delims
- the delimiter chars
public boolean hasAncestor(XdsDN root)
root
- the ancestor in question
public boolean checkScope(XdsDN base, int scope)
base
- the base of the scope checkscope
- the scope relative to the base
public boolean equals(XdsDN dn)
dn
- to compare
public boolean matchComponent(XdsDN.DNComponent c1, XdsDN.DNComponent c2)
c1
- first componentc2
- second component
public XdsDN.DNComponent getComponent(int n)
n
- the index of the dn component to get (0
is rootmost, getComponentCount() - 1
is leafmost)
public static boolean validateDelims(char[] d)
d
- the delimiter chars
public static String quote(String string, char[] d)
d
- the delimiter chars
public static void appendComponent(StringBuffer sb, XdsDN.DNComponent component, char[] delims, boolean typed)
sb
- buffer to which to append.component
- component to appenddelims
- the delimiter set used to be usedtyped
- true if type information is desiredpublic String getNDSStreamURL()
getNDSStreamURL
get the vnd.nds.stream URL representation of the URL
public String getNDSURLForm()
getNDSURLForm
get the form of the DN suitable for use in vnd.nds.* URL
public static XdsDN parseNDSURLForm(String urlFile)
parseNDSURLForm
Create an XdsDN from filespec from a vnd.nds.* URL
urlFile
- the filespec from a vnd.nds.* URL
public static String decodeURL(String s)
s
- String to be decoded
public static String encodeURL(String s)
s
- String to be encoded
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |