edu.internet2.middleware.grouper.ws.coresoap
Class WsSubjectLookup

java.lang.Object
  extended by edu.internet2.middleware.grouper.ws.coresoap.WsSubjectLookup
All Implemented Interfaces:
GrouperWsToStringCompact

public class WsSubjectLookup
extends java.lang.Object
implements GrouperWsToStringCompact

 template to lookup a subject.
 
 note if subjectId and subjectIdentifier are filled in with the same value, it will find by subject id or identifier.
 
 to lookup a group as a subject, use the group uuid (e.g. fa2dd790-d3f9-4cf4-ac41-bb82e63bff66) in the 
 subject id of the subject lookup.  Optionally you can use g:gsa as
 the source id.
 
 developers make sure each setter calls this.clearSubject();
 
 

Author:
mchyzer

Nested Class Summary
static class WsSubjectLookup.MemberFindResult
          result of a subject find
static class WsSubjectLookup.SubjectFindResult
          result of a subject find
 
Constructor Summary
WsSubjectLookup()
           
WsSubjectLookup(java.lang.String subjectId1, java.lang.String subjectSource1, java.lang.String subjectIdentifier1)
           
 
Method Summary
 boolean blank()
          see if there is a blank query (if there is not id or identifier
static java.util.Set<java.lang.String> convertToMemberIds(GrouperSession grouperSession, WsSubjectLookup[] wsSubjectLookups, java.lang.StringBuilder errorMessage)
          convert subject lookups to member ids (create if not exist)
static java.util.Set<java.lang.String> convertToMemberIds(GrouperSession grouperSession, WsSubjectLookup[] wsSubjectLookups, java.lang.StringBuilder errorMessage, int[] lookupCount)
          convert subject lookups to member ids (create if not exist)
static WsSubjectLookup createIfNeeded(java.lang.String subjectId, java.lang.String sourceId, java.lang.String subjectIdentifier)
          create if any not null, otherwise null
 java.lang.String getSubjectId()
          id of the subject
 java.lang.String getSubjectIdentifier()
          any identifier of the subject
 java.lang.String getSubjectSourceId()
          optional: source of subject in the subject api source list
 boolean hasData()
          see if this group lookup has data
static void main(java.lang.String[] args)
           
 Member retrieveMember()
           Retrieve the member object for this subject, do not create if not there Note: this is not a javabean property because we dont want it in the web service
 Member retrieveMember(java.lang.String invalidInputReason)
           Note: this is not a javabean property because we dont want it in the web service
 WsSubjectLookup.MemberFindResult retrieveMemberFindResult()
           Note: this is not a javabean property because we dont want it in the web service
 Subject retrieveSubject()
           Note: this is not a javabean property because we dont want it in the web service
 Subject retrieveSubject(boolean addExternalSubjectIfNotFound)
           Note: this is not a javabean property because we dont want it in the web service
 Subject retrieveSubject(java.lang.String invalidInputReason)
           Note: this is not a javabean property because we dont want it in the web service
 WsSubjectLookup.SubjectFindResult retrieveSubjectFindResult()
           Note: this is not a javabean property because we dont want it in the web service
 void setSubjectId(java.lang.String subjectId1)
          id of the subject
 void setSubjectIdentifier(java.lang.String subjectIdentifier1)
          any identifier of the subject
 void setSubjectSourceId(java.lang.String subjectSource1)
          optional: source of subject in the subject api source list
 java.lang.String toString()
           
 java.lang.String toStringCompact()
          make sure this is an explicit toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WsSubjectLookup

public WsSubjectLookup(java.lang.String subjectId1,
                       java.lang.String subjectSource1,
                       java.lang.String subjectIdentifier1)
Parameters:
subjectId1 -
subjectSource1 -
subjectIdentifier1 -

WsSubjectLookup

public WsSubjectLookup()
Method Detail

createIfNeeded

public static WsSubjectLookup createIfNeeded(java.lang.String subjectId,
                                             java.lang.String sourceId,
                                             java.lang.String subjectIdentifier)
create if any not null, otherwise null

Parameters:
subjectId -
sourceId -
subjectIdentifier -
Returns:
the subject lookup

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)
Parameters:
args -

