Examples of LdapServer


Examples of org.apache.directory.studio.ldapservers.model.LdapServer

     * @return
     *      the corresponding {@link LdapServer}
     */
    private static LdapServer readLdapServer( Element element )
    {
        LdapServer server = new LdapServer();

        // ID
        Attribute idAttribute = element.attribute( ID_ATTRIBUTE );
        if ( idAttribute != null )
        {
            server.setId( idAttribute.getValue() );
        }

        // Name
        Attribute nameAttribute = element.attribute( NAME_ATTRIBUTE );
        if ( nameAttribute != null )
        {
            server.setName( nameAttribute.getValue() );
        }

        // Adapter ID
        Attribute adapterIdAttribute = element.attribute( ADAPTER_ID_ATTRIBUTE );
        if ( adapterIdAttribute != null )
        {
            // Getting the id
            String adapterId = adapterIdAttribute.getValue();

            // Looking for the correct LDAP Server Adapter Extension object
            LdapServerAdapterExtension ldapServerAdapterExtension = LdapServerAdapterExtensionsManager.getDefault()
                .getLdapServerAdapterExtensionById( adapterId );
            if ( ldapServerAdapterExtension != null )
            {
                // The Adapter Extension has been found
                // Assigning it to the server
                server.setLdapServerAdapterExtension( ldapServerAdapterExtension );
            }
            else
            {
                // The Adapter Extension has not been found
                // Creating an "unknown" Adapter Extension
                UnknownLdapServerAdapterExtension unknownLdapServerAdapterExtension = new UnknownLdapServerAdapterExtension();

                // Adapter Id
                unknownLdapServerAdapterExtension.setId( adapterId );

                // Adapter Name
                Attribute adapterNameAttribute = element.attribute( ADAPTER_NAME_ATTRIBUTE );
                if ( adapterNameAttribute != null )
                {
                    unknownLdapServerAdapterExtension.setName( adapterNameAttribute.getValue() );
                }

                // Adapter Vendor
                Attribute adapterVendorAttribute = element.attribute( ADAPTER_VENDOR_ATTRIBUTE );
                if ( adapterVendorAttribute != null )
                {
                    unknownLdapServerAdapterExtension.setVendor( adapterVendorAttribute.getValue() );
                }

                // Adapter Version
                Attribute adapterVersionAttribute = element.attribute( ADAPTER_VERSION_ATTRIBUTE );
                if ( adapterVersionAttribute != null )
                {
                    unknownLdapServerAdapterExtension.setVersion( adapterVersionAttribute.getValue() );
                }

                // Assigning the "unknown" Adapter Extension to the server
                server.setLdapServerAdapterExtension( unknownLdapServerAdapterExtension );
            }
        }
        else
        {
            // TODO No Adapter ID, throw an error ?
View Full Code Here

Examples of org.sonatype.ldaptestsuite.LdapServer

  @Override
  public void tearDown()
      throws Exception
  {
    for (Entry<String, LdapServer> entry : this.ldapServerMap.entrySet()) {
      LdapServer ldapServer = entry.getValue();
      logger.info("Stopping LDAP server: " + entry.getKey());
      ldapServer.stop();
      ldapServer = null;
    }
    this.ldapServerMap = null;

    super.tearDown();
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.