|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.embedded.core.CrowdServiceImpl
public class CrowdServiceImpl
Default implementation of the CrowdService
Constructor Summary | |
---|---|
CrowdServiceImpl(ApplicationFactory applicationFactory,
ApplicationService applicationService,
DirectoryInstanceLoader directoryInstanceLoader)
|
Method Summary | ||
---|---|---|
User |
authenticate(java.lang.String name,
java.lang.String credential)
Authenticates a user with the given credential |
|
protected Application |
getApplication()
|
|
protected DirectoryInstanceLoader |
getDirectoryInstanceLoader()
|
|
Group |
getGroup(java.lang.String name)
Finds the group that matches the supplied name . |
|
GroupWithAttributes |
getGroupWithAttributes(java.lang.String name)
Finds the group that matches the supplied name . |
|
User |
getUser(java.lang.String name)
Returns the user that matches the supplied name . |
|
UserWithAttributes |
getUserWithAttributes(java.lang.String name)
Returns the user that matches the supplied name . |
|
boolean |
isGroupMemberOfGroup(Group childGroup,
Group parentGroup)
Returns true if the childGroup is a direct or indirect (nested) member of the parentGroup . |
|
boolean |
isUserMemberOfGroup(java.lang.String userName,
java.lang.String groupName)
Returns true if the user is a direct or indirect (nested) member of the group. |
|
boolean |
isUserMemberOfGroup(User user,
Group group)
Returns true if the user is a direct or indirect (nested) member of the group. |
|
|
search(Query<T> query)
Searches for entities (e.g. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CrowdServiceImpl(ApplicationFactory applicationFactory, ApplicationService applicationService, DirectoryInstanceLoader directoryInstanceLoader)
Method Detail |
---|
public User authenticate(java.lang.String name, java.lang.String credential) throws UserNotFoundException, InactiveAccountException, FailedAuthenticationException, ExpiredCredentialException, OperationFailedException
CrowdService
user
with the given credential
authenticate
in interface CrowdService
name
- The name of the user (username).credential
- The supplied credential to authenticate with
UserNotFoundException
- thrown if the name didn't resolve to a User
InactiveAccountException
- The supplied user is inactive.
FailedAuthenticationException
- Authentication with the provided credentials failed.
ExpiredCredentialException
- The user's credentials have expired. The user must change their credentials in order to successfully authenticate.
OperationFailedException
- underlying directory implementation failed to execute the operation.public User getUser(java.lang.String name)
CrowdService
user
that matches the supplied name
.
getUser
in interface CrowdService
name
- the name of the user (username). Does not allow null, blank or empty strings.
null
if the user is not foundpublic UserWithAttributes getUserWithAttributes(java.lang.String name)
CrowdService
user
that matches the supplied name
.
getUserWithAttributes
in interface CrowdService
name
- the name of the user (username).
null
if the user is not foundpublic Group getGroup(java.lang.String name)
CrowdService
group
that matches the supplied name
.
getGroup
in interface CrowdService
name
- the name of the group.
null
if not found.public GroupWithAttributes getGroupWithAttributes(java.lang.String name)
CrowdService
group
that matches the supplied name
.
getGroupWithAttributes
in interface CrowdService
name
- the name of the group.
null
if not found.public <T> java.lang.Iterable<T> search(Query<T> query)
CrowdService
Group
or User
) of type <T>
that match the supplied search query.
Search return types must be either String
, User
or Group
.
search
in interface CrowdService
query
- Query for a given entity (e.g. Group
or User
)
T
matching the search query. An Iterable
containing no results will be
returned if there are no matches for the query.public boolean isUserMemberOfGroup(java.lang.String userName, java.lang.String groupName) throws UserNotFoundException, GroupNotFoundException
CrowdService
true
if the user is a direct or indirect (nested) member of the group.
isUserMemberOfGroup
in interface CrowdService
userName
- user to inspect.groupName
- group to inspect.
true
if and only if the user is a direct or indirect (nested) member of the group.
UserNotFoundException
- if the userName doesn't resolve to an existing user.
GroupNotFoundException
- if the groupName doesn't resolve to an existing group.CrowdService.isUserMemberOfGroup(User, Group)
public boolean isUserMemberOfGroup(User user, Group group) throws UserNotFoundException, GroupNotFoundException
CrowdService
true
if the user is a direct or indirect (nested) member of the group.
isUserMemberOfGroup
in interface CrowdService
user
- user to inspect.group
- group to inspect.
true
if and only if the user is a direct or indirect (nested) member of the group.
UserNotFoundException
- if the userName doesn't resolve to an existing user.
GroupNotFoundException
- if the groupName doesn't resolve to an existing group.CrowdService.isUserMemberOfGroup(String, String)
public boolean isGroupMemberOfGroup(Group childGroup, Group parentGroup) throws GroupNotFoundException
CrowdService
true
if the childGroup
is a direct or indirect (nested) member of the parentGroup
.
isGroupMemberOfGroup
in interface CrowdService
childGroup
- group to inspect.parentGroup
- group to inspect.
true
if and only if the childGroup
is a direct or indirect (nested) member of the parentGroup
.
GroupNotFoundException
- if either groupd (childGroup
or parentGroup
) doesn't resolve to an existing group.protected Application getApplication()
protected DirectoryInstanceLoader getDirectoryInstanceLoader()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |