Examples of RDN


Examples of org.apache.directory.shared.ldap.name.Rdn

    /**
     * {@inheritDoc}
     */
    public Rdn getRdn()
    {
        Rdn rdn = getDn().getRdn();
        return rdn == null ? new Rdn() : rdn;
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.name.Rdn

        {
            return getDelegate().getRdn();
        }
        else
        {
            Rdn rdn = dn.getRdn();
            return rdn == null ? new Rdn() : rdn;
        }
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.name.Rdn

     * @param entry2 the second entry
     * @return a negative integer, zero, or a positive integer
     */
    private int compareRdns( IEntry entry1, IEntry entry2 )
    {
        Rdn rdn1 = entry1.getRdn();
        Rdn rdn2 = entry2.getRdn();

        if ( rdn1 == null && rdn2 == null )
        {
            return equal();
        }
        else if ( rdn1 == null && rdn2 != null )
        {
            return greaterThan();
        }
        else if ( rdn1 != null && rdn2 == null )
        {
            return lessThan();
        }
        else
        {
            return compare( rdn1.getUpName(), rdn2.getUpName() );
        }
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.name.Rdn

     * @param entry2 the second entry
     * @return a negative integer, zero, or a positive integer
     */
    private int compareRdnValues( IEntry entry1, IEntry entry2 )
    {
        Rdn rdn1 = entry1.getRdn();
        Rdn rdn2 = entry2.getRdn();

        if ( ( rdn1 == null || rdn1.getValue() == null || "".equals( rdn1.getValue() ) ) //$NON-NLS-1$
            && ( rdn2 == null || rdn2.getValue() == null || "".equals( rdn2.getValue() ) ) ) //$NON-NLS-1$
        {
            return equal();
        }
        else if ( ( rdn1 == null || rdn1.getValue() == null || "".equals( rdn1.getValue() ) ) //$NON-NLS-1$
            && !( rdn2 == null || rdn2.getValue() == null || "".equals( rdn2.getValue() ) ) ) //$NON-NLS-1$
        {
            return greaterThan();
        }
        else if ( !( rdn1 == null || rdn1.getValue() == null || "".equals( rdn1.getValue() ) ) //$NON-NLS-1$
            && ( rdn2 == null || rdn2.getValue() == null || "".equals( rdn2.getValue() ) ) ) //$NON-NLS-1$
        {
            return lessThan();
        }

        String rdn1Value = ( String ) rdn1.getUpValue();
        String rdn2Value = ( String ) rdn2.getUpValue();
        if ( rdn1Value.matches( "\\d*" ) && !rdn2Value.matches( "\\d*" ) ) //$NON-NLS-1$ //$NON-NLS-2$
        {
            // return lessThan();
            return compare( rdn1Value, rdn2Value );
        }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.RDN

            {
                entryToCopy = srs[0].getEntry();
                IAttribute[] attributesToCopy = entryToCopy.getAttributes();

                // create new entry
                RDN rdn = entryToCopy.getRdn();
                IEntry newEntry = new Entry( parent, rdn );

                // change RDN if entry already exists
                StudioProgressMonitor testMonitor = new StudioProgressMonitor( monitor );
                IEntry testEntry = parent.getBrowserConnection().getEntry( newEntry.getDn(), testMonitor );
                if ( testEntry != null )
                {
                    String rdnValue = rdn.getValue();
                    String newRdnValue = BrowserCoreMessages.bind( BrowserCoreMessages.copy_n_of_s, "", rdnValue ); //$NON-NLS-1$
                    RDN newRdn = getNewRdn( rdn, newRdnValue );
                    newEntry = new Entry( parent, newRdn );
                    testEntry = parent.getBrowserConnection().getEntry( newEntry.getDn(), testMonitor );
                    for ( int i = 2; testEntry != null; i++ )
                    {
                        newRdnValue = BrowserCoreMessages.bind( BrowserCoreMessages.copy_n_of_s, i + " ", rdnValue ); //$NON-NLS-1$
                        newRdn = getNewRdn( rdn, newRdnValue );
                        newEntry = new Entry( parent, newRdn );
                        testEntry = parent.getBrowserConnection().getEntry( newEntry.getDn(), testMonitor );
                    }
                }

                // copy attributes
                for ( int i = 0; i < attributesToCopy.length; i++ )
                {
                    IAttribute attributeToCopy = attributesToCopy[i];

                    if ( SchemaUtils.isModifyable( attributeToCopy.getAttributeTypeDescription() )
                        || IAttribute.REFERRAL_ATTRIBUTE.equalsIgnoreCase( attributeToCopy.getDescription() ) )
                    {
                        IAttribute newAttribute = new Attribute( newEntry, attributeToCopy.getDescription() );
                        newEntry.addAttribute( newAttribute );
                        IValue[] valuesToCopy = attributeToCopy.getValues();
                        for ( int j = 0; j < valuesToCopy.length; j++ )
                        {
                            IValue valueToCopy = valuesToCopy[j];
                            IValue newValue = new Value( newAttribute, valueToCopy.getRawValue() );
                            newAttribute.addValue( newValue );
                        }
                    }
                }

                // check if RDN attributes ar present
                RDN newRdn = newEntry.getRdn();
                RDNPart[] oldRdnParts = rdn.getParts();
                for ( int i = 0; i < oldRdnParts.length; i++ )
                {
                    RDNPart part = oldRdnParts[i];
                    IAttribute rdnAttribute = newEntry.getAttribute( part.getType() );
                    if ( rdnAttribute != null )
                    {
                        IValue[] values = rdnAttribute.getValues();
                        for ( int ii = 0; ii < values.length; ii++ )
                        {
                            if ( part.getUnencodedValue().equals( values[ii].getRawValue() ) )
                            {
                                rdnAttribute.deleteValue( values[ii] );
                            }
                            if ( rdnAttribute.getValueSize() == 0 )
                            {
                                newEntry.deleteAttribute( rdnAttribute );
                            }
                        }
                    }
                }
                RDNPart[] newRdnParts = newRdn.getParts();
                for ( int i = 0; i < newRdnParts.length; i++ )
                {
                    RDNPart part = newRdnParts[i];
                    IAttribute rdnAttribute = newEntry.getAttribute( part.getType() );
                    if ( rdnAttribute == null )
View Full Code Here

Examples of org.bouncycastle.asn1.x500.RDN

   */
  public String getUserCertificateCN()
     throws CertificateEncodingException
  {
    X500Name x500name = new JcaX509CertificateHolder(userCertificate).getSubject();
    RDN cn = x500name.getRDNs(BCStyle.CN)[0];

    return IETFUtils.valueToString(cn.getFirst().getValue());
  }
View Full Code Here

Examples of org.nasutekds.server.types.RDN

      return null;
    }


    // Get the information about the RDN attributes.
    RDN rdn = dn.getRDN();
    int numAVAs = rdn.getNumValues();

    // If there is only one RDN attribute, then see which objectclass we should
    // use.
    ObjectClass structuralClass;
    if (numAVAs == 1)
    {
      AttributeType attrType = rdn.getAttributeType(0);

      if (attrType.hasName(ATTR_C))
      {
        structuralClass = DirectoryServer.getObjectClass(OC_COUNTRY, true);
      }
      else if (attrType.hasName(ATTR_DC))
      {
        structuralClass = DirectoryServer.getObjectClass(OC_DOMAIN, true);
      }
      else if (attrType.hasName(ATTR_O))
      {
        structuralClass = DirectoryServer.getObjectClass(OC_ORGANIZATION, true);
      }
      else if (attrType.hasName(ATTR_OU))
      {
        structuralClass =
             DirectoryServer.getObjectClass(OC_ORGANIZATIONAL_UNIT_LC, true);
      }
      else
      {
        structuralClass =
             DirectoryServer.getObjectClass(OC_UNTYPED_OBJECT_LC, true);
      }
    }
    else
    {
      structuralClass =
           DirectoryServer.getObjectClass(OC_UNTYPED_OBJECT_LC, true);
    }


    // Get the top and untypedObject classes to include in the entry.
    LinkedHashMap<ObjectClass,String> objectClasses =
         new LinkedHashMap<ObjectClass,String>(3);

    objectClasses.put(DirectoryServer.getTopObjectClass(), OC_TOP);
    objectClasses.put(structuralClass, structuralClass.getNameOrOID());


    // Iterate through the RDN attributes and add them to the set of user or
    // operational attributes.
    LinkedHashMap<AttributeType,List<Attribute>> userAttributes =
         new LinkedHashMap<AttributeType,List<Attribute>>();
    LinkedHashMap<AttributeType,List<Attribute>> operationalAttributes =
         new LinkedHashMap<AttributeType,List<Attribute>>();

    boolean extensibleObjectAdded = false;
    for (int i=0; i < numAVAs; i++)
    {
      AttributeType attrType = rdn.getAttributeType(i);
      AttributeValue attrValue = rdn.getAttributeValue(i);
      String attrName = rdn.getAttributeName(i);

      // First, see if this type is allowed by the untypedObject class.  If not,
      // then we'll need to include the extensibleObject class.
      if ((! structuralClass.isRequiredOrOptional(attrType)) &&
          (! extensibleObjectAdded))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.