Package org.apache.juddi.error

Examples of org.apache.juddi.error.UnknownUserException


  public String authenticate(String userID,String credential)
    throws RegistryException
  {
    // a userID must be specified.
    if (userID == null)
      throw new UnknownUserException("Invalid user ID = "+userID);

    // credential (password) must be specified.
    if (credential == null)
      throw new UnknownUserException("Invalid credentials");

    if (userTable.containsKey(userID))
    {
      UserInfo userInfo = (UserInfo)userTable.get(userID);
      if ((userInfo.password == null) || (!credential.equals(userInfo.password)))
         throw new UnknownUserException("Invalid credentials");
    }
    else
      throw new UnknownUserException("Invalid user ID: "+userID);

    return userID;
  }
View Full Code Here


     *
     */
  public String authenticate(final String userID, final String credential)
      throws AuthenticationException {
    if (userID == null) {
      throw new UnknownUserException(new ErrorMessage("errors.auth.InvalidUserId", userID));
    }

    // Create a principal for the userID
    Principal principal = new Principal() {
      public String getName() {
        return userID;
      }
    };

    if (!authManager.isValid(principal, credential)) {
      throw new UnknownUserException(new ErrorMessage("errors.auth.InvalidCredentials"));
    }
    return userID;
  }
View Full Code Here

   */
  public boolean isAdministrator(String publisherID)
    throws org.apache.juddi.error.RegistryException
  {
    if ((publisherID == null) || (publisherID.length() == 0))
      throw new UnknownUserException("publisherID = "+publisherID);

    try
    {
      Publisher publisher = PublisherTable.select(publisherID,connection);
      if (publisher == null)
        throw new UnknownUserException("publisherID = "+publisherID);
      else
        return publisher.isAdmin();
    }
    catch(java.sql.SQLException sqlex)
    {
View Full Code Here

   */
  public boolean isEnabled(String publisherID)
    throws org.apache.juddi.error.RegistryException
  {
    if ((publisherID == null) || (publisherID.length() == 0))
      throw new UnknownUserException("publisherID = "+publisherID);

    try
    {
      Publisher publisher = PublisherTable.select(publisherID,connection);
      if (publisher == null)
        throw new UnknownUserException("publisherID = "+publisherID);
      else
        return publisher.isEnabled();
    }
    catch(java.sql.SQLException sqlex)
    {
View Full Code Here

   */
  public boolean isAdministrator(String publisherID)
    throws org.apache.juddi.error.RegistryException
  {
    if ((publisherID == null) || (publisherID.length() == 0))
      throw new UnknownUserException("publisherID = "+publisherID);

    try
    {
      Publisher publisher = PublisherTable.select(publisherID,connection);
      if (publisher == null)
        throw new UnknownUserException("publisherID = "+publisherID);
      else
        return publisher.isAdmin();
    }
    catch(java.sql.SQLException sqlex)
    {
View Full Code Here

   */
  public boolean isEnabled(String publisherID)
    throws org.apache.juddi.error.RegistryException
  {
    if ((publisherID == null) || (publisherID.length() == 0))
      throw new UnknownUserException("publisherID = "+publisherID);

    try
    {
      Publisher publisher = PublisherTable.select(publisherID,connection);
      if (publisher == null)
        throw new UnknownUserException("publisherID = "+publisherID);
      else
        return publisher.isEnabled();
    }
    catch(java.sql.SQLException sqlex)
    {
View Full Code Here

      dataStore.beginTrans();

      // authenticate the requestor's credentials
      String publisherID = authenticator.authenticate(userID,cred);
      if (publisherID == null)
        throw new UnknownUserException("get_authToken: "+
            "userID="+userID);

      // ensure the user has the authority to publish
      Publisher publisher = dataStore.getPublisher(publisherID);
      if (publisher == null)
        throw new UnknownUserException("get_authToken: "+
            "userID="+userID);

      // generate a new token (optionally using publisher info)
      String token = dataStore.generateToken(publisher);
View Full Code Here

        String publisherID = (String)idVector.elementAt(i);

        // If the a Publisher doesn't exist hrow an UnknownUserException.
        if ((publisherID == null) || (publisherID.length() == 0) ||
            (dataStore.getPublisher(publisherID) == null))
          throw new UnknownUserException("get_publisher: "+
              "userID="+publisherID);
      }

      Vector publisherVector = new Vector();
View Full Code Here

   */
  public boolean isAdministrator(String publisherID)
    throws org.apache.juddi.error.RegistryException
  {
    if ((publisherID == null) || (publisherID.length() == 0))
      throw new UnknownUserException("publisherID = "+publisherID);

    try
    {
      Publisher publisher = PublisherTable.select(publisherID,connection);
      if (publisher == null)
        throw new UnknownUserException("publisherID = "+publisherID);
      else
        return publisher.isAdmin();
    }
    catch(java.sql.SQLException sqlex)
    {
View Full Code Here

   */
  public boolean isEnabled(String publisherID)
    throws org.apache.juddi.error.RegistryException
  {
    if ((publisherID == null) || (publisherID.length() == 0))
      throw new UnknownUserException("publisherID = "+publisherID);

    try
    {
      Publisher publisher = PublisherTable.select(publisherID,connection);
      if (publisher == null)
        throw new UnknownUserException("publisherID = "+publisherID);
      else
        return publisher.isEnabled();
    }
    catch(java.sql.SQLException sqlex)
    {
View Full Code Here

TOP

Related Classes of org.apache.juddi.error.UnknownUserException

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.