Search in sources :

Example 11 with OrganizationConfigManager

use of com.sun.identity.sm.OrganizationConfigManager in project OpenAM by OpenRock.

the class PrivilegeManagerTest method cleanup.

@AfterClass
public void cleanup() throws Exception {
    if (!migrated) {
        return;
    }
    //Sub Realm
    PrivilegeManager prmSubReam = PrivilegeManager.getInstance(SUB_REALM, SubjectUtils.createSubject(adminToken));
    prmSubReam.remove(PRIVILEGE_NAME);
    PrivilegeManager prm = PrivilegeManager.getInstance("/", SubjectUtils.createSubject(adminToken));
    prm.remove(PRIVILEGE_NAME);
    ApplicationManager.deleteApplication(adminSubject, "/", APPL_NAME);
    ApplicationManager.deleteApplication(adminSubject, SUB_REALM, APPL_NAME);
    OrganizationConfigManager orgMgr = new OrganizationConfigManager(adminToken, "/");
    orgMgr.deleteSubOrganization(SUB_REALM, true);
}
Also used : OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager) AfterClass(org.testng.annotations.AfterClass)

Example 12 with OrganizationConfigManager

use of com.sun.identity.sm.OrganizationConfigManager in project OpenAM by OpenRock.

the class ReferralPrivilegeRemovalTest method createOrgs.

private void createOrgs() throws Exception {
    OrganizationConfigManager ocm = new OrganizationConfigManager(adminToken, "/");
    String subRealm = SUB_REALM1.substring(1);
    ocm.createSubOrganization(subRealm, Collections.EMPTY_MAP);
}
Also used : OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager)

Example 13 with OrganizationConfigManager

use of com.sun.identity.sm.OrganizationConfigManager in project OpenAM by OpenRock.

the class DelegationPrivilegeIdRepoAccessTest method cleanup.

@AfterTest
public void cleanup() throws Exception {
    Set<AMIdentity> identities = new HashSet<AMIdentity>();
    identities.add(delegatedUser);
    identities.add(delegatedUser1);
    IdRepoUtils.deleteIdentities(SUB_REALM, identities);
    ApplicationManager.deleteApplication(SubjectUtils.createSuperAdminSubject(), SUB_REALM, APPLICATION_NAME);
    OrganizationConfigManager orgMgr = new OrganizationConfigManager(adminToken, "/");
    orgMgr.deleteSubOrganization(SUB_REALM, true);
}
Also used : AMIdentity(com.sun.identity.idm.AMIdentity) OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager) HashSet(java.util.HashSet) AfterTest(org.testng.annotations.AfterTest)

Example 14 with OrganizationConfigManager

use of com.sun.identity.sm.OrganizationConfigManager in project OpenAM by OpenRock.

the class OrgAliasReferralTest method cleanup.

@AfterClass
public void cleanup() throws Exception {
    if (orgAliasEnabled) {
        OrganizationConfigManager ocm = new OrganizationConfigManager(adminToken, "/");
        ocm.deleteSubOrganization(SUB_REALM1.substring(1), true);
    }
}
Also used : OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager) AfterClass(org.testng.annotations.AfterClass)

Example 15 with OrganizationConfigManager

use of com.sun.identity.sm.OrganizationConfigManager in project OpenAM by OpenRock.

the class ReferredResourcesTest method cleanup.

@AfterClass
public void cleanup() throws Exception {
    if (!migrated) {
        return;
    }
    ApplicationManager.deleteApplication(adminSubject, "/", APPL_NAME);
    OrganizationConfigManager ocm = new OrganizationConfigManager(adminToken, "/");
    String subRealm = SUB_REALM1.substring(1);
    ocm.deleteSubOrganization(subRealm, true);
    subRealm = SUB_REALM2.substring(1);
    ocm.deleteSubOrganization(subRealm, true);
    subRealm = SUB_REALM3.substring(1);
    ocm.deleteSubOrganization(subRealm, true);
}
Also used : OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager) AfterClass(org.testng.annotations.AfterClass)

Aggregations

OrganizationConfigManager (com.sun.identity.sm.OrganizationConfigManager)144 SMSException (com.sun.identity.sm.SMSException)87 Set (java.util.Set)79 HashSet (java.util.HashSet)54 SSOException (com.iplanet.sso.SSOException)50 Map (java.util.Map)48 HashMap (java.util.HashMap)40 SSOToken (com.iplanet.sso.SSOToken)33 IdRepoException (com.sun.identity.idm.IdRepoException)32 Iterator (java.util.Iterator)28 AMIdentity (com.sun.identity.idm.AMIdentity)23 CLIException (com.sun.identity.cli.CLIException)21 AMIdentityRepository (com.sun.identity.idm.AMIdentityRepository)20 ServiceConfig (com.sun.identity.sm.ServiceConfig)17 IOutput (com.sun.identity.cli.IOutput)15 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)15 List (java.util.List)10 ForbiddenException (org.forgerock.json.resource.ForbiddenException)9 BadRequestException (org.forgerock.json.resource.BadRequestException)8 InternalServerErrorException (org.forgerock.json.resource.InternalServerErrorException)8