Package org.apache.directory.shared.ldap.entry

Examples of org.apache.directory.shared.ldap.entry.ServerEntry


                                        String realm, String dc)
            throws DirectoryServerException {

        try {
            DN adminDN = new DN(partitionDN);
            ServerEntry serverEntry = this.directoryService.newEntry(adminDN);

            addObjectClasses(serverEntry, objectClasses);

            serverEntry.add("o", realm);

            if (dc == null) {
                logger.warn("Domain component not found for partition with DN - " + partitionDN +
                            ". Not setting domain component.");
            } else {
                serverEntry.add("dc", dc);
            }

            addAccessControlAttributes(serverEntry);

            this.directoryService.getAdminSession().add(serverEntry);
View Full Code Here


    private void addUserStoreToPartition(String partitionSuffixDn)
            throws DirectoryServerException {

        try {
            DN usersDN = new DN("ou=Users," + partitionSuffixDn);
            ServerEntry usersEntry = this.directoryService.newEntry(usersDN);
            usersEntry.add("objectClass", "organizationalUnit", "top");
            usersEntry.add("ou", "Users");

            this.directoryService.getAdminSession().add(usersEntry);

        } catch (LdapInvalidDnException e) {
            String msg = "Could not add user store to partition - " + partitionSuffixDn +
View Full Code Here

    }

    private void addGroupStoreToPartition(String partitionSuffixDn)
            throws DirectoryServerException {

        ServerEntry groupsEntry;
        try {

            DN groupsDN = new DN("ou=Groups," + partitionSuffixDn);

            groupsEntry = this.directoryService.newEntry(groupsDN);
            groupsEntry.add("objectClass", "organizationalUnit", "top");
            groupsEntry.add("ou", "Groups");

            this.directoryService.getAdminSession().add(groupsEntry);
        } catch (NamingException e) {
            String msg = "Could not add group store to partition - " + partitionSuffixDn +
                         ". Cause - partition domain name is not valid.";
View Full Code Here

        try {

            //add the permission entry
            DN adminACLEntrydn = new DN("cn=adminACLEntry," + tenantSuffix);
            ServerEntry adminACLEntry = directoryService.newEntry(adminACLEntrydn);
            adminACLEntry.add("objectClass", "accessControlSubentry", "subentry", "top");
            adminACLEntry.add("cn", "adminACLEntry");

            String aclScript = "{ " +
                               "identificationTag \"adminACLEntryTag\", " +
                               "precedence 1, " +
                               "authenticationLevel simple, " +
                               "itemOrUserFirst userFirst: " +
                               "{ " +
                               "userClasses " +
                               "{ " +
                               "name { " +
                               "\"uid=" + adminUid + ",ou=Users," + tenantSuffix + "\" " +
                               "}  " +
                               "}, " +
                               "userPermissions " +
                               "{ " +
                               "{ " +
                               "protectedItems { entry, allUserAttributeTypesAndValues }, " +
                               "grantsAndDenials { " +
                               "grantBrowse, " +
                               "grantFilterMatch, " +
                               "grantModify, " +
                               "grantAdd, " +
                               "grantCompare, " +
                               "grantRename, " +
                               "grantRead, " +
                               "grantReturnDN, " +
                               "grantImport, " +
                               "grantInvoke, " +
                               "grantRemove, " +
                               "grantExport, " +
                               "grantDiscloseOnError " +
                               "} " +
                               "} " +
                               "} " +
                               "} " +
                               "}";

            adminACLEntry.add("prescriptiveACI", aclScript);
            adminACLEntry.add("subtreeSpecification", "{ }");

            directoryService.getAdminSession().add(adminACLEntry);

        } catch (LdapInvalidDnException e) {
            throwDirectoryServerException("Domain name invalid - cn=adminACLEntry," +
View Full Code Here

                domainName = groupInfo.getGroupNameAttribute() + "=" +
                             groupInfo.getAdminRoleName() + "," + "ou=Groups," + partitionSuffix;

                DN adminGroup = new DN(domainName);
                ServerEntry adminGroupEntry = directoryService.newEntry(adminGroup);
                addObjectClasses(adminGroupEntry, groupInfo.getObjectClasses());

                adminGroupEntry.add(groupInfo.getGroupNameAttribute(),
                                    groupInfo.getAdminRoleName());
                adminGroupEntry.add(groupInfo.getMemberNameAttribute(),
                                    "uid=" + adminInfo.getAdminUID() + "," + "ou=Users," +
                                    partitionSuffix);
                directoryService.getAdminSession().add(adminGroupEntry);
            }
View Full Code Here

        String domainName = "uid=" + adminInfo.getAdminUID() + "," + "ou=Users," + partitionSuffix;

        try {
            DN adminDn = new DN(domainName);

            ServerEntry adminEntry = directoryService.newEntry(adminDn);

            List<String> objectClasses = adminInfo.getObjectClasses();
            if (kdcEnabled) {
                // Add Kerberose specific object classes
                objectClasses = new ArrayList<String>(adminInfo.getObjectClasses());
                objectClasses.add("krb5principal");
                objectClasses.add("krb5kdcentry");
            }

            addObjectClasses(adminEntry, objectClasses);

            adminEntry.add("uid", adminInfo.getAdminUID());
            adminEntry.add("sn", adminInfo.getAdminLastName());
            adminEntry.add("givenName", adminInfo.getAdminCommonName());
            //setting admin full name as uid since 'cn' is a compulsory attribute when constructing a
            // user entry.
            adminEntry.add("cn", adminInfo.getAdminUID());

            adminEntry.add("mail", adminInfo.getAdminEmail());

            if (kdcEnabled) {
                String principal = adminInfo.getAdminUID() + "@" + realm;
                adminEntry.put(KerberosAttribute.KRB5_PRINCIPAL_NAME_AT, principal);
                adminEntry.put(KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT, "0");
            }

            addAdminPassword(adminEntry, adminInfo.getAdminPassword(),
                             adminInfo.getPasswordAlgorithm(), kdcEnabled);
View Full Code Here

        while ( cursor.next() )
        {
            ForwardIndexEntry<Long, ServerEntry, Long> forwardEntry = ( ForwardIndexEntry<Long, ServerEntry, Long> ) cursor
                .get();
            ServerEntry interceptorEntry = configPartition.lookup( forwardEntry.getId() );

            String id = getString( "ads-interceptorId", interceptorEntry );
            String fqcn = getString( "ads-interceptorClassName", interceptorEntry );
            int order = getInt( "ads-interceptorOrder", interceptorEntry );
View Full Code Here

        while ( cursor.next() )
        {
            ForwardIndexEntry<Long, ServerEntry, Long> forwardEntry = ( ForwardIndexEntry<Long, ServerEntry, Long> ) cursor
                .get();
            ServerEntry partitionEntry = configPartition.lookup( forwardEntry.getId() );

            if ( !isEnabled( partitionEntry ) )
            {
                continue;
            }
            EntryAttribute ocAttr = partitionEntry.get( "objectClass" );

            if ( ocAttr.contains( "ads-jdbmPartition" ) )
            {
                JdbmPartition partition = getJdbmPartition( partitionEntry );
                partitions.put( partition.getId(), partition );
View Full Code Here

        while ( cursor.next() )
        {
            ForwardIndexEntry<Long, ServerEntry, Long> forwardEntry = ( ForwardIndexEntry<Long, ServerEntry, Long> ) cursor
                .get();
            ServerEntry indexEntry = configPartition.lookup( forwardEntry.getId() );

            if ( !isEnabled( indexEntry ) )
            {
                continue;
            }

            EntryAttribute ocAttr = indexEntry.get( "objectClass" );

            if ( ocAttr.contains( "ads-jdbmIndex" ) )
            {
                indexes.add( getJdbmIndex( indexEntry ) );
            }
View Full Code Here

        while ( cursor.next() )
        {
            ForwardIndexEntry<Long, ServerEntry, Long> forwardEntry = ( ForwardIndexEntry<Long, ServerEntry, Long> ) cursor
                .get();
            ServerEntry transportEntry = configPartition.lookup( forwardEntry.getId() );

            if ( !isEnabled( transportEntry ) )
            {
                continue;
            }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.entry.ServerEntry

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.