Package org.apache.directory.server.core.configuration

Examples of org.apache.directory.server.core.configuration.MutablePartitionConfiguration


     * Start the server.
     */
    public void start() throws Exception
    {
        // Add partition 'sevenSeas'
        MutablePartitionConfiguration pcfg = new MutablePartitionConfiguration();
        pcfg.setName("sevenSeas");
        pcfg.setSuffix("o=sevenseas");

        // Create some indices
        Set<String> indexedAttrs = new HashSet<String>();
        indexedAttrs.add("objectClass");
        indexedAttrs.add("o");
        pcfg.setIndexedAttributes(indexedAttrs);

        // Create a first entry associated to the partition
        Attributes attrs = new BasicAttributes(true);

        // First, the objectClass attribute
        Attribute attr = new BasicAttribute("objectClass");
        attr.add("top");
        attr.add("organization");
        attrs.put(attr);

        // The the 'Organization' attribute
        attr = new BasicAttribute("o");
        attr.add("sevenseas");
        attrs.put(attr);

        // Associate this entry to the partition
        pcfg.setContextEntry(attrs);

        // As we can create more than one partition, we must store
        // each created partition in a Set before initialization
        Set<MutablePartitionConfiguration> pcfgs = new HashSet<MutablePartitionConfiguration>();
        pcfgs.add(pcfg);
View Full Code Here


    {
        BasicAttributes attrs;
        Set indexedAttrs;
        BasicAttribute attr;
        Set pcfgs = new HashSet();
        MutablePartitionConfiguration pcfg;
        pcfg = new MutablePartitionConfiguration();

        pcfg.setName( this.customRootPartitionName );
        pcfg.setSuffix( "dc=" + this.customRootPartitionName );

        indexedAttrs = new HashSet();
        indexedAttrs.add( "ou" );
        indexedAttrs.add( "dc" );
        indexedAttrs.add( "objectClass" );
        pcfg.setIndexedAttributes( indexedAttrs );

        attrs = new BasicAttributes( true );

        attr = new BasicAttribute( "objectClass" );
        attr.add( "top" );
        attr.add( "domain" );
        attr.add( "extensibleObject" );
        attrs.put( attr );

        attr = new BasicAttribute( "dc" );
        attr.add( this.customRootPartitionName );
        attrs.put( attr );

        pcfg.setContextEntry( attrs );

        pcfgs.add( pcfg );

        return pcfgs;
    }
View Full Code Here

   protected LdapContext rootDSE;

   public DummyLDAPServiceImpl() throws Exception
   {
      // configuration and launch of embedded ldap server
      MutablePartitionConfiguration pcfg = new MutablePartitionConfiguration();

      pcfg.setName("eXoTestPartition");
      pcfg.setSuffix("dc=exoplatform,dc=org");

      Set<String> indexedAttrs = new HashSet<String>();
      indexedAttrs.add("objectClass");
      indexedAttrs.add("o");
      pcfg.setIndexedAttributes(indexedAttrs);

      Attributes attrs = new BasicAttributes(true);
      Attribute attr = new BasicAttribute("objectClass");
      attr.add("top");
      attr.add("organization");
      attrs.put(attr);
      attr = new BasicAttribute("o");
      attr.add("eXoTestPartition");
      attrs.put(attr);
      pcfg.setContextEntry(attrs);

      Set<MutablePartitionConfiguration> pcfgs = new HashSet<MutablePartitionConfiguration>();
      pcfgs.add(pcfg);
      configuration.setContextPartitionConfigurations(pcfgs);
      File workingDirectory = new File("target/working-server");
View Full Code Here

    };

    @Override
    public void setUp() throws Exception {
        // Add partition 'test'
        MutablePartitionConfiguration pcfg = new MutablePartitionConfiguration();
        pcfg.setName("test");
        pcfg.setSuffix("o=test");

        // Create some indices
        Set<String> indexedAttrs = new HashSet<String>();
        indexedAttrs.add("objectClass");
        indexedAttrs.add("o");
        pcfg.setIndexedAttributes(indexedAttrs);

        // Create a first entry associated to the partition
        Attributes attrs = new BasicAttributes(true);

        // First, the objectClass attribute
        Attribute attr = new BasicAttribute("objectClass");
        attr.add("top");
        attr.add("organization");
        attrs.put(attr);

        // The the 'Organization' attribute
        attr = new BasicAttribute("o");
        attr.add("test");
        attrs.put(attr);

        // Associate this entry to the partition
        pcfg.setContextEntry(attrs);

        // As we can create more than one partition, we must store
        // each created partition in a Set before initialization
        Set<MutablePartitionConfiguration> pcfgs = new HashSet<MutablePartitionConfiguration>();
        pcfgs.add(pcfg);
View Full Code Here

    }

    public void addPartition( Partition partition )
        throws NamingException
    {
        MutablePartitionConfiguration configuration = new MutablePartitionConfiguration();

        configuration.setId( partition.getName() );
        configuration.setSuffix( partition.getSuffix() );
        configuration.setIndexedAttributes( partition.getIndexedAttributes() );
        configuration.setContextEntry( partition.getContextAttributes() );
        //configuration.setSynchOnWrite( true );
        configuration.setCacheSize( 1 );
        //configuration.setOptimizerEnabled( false );
        partitionConfigurations.add( configuration );
    }
View Full Code Here

    }

    public void addPartition( String name, String root, Set indexedAttributes, Attributes partitionAttributes )
        throws NamingException
    {
        MutablePartitionConfiguration configuration = new MutablePartitionConfiguration();
        configuration.setId( name );
        configuration.setSuffix( root );
        configuration.setIndexedAttributes( indexedAttributes );
        configuration.setContextEntry( partitionAttributes );
        partitionConfigurations.add( configuration );
    }
