Examples of ServerXmlIOException


Examples of org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException

                    }
                    else
                    {
                        // If the 'port' attribute does not exists,
                        // we throw an exception
                        throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorKdcServerPort" ) ); //$NON-NLS-1$
                    }
                }
                else
                {
                    // If the 'tcpTransport' element does not exists,
                    // we throw an exception
                    throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorKdcServerPort" ) ); //$NON-NLS-1$
                }
            }
            else
            {
                // If the 'transports' element does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorKdcServerPort" ) ); //$NON-NLS-1$
            }
        }
    }
View Full Code Here

Examples of org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException

                    }
                    else
                    {
                        // If the 'port' attribute does not exists,
                        // we throw an exception
                        throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorNtpServerPort" ) ); //$NON-NLS-1$
                    }
                }
                else
                {
                    // If the 'tcpTransport' element does not exists,
                    // we throw an exception
                    throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorNtpServerPort" ) ); //$NON-NLS-1$
                }
            }
            else
            {
                // If the 'transports' element does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorNtpServerPort" ) ); //$NON-NLS-1$
            }
        }
    }
View Full Code Here

Examples of org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException

                    }
                    else
                    {
                        // If the 'port' attribute does not exists,
                        // we throw an exception
                        throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorDnsServerPort" ) ); //$NON-NLS-1$
                    }
                }
                else
                {
                    // If the 'tcpTransport' element does not exists,
                    // we throw an exception
                    throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorDnsServerPort" ) ); //$NON-NLS-1$
                }
            }
            else
            {
                // If the 'transports' element does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorDnsServerPort" ) ); //$NON-NLS-1$
            }
        }
    }
View Full Code Here

