Examples of LDAPEntry


Examples of netscape.ldap.LDAPEntry

        // referrals failure

        LDAPAttributeSet attrSet = new LDAPAttributeSet();
        attrSet.add( new LDAPAttribute( "objectClass", "organizationalUnit" ) );
        attrSet.add( new LDAPAttribute( "ou", "UnderReferral" ) );
        LDAPEntry entry = new LDAPEntry( "ou=UnderReferral,uid=akarasuluref,ou=users,ou=system", attrSet );

        LDAPResponseListener listener = null;
        LDAPResponse response = null;
        listener = conn.add( entry, null, constraints );
        response = listener.getResponse();
View Full Code Here

Examples of netscape.ldap.LDAPEntry

      if ( _attrSet != null )
    throw new SAXException( Messages.format( "dsml.closingTagNotRecognized", tagName ) );
  } else if ( tagName.equals( XML.Entries.Elements.Entry ) ) {
      if ( _attrSet == null || _attr != null )
    throw new SAXException( Messages.format( "dsml.closingTagNotRecognized", tagName ) );
      _entries.addElement( new LDAPEntry( _entryDN, _attrSet ) );
      _entryDN = null;
      _attrSet = null;
  } else if ( tagName.equals( XML.Entries.Elements.ObjectClass ) ||
        tagName.equals( XML.Entries.Elements.Attribute ) ) {
      if ( _attrSet == null || _attr == null || _value != null )
View Full Code Here

Examples of netscape.ldap.LDAPEntry


    public void importEntry( LDAPEntry entry, int policy )
  throws LDAPException
    {
  LDAPEntry           existing;
  LDAPModificationSet modifs;
  LDAPAttributeSet    attrSet;
  LDAPAttribute       attr;
  int                 i;
  Enumeration         enumeration;

  if ( entry.getAttributeSet() == null ||
       entry.getAttributeSet().size() == 0 ) {

      if ( ( policy & ImportDescriptor.Policy.DeleteEmpty ) != 0 ) {
    try {
        _conn.read( entry.getDN() );
        _conn.delete( entry.getDN() );
        notify( entry.getDN(), ImportEventListener.Deleted );
    } catch ( LDAPException except ) {
        // Object does not exist, was not removed, ignore.
        // Anything else, we must complain.
        if ( except.getLDAPResultCode() != LDAPException.NO_SUCH_OBJECT )
      throw except;
        notify( entry.getDN(), ImportEventListener.Ignored );
    }
      } else {
    notify( entry.getDN(), ImportEventListener.Ignored );
      }

  } else {

      try {
    existing = _conn.read( entry.getDN() );

    modifs = new LDAPModificationSet();
    attrSet = entry.getAttributeSet();
    for ( i = 0 ; i < attrSet.size() ; ++i ) {
                    attr = attrSet.elementAt( i );
                    if ( existing.getAttributeSet().getAttribute( attr.getName() ) != null ) {
                        if ( ( policy & ImportDescriptor.Policy.NewAttrOnly ) == 0 ) {
                            if ( attr.size() > 0 ) {
                                modifs.add( LDAPModification.REPLACE, attr );
                            } else {
                                modifs.add( LDAPModification.DELETE, attr );
                            }
                        }
                    } else {
                        if ( ( policy & ImportDescriptor.Policy.UpdateOnly ) == 0 ) {
                            if ( attr.size() > 0 ) {
                                modifs.add( LDAPModification.ADD, attr );
                            }
                        }
                    }
                }
                if ( ( policy & ImportDescriptor.Policy.ReplaceAttr ) != 0 ) {
        enumeration = existing.getAttributeSet().getAttributes();
        while ( enumeration.hasMoreElements() ) {
      attr = (LDAPAttribute) enumeration.nextElement();
      if ( entry.getAttribute( attr.getName() ) == null ) {
          modifs.add( LDAPModification.DELETE, attr );
      }
View Full Code Here

Examples of netscape.ldap.LDAPEntry


    public void importEntries( Enumeration entries )
  throws ImportExportException
    {
  LDAPEntry entry;

  if ( getImportDescriptor() == null )
      setImportDescriptor( new ImportDescriptor() );
  try {
      while ( entries.hasMoreElements() ) {
    entry = (LDAPEntry) entries.nextElement();
    importEntry( entry, getImportDescriptor().getPolicy( entry.getDN() ) );
      }
  } catch ( LDAPException except ) {
      throw new ImportExportException( except );
  }
    }
View Full Code Here

Examples of netscape.ldap.LDAPEntry

       
        // add success
        LDAPAttributeSet attrSet = new LDAPAttributeSet();
        attrSet.add( new LDAPAttribute( "objectClass", "organizationalUnit" ) );
        attrSet.add( new LDAPAttribute( "ou", "UnderReferral" ) );
        LDAPEntry entry = new LDAPEntry( "ou=UnderReferral,uid=akarasuluref,ou=users,ou=system", attrSet );
       
        try
        {
            conn.add( entry, constraints );
            fail();
View Full Code Here

Examples of netscape.ldap.LDAPEntry

        // referrals failure
        LDAPAttributeSet attrSet = new LDAPAttributeSet();
        attrSet.add( new LDAPAttribute( "objectClass", "organizationalUnit" ) );
        attrSet.add( new LDAPAttribute( "ou", "UnderReferral" ) );
        LDAPEntry entry = new LDAPEntry( "ou=UnderReferral,ou=Computers,uid=akarasuluref,ou=users,ou=system", attrSet );
       
        LDAPResponseListener listener = conn.add( entry, null, constraints );
        LDAPResponse response = listener.getResponse();
        assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
View Full Code Here

Examples of netscape.ldap.LDAPEntry

        // referrals failure

        LDAPAttributeSet attrSet = new LDAPAttributeSet();
        attrSet.add( new LDAPAttribute( "objectClass", "organizationalUnit" ) );
        attrSet.add( new LDAPAttribute( "ou", "UnderReferral" ) );
        LDAPEntry entry = new LDAPEntry( "ou=UnderReferral,uid=akarasuluref,ou=users,ou=system", attrSet );
       
        LDAPResponseListener listener = null;
        LDAPResponse response = null;
        listener = conn.add( entry, null, constraints );
        response = listener.getResponse();
View Full Code Here

Examples of netscape.ldap.LDAPEntry

                { "vendorName" }, 0, "(ObjectClass=*)" );
            LDAPSearchResults results = LDAPConnection.search( url );

            if ( results.hasMoreElements() )
            {
                LDAPEntry entry = results.next();

                LDAPAttribute vendorName = entry.getAttribute( "vendorName" );

                if ( vendorName != null )
                {
                    assertEquals( "Apache Software Foundation", vendorName.getStringValueArray()[0] );
                }
View Full Code Here

Examples of netscape.ldap.LDAPEntry

                { "vendorName" }, 0, "(ObjectClass=*)" );
            LDAPSearchResults results = LDAPConnection.search( url );

            if ( results.hasMoreElements() )
            {
                LDAPEntry entry = results.next();

                LDAPAttribute vendorName = entry.getAttribute( "vendorName" );

                if ( vendorName != null )
                {
                    assertEquals( "Apache Software Foundation", vendorName.getStringValueArray()[0] );
                }
View Full Code Here

Examples of netscape.ldap.LDAPEntry

            final LDAPSearchResults results = connection.search(
                this.searchBase, LDAPv2.SCOPE_SUB, this.searchFilter, null,
                false);
            while (results.hasMoreElements())
            {
                final LDAPEntry entry = results.next();
                this.getLog().info("Dumping: " + entry.getDN());
                writer.printEntry(entry);
            }
        }
        catch (LDAPException e)
        {
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.