public Object callback(GrouperSession theGrouperSession) throws GrouperSessionException { try { //see if across all sources if (SOURCE_ID == null) { return SubjectFinder.findByIdOrIdentifier(USER_ID_LOGGED_IN, true); } //see if in specified sources String[] sourceIds = GrouperUtil.splitTrim(SOURCE_ID, ","); for (String curSource : sourceIds) { Subject s = SubjectFinder.findByIdOrIdentifierAndSource(USER_ID_LOGGED_IN, curSource, false); if (s != null) { return s; } } throw new SubjectNotFoundException("Unable to find subject in source type(s): " + SOURCE_ID); } catch (Exception e) { //this is probably a system error... not a user error throw new RuntimeException("Cant find subject from login id: " + USER_ID_LOGGED_IN, e); } } });
/** */ @Override public Subject lookup(HttpServletRequest localRequest, GrouperSession grouperSession, String query) { //when we refer to subjects in the dropdown, we will use a sourceId / subject tuple Subject subject = null; try { GrouperSourceAdapter.searchForGroupsWithReadPrivilege(true); if (query != null && query.contains("||")) { String sourceId = GrouperUtil.prefixOrSuffix(query, "||", true); String subjectId = GrouperUtil.prefixOrSuffix(query, "||", false); subject = SubjectFinder.findByIdOrIdentifierAndSource(subjectId, sourceId, false); } else { try { subject = SubjectFinder.findByIdOrIdentifier(query, false); } catch (SubjectNotUniqueException snue) { //ignore this... if (LOG.isDebugEnabled()) { LOG.debug("Find by id or identifier not unique: '" + query + "'"); } } } } finally { GrouperSourceAdapter.clearSearchForGroupsWithReadPrivilege(); } return subject; }
Subject subject = SubjectFinder.findByIdOrIdentifierAndSource(subjectIdOrIdentifier, sourceId, true); loaderReport.append("<font color='green'>SUCCESS:</font> Found subject '" + subjectIdOrIdentifier + "' in source: '" + sourceId + "' by idOrIdentifier: " + GrouperUtil.subjectToString(subject) + "\n");
String sourceId = GrouperUtil.prefixOrSuffix(query, "||", true); String subjectId = GrouperUtil.prefixOrSuffix(query, "||", false); subject = SubjectFinder.findByIdOrIdentifierAndSource(subjectId, sourceId, false); } else { try {
String sourceId = GrouperUtil.prefixOrSuffix(comboValue, "||", true); String subjectId = GrouperUtil.prefixOrSuffix(comboValue, "||", false); theSubject = SubjectFinder.findByIdOrIdentifierAndSource(subjectId, sourceId, false); } else { try { String sourceId = GrouperUtil.prefixOrSuffix(extraSourceIdSubjectId, "||", true); String subjectId = GrouperUtil.prefixOrSuffix(extraSourceIdSubjectId, "||", false); theSubject = SubjectFinder.findByIdOrIdentifierAndSource(subjectId, sourceId, false);
Subject theSubjectLoggedIn = null; for (String sourceId : GrouperUtil.splitTrim(sourceIds, ",")) { Subject tempSubject = SubjectFinder.findByIdOrIdentifierAndSource(userIdLoggedIn, sourceId, false); if (tempSubject != null) { if (theSubjectLoggedIn == null) {
if (hasSubjectSource) { this.subject = SubjectFinder.findByIdOrIdentifierAndSource(this.subjectId, this.subjectSourceId, true); return; this.subject = SubjectFinder.findByIdOrIdentifierAndSource(loginId, ExternalSubject.sourceId(), false); if (this.subject == null) { this.subject = SubjectFinder.findByIdOrIdentifier(loginId, false);
Subject subjectToAssign = SubjectFinder.findByIdOrIdentifierAndSource(loginId, ExternalSubject.sourceId(), false); if (subjectToAssign == null) { try {
String theSourceId = GrouperUtil.prefixOrSuffix(actAsComboName, "||", true); String theSubjectId = GrouperUtil.prefixOrSuffix(actAsComboName, "||", false); actAsSubject = SubjectFinder.findByIdOrIdentifierAndSource(theSubjectId, theSourceId, true); } else { actAsSubject = SubjectFinder.findByIdOrIdentifierAndSource(actAsComboName, SubjectHelper.nonGroupSources(), true);
String sourceId = GrouperUtil.prefixOrSuffix(subjectString, "||", true); String subjectId = GrouperUtil.prefixOrSuffix(subjectString, "||", false); subject = SubjectFinder.findByIdOrIdentifierAndSource(subjectId, sourceId, false);
String sourceId = GrouperUtil.prefixOrSuffix(subjectString, "||", true); String subjectId = GrouperUtil.prefixOrSuffix(subjectString, "||", false); subject = SubjectFinder.findByIdOrIdentifierAndSource(subjectId, sourceId, false);
subject = SubjectFinder.findByIdOrIdentifierAndSource(searchString, sourceId, false);
String sourceId = GrouperUtil.prefixOrSuffix(subjectString, "||", true); String subjectId = GrouperUtil.prefixOrSuffix(subjectString, "||", false); subject = SubjectFinder.findByIdOrIdentifierAndSource(subjectId, sourceId, false);
String sourceId = GrouperUtil.prefixOrSuffix(subjectString, "||", true); String subjectId = GrouperUtil.prefixOrSuffix(subjectString, "||", false); subject = SubjectFinder.findByIdOrIdentifierAndSource(subjectId, sourceId, false);
subject = SubjectFinder.findByIdOrIdentifierAndSource(searchString, sourceId, false);
String sourceId = GrouperUtil.prefixOrSuffix(subjectString, "||", true); String subjectId = GrouperUtil.prefixOrSuffix(subjectString, "||", false); subject = SubjectFinder.findByIdOrIdentifierAndSource(subjectId, sourceId, false);