001/** 002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 003 * 004 * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved 005 * 006 * The contents of this file are subject to the terms 007 * of the Common Development and Distribution License 008 * (the License). You may not use this file except in 009 * compliance with the License. 010 * 011 * You can obtain a copy of the License at 012 * https://opensso.dev.java.net/public/CDDLv1.0.html or 013 * opensso/legal/CDDLv1.0.txt 014 * See the License for the specific language governing 015 * permission and limitations under the License. 016 * 017 * When distributing Covered Code, include this CDDL 018 * Header Notice in each file and include the License file 019 * at opensso/legal/CDDLv1.0.txt. 020 * If applicable, add the following below the CDDL Header, 021 * with the fields enclosed by brackets [] replaced by 022 * your own identifying information: 023 * "Portions Copyrighted [year] [name of copyright owner]" 024 * 025 * $Id: Referral.java,v 1.2 2008/06/25 05:43:47 qcheng Exp $ 026 * 027 * Portions Copyrighted 2014 ForgeRock AS. 028 */ 029 030 031 032package com.sun.identity.policy.interfaces; 033 034import com.sun.identity.policy.*; 035import com.iplanet.sso.SSOToken; 036import com.iplanet.sso.SSOException; 037import java.util.*; 038 039/** 040 * Interface to facilitate delegating policy evaluation 041 * There would be many implementations with different policy delegation 042 * mechanisms such as delegating to peer organizations only 043 * or delegating to sub organizations only. 044 * @supported.all.api 045 * @deprecated since 12.0.0 046 */ 047@Deprecated 048public interface Referral { 049 /** 050 * Initializes the Referral with a <code>Map</code> 051 * @param configurationMap a <code>Map</code> containing configuration 052 * information. Each key of the <code>Map</code> is a configuration 053 * parameter. Each value of the key would be a <code>Set</code> of 054 * values for the parameter. The <code>Map</code> is cloned and a 055 * reference to the clone is stored in the referral 056 */ 057 void initialize(Map configurationMap); 058 059 /** 060 * Sets the values of this referral 061 * @param values <code>Set</code> of values for this referral. 062 * Each element of the <code>Set</code> has to be a 063 * <code>String</code> 064 * @throws InvalidNameException if any value passed in values is 065 * not valid 066 */ 067 void setValues(Set values) throws InvalidNameException; 068 069 /** 070 * Gets the values of this referral 071 * @return the values of this referral 072 * Each element of the returned <code>Set</code> is a 073 * <code>String</code>. 074 */ 075 Set getValues(); 076 077 /** 078 * 079 * Returns the display name for the value for the given locale. 080 * For all the valid values obtained through the methods 081 * <code>getValidValues</code> this method must be called 082 * by web and command line interfaces to get the corresponding display name. 083 * The <code>locale</code> variable could be used by the 084 * plugin to customize 085 * the display name for the given locale. 086 * The <code>locale</code> variable 087 * could be <code>null</code>, in which case the plugin must 088 * use the default locale (most probably <code>en_US</code>). 089 * This method returns only the display name and should not 090 * be used for the method <code>setValues</code>. 091 * Alternatively, if the plugin does not have to localize 092 * the value, it can just return the <code>value</code> as is. 093 * 094 * @param value one of the valid value for the plugin 095 * @param locale locale for which the display name must be customized 096 * @return the display name for the value for the given locale. 097 * @exception NameNotFoundException if the given <code>value</code> 098 * is not one of the valid values for the plugin 099 */ 100 public String getDisplayNameForValue(String value, Locale locale) 101 throws NameNotFoundException; 102 103 /** 104 * Gets the valid values for this referral 105 * @param token <code>SSOToken</code> 106 * @return <code>ValidValues</code> object 107 * @throws SSOException, PolicyException 108 */ 109 ValidValues getValidValues(SSOToken token) 110 throws SSOException, PolicyException; 111 112 /** 113 * Gets the valid values for this referral 114 * matching a pattern 115 * @param token <code>SSOToken</code> 116 * @param pattern a pattern to match against the value 117 * @return <code>ValidValues</code> object 118 * @throws SSOException, PolicyException 119 */ 120 ValidValues getValidValues(SSOToken token, String pattern) 121 throws SSOException, PolicyException; 122 123 /** 124 * Gets the syntax for the value 125 * @param token <code>SSOToken</code> 126 * @see com.sun.identity.policy.Syntax 127 */ 128 Syntax getValueSyntax(SSOToken token) 129 throws SSOException, PolicyException; 130 131 /** 132 * Gets the name of the Referral Type 133 * @return name of the Referral Type representing this referral 134 */ 135 String getReferralTypeName(); 136 137 /** 138 * Gets policy results 139 * @param token SSOToken 140 * @param resourceType resource Type 141 * @param resourceName name of the resource 142 * @param actionNames a set of action names 143 * @param envParameters a map of enivronment parameters. 144 * Each key is an environment parameter name. 145 * Each value is a set of values for the parameter. 146 * @return policy decision 147 * 148 * @throws PolicyException 149 * @throws SSOException 150 */ 151 PolicyDecision getPolicyDecision(SSOToken token, String resourceType, 152 String resourceName, Set actionNames, Map envParameters 153 ) throws SSOException, PolicyException; 154 155 /** 156 * Gets resource names that are exact matches, sub resources or 157 * wild card matches of argument resource name. 158 * To determine whether to include a 159 * resource name of a resource, argument resource name and policy 160 * resource name are compared treating wild characters in the policy 161 * resource name as wild. If the comparsion resulted in EXACT_MATCH, 162 * WILD_CARD_MACTH or SUB_RESOURCE_MACTH, the resource result would be 163 * included. 164 * 165 * @param token sso token 166 * @param serviceTypeName service type name 167 * @param resourceName resource name 168 * @return names of sub resources for the given resourceName. 169 * The return value also includes the resourceName. 170 * 171 * @throws PolicyException 172 * @throws SSOException 173 * 174 * @see com.sun.identity.policy.ResourceMatch#EXACT_MATCH 175 * @see com.sun.identity.policy.ResourceMatch#SUB_RESOURCE_MATCH 176 * @see com.sun.identity.policy.ResourceMatch#WILDCARD_MATCH 177 * 178 */ 179 Set getResourceNames(SSOToken token, String serviceTypeName, 180 String resourceName) throws PolicyException, SSOException; 181}
Copyright © 2010-2017, ForgeRock All Rights Reserved.