Package org.apache.directory.studio.apacheds.configuration.model

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


                .attribute( ServerXmlIOV154.ATTRIBUTE_SYNCH_PERIOD_MILLIS );
            if ( synchPeriodMillisAttribute == null )
            {
                // If the 'synchPeriodMillis' attribute does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV154.ErrorSyncPeriodMillis" ) ); //$NON-NLS-1$
            }
            else
            {
                serverConfiguration
                    .setSynchronizationPeriod( Integer.parseInt( synchPeriodMillisAttribute.getValue() ) );
View Full Code Here


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

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

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

            // SynchPeriodMillis
            org.dom4j.Attribute synchPeriodMillisAttribute = defaultDirectoryServiceElement
                .attribute( ServerXmlIOV156.ATTRIBUTE_SYNCH_PERIOD_MILLIS );
            if ( synchPeriodMillisAttribute == null )
            {
                // If the 'synchPeriodMillis' attribute does not exists,
                // we throw an exception
                throw new ServerXmlIOException( Messages.getString( "ServerXmlIOV156.ErrorSyncPeriodMillis" ) ); //$NON-NLS-1$
            }
            else
            {
                serverConfiguration
                    .setSynchronizationPeriod( Integer.parseInt( synchPeriodMillisAttribute.getValue() ) );
View Full Code Here

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    // Getting the 'enableSSL' attribute
                    boolean enableSsl = false;
                    org.dom4j.Attribute enableSslAttribut = tcpTransportElement
                        .attribute( ServerXmlIOV156.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( "ServerXmlIOV156.ErrorLdapServerPort" ) ); //$NON-NLS-1$
            }

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

TOP

Related Classes of org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException

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.