use of com.sun.identity.policy.interfaces.Subject in project OpenAM by OpenRock.
the class Subjects method removeSubject.
/**
* Removes the <code>Subject</code> object identified by
* object's <code>equals</code> method. If a subject instance
* does not exist, the method will return silently.
*
* @param subject subject object that
* will be removed from the user collection
* @return the subject that was just removed
*/
public Subject removeSubject(Subject subject) {
Subject s = null;
String subjectName = getSubjectName(subject);
if (subjectName != null) {
QualifiedSubject qualifiedSubject = (QualifiedSubject) users.remove(subjectName);
if (qualifiedSubject != null) {
s = qualifiedSubject.getSubject();
}
}
return s;
}
use of com.sun.identity.policy.interfaces.Subject in project OpenAM by OpenRock.
the class IdentitySubjectEditViewBean method getDefaultValues.
protected Set getDefaultValues(IdentitySubjectModel model) {
Set values = null;
String subjectName = (String) getPageSessionAttribute(SubjectOpViewBeanBase.PG_SESSION_SUBJECT_NAME);
try {
CachedPolicy cachedPolicy = getCachedPolicy();
Policy policy = cachedPolicy.getPolicy();
Subject subject = policy.getSubject(subjectName);
values = subject.getValues();
} catch (NameNotFoundException e) {
debug.warning("IdentitySubjectEditViewBean.getDefaultValues", e);
} catch (AMConsoleException e) {
debug.warning("IdentitySubjectEditViewBean.getDefaultValues", e);
}
return (values != null) ? values : Collections.EMPTY_SET;
}
Aggregations