RealmGetAssignedServices.java revision 80ca0b9f5ad61b2335af25d4dcf25a04ebfcbc91
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2006 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: RealmGetAssignedServices.java,v 1.2 2008/06/25 05:42:16 qcheng Exp $
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.cli.AuthenticatedCommand;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.idm.AMIdentityRepository;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.sm.OrganizationConfigManager;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Gets assigned service of realm command.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterpublic class RealmGetAssignedServices extends AuthenticatedCommand {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Services a Commandline Request.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param rc Request Context.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws CLIException if the request cannot serviced.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String realm = getStringOptionValue(IArgument.REALM_NAME);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean incMandatory = isOptionSet(IArgument.MANDATORY);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String strMandatory = (incMandatory) ? "include mandatory" :
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "exclude mandatory";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "ATTEMPT_GET_ASSIGNED_SERVICES_OF_REALM", params);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster OrganizationConfigManager ocm = new OrganizationConfigManager(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Set serviceNames = ocm.getAssignedServices(incMandatory);
} catch (SSOException e) {
} catch (IdRepoException e) {
} catch (SMSException e) {