blank

public boolean blank()
see if there is a blank query (if there is not id or identifier

Returns:
true or false

hasData

public boolean hasData()
see if this group lookup has data

Returns:
true if it has data

getSubjectSourceId

public java.lang.String getSubjectSourceId()
optional: source of subject in the subject api source list

Returns:
the subjectSource

setSubjectSourceId

public void setSubjectSourceId(java.lang.String subjectSource1)
optional: source of subject in the subject api source list

Parameters:
subjectSource1 - the subjectSource to set

retrieveSubject

public Subject retrieveSubject()
 
 Note: this is not a javabean property because we dont want it in the web service
 

Returns:
the subject

retrieveSubject

public Subject retrieveSubject(boolean addExternalSubjectIfNotFound)
 
 Note: this is not a javabean property because we dont want it in the web service
 

Parameters:
addExternalSubjectIfNotFound - if this is a search by id or identifier, with no source, or the external source, and the subject is not found, then add an external subject (if the user is allowed
Returns:
the subject

retrieveMember

public Member retrieveMember()
 Retrieve the member object for this subject, do not create if not there
 Note: this is not a javabean property because we dont want it in the web service
 

Returns:
the member

retrieveMember

public Member retrieveMember(java.lang.String invalidInputReason)
 
 Note: this is not a javabean property because we dont want it in the web service
 

Parameters:
invalidInputReason - label to be put in WsInvalidQueryException
Returns:
the subject
Throws:
WsInvalidQueryException

retrieveSubject

public Subject retrieveSubject(java.lang.String invalidInputReason)
 
 Note: this is not a javabean property because we dont want it in the web service
 

Parameters:
invalidInputReason - label to be put in WsInvalidQueryException
Returns:
the subject
Throws:
WsInvalidQueryException

retrieveSubjectFindResult

public WsSubjectLookup.SubjectFindResult retrieveSubjectFindResult()
 
 Note: this is not a javabean property because we dont want it in the web service
 

Returns:
the subjectFindResult, this is never null

retrieveMemberFindResult

public WsSubjectLookup.MemberFindResult retrieveMemberFindResult()
 Note: this is not a javabean property because we dont want it in the web service
 

Returns:
the memberFindResult, this is never null

getSubjectId

public java.lang.String getSubjectId()
id of the subject

Returns:
the subjectId

setSubjectId

public void setSubjectId(java.lang.String subjectId1)
id of the subject

Parameters:
subjectId1 - the subjectId to set

getSubjectIdentifier

public java.lang.String getSubjectIdentifier()
any identifier of the subject

Returns:
the subjectIdentifier

setSubjectIdentifier

public void setSubjectIdentifier(java.lang.String subjectIdentifier1)
any identifier of the subject

Parameters:
subjectIdentifier1 - the subjectIdentifier to set

convertToMemberIds

public static java.util.Set<java.lang.String> convertToMemberIds(GrouperSession grouperSession,
                                                                 WsSubjectLookup[] wsSubjectLookups,
                                                                 java.lang.StringBuilder errorMessage)
convert subject lookups to member ids (create if not exist)

Parameters:
grouperSession -
wsSubjectLookups -
errorMessage -
Returns:
the group ids

convertToMemberIds

public static java.util.Set<java.lang.String> convertToMemberIds(GrouperSession grouperSession,
                                                                 WsSubjectLookup[] wsSubjectLookups,
                                                                 java.lang.StringBuilder errorMessage,
                                                                 int[] lookupCount)
convert subject lookups to member ids (create if not exist)

Parameters:
grouperSession -
wsSubjectLookups -
errorMessage -
lookupCount - is an array of size one int where 1 will be added if there are records, and no change if not
Returns:
the group ids

toStringCompact

public java.lang.String toStringCompact()
make sure this is an explicit toString

Specified by:
toStringCompact in interface GrouperWsToStringCompact
Returns:
return a compact to string