Package org.nemesis.forum

Examples of org.nemesis.forum.User


  }

  //FROM THE PROFILEMANAGER INTERFACE//

  public User createUser(String username, String password, String email) throws UserAlreadyExistsException {
    User newUser = null;
    try {
      User existingUser = getUser(username);

      //The user already exists since now exception, so:
      throw new UserAlreadyExistsException();
    } catch (UserNotFoundException unfe) {
      //The user doesn't already exist so we can create a new user
View Full Code Here


  public User getUser(String username) throws UserNotFoundException {
    DbCacheManager cacheManager = factory.getCacheManager();
    //If cache is not enabled, do a new lookup of object
    if (!cacheManager.isCacheEnabled()) {
      User user = new DbUser(username);
      return getUser(user.getID());
    }
    //Cache is enabled.
    CacheableInteger userIDInteger = (CacheableInteger) cacheManager.get(DbCacheManager.USER_ID_CACHE, username);
    //if id wan't found in cache, load it up and put it there.
    if (userIDInteger == null) {
      User user = new DbUser(username);
      userIDInteger = new CacheableInteger(new Integer(user.getID()));
      cacheManager.add(DbCacheManager.USER_ID_CACHE, username, userIDInteger);
    }
    return getUser(userIDInteger.getInteger().intValue());
  }
View Full Code Here

  public void deleteGroup(Group group) throws UnauthorizedException {
    int groupID = group.getID();
    int[] members = new int[group.getMemberCount()];
    Iterator iter = group.members();
    for (int i = 0; i < members.length; i++) {
      User user = (User) iter.next();
      members[i] = user.getID();
    }

    Connection con = null;
    PreparedStatement pstmt = null;
    try {
View Full Code Here

    {
        super(iterator, authorization, permissions);
    }

    public Object next() throws NoSuchElementException {
        User user = (User)iterator.next();
        ForumPermissions userPermissions = user.getPermissions(authorization);
        ForumPermissions newPermissions =
                new ForumPermissions(permissions, userPermissions);
        return new UserProxy(user, authorization, newPermissions);
    }
View Full Code Here

      throw new UnauthorizedException();
    }
  }

  public User getUser(int userID) throws UserNotFoundException {
    User user = profileManager.getUser(userID);
    ForumPermissions userPermissions = user.getPermissions(authorization);
    ForumPermissions newPermissions =
      new ForumPermissions(permissions, userPermissions);
    return new UserProxy(user, authorization, newPermissions);
  }
View Full Code Here

      new ForumPermissions(permissions, userPermissions);
    return new UserProxy(user, authorization, newPermissions);
  }

  public User getUser(String username) throws UserNotFoundException {
    User user = profileManager.getUser(username);
    ForumPermissions userPermissions = user.getPermissions(authorization);
    ForumPermissions newPermissions =
      new ForumPermissions(permissions, userPermissions);
    return new UserProxy(user, authorization, newPermissions);
  }
View Full Code Here

      throw new UnauthorizedException();
    }
  }

  public User getUser() {
    User user = message.getUser();
    ForumPermissions userPermissions = user.getPermissions(authorization);
    ForumPermissions newPermissions = new ForumPermissions(permissions, userPermissions);
    return new UserProxy(user, authorization, newPermissions);
  }
View Full Code Here

    try {
       
       
        ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
        ProfileManager manager = forumFactory.getProfileManager();
        User user = manager.getUser(getAuthToken(request).getUserID());
         
        Group group = manager.getGroup(request.getParameter("group"));
        request.setAttribute("id",group.getID()+"";
        User  u = manager.getUser(request.getParameter("username"));
        // add user as an administrator of the group
        group.removeAdministrator(u);
         
       
    } catch (NotFoundException e) {
View Full Code Here

    try {
      con = DbConnectionManager.getConnection();
      pstmt = con.prepareStatement(LOAD_USERS);
      pstmt.setInt(1, id);
      ResultSet rs = pstmt.executeQuery();
      User user = null;
      while (rs.next()) {
        try {
          user = profileManager.getUser(rs.getInt("userID"));
        } catch (UserNotFoundException    unfe) {
          log.error("",unfe);
View Full Code Here

    try {
      con = DbConnectionManager.getConnection();
      pstmt = con.prepareStatement(LOAD_ADMINS);
      pstmt.setInt(1, id);
      ResultSet rs = pstmt.executeQuery();
      User user = null;
      while (rs.next()) {
        try {
          user = profileManager.getUser(rs.getInt("userID"));
        } catch (UserNotFoundException unfe) {
          log.error("" , unfe);
View Full Code Here

TOP

Related Classes of org.nemesis.forum.User

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.