1   package com.atlassian.user.search.query;
2   
3   /**
4    * Here the term should correspond to a user.
5    * This will be parsed into a query returning all groups for the user.
6    *
7    * @deprecated since 2.1 because this isn't supported by all LDAP servers or by Crowd
8    */
9   public class GroupsOfUserTwoTermQuery extends TwoTermBooleanQuery implements MembershipQuery
10  {
11      public GroupsOfUserTwoTermQuery(UserNameTermQuery userNameQuery)
12      {
13          super(userNameQuery, new GroupNameTermQuery(TermQuery.WILDCARD), true);
14      }
15  
16      public GroupsOfUserTwoTermQuery(GroupNameTermQuery groupNameQuery)
17      {
18          super(new UserNameTermQuery(TermQuery.WILDCARD), groupNameQuery, true);
19      }
20  
21      public GroupsOfUserTwoTermQuery(UserNameTermQuery userNameQuery, GroupNameTermQuery groupNameQuery)
22      {
23          super(userNameQuery, groupNameQuery, true);
24      }
25  
26      public UserNameTermQuery getUserNameTermQuery()
27      {
28          return (UserNameTermQuery) getFirstQuery();
29      }
30  
31      public GroupNameTermQuery getGroupNameTermQuery()
32      {
33          return (GroupNameTermQuery) getSecondQuery();
34      }
35  }