01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.apache.cxf.ws.policy.attachment.external;
19:
20: import java.util.Collection;
21:
22: import org.apache.cxf.service.model.BindingFaultInfo;
23: import org.apache.cxf.service.model.BindingMessageInfo;
24: import org.apache.cxf.service.model.BindingOperationInfo;
25: import org.apache.cxf.service.model.EndpointInfo;
26: import org.apache.cxf.service.model.ServiceInfo;
27: import org.apache.neethi.Policy;
28:
29: /**
30: *
31: */
32: public class PolicyAttachment {
33:
34: private Collection<DomainExpression> domainExpressions;
35: private Policy policy;
36:
37: public Collection<DomainExpression> getDomainExpressions() {
38: return domainExpressions;
39: }
40:
41: public void setDomainExpressions(Collection<DomainExpression> des) {
42: domainExpressions = des;
43: }
44:
45: public Policy getPolicy() {
46: return policy;
47: }
48:
49: public void setPolicy(Policy p) {
50: policy = p;
51: }
52:
53: public boolean appliesTo(ServiceInfo si) {
54: for (DomainExpression de : domainExpressions) {
55: if (de.appliesTo(si)) {
56: return true;
57: }
58: }
59: return false;
60: }
61:
62: public boolean appliesTo(EndpointInfo ei) {
63: for (DomainExpression de : domainExpressions) {
64: if (de.appliesTo(ei)) {
65: return true;
66: }
67: }
68: return false;
69: }
70:
71: public boolean appliesTo(BindingOperationInfo boi) {
72: for (DomainExpression de : domainExpressions) {
73: if (de.appliesTo(boi)) {
74: return true;
75: }
76: }
77: return false;
78: }
79:
80: public boolean appliesTo(BindingMessageInfo bmi) {
81: for (DomainExpression de : domainExpressions) {
82: if (de.appliesTo(bmi)) {
83: return true;
84: }
85: }
86: return false;
87: }
88:
89: public boolean appliesTo(BindingFaultInfo bfi) {
90: for (DomainExpression de : domainExpressions) {
91: if (de.appliesTo(bfi)) {
92: return true;
93: }
94: }
95: return false;
96: }
97:
98: }
|