View Full Code Here

   protected LdapContext rootDSE;

   public DummyLDAPServiceImpl() throws Exception
   {
      // configuration and launch of embedded ldap server
      MutablePartitionConfiguration pcfg = new MutablePartitionConfiguration();

      pcfg.setName("eXoTestPartition");
      pcfg.setSuffix("dc=exoplatform,dc=org");

      Set<String> indexedAttrs = new HashSet<String>();
      indexedAttrs.add("objectClass");
      indexedAttrs.add("o");
      pcfg.setIndexedAttributes(indexedAttrs);

      Attributes attrs = new BasicAttributes(true);
      Attribute attr = new BasicAttribute("objectClass");
      attr.add("top");
      attr.add("organization");
      attrs.put(attr);
      attr = new BasicAttribute("o");
      attr.add("eXoTestPartition");
      attrs.put(attr);
      pcfg.setContextEntry(attrs);

      Set<MutablePartitionConfiguration> pcfgs = new HashSet<MutablePartitionConfiguration>();
      pcfgs.add(pcfg);
      configuration.setContextPartitionConfigurations(pcfgs);
      File workingDirectory = new File("target/working-server");
View Full Code Here

     * Start the server.
     */
    public void start() throws Exception
    {
        // Add partition 'sevenSeas'
        MutablePartitionConfiguration pcfg = new MutablePartitionConfiguration();
        pcfg.setName("sevenSeas");
        pcfg.setSuffix("o=sevenseas");

        // Create some indices
        Set<String> indexedAttrs = new HashSet<String>();
        indexedAttrs.add("objectClass");
        indexedAttrs.add("o");
        pcfg.setIndexedAttributes(indexedAttrs);

        // Create a first entry associated to the partition
        Attributes attrs = new BasicAttributes(true);

        // First, the objectClass attribute
        Attribute attr = new BasicAttribute("objectClass");
        attr.add("top");
        attr.add("organization");
        attrs.put(attr);

        // The the 'Organization' attribute
        attr = new BasicAttribute("o");
        attr.add("sevenseas");
        attrs.put(attr);

        // Associate this entry to the partition
        pcfg.setContextEntry(attrs);

        // As we can create more than one partition, we must store
        // each created partition in a Set before initialization
        Set<MutablePartitionConfiguration> pcfgs = new HashSet<MutablePartitionConfiguration>();
        pcfgs.add(pcfg);
View Full Code Here

    };

    @Override
    public void setUp() throws Exception {
        // Add partition 'test'
        MutablePartitionConfiguration pcfg = new MutablePartitionConfiguration();
        pcfg.setName("test");
        pcfg.setSuffix("o=test");

        // Create some indices
        Set<String> indexedAttrs = new HashSet<String>();
        indexedAttrs.add("objectClass");
        indexedAttrs.add("o");
        pcfg.setIndexedAttributes(indexedAttrs);

        // Create a first entry associated to the partition
        Attributes attrs = new BasicAttributes(true);

        // First, the objectClass attribute
        Attribute attr = new BasicAttribute("objectClass");
        attr.add("top");
        attr.add("organization");
        attrs.put(attr);

        // The the 'Organization' attribute
        attr = new BasicAttribute("o");
        attr.add("test");
        attrs.put(attr);

        // Associate this entry to the partition
        pcfg.setContextEntry(attrs);

        // As we can create more than one partition, we must store
        // each created partition in a Set before initialization
        Set<MutablePartitionConfiguration> pcfgs = new HashSet<MutablePartitionConfiguration>();
        pcfgs.add(pcfg);
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.configuration.MutablePartitionConfiguration

Copyright © 2018 www.massapicom. 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.