View Javadoc
1   /**
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements. See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership. The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License. You may obtain a copy of the License at
9    *
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   */
19  package org.apache.wss4j.policy.stax;
20  
21  import javax.xml.namespace.QName;
22  
23  import org.apache.neethi.Policy;
24  
25  public class OperationPolicy {
26  
27      private QName operationName;
28      private String operationAction;
29      private Policy policy;
30      private String soapMessageVersionNamespace;
31  
32      public OperationPolicy(QName operationName) {
33          this.operationName = operationName;
34      }
35  
36      public QName getOperationName() {
37          return operationName;
38      }
39  
40      public void setOperationName(QName operationName) {
41          this.operationName = operationName;
42      }
43  
44      public String getOperationAction() {
45          return operationAction;
46      }
47  
48      public void setOperationAction(String operationAction) {
49          this.operationAction = operationAction;
50      }
51  
52      public Policy getPolicy() {
53          return policy;
54      }
55  
56      public void setPolicy(Policy policy) {
57          this.policy = policy;
58      }
59  
60      public String getSoapMessageVersionNamespace() {
61          return soapMessageVersionNamespace;
62      }
63  
64      public void setSoapMessageVersionNamespace(String soapMessageVersionNamespace) {
65          this.soapMessageVersionNamespace = soapMessageVersionNamespace;
66      }
67  
68      @Override
69      public boolean equals(Object obj) {
70          if (!(obj instanceof OperationPolicy)) {
71              return false;
72          }
73          OperationPolicy other = (OperationPolicy) obj;
74          return getOperationName().equals(other.getOperationName());
75      }
76  
77      @Override
78      public int hashCode() {
79          int hashcode = 17;
80          if (getOperationName() != null) {
81              hashcode *= 31 * getOperationName().hashCode();
82          }
83          return hashcode;
84      }
85  }