org.kohsuke.jnt
Class JNMembership

java.lang.Object
  extended by org.kohsuke.jnt.JNMembership

public class JNMembership
extends Object

Membership of a project.

Author:
Kohsuke Kawaguchi (kk@kohsuke.org), Bruno Souza

Method Summary
 void declineRole(JNUser user, String roleName, String reason)
          Declines the specified role request.
 void declineRole(String userName, String roleName, String reason)
          Deprecated.  
 Set<JNUser> getMembers()
          Gets all the members of this project as a Set of JNUsers.
 Set<JNRole> getRoles()
          Gets all the roles used in this project as a Set of JNRoles.
 Set<JNRole> getRolesOf(JNUser user)
          Gets the JNRoles that a given user has in this project.
 Set<JNUser> getUserOf(JNRole role)
          Gets the JNUsers who has a specified role in this project.
 void grantRole(JNUser user, String roleName)
          Grants the specified role request.
 void grantRole(String userName, String roleName)
          Deprecated.  
 void revokeRole(JNUser user, String roleName)
          Revokes the specified role from the user.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMembers

public Set<JNUser> getMembers()
                       throws ProcessingException
Gets all the members of this project as a Set of JNUsers.

Returns:
the set can be empty, but always non-null. The set is read-only.
Throws:
ProcessingException

getRoles

public Set<JNRole> getRoles()
                     throws ProcessingException
Gets all the roles used in this project as a Set of JNRoles.

Returns:
the set can be empty, but always non-null. The set is read-only.
Throws:
ProcessingException

getRolesOf

public Set<JNRole> getRolesOf(JNUser user)
                       throws ProcessingException
Gets the JNRoles that a given user has in this project.

This method returns a copy of the information, and changing the values on the array will not grant/revoke roles.

Returns:
always return a read-only non-null (but possibly empty) set.
Throws:
ProcessingException

getUserOf

public Set<JNUser> getUserOf(JNRole role)
                      throws ProcessingException
Gets the JNUsers who has a specified role in this project.

Returns:
always return a read-only non-null (but possibly empty) set.
Throws:
ProcessingException

grantRole

public void grantRole(JNUser user,
                      String roleName)
               throws ProcessingException
Grants the specified role request.

Throws:
ProcessingException

grantRole

public void grantRole(String userName,
                      String roleName)
               throws ProcessingException
Deprecated. 

Grants the specified role request.

Throws:
ProcessingException
See Also:
grantRole(JNUser, String)

revokeRole

public void revokeRole(JNUser user,
                       String roleName)
                throws ProcessingException
Revokes the specified role from the user.

Throws:
ProcessingException

declineRole

public void declineRole(String userName,
                        String roleName,
                        String reason)
                 throws ProcessingException
Deprecated. 

Declines the specified role request. The role request has to be pending. In other words, this method is not for revoking a role from an user.

Throws:
ProcessingException
See Also:
declineRole(JNUser, String, String)

declineRole

public void declineRole(JNUser user,
                        String roleName,
                        String reason)
                 throws ProcessingException
Declines the specified role request. The role request has to be pending. In other words, this method is not for revoking a role from an user.

Throws:
ProcessingException


Copyright © 2003-2008 Kohsuke Kawaguchi. All Rights Reserved.