Package javax.naming.directory

Examples of javax.naming.directory.InvalidAttributesException


    Method[] methodsToReturn = getSpecificMethods(testClass, methodAnnotation);
    Method methodToReturn = null;
    if (methodsToReturn.length == 1) {
      methodToReturn = methodsToReturn[0];
    } else if (methodsToReturn.length > 1) {
      throw new InvalidAttributesException("Only 1 non parameterized before method accepted");
    }

    return methodToReturn;
  }
View Full Code Here


            newMods = ServerEntryUtils
                .toServerModification( mods, getDirectoryService().getSchemaManager() );
        }
        catch ( LdapException le )
        {
            throw new InvalidAttributesException( le.getMessage() );
        }

        try
        {
            doModifyOperation( buildTarget( JndiUtils.fromName( name ) ), newMods );
View Full Code Here

                .convertToServerModification( mods,
                    getDirectoryService().getSchemaManager() );
        }
        catch ( LdapException le )
        {
            throw new InvalidAttributesException( le.getMessage() );
        }

        try
        {
            doModifyOperation( buildTarget( JndiUtils.fromName( name ) ), newMods );
View Full Code Here

            serverEntry = ServerEntryUtils.toServerEntry( AttributeUtils.toCaseInsensitive( attrs ), target,
                getDirectoryService().getSchemaManager() );
        }
        catch ( LdapInvalidAttributeTypeException liate )
        {
            throw new InvalidAttributesException( liate.getMessage() );
        }

        // No object binding so we just add the attributes
        if ( null == obj )
        {
            Entry clone = serverEntry.clone();
            try
            {
                doAddOperation( target, clone );
            }
            catch ( Exception e )
            {
                JndiUtils.wrap( e );
            }
            return;
        }

        // First, use state factories to do a transformation
        DirStateFactory.Result res = DirectoryManager.getStateToBind( obj, name, this, getEnvironment(), attrs );
        Entry outServerEntry = null;

        try
        {
            outServerEntry = ServerEntryUtils.toServerEntry(
                res.getAttributes(), target, getDirectoryService().getSchemaManager() );
        }
        catch ( LdapInvalidAttributeTypeException le )
        {
            throw new InvalidAttributesException( le.getMessage() );
        }

        if ( outServerEntry != serverEntry )
        {
            Entry clone = serverEntry.clone();

            if ( ( outServerEntry != null ) && ( outServerEntry.size() > 0 ) )
            {
                for ( Attribute attribute : outServerEntry )
                {
                    try
                    {
                        clone.put( attribute );
                    }
                    catch ( LdapException e )
                    {
                        // TODO Auto-generated catch block
                    }
                }
            }

            try
            {
                // setup the op context
                doAddOperation( target, clone );
            }
            catch ( Exception e )
            {
                JndiUtils.wrap( e );
            }

            return;
        }

        // Check for Referenceable
        if ( obj instanceof Referenceable )
        {
            throw new NamingException( I18n.err( I18n.ERR_493 ) );
        }

        // Store different formats
        if ( obj instanceof Reference )
        {
            // Store as ref and add outAttrs
            throw new NamingException( I18n.err( I18n.ERR_494 ) );
        }
        else if ( obj instanceof Serializable )
        {
            // Serialize and add outAttrs
            Entry clone = serverEntry.clone();

            if ( outServerEntry != null && outServerEntry.size() > 0 )
            {
                for ( Attribute attribute : outServerEntry )
                {
                    try
                    {
                        clone.put( attribute );
                    }
                    catch ( LdapException le )
                    {
                        throw new InvalidAttributesException( le.getMessage() );
                    }
                }
            }

            try
View Full Code Here

                modItems,
                getDirectoryService().getSchemaManager() );
        }
        catch ( LdapException le )
        {
            throw new InvalidAttributesException( le.getMessage() );
        }

        try
        {
            doModifyOperation( buildTarget( DN.fromName( name ) ), newMods );
View Full Code Here

            newMods = ServerEntryUtils
                .toServerModification( mods, getDirectoryService().getSchemaManager() );
        }
        catch ( LdapException le )
        {
            throw new InvalidAttributesException( le.getMessage() );
        }
       
        try
        {
            doModifyOperation( buildTarget( DN.fromName( name ) ), newMods );
View Full Code Here

                .convertToServerModification( mods,
                    getDirectoryService().getSchemaManager() );
        }
        catch ( LdapException le )
        {
            throw new InvalidAttributesException( le.getMessage() );
        }
       
        try
        {
            doModifyOperation( buildTarget( DN.fromName( name ) ), newMods );
View Full Code Here

            serverEntry = ServerEntryUtils.toServerEntry( AttributeUtils.toCaseInsensitive( attrs ), target,
                getDirectoryService().getSchemaManager() );
        }
        catch ( LdapInvalidAttributeTypeException liate )
        {
            throw new InvalidAttributesException( liate.getMessage() );
        }

        // No object binding so we just add the attributes
        if ( null == obj )
        {
            ServerEntry clone = ( ServerEntry ) serverEntry.clone();
            try
            {
                doAddOperation( target, clone );
            }
            catch ( Exception e )
            {
                JndiUtils.wrap( e );
            }
            return;
        }

        // First, use state factories to do a transformation
        DirStateFactory.Result res = DirectoryManager.getStateToBind( obj, name, this, getEnvironment(), attrs );
        ServerEntry outServerEntry = null;
       
        try
        {
            outServerEntry = ServerEntryUtils.toServerEntry(
                res.getAttributes(), target, getDirectoryService().getSchemaManager() );
        }
        catch ( LdapInvalidAttributeTypeException le )
        {
            throw new InvalidAttributesException( le.getMessage() );
        }

        if ( outServerEntry != serverEntry )
        {
            ServerEntry clone = ( ServerEntry ) serverEntry.clone();

            if ( ( outServerEntry != null ) && ( outServerEntry.size() > 0 ) )
            {
                for ( EntryAttribute attribute : outServerEntry )
                {
                    try
                    {
                        clone.put( attribute );
                    }
                    catch ( LdapException e )
                    {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                }
            }

            try
            {
                // setup the op context
                doAddOperation( target, clone );
            }
            catch ( Exception e )
            {
                JndiUtils.wrap( e );
            }
           
            return;
        }

        // Check for Referenceable
        if ( obj instanceof Referenceable )
        {
            throw new NamingException( I18n.err( I18n.ERR_493 ) );
        }

        // Store different formats
        if ( obj instanceof Reference )
        {
            // Store as ref and add outAttrs
            throw new NamingException( I18n.err( I18n.ERR_494 ) );
        }
        else if ( obj instanceof Serializable )
        {
            // Serialize and add outAttrs
            ServerEntry clone = ( ServerEntry ) serverEntry.clone();

            if ( outServerEntry != null && outServerEntry.size() > 0 )
            {
                for ( EntryAttribute attribute : outServerEntry )
                {
                    try
                    {
                        clone.put( attribute );
                    }
                    catch ( LdapException le )
                    {
                        throw new InvalidAttributesException( le.getMessage() );
                    }
                }
            }

            try
View Full Code Here

   *
   */
  public void test06InvalidAttrException() {
    ctxmock.expects(once()).method("modifyAttributes").with(same(cn),
        modopCheck05()).will(
        throwException(new InvalidAttributesException()));
    /* input */
    Personne input = new Personne();
    input.setName("Naquin");
    input.setSurname("Thierry");
    /* operations */
 
View Full Code Here

                modItems,
                getDirectoryService().getSchemaManager() );
        }
        catch ( LdapNoSuchAttributeException lnsae )
        {
            throw new InvalidAttributesException( lnsae.getMessage() );
        }
        catch ( LdapException le )
        {
            throw new InvalidAttributeValueException( le.getMessage() );
        }
View Full Code Here

TOP

Related Classes of javax.naming.directory.InvalidAttributesException

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.