Wed, 27 Apr 2016 01:27:09 +0800
Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/jaxws/
changeset: 657:d47a47f961ee
tag: jdk8u25-b17
1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
26 package com.sun.xml.internal.ws.policy;
28 /**
29 * The class serves as a policy map mutator that allows for replacement of current effective policies
30 * stored in the policy map with new effective policy provided by the mutator user.
31 *
32 * @author Marek Potociar (marek.potociar@sun.com)
33 */
34 public final class EffectivePolicyModifier extends PolicyMapMutator {
35 public static EffectivePolicyModifier createEffectivePolicyModifier() {
36 return new EffectivePolicyModifier();
37 }
39 /**
40 * Ensures that direct instantiation is not possible from outside of the class
41 */
42 private EffectivePolicyModifier() {
43 // no initialization required
44 }
46 /**
47 * Replaces current effective policy on the service scope (identified by a {@code key} parameter) with the new efective
48 * policy provided as a second input parameter. If no policy was defined for the presented key, the new policy is simply
49 * stored with the key.
50 *
51 * @param key identifier of the scope the effective policy should be replaced with the new one. Must not be {@code null}.
52 * @param newEffectivePolicy the new policy to replace the old effective policy of the scope. Must not be {@code null}.
53 *
54 * @throws IllegalArgumentException in case any of the input parameters is {@code null}
55 */
56 public void setNewEffectivePolicyForServiceScope(
57 final PolicyMapKey key, final Policy newEffectivePolicy) {
58 getMap().setNewEffectivePolicyForScope(PolicyMap.ScopeType.SERVICE, key, newEffectivePolicy);
59 }
61 /**
62 * Replaces current effective policy on the endpoint scope (identified by a {@code key} parameter) with the new efective
63 * policy provided as a second input parameter.
64 *
65 * @param key identifier of the scope the effective policy should be replaced with the new one. Must not be {@code null}.
66 * @param newEffectivePolicy the new policy to replace the old effective policy of the scope. Must not be {@code null}.
67 *
68 * @throws IllegalArgumentException in case any of the input parameters is {@code null}
69 */
70 public void setNewEffectivePolicyForEndpointScope(
71 final PolicyMapKey key, final Policy newEffectivePolicy) {
72 getMap().setNewEffectivePolicyForScope(PolicyMap.ScopeType.ENDPOINT, key, newEffectivePolicy);
73 }
75 /**
76 * Replaces current effective policy on the operation scope (identified by a {@code key} parameter) with the new efective
77 * policy provided as a second input parameter. If no policy was defined for the presented key, the new policy is simply
78 * stored with the key.
79 *
80 * @param key identifier of the scope the effective policy should be replaced with the new one. Must not be {@code null}.
81 * @param newEffectivePolicy the new policy to replace the old effective policy of the scope. Must not be {@code null}.
82 *
83 * @throws IllegalArgumentException in case any of the input parameters is {@code null}
84 */
85 public void setNewEffectivePolicyForOperationScope(
86 final PolicyMapKey key, final Policy newEffectivePolicy) {
87 getMap().setNewEffectivePolicyForScope(PolicyMap.ScopeType.OPERATION, key, newEffectivePolicy);
88 }
90 /**
91 * Replaces current effective policy on the input message scope (identified by a {@code key} parameter) with the new efective
92 * policy provided as a second input parameter. If no policy was defined for the presented key, the new policy is simply
93 * stored with the key.
94 *
95 * @param key identifier of the scope the effective policy should be replaced with the new one. Must not be {@code null}.
96 * @param newEffectivePolicy the new policy to replace the old effective policy of the scope. Must not be {@code null}.
97 *
98 * @throws IllegalArgumentException in case any of the input parameters is {@code null}
99 */
100 public void setNewEffectivePolicyForInputMessageScope(
101 final PolicyMapKey key, final Policy newEffectivePolicy) {
102 getMap().setNewEffectivePolicyForScope(PolicyMap.ScopeType.INPUT_MESSAGE, key, newEffectivePolicy);
103 }
105 /**
106 * Replaces current effective policy on the output message scope (identified by a {@code key} parameter) with the new efective
107 * policy provided as a second input parameter. If no policy was defined for the presented key, the new policy is simply
108 * stored with the key.
109 *
110 * @param key identifier of the scope the effective policy should be replaced with the new one. Must not be {@code null}.
111 * @param newEffectivePolicy the new policy to replace the old effective policy of the scope. Must not be {@code null}.
112 *
113 * @throws IllegalArgumentException in case any of the input parameters is {@code null}
114 */
115 public void setNewEffectivePolicyForOutputMessageScope(
116 final PolicyMapKey key, final Policy newEffectivePolicy) {
117 getMap().setNewEffectivePolicyForScope(PolicyMap.ScopeType.OUTPUT_MESSAGE, key, newEffectivePolicy);
118 }
120 /**
121 * Replaces current effective policy on the fault message scope (identified by a {@code key} parameter) with the new efective
122 * policy provided as a second input parameter. If no policy was defined for the presented key, the new policy is simply
123 * stored with the key.
124 *
125 * @param key identifier of the scope the effective policy should be replaced with the new one. Must not be {@code null}.
126 * @param newEffectivePolicy the new policy to replace the old effective policy of the scope. Must not be {@code null}.
127 *
128 * @throws IllegalArgumentException in case any of the input parameters is {@code null}
129 */
130 public void setNewEffectivePolicyForFaultMessageScope(
131 final PolicyMapKey key, final Policy newEffectivePolicy) {
132 getMap().setNewEffectivePolicyForScope(PolicyMap.ScopeType.FAULT_MESSAGE, key, newEffectivePolicy);
133 }
134 }