Package javax.naming

Examples of javax.naming.NoPermissionException


            // We don't allow modification of operational attributes
            if ( !attributeType.isCanUserModify() )
            {
                String msg = "Cannot modify the attribute : " + attributeType;
                LOG.error( msg );
                throw new NoPermissionException( msg );
            }
           
            // Check the syntax here
            if ( !attribute.isValid() )
            {
View Full Code Here


        {
            ne = new NamingException( t.getLocalizedMessage() );
        }
        else if ( t instanceof LdapNoPermissionException )
        {
            ne = new NoPermissionException( t.getLocalizedMessage() );
        }
        else if ( t instanceof LdapNoSuchAttributeException)
        {
            ne = new NoSuchAttributeException( t.getLocalizedMessage() );
        }
View Full Code Here

    {
        Dn target = buildTarget( JndiUtils.fromName( name ) );

        if ( target.size() == 0 )
        {
            throw new NoPermissionException( I18n.err( I18n.ERR_492 ) );
        }

        try
        {
            doDeleteOperation( target );
View Full Code Here

        Dn oldDn = buildTarget( JndiUtils.fromName( oldName ) );
        Dn newDn = buildTarget( JndiUtils.fromName( newName ) );

        if ( oldDn.size() == 0 )
        {
            throw new NoPermissionException( I18n.err( I18n.ERR_312 ) );
        }

        // calculate parents
        Dn oldParent = oldDn;
View Full Code Here

    private void checkPermissionToCreateBootstrapEntries() throws NamingException
    {
        String principal = ( String ) environment.get( Context.SECURITY_PRINCIPAL );
        if( principal == null || !ContextPartitionNexus.ADMIN_PRINCIPAL.equals( principal ) )
        {
            throw new NoPermissionException(
                    "Only '" + ContextPartitionNexus.ADMIN_PRINCIPAL + "' can initiate the first run." );
        }
    }
View Full Code Here

                Enumeration<ResourceRecord> records = resolver.lookup(nameToLookFor.toString(),
                        types, classes);

                attrs = createAttributesFromRecords(records);
            } catch (SecurityException e) {
                NoPermissionException e2 = new NoPermissionException();

                e2.setRootCause(e);
                throw e2;
            } catch (NamingException e) {
                throw e;
            } catch (Exception e) {
                NamingException ne = new NamingException();
View Full Code Here

                Attributes attrs = createAttributesFromRecords(records);

                result = DirectoryManager.getObjectInstance(
                        resolvedCtx, name, this, environment, attrs);
            } catch (SecurityException e) {
                NoPermissionException e2 =
                        new NoPermissionException(e.getMessage());

                e2.setRootCause(e);
                throw e2;
            } catch (NamingException e) {
                throw e;
            } catch (Exception e) {
                NamingException ne = new NamingException(e.getMessage());
View Full Code Here

                throw (ConfigurationException) new ConfigurationException(
                        Messages.getString("jndi.79")) //$NON-NLS-1$
                                .initCause(e);
            } catch (IllegalAccessException e) {
                // jndi.79=RMI Client Socket Factory cannot be instantiated
                throw (NoPermissionException) new NoPermissionException(
                        Messages.getString("jndi.79")) //$NON-NLS-1$
                                .initCause(e);
            }
        }
        registry = getRegistry(host, port, csf);
View Full Code Here

     */
    @SuppressWarnings("deprecation") //$NON-NLS-1$
    protected NamingException newNamingException(Throwable e) {
        NamingException ret =
                  (e instanceof AccessException)
                        ? new NoPermissionException()
                : (e instanceof ConnectException)
                        ? new ServiceUnavailableException()
                : (e instanceof ConnectIOException)
               || (e instanceof ExportException)
               || (e instanceof MarshalException)
View Full Code Here

        if (! (System.getSecurityManager() instanceof RMISecurityManager)) {
            try {
                System.setSecurityManager(new RMISecurityManager());
            } catch (SecurityException e) {
                // jndi.84=Cannot install RMISecurityManager
                throw (NoPermissionException) new NoPermissionException(
                        Messages.getString("jndi.84")).initCause(e); //$NON-NLS-1$
            }
        }
    }
View Full Code Here

TOP

Related Classes of javax.naming.NoPermissionException

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.