Class WsSubjectLookup

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

public class WsSubjectLookup extends 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();
 
 
  • Constructor Details

    • WsSubjectLookup

      public WsSubjectLookup(String subjectId1, String subjectSource1, String subjectIdentifier1)
      Parameters:
      subjectId1 -
      subjectSource1 -
      subjectIdentifier1 -
    • WsSubjectLookup

      public WsSubjectLookup()
  • Method Details

    • createIfNeeded

      public static WsSubjectLookup createIfNeeded(String subjectId, String sourceId, String subjectIdentifier)
      create if any not null, otherwise null
      Parameters:
      subjectId -
      sourceId -
      subjectIdentifier -
      Returns:
      the subject lookup
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • main

      public static void main(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 String getSubjectSourceId()
      optional: source of subject in the subject api source list
      Returns:
      the subjectSource
    • setSubjectSourceId

      public void setSubjectSourceId(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(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(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 String getSubjectId()
      id of the subject
      Returns:
      the subjectId
    • setSubjectId

      public void setSubjectId(String subjectId1)
      id of the subject
      Parameters:
      subjectId1 - the subjectId to set
    • getSubjectIdentifier

      public String getSubjectIdentifier()
      any identifier of the subject
      Returns:
      the subjectIdentifier
    • setSubjectIdentifier

      public void setSubjectIdentifier(String subjectIdentifier1)
      any identifier of the subject
      Parameters:
      subjectIdentifier1 - the subjectIdentifier to set
    • convertToMemberIds

      public static Set<String> convertToMemberIds(GrouperSession grouperSession, WsSubjectLookup[] wsSubjectLookups, StringBuilder errorMessage)
      convert subject lookups to member ids (create if not exist)
      Parameters:
      grouperSession -
      wsSubjectLookups -
      errorMessage -
      Returns:
      the group ids
    • convertToMemberIds

      public static Set<String> convertToMemberIds(GrouperSession grouperSession, WsSubjectLookup[] wsSubjectLookups, 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 String toStringCompact()
      make sure this is an explicit toString
      Specified by:
      toStringCompact in interface GrouperWsToStringCompact
      Returns:
      return a compact to string