Examples of org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException

                .attribute( ServerXmlIOV155.ATTRIBUTE_ALLOW_ANONYMOUS_ACCESS );
            if ( allowAnonymousAccessAttribute == null )
            {
                // If the 'allowAnonymousAccess' attribute does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorAllowAnonymousAccess" ) ); //$NON-NLS-1$
            }
            else
            {
                serverConfiguration.setAllowAnonymousAccess( parseBoolean( allowAnonymousAccessAttribute.getValue() ) );
            }

            // SaslHost
            org.dom4j.Attribute saslHostAttribute = ldapServerElement.attribute( ServerXmlIOV155.ATTRIBUTE_SASL_HOST );
            if ( saslHostAttribute == null )
            {
                // If the 'saslHost' attribute does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorSaslHost" ) ); //$NON-NLS-1$
            }
            else
            {
                serverConfiguration.setSaslHost( saslHostAttribute.getValue() );
            }

            // SaslPrincipal
            org.dom4j.Attribute saslPrincipalAttribute = ldapServerElement
                .attribute( ServerXmlIOV155.ATTRIBUTE_SASL_PRINCIPAL );
            if ( saslPrincipalAttribute == null )
            {
                // If the 'saslPrincipal' attribute does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorSaslPrincipal" ) ); //$NON-NLS-1$
            }
            else
            {
                serverConfiguration.setSaslPrincipal( saslPrincipalAttribute.getValue() );
            }

            // SearchBaseDn
            org.dom4j.Attribute searchBaseDnAttribute = ldapServerElement
                .attribute( ServerXmlIOV155.ATTRIBUTE_SEARCH_BASE_DN );
            if ( searchBaseDnAttribute == null )
            {
                // If the 'searchBaseDn' attribute does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorSearchBaseDn" ) ); //$NON-NLS-1$
            }
            else
            {
                serverConfiguration.setSearchBaseDn( searchBaseDnAttribute.getValue() );
            }

            // MaxTimeLimit
            org.dom4j.Attribute maxTimeLimitAttribute = ldapServerElement
                .attribute( ServerXmlIOV155.ATTRIBUTE_MAX_TIME_LIMIT );
            if ( maxTimeLimitAttribute == null )
            {
                // If the 'maxTimeLimit' attribute does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorMaxTimeLimit" ) ); //$NON-NLS-1$
            }
            else
            {
                serverConfiguration.setMaxTimeLimit( Integer.parseInt( maxTimeLimitAttribute.getValue() ) );
            }

            // MaxSizeLimit
            org.dom4j.Attribute maxSizeLimitAttribute = ldapServerElement
                .attribute( ServerXmlIOV155.ATTRIBUTE_MAX_SIZE_LIMIT );
            if ( maxSizeLimitAttribute == null )
            {
                // If the 'maxSizeLimit' attribute does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorMaxSizeLimit" ) ); //$NON-NLS-1$
            }
            else
            {
                serverConfiguration.setMaxSizeLimit( Integer.parseInt( maxSizeLimitAttribute.getValue() ) );
            }

            // Getting the 'transports' element
            Element transportsElement = ldapServerElement.element( ServerXmlIOV155.ELEMENT_TRANSPORTS );
            if ( transportsElement != null )
            {
                // Looping on all 'tcpTransport' elements
                for ( Iterator<?> iterator = transportsElement.elementIterator( ServerXmlIOV155.ELEMENT_TCP_TRANSPORT ); iterator
                    .hasNext(); )
                {
                    // Getting the 'tcpTransport' element
                    Element tcpTransportElement = ( Element ) iterator.next();

                    // Getting the 'port' attribute
                    org.dom4j.Attribute portAttribute = tcpTransportElement.attribute( ServerXmlIOV155.ATTRIBUTE_PORT );
                    if ( portAttribute == null )
                    {
                        // If the 'port' attribute does not exists,
                        // we throw an exception
                        throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorLdapServerPort" ) ); //$NON-NLS-1$
                    }

                    // Getting the 'enableSSL' attribute
                    boolean enableSsl = false;
                    org.dom4j.Attribute enableSslAttribut = tcpTransportElement
                        .attribute( ServerXmlIOV155.ATTRIBUTE_ENABLESSL );
                    if ( enableSslAttribut != null )
                    {
                        enableSsl = parseBoolean( enableSslAttribut.getValue() );
                    }

                    // Enabling the right protocol
                    if ( enableSsl )
                    {
                        serverConfiguration.setEnableLdaps( true );
                        serverConfiguration.setLdapsPort( Integer.parseInt( portAttribute.getValue() ) );
                    }
                    else
                    {
                        serverConfiguration.setEnableLdap( true );
                        serverConfiguration.setLdapPort( Integer.parseInt( portAttribute.getValue() ) );
                    }

                }
            }
            else
            {
                // If the 'transports' element does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV155.ErrorLdapServerPort" ) ); //$NON-NLS-1$
            }

            // Supported Mechanisms
            Element supportedMechanismsElement = ldapServerElement
                .element( ServerXmlIOV155.ELEMENT_SASL_MECHANISM_HANDLERS );
View Full Code Here

Examples of org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException

            {
                throw ( ServerXmlIOException ) e;
            }
            else
            {
                ServerXmlIOException exception = new ServerXmlIOException( e.getMessage(), e.getCause() );
                exception.setStackTrace( e.getStackTrace() );
                throw exception;
            }
        }
    }
View Full Code Here

