Package org.apache.directory.api.ldap.model.schema

Examples of org.apache.directory.api.ldap.model.schema.SchemaManager


     * {@inheritDoc}
     */
    public static Entry getSubschemaEntry( DirectoryService directoryService, FilteringOperationContext operationContext )
        throws LdapException
    {
        SchemaManager schemaManager = directoryService.getSchemaManager();

        Entry attrs = new DefaultEntry( schemaManager, Dn.ROOT_DSE );

        synchronized ( schemaSubentrLock )
        {
View Full Code Here


        {
            // The schema has already been extracted, bypass
        }

        SchemaLoader loader = new LdifSchemaLoader( schemaRepository );
        SchemaManager schemaManager = new DefaultSchemaManager( loader );

        // We have to load the schema now, otherwise we won't be able
        // to initialize the Partitions, as we won't be able to parse
        // and normalize their suffix Dn
        schemaManager.loadAllEnabled();

        // Tell all the normalizer comparators that they should not normalize anything
        ComparatorRegistry comparatorRegistry = schemaManager.getComparatorRegistry();

        for ( LdapComparator<?> comparator : comparatorRegistry )
        {
            if ( comparator instanceof NormalizingComparator )
            {
                ( ( NormalizingComparator ) comparator ).setOnServer();
            }
        }

        directoryService.setSchemaManager( schemaManager );

        // Init the LdifPartition
        LdifPartition ldifPartition = new LdifPartition( schemaManager );
        ldifPartition.setPartitionPath( new File( workingDirectory, "schema" ).toURI() );
        SchemaPartition schemaPartition = new SchemaPartition( schemaManager );
        schemaPartition.setWrappedPartition( ldifPartition );
        directoryService.setSchemaPartition( schemaPartition );

        List<Throwable> errors = schemaManager.getErrors();

        if ( errors.size() != 0 )
        {
            throw new Exception( I18n.err( I18n.ERR_317, Exceptions.printErrors( errors ) ) );
        }
View Full Code Here

     */
    public void loadSchema( SchemaLoader loader ) throws LdapException
    {
        try
        {
            SchemaManager tmp = new DefaultSchemaManager( loader );

            tmp.loadAllEnabled();

            if ( !tmp.getErrors().isEmpty() )
            {
                String msg = "there are errors while loading the schema";
                LOG.error( msg + " {}", tmp.getErrors() );
                throw new LdapException( msg );
            }

            schemaManager = tmp;

View Full Code Here

     * @param replicaId The replica ID
     */
    public ReplicaEventLog( DirectoryService directoryService, int replicaId ) throws IOException
    {
        PROVIDER_LOG.debug( "Creating the replication queue for replica {}", replicaId );
        SchemaManager schemaManager = directoryService.getSchemaManager();
        this.replicaId = replicaId;
        this.searchCriteria = new NotificationCriteria();
        this.searchCriteria.setEventMask( EventType.ALL_EVENT_TYPES_MASK );

        // Create the journal file, or open if already exists
View Full Code Here

     */
    public void loadSchema( SchemaLoader loader ) throws LdapException
    {
        try
        {
            SchemaManager tmp = new DefaultSchemaManager( loader );

            tmp.loadAllEnabled();

            if ( !tmp.getErrors().isEmpty() )
            {
                String msg = "there are errors while loading the schema";
                LOG.error( msg + " {}", tmp.getErrors() );
                throw new LdapException( msg );
            }

            schemaManager = tmp;

View Full Code Here

     */
    public void loadSchema( SchemaLoader loader ) throws LdapException
    {
        try
        {
            SchemaManager tmp = new DefaultSchemaManager( loader );

            tmp.loadAllEnabled();

            if ( !tmp.getErrors().isEmpty() )
            {
                String msg = "there are errors while loading the schema";
                LOG.error( msg + " {}", tmp.getErrors() );
                throw new LdapException( msg );
            }

            schemaManager = tmp;

View Full Code Here

    {
        Cursor<Entry> cursor = null;

        try
        {
            SchemaManager schemaManager = session.getDirectoryService().getSchemaManager();
            cursor = session.search( searchBaseDn, SearchScope.SUBTREE,
                getFilter( schemaManager, principal ), AliasDerefMode.DEREF_ALWAYS, "*" );

            cursor.beforeFirst();

View Full Code Here

    SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor(
            instanceLayout.getPartitionsDirectory());
    extractor.extractOrCopy();

    SchemaLoader loader = new LdifSchemaLoader(schemaPartitionDirectory);
    SchemaManager schemaManager = new DefaultSchemaManager(loader);
    schemaManager.loadAllEnabled();
    ds.setSchemaManager(schemaManager);
    // Init the LdifPartition with schema
    LdifPartition schemaLdifPartition = new LdifPartition(schemaManager);
    schemaLdifPartition.setPartitionPath(schemaPartitionDirectory.toURI());
View Full Code Here

    map.put("4", bindAddress);

    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    InputStream is1 = cl.getResourceAsStream("minikdc.ldiff");

    SchemaManager schemaManager = ds.getSchemaManager();
    LdifReader reader = null;

    try {
      final String content = StrSubstitutor.replace(IOUtils.toString(is1), map);
      reader = new LdifReader(new StringReader(content));
View Full Code Here

     * @param replicaId The replica ID
     */
    public ReplicaEventLog( DirectoryService directoryService, int replicaId ) throws IOException
    {
        PROVIDER_LOG.debug( "Creating the replication queue for replica {}", replicaId );
        SchemaManager schemaManager = directoryService.getSchemaManager();
        this.replicaId = replicaId;
        this.searchCriteria = new NotificationCriteria();
        this.searchCriteria.setEventMask( EventType.ALL_EVENT_TYPES_MASK );

        // Create the journal file, or open if already exists
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.schema.SchemaManager

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.