Package javax.naming

Examples of javax.naming.InvalidNameException


     * {@inheritDoc}
     */
    public void rebind(Name name, Object obj) throws NamingException {
        if (name.isEmpty()) {
            // jndi.7D=Cannot rebind empty name
            throw new InvalidNameException(Messages.getString("jndi.7D")); //$NON-NLS-1$
        }
        String stringName = getMyComponents(name);

        try {
            registry.rebind(stringName, getStateToBind(stringName, obj));
View Full Code Here


     * {@inheritDoc}
     */
    public void unbind(Name name) throws NamingException {
        if (name.isEmpty()) {
            // jndi.7E=Cannot unbind empty name
            throw new InvalidNameException(Messages.getString("jndi.7E")); //$NON-NLS-1$
        }
        String stringName = getMyComponents(name);

        try {
            registry.unbind(stringName);
View Full Code Here

            //    nameToLookFor = (DNSName) name.clone();
            //}
        }
        else {
            // jndi.4B=Only instances of CompositeName class or DNSName class are acceptable
            throw new InvalidNameException(Messages.getString("jndi.4B")); //$NON-NLS-1$
        }

        // we should have correct nameToLookFor at this point
        if (remainingName != null) {
            CannotProceedException cpe = constructCannotProceedException(
View Full Code Here

            //    nameToLookFor = (DNSName) name.clone();
            //}
        }
        else {
            // jndi.4B=Only instances of CompositeName class or DNSName class are acceptable
            throw new InvalidNameException(Messages.getString("jndi.4B")); //$NON-NLS-1$
        }
        // we should have correct nameToLookFor at this point
        types[0] = lookupAttrType;
        classes[0] = lookupAttrClass;
        if (remainingName != null) {
View Full Code Here

            //} else {
            //    nameToList = (DNSName) name.clone();
            //}
        }
        else {
            throw new InvalidNameException(Messages.getString("jndi.4B")); //$NON-NLS-1$
        }
        // we should have correct nameToLookFor at this point
        if (remainingName != null) {
            CannotProceedException cpe = constructCannotProceedException(
                    altName, remainingName);
View Full Code Here

               NameParser parser = context.getNameParser("");
               URI userNameUri = new URI(absoluteName);
               String pathComponent = userNameUri.getPath();
               // Should not ever have an empty path component, since that is /{DN}
               if (pathComponent.length() < 1 ) {
                   throw new InvalidNameException(
                           "Search returned unparseable absolute name: " +
                           absoluteName );
               }
               Name name = parser.parse(pathComponent.substring(1));
               return name.toString();
           } catch ( URISyntaxException e ) {
               throw new InvalidNameException(
                       "Search returned unparseable absolute name: " +
                       absoluteName );
           }
        }
    }
View Full Code Here

               NameParser parser = context.getNameParser("");
               URI userNameUri = new URI(absoluteName);
               String pathComponent = userNameUri.getPath();
               // Should not ever have an empty path component, since that is /{DN}
               if (pathComponent.length() < 1 ) {
                   throw new InvalidNameException(
                           "Search returned unparseable absolute name: " +
                           absoluteName );
               }
               Name name = parser.parse(pathComponent.substring(1));
               return name.toString();
           } catch ( URISyntaxException e ) {
               throw new InvalidNameException(
                       "Search returned unparseable absolute name: " +
                       absoluteName );
           }
        }
    }
View Full Code Here

     * @see javax.naming.Name#add(int, java.lang.String)
     */
    public Name add(int posn, String comp) throws InvalidNameException {
        if (!componentIsOk(comp)) {
            // jndi.30={0} can't be used as a component for DNS name
            throw new InvalidNameException(Messages.getString("jndi.30", comp)); //$NON-NLS-1$
        }
        components.insertElementAt(comp, posn);
        return this;
    }
View Full Code Here

     * @see javax.naming.Name#add(java.lang.String)
     */
    public Name add(String comp) throws InvalidNameException {
        if (!componentIsOk(comp)) {
            // jndi.30={0} can't be used as a component for DNS name
            throw new InvalidNameException(Messages.getString("jndi.30", comp));//$NON-NLS-1$
        }
        components.addElement(comp);
        return this;
    }
View Full Code Here

    public Name addAll(int posn, Name name) throws InvalidNameException {
        Vector<String> newComps;

        if (!(name instanceof DNSName)) {
            // jndi.31=Given name is not an instance of DNSName class
            throw new InvalidNameException(Messages.getString("jndi.31")); //$NON-NLS-1$
        }
        newComps = ((DNSName) name).components;
        components.addAll(posn, newComps);
        return this;
    }
View Full Code Here

TOP

Related Classes of javax.naming.InvalidNameException

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.