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: PolicyEvent.java,v 1.2 2008/06/25 05:43:44 qcheng Exp $
026 *
027 * Portions Copyrighted 2014 ForgeRock AS.
028 */
029
030
031package com.sun.identity.policy;
032
033import java.util.Set;
034
035/**
036 * Class to represent policy change events, used by policy framework to
037 *  notify interested listeners
038 *  @see com.sun.identity.policy.interfaces.PolicyListener
039 *
040 * @supported.all.api
041 * @deprecated since 12.0.0
042 */
043@Deprecated
044public class PolicyEvent {
045
046    /**
047     * constant to indicate change type policy added
048     */
049    public static final int POLICY_ADDED =
050        com.sun.identity.sm.ServiceListener.ADDED;
051
052    /**
053     * constant to indicate change type policy modified
054     */
055    public static final int POLICY_MODIFIED =
056        com.sun.identity.sm.ServiceListener.MODIFIED;
057
058    /**
059     * constant to indicate change type policy removed
060     */
061    public static final int POLICY_REMOVED =
062        com.sun.identity.sm.ServiceListener.REMOVED;
063    
064    private Set resourceNames;
065    private int changeType;
066
067    /**
068     * No argument constructor 
069     */
070    PolicyEvent() {
071    }
072
073    /**
074     * Sets the resource names affected by the policy change 
075     * @param resourceNames names of the resources affected by 
076     *       the policy change
077     */
078    void setResourceNames(Set resourceNames) {
079        this.resourceNames = resourceNames;
080    }
081
082    /**
083     * Gets the resource names affected by the policy change.
084     * This indicates that policy decisions for the affected resource names
085     * would likely  be different from those computed before the change. 
086     * @return names of the resources affected by the policy change.
087     */
088    public Set getResourceNames() {
089        return resourceNames;
090    }
091
092    /**
093     * Sets the change type
094     * @param changeType <code>int</code> representing change type
095     */
096    void setChangeType(int changeType) {
097        this.changeType = changeType;
098    }
099
100    /**
101     * Gets the change type
102     * The change type gives the type of policy change that triggered this
103     * event indicating whether a policy was added, modified or removed. 
104     * This change type does not indicate whether resource(s) were added,
105     * modified or removed.
106     * @return change type
107     */
108    public int getChangeType() {
109        return changeType;
110    }
111}
112




























































Copyright © 2010-2017, ForgeRock All Rights Reserved.