8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of the Common Development and Distribution License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (the License). You may not use this file except in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Header Notice in each file and include the License file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below the CDDL Header,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with the fields enclosed by brackets [] replaced by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * $Id: ApplicationTypeManager.java,v 1.1 2009/08/19 05:40:32 veiming Exp $
a4544a5a0e622ef69e38641f87ab1b5685e05911Phill Cunnington * Portions Copyrighted 2015 ForgeRock AS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.entitlement.interfaces.ISaveIndex;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.entitlement.interfaces.ISearchIndex;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.entitlement.interfaces.ResourceName;
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestimport org.forgerock.openam.entitlement.PolicyConstants;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Application Type manager.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String URL_APPLICATION_TYPE_NAME =
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "iPlanetAMWebAgentService";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String DELEGATION_APPLICATION_TYPE_NAME =
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "sunAMDelegationService";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String WEB_SERVICE_APPLICATION_TYPE_NAME =
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "webservices";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns application type names.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param adminSubject Admin Subject who has the rights to access
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * configuration datastore.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return application type names.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static Set<String> getApplicationTypeNames(Subject adminSubject) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster EntitlementConfiguration ec = EntitlementConfiguration.getInstance(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Set<ApplicationType> applications = ec.getApplicationTypes();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns application type.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param adminSubject Admin Subject who has the rights to access
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * configuration datastore.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param name Name of application type.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return application type.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static ApplicationType getAppplicationType(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster EntitlementConfiguration ec = EntitlementConfiguration.getInstance(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Set<ApplicationType> applications = ec.getApplicationTypes();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Removes application type.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param adminSubject Admin Subject who has the rights to access
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * configuration datastore.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param name Name of application type.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws EntitlementException if application type cannot be removed.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster EntitlementConfiguration ec = EntitlementConfiguration.getInstance(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Stores application type.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param adminSubject Admin Subject who has the rights to access
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * configuration datastore.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param appType Application type.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster EntitlementConfiguration ec = EntitlementConfiguration.getInstance(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns search index class.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param className Search index implementation class name.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return search index class.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static Class getSearchIndex(String className) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (o instanceof ISearchIndex) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns save index class.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param className Save index implementation class name.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return saveindex class.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static Class getSaveIndex(String className) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (o instanceof ISaveIndex) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns resource comparator implementation class.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param className Resource comparator implementation class name.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return resource comparator implementation class.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static Class getResourceComparator(String className) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (o instanceof ResourceName) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "ApplicationTypeManager.getResourceComparator", ex);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "ApplicationTypeManager.getResourceComparator", ex);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "ApplicationTypeManager.getResourceComparator", ex);