Package javax.naming

Examples of javax.naming.InvalidNameException


              if (!isRegistrationDisabled) {
                if (!RegistrationUtil.createAccountIfMissing(accountStore, id, null, welcomeBot)) {
                  return null;
                }
              } else {
                throw new InvalidNameException(
                    "User doesn't already exist, and registration disabled by administrator");
              }
            }
            return id;
          }
View Full Code Here


    }

    public Object lookup(String name) throws NamingException {
        Object binding = null;
        if (name == null || name.length() == 0)
            throw new InvalidNameException("name cannot be null or empty");

        if (name.equals(ACTIVE_SUBJECT))
            binding = getSubject();
        else if (name.equals(AUTHENTICATION_MGR))
            binding = getAuthenticationManager();
View Full Code Here

        {
            ne = new InvalidAttributeValueException( t.getLocalizedMessage() );
        }
        else if ( t instanceof LdapInvalidDnException )
        {
            ne = new InvalidNameException( t.getLocalizedMessage() );
        }
        else if ( t instanceof LdapInvalidSearchFilterException )
        {
            ne = new InvalidSearchFilterException( t.getLocalizedMessage() );
        }
View Full Code Here

        }
        catch ( Exception e )
        {
        }

        throw new InvalidNameException( Messages.error__invalid_rdn );
    }
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

     * Create an invalid name exception for an empty name.
     *
     * @return the exception
     */
    public static InvalidNameException emptyNameException() {
        return new InvalidNameException("An empty name is not allowed");
    }
View Full Code Here

   public Object lookup(String name) throws NamingException
   {
      Object binding = null;
      if( name == null || name.length() == 0 )
         throw new InvalidNameException("name cannot be null or empty");

      if( name.equals(ACTIVE_SUBJECT) )
         binding = getSubject();
      else if( name.equals(AUTHENTICATION_MGR) || name.equals(SECURITY_MGR))
         binding = securityMgr;
View Full Code Here

   public Object lookup(String name) throws NamingException
   {
      Object binding = null;
      if( name == null || name.length() == 0 )
         throw new InvalidNameException("name cannot be null or empty");

      if( name.equals(ACTIVE_SUBJECT) )
         binding = getSubject();
      else if( name.equals(AUTHENTICATION_MGR) || name.equals(SECURITY_MGR))
         binding = securityMgr;
View Full Code Here

        }

        orgService.flush();

        if (g == null) {
            throw new InvalidNameException("Can not create membership record for " + user.getUserName()
                    + " because group is null");
        }

        if (mt == null) {
            throw new InvalidNameException("Can not create membership record for " + user.getUserName()
                    + " because membership type is null");
        }

        if (orgService.getMembershipTypeHandler().findMembershipType(mt.getName()) == null) {
            throw new InvalidNameException("MembershipType doesn't exist: " + mt.getName());
        }

        String plGroupName = getPLIDMGroupName(g.getGroupName());

        String groupId = getIdentitySession().getPersistenceManager().createGroupKey(plGroupName,
View Full Code Here

    */
   public void createMembership(Membership m, boolean broadcast) throws Exception
   {
      if (service.getMembershipTypeHandler().findMembershipType(m.getMembershipType()) == null)
      {
         throw new InvalidNameException("Can not create membership record " + m.getId() + " because membership type "
            + m.getMembershipType() + " does not exists.");
      }

      if (service.getGroupHandler().findGroupById(m.getGroupId()) == null)
      {
         throw new InvalidNameException("Can not create membership record " + m.getId() + ", because group "
            + m.getGroupId() + " does not exist.");
      }

      if (service.getUserHandler().findUserByName(m.getUserName()) == null)
      {
         throw new InvalidNameException("Can not create membership record " + m.getId() + ", because user "
            + m.getGroupId() + " does not exist.");
      }

      // check if we already have membership record
      if (findMembershipByUserGroupAndType(m.getUserName(), m.getGroupId(), m.getMembershipType()) != null)
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.