de.theit.hudson.crowd
Class CrowdConfigurationService

java.lang.Object
  extended by de.theit.hudson.crowd.CrowdConfigurationService

public class CrowdConfigurationService
extends Object

This class contains all objects that are necessary to access the REST services on the remote Crowd server. In addition to this it contains some helper methods

Since:
08.09.2011
Version:
$Id$
Author:
Thorsten Heit (theit@gmx.de)

Constructor Summary
CrowdConfigurationService(String pGroupName, boolean pNestedGroups)
          Creates a new Crowd configuration object.
 
Method Summary
 Collection<org.acegisecurity.GrantedAuthority> getAuthoritiesForUser(String username)
          Retrieves the list of all (nested) groups from the Crowd server that the user is a member of.
 boolean isGroupActive()
          Checks if the group exists on the remote Crowd server and is active.
 boolean isGroupMember(String username)
          Checks whether the user is a member of a certain Crowd group whose members are allowed to login into Hudson / Jenkins.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CrowdConfigurationService

public CrowdConfigurationService(String pGroupName,
                                 boolean pNestedGroups)
Creates a new Crowd configuration object.

Parameters:
pGroupName - The group name to use when authenticating Crowd users. May not be null.
pNestedGroups - Specifies whether nested groups should be used when validating users against the group name.
Method Detail

isGroupMember

public boolean isGroupMember(String username)
Checks whether the user is a member of a certain Crowd group whose members are allowed to login into Hudson / Jenkins.

Parameters:
username - The name of the user to check. May not be null.
Returns:
true if and only if the group exists, is active and the user is either a direct group member or, if nested groups may be used, a nested group member. false else.

isGroupActive

public boolean isGroupActive()
Checks if the group exists on the remote Crowd server and is active.

Returns:
true if and only if:
  • The group name is empty or
  • The group name is not empty, does exist on the remote Crowd server and is active.
false else.

getAuthoritiesForUser

public Collection<org.acegisecurity.GrantedAuthority> getAuthoritiesForUser(String username)
Retrieves the list of all (nested) groups from the Crowd server that the user is a member of.

Parameters:
username - The name of the user. May not be null.
Returns:
The list of all groups that the user is a member of. Always non-null.


Copyright © 2004-2011 Hudson. All Rights Reserved.