Tabnine Logo
DN
Code IndexAdd Tabnine to your IDE (free)

How to use
DN
in
com.novell.ldap.util

Best Java code snippets using com.novell.ldap.util.DN (Showing top 11 results out of 315)

origin: com.novell.ldap/jldap

/**
 * Creates an RDN object from the DN component specified in the string RDN
 *
 * @param rdn the DN component
 */
public RDN(String rdn){
  rawValue = rdn;
  DN dn = new DN(rdn);
  Vector rdns = dn.getRDNs();
  //there should only be one rdn
  if (rdns.size() != 1)
    throw new IllegalArgumentException("Invalid RDN: see API " +
      "documentation");
  RDN thisRDN   = (RDN)(rdns.elementAt(0));
  this.types    = thisRDN.types;
  this.values   = thisRDN.values;
  this.rawValue = thisRDN.rawValue;
  return;
}
origin: com.novell.ldap/jldap

/**
* Compares the two strings per the distinguishedNameMatch equality matching
* (using case-ignore matching).  IllegalArgumentException is thrown if one
* or both DNs are invalid.  UnsupportedOpersationException is thrown if the
* API implementation is not able to detemine if the DNs match or not.
*
*  @param dn1            String form of the first DN to compare.
*<br><br>
*  @param dn2            String form of the second DN to compare.
*
* @return Returns true if the two strings correspond to the same DN; false
*         if the DNs are different.
*/
public static boolean equals (String dn1, String dn2) {
  DN dnA = new DN(dn1);
  DN dnB = new DN(dn2);
  return dnA.equals(dnB);
}
origin: com.novell.ldap/jldap

/**
* Returns the individual components of a distinguished name (DN).
*
* @param dn        The distinguished name, for example, "cn=Babs
*                  Jensen,ou=Accounting,o=Acme,c=US"
*<br><br>
* @param noTypes   If true, returns only the values of the
*                  components and not the names.  For example, "Babs
*                  Jensen", "Accounting", "Acme", "US" instead of
*                  "cn=Babs Jensen", "ou=Accounting", "o=Acme", and
*                  "c=US".
*
* @return An array of strings representing the individual components
* of a DN, or null if the DN is not valid.
*/
public static String[] explodeDN(String dn, boolean noTypes) {
  DN dnToExplode = new DN(dn);
  return dnToExplode.explodeDN(noTypes);
}
origin: com.novell.ldap/jldap

/**
 * Returns the DN normalized by removal of non-significant space characters
 * as per RFC 2253, section4.
 *
 * @return      a normalized string
 */
public static String normalize(String dn){
  DN testDN = new DN(dn);
  return testDN.toString();
}
origin: com.novell.ldap/jldap

if (isAlpha(currChar))
      throw new IllegalArgumentException(dnString);
    currChar = dnString.charAt(currIndex);
    if (isDigit(currChar))
else if (isDigit(currChar))
if (isAlpha(currChar) || isDigit(currChar) || (currChar == '-'))
  tokenBuf[tokenIndex++] = currChar;
else
if (!isDigit(currChar))
  throw new IllegalArgumentException(dnString);
firstDigitZero = (currChar == '0') ? true: false;
    (isDigit(currChar) && firstDigitZero) ||
while (isDigit(currChar) && (currIndex < lastIndex)){
  tokenBuf[tokenIndex++] = currChar;
  currChar = dnString.charAt(++currIndex);
    throw new IllegalArgumentException(dnString);
  currChar = dnString.charAt(++currIndex);
  if (isHexDigit(currChar))
    if (isHexDigit(nextChar))
      char tmpc = hexToChar(currChar, nextChar);
origin: sakaiproject/sakai

DN dn = new DN(dnString);
DN containerDN = dn.getParent();
Vector<RDN> containerRDNs = containerDN.getRDNs();
Iterator<RDN> containerRDNsIterator = containerRDNs.iterator();
RDN rdn = containerRDNsIterator.next();
origin: com.novell.ldap/jldap

DN dn = new DN(base);
    Identifier id = new Identifier();
    try {
      id.setType(this.getIdentifierType(((RDN)dn.getRDNs().get(0)).getType()));
    } catch (IllegalArgumentException e1) {
      throw new LDAPException("Could not determine type",53, e1.toString(), e1);
      throw new LDAPException("Could not determine type",53, e1.toString(), e1);
    id.setId(dn.explodeDN(true)[0]);
origin: com.novell.ldap/jldap

/**
 * Returns true if the string conforms to distinguished name syntax.
 * @param dn    String to evaluate fo distinguished name syntax.
 * @return      true if the dn is valid.
 */
public static boolean isValid(String dn){
  try {
    new DN(dn);
  } catch (IllegalArgumentException iae){
    return false;
  }
  return true;
}
origin: com.novell.ldap/jldap

/**
 * Returns the Parent of this DN
 * @return Parent DN
 */
public DN getParent(){
  DN parent = new DN();
  parent.rdnList = (ArrayList)this.rdnList.clone();
  if (parent.rdnList.size() >= 1)
    parent.rdnList.remove(0);  //remove first object
  return parent;
}
origin: com.novell.ldap/jldap

DN dn = new DN(entry.getDN());
RDN rdn = (RDN) dn.getRDNs().get(0);
Identifier id = new Identifier();
origin: com.novell.ldap/jldap

DN dnVal = new DN(dn);
RDN rdn = (RDN) dnVal.getRDNs().get(0);
Identifier id = new Identifier();
com.novell.ldap.utilDN

Javadoc

A DN encapsulates a Distinguished Name (an ldap name with context). A DN does not need to be fully distinguished, or extend to the Root of a directory. It provides methods to get information about the DN and to manipulate the DN.

The following are examples of valid DN:

  • cn=admin,ou=marketing,o=corporation
  • cn=admin,ou=marketing
  • 2.5.4.3=admin,ou=marketing
  • oid.2.5.4.3=admin,ou=marketing

Note: Multivalued attributes are all considered to be one component and are represented in one RDN (see RDN)

Most used methods

  • <init>
    Constructs a new DN based on the specified string representation of a distinguished name. The syntax
  • getRDNs
    Retrieves a list of RDN Objects, or individual names of the DN
  • equals
    Compares this DN to the specified DN to determine if they are equal.
  • explodeDN
    return a string array of the individual RDNs contained in the DN
  • getParent
    Returns the Parent of this DN
  • hexToChar
    Converts two valid hex digit characters that form the string representation of an ascii character va
  • isAlpha
    Checks a character to see if it is an ascii alphabetic character in ranges 65-90 or 97-122.
  • isDigit
    Checks a character to see if it is an ascii digit (0-9) character in the ascii value range 48-57.
  • isHexDigit
    Checks a character to see if it is valid hex digit 0-9, a-f, or A-F (ASCII value ranges 48-47, 65-70
  • needsEscape
    Checks a character to see if it must always be escaped in the string representation of a DN. We must
  • toString
    Creates and returns a string that represents this DN. The string follows RFC 2253, which describes S
  • toString

Popular in Java

  • Making http post requests using okhttp
  • putExtra (Intent)
  • getContentResolver (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Path (java.nio.file)
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now