View Javadoc

1   /**
2    * SRMServiceLocator.java
3    *
4    * This file was auto-generated from WSDL
5    * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
6    */
7   
8   package org.ogf.srm22;
9   
10  public class SRMServiceLocator extends org.apache.axis.client.Service implements org.ogf.srm22.SRMService {
11  
12      public SRMServiceLocator() {
13      }
14  
15  
16      public SRMServiceLocator(org.apache.axis.EngineConfiguration config) {
17          super(config);
18      }
19  
20      public SRMServiceLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException {
21          super(wsdlLoc, sName);
22      }
23  
24      // Use to get a proxy class for srm
25  
26      /**
27       * the following location of the service is specific to the 
28       *                particular deployment and is not part of the specification
29       */
30      private java.lang.String srm_address = "https://localhost:8443/ogsa/services/srm";
31  
32      public java.lang.String getsrmAddress() {
33          return srm_address;
34      }
35  
36      // The WSDD service name defaults to the port name.
37      private java.lang.String srmWSDDServiceName = "srm";
38  
39      public java.lang.String getsrmWSDDServiceName() {
40          return srmWSDDServiceName;
41      }
42  
43      public void setsrmWSDDServiceName(java.lang.String name) {
44          srmWSDDServiceName = name;
45      }
46  
47      public org.ogf.srm22.ISRM getsrm() throws javax.xml.rpc.ServiceException {
48         java.net.URL endpoint;
49          try {
50              endpoint = new java.net.URL(srm_address);
51          }
52          catch (java.net.MalformedURLException e) {
53              throw new javax.xml.rpc.ServiceException(e);
54          }
55          return getsrm(endpoint);
56      }
57  
58      public org.ogf.srm22.ISRM getsrm(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
59          try {
60              org.ogf.srm22.SrmSoapBindingStub _stub = new org.ogf.srm22.SrmSoapBindingStub(portAddress, this);
61              _stub.setPortName(getsrmWSDDServiceName());
62              return _stub;
63          }
64          catch (org.apache.axis.AxisFault e) {
65              return null;
66          }
67      }
68  
69      public void setsrmEndpointAddress(java.lang.String address) {
70          srm_address = address;
71      }
72  
73      /**
74       * For the given interface, get the stub implementation.
75       * If this service has no port for the given interface,
76       * then ServiceException is thrown.
77       */
78      public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
79          try {
80              if (org.ogf.srm22.ISRM.class.isAssignableFrom(serviceEndpointInterface)) {
81                  org.ogf.srm22.SrmSoapBindingStub _stub = new org.ogf.srm22.SrmSoapBindingStub(new java.net.URL(srm_address), this);
82                  _stub.setPortName(getsrmWSDDServiceName());
83                  return _stub;
84              }
85          }
86          catch (java.lang.Throwable t) {
87              throw new javax.xml.rpc.ServiceException(t);
88          }
89          throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
90      }
91  
92      /**
93       * For the given interface, get the stub implementation.
94       * If this service has no port for the given interface,
95       * then ServiceException is thrown.
96       */
97      public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
98          if (portName == null) {
99              return getPort(serviceEndpointInterface);
100         }
101         java.lang.String inputPortName = portName.getLocalPart();
102         if ("srm".equals(inputPortName)) {
103             return getsrm();
104         }
105         else  {
106             java.rmi.Remote _stub = getPort(serviceEndpointInterface);
107             ((org.apache.axis.client.Stub) _stub).setPortName(portName);
108             return _stub;
109         }
110     }
111 
112     public javax.xml.namespace.QName getServiceName() {
113         return new javax.xml.namespace.QName("http://srm.lbl.gov/StorageResourceManager", "SRMService");
114     }
115 
116     private java.util.HashSet ports = null;
117 
118     public java.util.Iterator getPorts() {
119         if (ports == null) {
120             ports = new java.util.HashSet();
121             ports.add(new javax.xml.namespace.QName("http://srm.lbl.gov/StorageResourceManager", "srm"));
122         }
123         return ports.iterator();
124     }
125 
126     /**
127     * Set the endpoint address for the specified port name.
128     */
129     public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
130         
131 if ("srm".equals(portName)) {
132             setsrmEndpointAddress(address);
133         }
134         else 
135 { // Unknown Port Name
136             throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
137         }
138     }
139 
140     /**
141     * Set the endpoint address for the specified port name.
142     */
143     public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
144         setEndpointAddress(portName.getLocalPart(), address);
145     }
146 
147 }