Examples of DirectoryServerException


Examples of org.wso2.carbon.apacheds.exception.DirectoryServerException


        } catch (Exception e) {
            String errorMessage = "Could not add the partition";
            logger.error(errorMessage, e);
            throw new DirectoryServerException(errorMessage, e);

        }
    }
View Full Code Here

Examples of org.wso2.carbon.apacheds.exception.DirectoryServerException

                        " added to directory service.");
            }

        } catch (Exception e) {
            logger.error("Error in initializing partition in directory service", e);
            throw new DirectoryServerException(e);
        }


    }
View Full Code Here

Examples of org.wso2.carbon.apacheds.exception.DirectoryServerException

        if (partition == null) {
            String msg = "Error deleting partition. Could not find a partition with suffix " +
                         partitionSuffix;
            logger.error(msg);
            throw new DirectoryServerException(msg);
        }

        try {
            this.directoryService.removePartition(partition);
        } catch (Exception e) {
            String msg = "Unable to delete partition with suffix " + partitionSuffix;
            logger.error(msg, e);
            throw new DirectoryServerException("Unable to delete partition with suffix " +
                                               partitionSuffix, e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.apacheds.exception.DirectoryServerException

                    this.directoryService.removePartition(partition);
                } catch (Exception e) {
                    String msg = "Unable to remove partition with id " + partition.getId() +
                                 " with suffix " + partition.getSuffix();
                    logger.error(msg, e);
                    throw new DirectoryServerException(msg, e);
                }
            }
        }
    }
View Full Code Here

Examples of org.wso2.carbon.apacheds.exception.DirectoryServerException

            for (Interceptor interceptor : interceptors) {
                interceptor.init(this.directoryService);
            }

        } catch (Exception e) {
            throw new DirectoryServerException("Unable to sync partitions. ", e);
        }

    }
View Full Code Here

Examples of org.wso2.carbon.apacheds.exception.DirectoryServerException

    private static void throwDirectoryServerException(String message, Throwable e)
            throws DirectoryServerException {

        logger.error(message, e);
        throw new DirectoryServerException(message, e);
    }
View Full Code Here

Examples of org.wso2.carbon.apacheds.exception.DirectoryServerException

        } catch (LdapInvalidDnException e) {
            String msg = "Could not add a new partition with partition id " + partitionId +
                         " and suffix " + partitionSuffix;
            logger.error(msg, e);
            throw new DirectoryServerException(msg, e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.apacheds.exception.DirectoryServerException

    public void init(final KdcConfiguration configuration, LDAPServer ldapServer)
        throws DirectoryServerException {

        if (configuration == null) {
            throw new DirectoryServerException("Could not initialize KDC server. " +
                                               "KDC configurations are null");
        }

        if (ldapServer == null) {
            throw new DirectoryServerException("Could not initialize KDC server. " +
                                               "Directory service is null.");
        }

        if (!(ldapServer instanceof ApacheLDAPServer)) {
            throw new DirectoryServerException("Apache KDC server is only compatible with " +
                                               "ApacheLDAPServer");
        }

        ApacheLDAPServer apacheLDAP = (ApacheLDAPServer)ldapServer;

        this.kdcServer.setServiceName(configuration.getKdcName());
        this.kdcServer.setKdcPrincipal(configuration.getKdcPrinciple());
        this.kdcServer.setPrimaryRealm(configuration.getPrimaryRealm());
        this.kdcServer.setMaximumTicketLifetime(configuration.getMaxTicketLifeTime());
        this.kdcServer.setMaximumRenewableLifetime(configuration.getMaxRenewableLifeTime());
        this.kdcServer.setSearchBaseDn(configuration.getSearchBaseDomainName());
        this.kdcServer.setPaEncTimestampRequired(
                configuration.isPreAuthenticateTimeStampRequired());
       
        configureTransportHandlers(configuration);

        DirectoryService directoryService = apacheLDAP.getService();

        if (directoryService == null) {
            throw new DirectoryServerException("LDAP service is null. " +
                                               "Could not configure Kerberos.");
        }

        this.kdcServer.setDirectoryService(directoryService);
View Full Code Here

Examples of org.wso2.carbon.apacheds.exception.DirectoryServerException

                schemaRoot.modifyAttributes("cn=Krb5kdc", mods);
            }
        } catch (NamingException e) {
            String msg = "An error occurred while enabling Kerberos schema.";
            logger.error(msg, e);
            throw new DirectoryServerException(msg, e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.apacheds.exception.DirectoryServerException

        DirContext ctx = null;

        try {

            if (!(ldapServer instanceof ApacheLDAPServer)) {
                throw new DirectoryServerException("Apache KDC server is only compatible with " +
                                                   "ApacheLDAPServer");
            }

            ApacheLDAPServer apacheLDAP = (ApacheLDAPServer)ldapServer;

            // Get a context, create the ou=users subcontext, then create the 3 principals.
            Hashtable<String, Object> env = new Hashtable<String, Object>();
            env.put(DirectoryService.JNDI_KEY, apacheLDAP.getService());
            env.put(Context.INITIAL_CONTEXT_FACTORY,
                    ConfigurationConstants.LDAP_INITIAL_CONTEXT_FACTORY);
            env.put(Context.PROVIDER_URL, ConfigurationConstants.USER_SUB_CONTEXT + "," +
                                          partitionInfo.getRootDN());
            env.put(Context.SECURITY_PRINCIPAL, partitionInfo.getAdminDomainName());
            env.put(Context.SECURITY_CREDENTIALS,
                    partitionInfo.getPartitionAdministrator().getAdminPassword());
            env.put(Context.SECURITY_AUTHENTICATION, ConfigurationConstants.SIMPLE_AUTHENTICATION);

            ctx = new InitialDirContext(env);


            // Set KDC principle for this partition
            Attributes attrs = getPrincipalAttributes(ConfigurationConstants.SERVER_PRINCIPLE,
                                           ConfigurationConstants.KDC_SERVER_COMMON_NAME,
                                           ConfigurationConstants.KDC_SERVER_UID,
                                           partitionInfo.getPartitionKdcPassword(),
                                           getKDCPrincipleName(partitionInfo));

            ctx.createSubcontext("uid=" + ConfigurationConstants.KDC_SERVER_UID, attrs);

            // Set LDAP principle for this partition
            attrs = getPrincipalAttributes(ConfigurationConstants.SERVER_PRINCIPLE,
                                           ConfigurationConstants.LDAP_SERVER_COMMON_NAME,
                                           ConfigurationConstants.LDAP_SERVER_UID,
                                           partitionInfo.getLdapServerPrinciplePassword(),
                                           getLDAPPrincipleName(partitionInfo));

            ctx.createSubcontext("uid=" + ConfigurationConstants.LDAP_SERVER_UID, attrs);

        } catch (NamingException e) {
            String msg = "Unable to add server principles for KDC and LDAP. " +
                         "Incorrect domain names.";
            logger.error(msg, e);
            throw new DirectoryServerException(msg, e);
        } finally {

            if (ctx != null) {
                try {
                    ctx.close();
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.