Package au.edu.qut.yawl.exceptions

Examples of au.edu.qut.yawl.exceptions.YAuthenticationException


      }
     
      System.out.println("deleting user: " + resourceID);
      result = iaClient.deleteUser(resourceID,sessionHandle);
      if(result.indexOf("<failure") != -1) {
    throw new YAuthenticationException(result);
      }
  } catch (IOException e) {
      e.printStackTrace();
  }
 
View Full Code Here


            if (founduser) {
    result = iaClient.deleteUser(resourceID,sessionHandle);
    System.out.println("I found the user...." + result);
    if(result.indexOf("<failure") != -1) {
        throw new YAuthenticationException(result);
    }
      }
      result = iaClient.createUser(resourceID, password, "Admin".equals(usertype), sessionHandle);
            if(result.indexOf("<failure") != -1) {
                throw new YAuthenticationException(result);
            }
        } catch (IOException e3) {
            e3.printStackTrace();
        }
    }
View Full Code Here

    public String checkConnection(String sessionHandle) throws YAuthenticationException{
        Connection connection = (Connection) _connections.get(sessionHandle);
        Date now = new Date();
        if(connection == null){
            throw new YAuthenticationException(
                    "There is no registered connection for " + sessionHandle);
        }
        else if(now.after(connection._timeOut)){
            throw new YAuthenticationException(
                    "Connection for session (" + sessionHandle +
                    ") has timed out");
        }
        return _permissionGranted;
    }
View Full Code Here

    public String checkConnectionForAdmin(String sessionHandle) throws YAuthenticationException {
        checkConnection(sessionHandle);
        Connection connection = (Connection) _connections.get(sessionHandle);
        User user = (User) _users.get(connection._userid);
        if (!user.isAdmin()) {
            throw new YAuthenticationException(
                    "This user is not an administrator.");
        }
        return _permissionGranted;
    }
View Full Code Here

                    _users.put(userID, user);
                    if (isAdmin) {
                        user.setAdmin(isAdmin);
                    }
                } else {
                    throw new YAuthenticationException(
                        "The userID[" + userID + "] is being used already.");
                }
            } else {
                throw new YAuthenticationException("Password must be at least 4 chars.");
            }
        } else {
            throw new YAuthenticationException("UserID cannot be null.");
        }

        return user;
    }
View Full Code Here



    public synchronized void removeUser(YPersistenceManager pmgr, String inSessionUserID, String userNameToDelete) throws YAuthenticationException, YPersistenceException {
        if(inSessionUserID.equals(userNameToDelete)) {
            throw new YAuthenticationException("Users cannot delete oneself.");
        }
        if(null == _users.get(inSessionUserID)){
            throw new YAuthenticationException("The user trying to delete is not a user.");
        }
        List connections = new ArrayList(_connections.values());
        for (int i = 0; i < connections.size(); i++) {
            Connection connection = (Connection) connections.get(i);
            if(connection._userid.equals(userNameToDelete)){
View Full Code Here

            if(user.getPassword().equals(password)){
                Connection connection = new Connection(userID);
                _connections.put(connection._sessionHandle, connection);
                return connection._sessionHandle;
            }
            throw new YAuthenticationException("Password (" + password + ") not valid.");
        }
        throw new YAuthenticationException("Userid (" + userID + ") not valid.");
    }
View Full Code Here

TOP

Related Classes of au.edu.qut.yawl.exceptions.YAuthenticationException

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.