use of com.sun.identity.sm.OrganizationConfigManager in project OpenAM by OpenRock.
the class SubRealmGroupTest method removeOrganization.
private void removeOrganization() throws Exception {
SSOToken adminToken = (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance());
Set<AMIdentity> identities = new HashSet<AMIdentity>();
identities.add(user1);
identities.add(group1);
IdRepoUtils.deleteIdentities("/", identities);
OrganizationConfigManager orgMgr = new OrganizationConfigManager(adminToken, "/");
orgMgr.deleteSubOrganization(SUB_REALM1, true);
orgMgr.deleteSubOrganization(SUB_REALM2, true);
EntitlementConfiguration ec = EntitlementConfiguration.getInstance(adminSubject, "/");
Map<String, Set<String>> saccMap = ec.getSubjectAttributesCollectorConfiguration("OpenSSO");
Set<String> tmpSet = saccMap.get("groupMembershipSearchIndexEnabled");
tmpSet.clear();
tmpSet.add(origGroupMembershipSearchIndexEnabled);
ec.setSubjectAttributesCollectorConfiguration("OpenSSO", saccMap);
}
use of com.sun.identity.sm.OrganizationConfigManager in project OpenAM by OpenRock.
the class UserIdRepo method getOrgConfig.
static ServiceConfig getOrgConfig(SSOToken adminToken) throws SMSException, SSOException {
ServiceConfigManager svcCfgMgr = new ServiceConfigManager(IdConstants.REPO_SERVICE, adminToken);
ServiceConfig cfg = svcCfgMgr.getOrganizationConfig("", null);
Map values = new HashMap();
if (cfg == null) {
OrganizationConfigManager orgCfgMgr = new OrganizationConfigManager(adminToken, "/");
ServiceSchemaManager schemaMgr = new ServiceSchemaManager(IdConstants.REPO_SERVICE, adminToken);
ServiceSchema orgSchema = schemaMgr.getOrganizationSchema();
Set attrs = orgSchema.getAttributeSchemas();
for (Iterator iter = attrs.iterator(); iter.hasNext(); ) {
AttributeSchema as = (AttributeSchema) iter.next();
values.put(as.getName(), as.getDefaultValues());
}
cfg = orgCfgMgr.addServiceConfig(IdConstants.REPO_SERVICE, values);
}
return cfg;
}
use of com.sun.identity.sm.OrganizationConfigManager in project OpenAM by OpenRock.
the class AMIdentityTestBase method deleteRealm.
private void deleteRealm(SSOToken ssoToken, String realm) throws SSOException {
if ((realm != null) && !realm.equals("/")) {
String parentRealm = getParentRealm(realm);
try {
OrganizationConfigManager orgMgr = new OrganizationConfigManager(ssoToken, parentRealm);
int idx = realm.lastIndexOf("/");
orgMgr.deleteSubOrganization(realm.substring(idx + 1), true);
} catch (SMSException e) {
//ignore if the sub organization already exists.
}
deleteRealm(ssoToken, parentRealm);
}
}
use of com.sun.identity.sm.OrganizationConfigManager in project OpenAM by OpenRock.
the class AMIdentityTestBase method createSubRealm.
private void createSubRealm(SSOToken ssoToken, String realm) throws SSOException, SMSException {
if ((realm != null) && !realm.equals("/")) {
String parentRealm = getParentRealm(realm);
createSubRealm(ssoToken, parentRealm);
OrganizationConfigManager orgMgr = new OrganizationConfigManager(ssoToken, parentRealm);
int idx = realm.lastIndexOf("/");
try {
orgMgr.createSubOrganization(realm.substring(idx + 1), null);
} catch (SMSException e) {
//ignore if the sub organization already exists.
}
}
}
use of com.sun.identity.sm.OrganizationConfigManager in project OpenAM by OpenRock.
the class RealmTest method deleteRealm.
@Parameters({ "realm" })
@AfterTest(groups = { "cli-realm", "delete-realm" })
public void deleteRealm(String realm) throws CLIException, SMSException {
String[] param = { realm };
entering("deleteRealm", param);
String[] args = { "delete-realm", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, realm };
CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
String parentRealm = RealmUtils.getParentRealm(realm);
String realmName = RealmUtils.getChildRealm(realm);
OrganizationConfigManager ocm = new OrganizationConfigManager(getAdminSSOToken(), parentRealm);
Set results = ocm.getSubOrganizationNames(realmName, false);
assert (results.isEmpty());
exiting("deleteRealm");
}
Aggregations