View Javadoc

1   /*
2    * Copyright 2001-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.apache.geronimo.ews.ws4j2ee.context.wsdl.impl;
18  
19  import org.apache.axis.wsdl.symbolTable.BindingEntry;
20  import org.apache.axis.wsdl.symbolTable.PortTypeEntry;
21  import org.apache.axis.wsdl.symbolTable.ServiceEntry;
22  import org.apache.geronimo.ews.ws4j2ee.context.wsdl.WSDLContext;
23  import org.apache.geronimo.ews.ws4j2ee.toWs.UnrecoverableGenerationFault;
24  
25  import javax.wsdl.Port;
26  
27  /***
28   * @author hemapani@opensource.lk
29   */
30  public abstract class AbstractWSDLContext implements WSDLContext {
31      private ServiceEntry service;
32      private BindingEntry binding;
33      private PortTypeEntry portType;
34      private Port port;
35  
36      public BindingEntry gettargetBinding() {
37          return binding;
38      }
39  
40      public PortTypeEntry getTargetPortType() {
41          return portType;
42      }
43  
44      public ServiceEntry gettargetService() {
45          return service;
46      }
47  
48      public void settargetBinding(BindingEntry binding) {
49          this.binding = binding;
50      }
51  
52      public void setTargetPortType(PortTypeEntry port) {
53          this.portType = port;
54      }
55  
56      public void settargetService(ServiceEntry service) {
57          this.service = service;
58      }
59  
60      public Port getTargetPort() {
61          return port;
62      }
63  
64      public void setTargetPort(Port port) {
65          this.port = port;
66      }
67  
68      /* (non-Javadoc)
69       * @see org.apache.geronimo.ews.ws4j2ee.context.wsdl.WSDLContext#validate()
70       */
71      public void validate() {
72          if (portType == null || binding == null
73          ) {
74              throw new UnrecoverableGenerationFault("validation of MiscInfo failed");
75          }
76      }
77  
78  }