Search in sources :

Example 16 with OrganizationConfigManager

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

the class OrgAliasReferralTest method createOrgs.

private void createOrgs() throws Exception {
    OrganizationConfigManager ocm = new OrganizationConfigManager(adminToken, "/");
    String subRealm = SUB_REALM1.substring(1);
    Map<String, Map<String, Set<String>>> map = new HashMap<String, Map<String, Set<String>>>();
    Map<String, Set<String>> idRepoService = new HashMap<String, Set<String>>();
    Set<String> set = new HashSet<String>();
    set.add("www.OrgAliasReferralTest.com");
    idRepoService.put(PolicyManager.ORG_ALIAS, set);
    map.put(PolicyManager.ID_REPO_SERVICE, idRepoService);
    ocm.createSubOrganization(subRealm, map);
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) HashMap(java.util.HashMap) OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager) HashMap(java.util.HashMap) Map(java.util.Map) HashSet(java.util.HashSet)

Example 17 with OrganizationConfigManager

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

the class ReferralPrivilegeTest method cleanup.

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

Example 18 with OrganizationConfigManager

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

the class ReferralPrivilegeWithRemovedRealmTest method setup.

@BeforeClass
public void setup() throws Exception {
    if (!migrated) {
        return;
    }
    OrganizationConfigManager ocm = new OrganizationConfigManager(adminToken, "/");
    String subRealm = SUB_REALM.substring(1);
    ocm.createSubOrganization(subRealm, Collections.EMPTY_MAP);
    createReferral();
}
Also used : OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager) BeforeClass(org.testng.annotations.BeforeClass)

Example 19 with OrganizationConfigManager

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

the class ReferralPrivilegeWithRemovedRealmTest method test.

@Test
public void test() throws Exception {
    if (!migrated) {
        return;
    }
    OrganizationConfigManager ocm = new OrganizationConfigManager(adminToken, "/");
    String subRealm = SUB_REALM.substring(1);
    ocm.deleteSubOrganization(subRealm, true);
    Evaluator evaluator = new Evaluator(adminSubject, ApplicationTypeManager.URL_APPLICATION_TYPE_NAME);
    Set actions = new HashSet();
    actions.add("GET");
    //should not result in NPE.
    evaluator.hasEntitlement("/", adminSubject, new Entitlement("http://www.ReferralPrivilegeWithRemovedRealmTest.com/index.html", actions), Collections.EMPTY_MAP);
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager) HashSet(java.util.HashSet) Test(org.testng.annotations.Test)

Example 20 with OrganizationConfigManager

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

the class ReferredResourcesTest method createOrgs.

private void createOrgs() throws Exception {
    OrganizationConfigManager ocm = new OrganizationConfigManager(adminToken, "/");
    String subRealm = SUB_REALM1.substring(1);
    Map<String, Map<String, Set<String>>> map = new HashMap<String, Map<String, Set<String>>>();
    Map<String, Set<String>> idRepoService = new HashMap<String, Set<String>>();
    Set<String> set = new HashSet<String>();
    set.add("a.com");
    idRepoService.put(PolicyManager.ORG_ALIAS, set);
    map.put(PolicyManager.ID_REPO_SERVICE, idRepoService);
    ocm.createSubOrganization(subRealm, map);
    subRealm = SUB_REALM2.substring(1);
    ocm.createSubOrganization(subRealm, Collections.EMPTY_MAP);
    subRealm = SUB_REALM3.substring(1);
    ocm.createSubOrganization(subRealm, Collections.EMPTY_MAP);
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) HashMap(java.util.HashMap) OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager) HashMap(java.util.HashMap) Map(java.util.Map) HashSet(java.util.HashSet)

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