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); } } });
return SubjectFinder.findByIdOrIdentifier(searchString, exceptionIfNotFound); } catch (SubjectNotUniqueException snue) { if (exceptionIfNotFound) {
/** */ @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 = SubjectFinder.findByIdentifier(subjectIdentifier, true); } else if (hasSubjectIdOrIdentifier) { subject = SubjectFinder.findByIdOrIdentifier(theSubjectIdOrIdentifier, true); } else { throw new RuntimeException("Should not get here either");
} else { try { subject = SubjectFinder.findByIdOrIdentifier(query, false); } catch (SubjectNotUniqueException snue) {
Subject subject = SubjectFinder.findByIdOrIdentifier(subjectIdOrIdentifier, true); Subject subject = SubjectFinder.findByIdOrIdentifier(subjectIdOrIdentifier, true);
Subject subject = SubjectFinder.findByIdOrIdentifier(subjectIdOrIdentifier, true); loaderReport.append("<font color='green'>SUCCESS:</font> Found subject '" + subjectIdOrIdentifier + "' by idOrIdentifier: " + GrouperUtil.subjectToString(subject) + "\n");
subjectWhoRegistered = SubjectFinder.findByIdOrIdentifier(identifier, false); } catch (Exception e2) { LOG.warn("Problem looking for subject: " + identifier, e2);
return; this.subject = SubjectFinder.findByIdOrIdentifier(this.subjectId, true); this.subject = SubjectFinder.findByIdOrIdentifier(loginId, false);
} else { try { theSubject = StringUtils.isBlank(comboValue) ? null : SubjectFinder.findByIdOrIdentifier(comboValue, false); } catch (SubjectNotUniqueException snue) {
String sourceIds = GrouperUiConfig.retrieveConfig().propertyValueString("grouper.ui.authentication.sourceIds"); if (StringUtils.isBlank(sourceIds)) { subjectLoggedIn = SubjectFinder.findByIdOrIdentifier(userIdLoggedIn, true); } else { Subject theSubjectLoggedIn = null;
if (subjectToAssign == null) { try { subjectToAssign = SubjectFinder.findByIdOrIdentifier(loginId, false); } catch (SubjectNotUniqueException snue) {
subject = SubjectFinder.findByIdOrIdentifier(subjectString, false); } catch (SubjectNotUniqueException snue) {
subject = SubjectFinder.findByIdOrIdentifier(subjectString, false); } catch (SubjectNotUniqueException snue) {
subject = SubjectFinder.findByIdOrIdentifier(subjectString, false); } catch (SubjectNotUniqueException snue) {
if (StringUtils.equals("all", sourceId)) { try { subject = SubjectFinder.findByIdOrIdentifier(searchString, false); } catch (SubjectNotUniqueException snue) {
subject = SubjectFinder.findByIdOrIdentifier(subjectString, false); } catch (SubjectNotUniqueException snue) {
subject = SubjectFinder.findByIdOrIdentifier(subjectString, false); } catch (SubjectNotUniqueException snue) {
if (StringUtils.equals("all", sourceId)) { try { subject = SubjectFinder.findByIdOrIdentifier(searchString, false); } catch (SubjectNotUniqueException snue) {