Examples of org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException

        throws ServerXmlIOException, NumberFormatException, BooleanFormatException
    {
        Element defaultDirectoryServiceElement = element.element( ELEMENT_DEFAULT_DIRECTORY_SERVICE );
        if ( defaultDirectoryServiceElement == null )
        {
            throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV153.ErrorDefaultDirectoryService" ) ); //$NON-NLS-1$
        }
        else
        {
            // Access Control Enabled
            org.dom4j.Attribute accessControlEnabledAttribute = defaultDirectoryServiceElement
                .attribute( ServerXmlIOV153.ATTRIBUTE_ACCESS_CONTROL_ENABLED );
            if ( accessControlEnabledAttribute == null )
            {
                // If the 'accessControlEnabled' attribute does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV153.ErrorAccessControlEnabled" ) ); //$NON-NLS-1$
            }
            else
            {
                serverConfiguration.setEnableAccessControl( parseBoolean( accessControlEnabledAttribute.getValue() ) );
            }

            // Denormalize Op Attrs Enabled
            org.dom4j.Attribute denormalizeOpAttrsEnabledAttribute = defaultDirectoryServiceElement
                .attribute( ServerXmlIOV153.ATTRIBUTE_DENORMALIZE_OP_ATTRS_ENABLED );
            if ( denormalizeOpAttrsEnabledAttribute == null )
            {
                // If the 'denormalizeOpAttrsEnabled' attribute does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV153.ErrorDenormalizedOpAttrsEnabled" ) ); //$NON-NLS-1$
            }
            else
            {
                serverConfiguration
                    .setDenormalizeOpAttr( parseBoolean( denormalizeOpAttrsEnabledAttribute.getValue() ) );
View Full Code Here

Examples of org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException

        throws ServerXmlIOException, NumberFormatException
    {
        Element standardThreadPoolElement = element.element( ServerXmlIOV153.ELEMENT_STANDARD_THREAD_POOL );
        if ( standardThreadPoolElement == null )
        {
            throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV153.ErrorStandardThreadPool" ) ); //$NON-NLS-1$
        }
        else
        {
            // MaxThreads
            org.dom4j.Attribute maxThreadsAttribute = standardThreadPoolElement
                .attribute( ServerXmlIOV153.ATTRIBUTE_MAX_THREADS );
            if ( maxThreadsAttribute == null )
            {
                // If the 'maxThreads' attribute does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV153.ErrorMaxThreads" ) ); //$NON-NLS-1$
            }
            else
            {
                serverConfiguration.setMaxThreads( Integer.parseInt( maxThreadsAttribute.getValue() ) );
            }
View Full Code Here

Examples of org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException

        Element systemPartitionElement = element.element( ServerXmlIOV153.ELEMENT_SYSTEM_PARTITION );
        if ( systemPartitionElement == null )
        {
            // If the 'systemPartition' element does not exists,
            // we throw an exception
            throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV153.ErrorSystemPartition" ) ); //$NON-NLS-1$
        }
        else
        {
            // Getting the 'jdbmPartition' element
            Element jdbmPartitionElement = systemPartitionElement.element( ServerXmlIOV153.ELEMENT_JDBM_PARTITION );
            if ( jdbmPartitionElement == null )
            {
                // If the 'jdbmPartition' element does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV153.ErrorJDBMPartition" ) ); //$NON-NLS-1$
            }
            else
            {
                // Creating the system partition
                Partition systemPartition = new Partition();
View Full Code Here

Examples of org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException

        org.dom4j.Attribute idAttribute = element.attribute( ServerXmlIOV153.ATTRIBUTE_ID );
        if ( idAttribute == null )
        {
            // If the 'id' attribute does not exists,
            // we throw an exception
            throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV153.ErrorId" ) ); //$NON-NLS-1$
        }
        else
        {
            partition.setId( idAttribute.getValue() );
        }

        // Cache Size
        org.dom4j.Attribute cacheSizeAttribute = element.attribute( ServerXmlIOV153.ATTRIBUTE_CACHE_SIZE );
        if ( cacheSizeAttribute == null )
        {
            // If the 'cacheSize' attribute does not exists,
            // we throw an exception
            throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV153.ErrorCacheSize" ) ); //$NON-NLS-1$
        }
        else
        {
            partition.setCacheSize( Integer.parseInt( cacheSizeAttribute.getValue() ) );
        }

        // Suffix
        org.dom4j.Attribute suffixAttribute = element.attribute( ServerXmlIOV153.ATTRIBUTE_SUFFIX );
        if ( suffixAttribute == null )
        {
            // If the 'suffix' attribute does not exists,
            // we throw an exception
            throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV153.ErrorSuffix" ) ); //$NON-NLS-1$
        }
        else
        {
            partition.setSuffix( suffixAttribute.getValue() );
        }

        // Optimizer Enabled
        org.dom4j.Attribute optimizerEnabledAttribute = element.attribute( ServerXmlIOV153.ATTRIBUTE_OPTIMIZER_ENABLED );
        if ( optimizerEnabledAttribute == null )
        {
            // If the 'optimizeEnabled' attribute does not exists,
            // we throw an exception
            throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV153.ErrorOptimizerEnabled" ) ); //$NON-NLS-1$
        }
        else
        {
            partition.setEnableOptimizer( parseBoolean( optimizerEnabledAttribute.getValue() ) );
        }

        // Sync On Write
        org.dom4j.Attribute syncOnWriteAttribute = element.attribute( ServerXmlIOV153.ATTRIBUTE_SYNC_ON_WRITE );
        if ( syncOnWriteAttribute == null )
        {
            // If the 'syncOnWrite' attribute does not exists,
            // we throw an exception
            throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV153.ErrorSyncOnWrite" ) ); //$NON-NLS-1$
        }
        else
        {
            partition.setSynchronizationOnWrite( parseBoolean( syncOnWriteAttribute.getValue() ) );
        }
View Full Code Here

Examples of org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException

        Element contextEntryElement = element.element( ServerXmlIOV153.ELEMENT_CONTEXT_ENTRY );
        if ( contextEntryElement == null )
        {
            // If the 'contextEntry' element does not exists,
            // we throw an exception
            throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV153.ErrorContextEntry" ) ); //$NON-NLS-1$
        }
        else
        {
            // Getting the id of the linked bean
            String linkedBeanId = contextEntryElement.getText().trim();

            // Removing the '#' character at the beginning of the value
            linkedBeanId = linkedBeanId.substring( 1, linkedBeanId.length() );

            // Creating a 'foundBean' flag to check if we've found the associated bean
            boolean foundBean = false;

            // Looping on all 'bean' tags
            for ( Iterator<?> i = element.getDocument().getRootElement().elementIterator( ServerXmlIOV153.ELEMENT_BEAN ); i
                .hasNext(); )
            {
                // Getting the bean element
                Element beanElement = ( Element ) i.next();

                // Getting the id attribute
                org.dom4j.Attribute idAttribute = beanElement.attribute( ServerXmlIOV153.ATTRIBUTE_ID );
                if ( idAttribute != null )
                {
                    // Checking if we've found the correct bean
                    if ( linkedBeanId.equalsIgnoreCase( idAttribute.getValue() ) )
                    {
                        // Setting the 'foundBean' flag to true
                        foundBean = true;

                        // Creating a 'foundProperty' flag to check if we've found the associated bean
                        boolean foundProperty = false;

                        // Looping on all 'property' tags
                        for ( Iterator<?> i2 = beanElement.elementIterator( ServerXmlIOV153.ELEMENT_PROPERTY ); i2
                            .hasNext(); )
                        {
                            // Getting the property element
                            Element propertyElement = ( Element ) i2.next();

                            // Getting the name attribute
                            org.dom4j.Attribute nameAttribute = propertyElement
                                .attribute( ServerXmlIOV153.ATTRIBUTE_NAME );
                            if ( nameAttribute != null )
                            {
                                if ( nameAttribute.getValue().equalsIgnoreCase( ServerXmlIOV153.VALUE_ARGUMENTS ) )
                                {
                                    // Setting the 'foundProperty' flag to true
                                    foundProperty = true;

                                    // Getting the list element
                                    Element listElement = propertyElement.element( ServerXmlIOV153.ELEMENT_LIST );
                                    if ( listElement != null )
                                    {
                                        // Looping on all 'value' tags
                                        for ( Iterator<?> i3 = listElement
                                            .elementIterator( ServerXmlIOV153.ELEMENT_VALUE ); i3.hasNext(); )
                                        {
                                            // Getting the value element
                                            Element valueElement = ( Element ) i3.next();

                                            // Getting the text value
                                            String value = valueElement.getText().trim();

                                            // We are looking for LDIF, so let's look if the text value
                                            // contains any ':'
                                            if ( value.indexOf( ':' ) != -1 )
                                            {
                                                // Returning the LDIF converted to JNDI Attributes
                                                return readContextEntry( valueElement.getText().trim() );
                                            }
                                        }
                                    }
                                }
                            }
                        }

                        // Checking if we have found the associated property
                        // If not, we throw an error
                        if ( !foundProperty )
                        {
                            // If the correct property element does not exists,
                            // we throw an exception
                            throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV153.ErrorArguments" ) ); //$NON-NLS-1$
                        }
                    }
                }
            }

            // Checking if we have found the associated bean
            // If not, we throw an error
            if ( !foundBean )
            {
                // If the correct bean element does not exists,
                // we throw an exception
                throw new ServerXmlIOException( NLS.bind(
                    Messages.getString( "ServerXmlIOV153.ErrorBean" ), new String[] { linkedBeanId } ) ); //$NON-NLS-1$
            }
        }

        return null;
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.