com.atlassian.crowd.integration.atlassianuser
Class CrowdEntityQueryParser

java.lang.Object
  extended by com.atlassian.user.search.query.AbstractEntityQueryParser
      extended by com.atlassian.crowd.integration.atlassianuser.CrowdEntityQueryParser
All Implemented Interfaces:
com.atlassian.user.search.query.EntityQueryParser

public class CrowdEntityQueryParser
extends com.atlassian.user.search.query.AbstractEntityQueryParser
implements com.atlassian.user.search.query.EntityQueryParser

Performs searching verses the Crowd security server.


Constructor Summary
CrowdEntityQueryParser(com.atlassian.user.UserManager users, com.atlassian.user.GroupManager groups, com.atlassian.user.repository.RepositoryIdentifier id)
           
CrowdEntityQueryParser(com.atlassian.user.UserManager users, com.atlassian.user.GroupManager groups, com.atlassian.user.repository.RepositoryIdentifier id, com.atlassian.crowd.service.client.CrowdClient client)
           
 
Method Summary
protected  com.atlassian.crowd.search.query.entity.restriction.MatchMode changeTermQueryMatchMode(com.atlassian.user.search.query.TermQuery query)
           
protected  void ensureAllTermQueries(java.util.List<com.atlassian.user.search.query.Query> queries)
           
protected  java.util.List<com.atlassian.crowd.model.user.User> filterSingleQueryResults(java.util.List<com.atlassian.crowd.model.user.User> results, com.atlassian.user.search.query.Query query)
           
 com.atlassian.user.search.SearchResult findGroups(com.atlassian.user.search.query.Query query)
          Searches the Crowd directory server for a set of groups.
 com.atlassian.user.search.SearchResult findGroups(com.atlassian.user.search.query.Query query, com.atlassian.user.search.query.QueryContext context)
          Searches the Crowd directory server for a set of groups.
 com.atlassian.user.search.SearchResult findUsers(com.atlassian.user.search.query.Query query)
          Searches the Crowd directory server for a set of principals.
 com.atlassian.user.search.SearchResult findUsers(com.atlassian.user.search.query.Query query, com.atlassian.user.search.query.QueryContext context)
          Searches the Crowd directory server for a set of principals.
protected  java.util.List<com.atlassian.crowd.model.user.User> postFilterEndsWithQueryResults(java.util.List<com.atlassian.crowd.model.user.User> results, com.atlassian.user.search.query.Query query)
           
protected  com.atlassian.crowd.search.query.entity.restriction.BooleanRestriction queryAsBooleanRestriction(java.util.List<com.atlassian.user.search.query.TermQuery> queries, com.atlassian.crowd.search.query.entity.restriction.BooleanRestriction.BooleanLogic logic)
           
protected  com.atlassian.crowd.embedded.api.SearchRestriction queryAsSearchRestriction(com.atlassian.user.search.query.TermQuery query)
           
protected  java.util.List<com.atlassian.crowd.model.group.Group> searchGroups(com.atlassian.user.search.query.GroupNameTermQuery query)
           
protected  java.util.List<com.atlassian.crowd.model.user.User> searchUsers(com.atlassian.user.search.query.Query query)
           
 
Methods inherited from class com.atlassian.user.search.query.AbstractEntityQueryParser
identifyDefiningQuery, matchQueryToQueryType, validateBooleanToQueryType, validateQuery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CrowdEntityQueryParser

public CrowdEntityQueryParser(com.atlassian.user.UserManager users,
                              com.atlassian.user.GroupManager groups,
                              com.atlassian.user.repository.RepositoryIdentifier id,
                              com.atlassian.crowd.service.client.CrowdClient client)

CrowdEntityQueryParser

public CrowdEntityQueryParser(com.atlassian.user.UserManager users,
                              com.atlassian.user.GroupManager groups,
                              com.atlassian.user.repository.RepositoryIdentifier id)
Method Detail

findGroups

public com.atlassian.user.search.SearchResult findGroups(com.atlassian.user.search.query.Query query)
                                                  throws com.atlassian.user.EntityException
Searches the Crowd directory server for a set of groups. Supports GroupNameTermQuery only.

Specified by:
findGroups in interface com.atlassian.user.search.query.EntityQueryParser
Parameters:
query - Query restrictions.
Returns:
The search results.
Throws:
com.atlassian.user.EntityException

searchGroups

protected java.util.List<com.atlassian.crowd.model.group.Group> searchGroups(com.atlassian.user.search.query.GroupNameTermQuery query)
                                                                      throws com.atlassian.user.EntityException,
                                                                             com.atlassian.crowd.exception.InvalidAuthenticationException,
                                                                             com.atlassian.crowd.exception.ApplicationPermissionException,
                                                                             com.atlassian.crowd.exception.OperationFailedException
Throws:
com.atlassian.user.EntityException
com.atlassian.crowd.exception.InvalidAuthenticationException
com.atlassian.crowd.exception.ApplicationPermissionException
com.atlassian.crowd.exception.OperationFailedException

findUsers

public com.atlassian.user.search.SearchResult findUsers(com.atlassian.user.search.query.Query query,
                                                        com.atlassian.user.search.query.QueryContext context)
                                                 throws com.atlassian.user.EntityException
Searches the Crowd directory server for a set of principals.

Specified by:
findUsers in interface com.atlassian.user.search.query.EntityQueryParser
Parameters:
query - Query restrictions.
context - This attribute is ignored.
Returns:
The search results.
Throws:
com.atlassian.user.EntityException

findGroups

public com.atlassian.user.search.SearchResult findGroups(com.atlassian.user.search.query.Query query,
                                                         com.atlassian.user.search.query.QueryContext context)
                                                  throws com.atlassian.user.EntityException
Searches the Crowd directory server for a set of groups. Supports UserNameTermQuery, EmailTermQuery, FullNameTermQuery and also BooleanQueries that do not comprise of other BooleanQueries.

Specified by:
findGroups in interface com.atlassian.user.search.query.EntityQueryParser
Parameters:
query - Query restrictions.
context - This attribute is ignored.
Returns:
The search results.
Throws:
com.atlassian.user.EntityException

queryAsSearchRestriction

protected com.atlassian.crowd.embedded.api.SearchRestriction queryAsSearchRestriction(com.atlassian.user.search.query.TermQuery query)
                                                                               throws com.atlassian.user.EntityException
Throws:
com.atlassian.user.EntityException

queryAsBooleanRestriction

protected com.atlassian.crowd.search.query.entity.restriction.BooleanRestriction queryAsBooleanRestriction(java.util.List<com.atlassian.user.search.query.TermQuery> queries,
                                                                                                           com.atlassian.crowd.search.query.entity.restriction.BooleanRestriction.BooleanLogic logic)
                                                                                                    throws com.atlassian.user.EntityException
Throws:
com.atlassian.user.EntityException

changeTermQueryMatchMode

protected com.atlassian.crowd.search.query.entity.restriction.MatchMode changeTermQueryMatchMode(com.atlassian.user.search.query.TermQuery query)
                                                                                          throws com.atlassian.user.EntityException
Throws:
com.atlassian.user.EntityException

ensureAllTermQueries

protected void ensureAllTermQueries(java.util.List<com.atlassian.user.search.query.Query> queries)
                             throws com.atlassian.user.search.query.EntityQueryException
Throws:
com.atlassian.user.search.query.EntityQueryException

searchUsers

protected java.util.List<com.atlassian.crowd.model.user.User> searchUsers(com.atlassian.user.search.query.Query query)
                                                                   throws com.atlassian.user.EntityException,
                                                                          com.atlassian.crowd.exception.InvalidAuthenticationException,
                                                                          com.atlassian.crowd.exception.ApplicationPermissionException,
                                                                          com.atlassian.crowd.exception.OperationFailedException
Throws:
com.atlassian.user.EntityException
com.atlassian.crowd.exception.InvalidAuthenticationException
com.atlassian.crowd.exception.ApplicationPermissionException
com.atlassian.crowd.exception.OperationFailedException

postFilterEndsWithQueryResults

protected java.util.List<com.atlassian.crowd.model.user.User> postFilterEndsWithQueryResults(java.util.List<com.atlassian.crowd.model.user.User> results,
                                                                                             com.atlassian.user.search.query.Query query)
                                                                                      throws com.atlassian.user.EntityException
Throws:
com.atlassian.user.EntityException

filterSingleQueryResults

protected java.util.List<com.atlassian.crowd.model.user.User> filterSingleQueryResults(java.util.List<com.atlassian.crowd.model.user.User> results,
                                                                                       com.atlassian.user.search.query.Query query)
                                                                                throws com.atlassian.user.EntityException
Throws:
com.atlassian.user.EntityException

findUsers

public com.atlassian.user.search.SearchResult findUsers(com.atlassian.user.search.query.Query query)
                                                 throws com.atlassian.user.EntityException
Searches the Crowd directory server for a set of principals.

Specified by:
findUsers in interface com.atlassian.user.search.query.EntityQueryParser
Parameters:
query - Query restrictions.
Returns:
The search results.
Throws:
com.atlassian.user.EntityException


Copyright © 2011 Atlassian. All Rights Reserved.