View Javadoc
1   /*
2    * Copyright 2015 alex.
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.miloss.fgsms.services.das.impl;
18  
19  import java.util.logging.Level;
20  import java.util.logging.Logger;
21  import javax.annotation.Resource;
22  import javax.jws.WebMethod;
23  import javax.jws.WebParam;
24  import javax.jws.WebResult;
25  import javax.jws.WebService;
26  import javax.xml.datatype.DatatypeConfigurationException;
27  import javax.xml.ws.RequestWrapper;
28  import javax.xml.ws.ResponseWrapper;
29  import javax.xml.ws.WebServiceContext;
30  import org.miloss.fgsms.services.interfaces.common.GetOperatingStatusRequestMessage;
31  import org.miloss.fgsms.services.interfaces.common.GetOperatingStatusResponseMessage;
32  import org.miloss.fgsms.services.interfaces.policyconfiguration.OpStatusService;
33  
34  @WebService(serviceName = "dataAccessService",
35          name = "opStatusService",
36          targetNamespace = "urn:org:miloss:fgsms:services:interfaces:opstatus"
37  )
38  public class OpStat implements OpStatusService {
39  
40       public OpStat() {
41       }
42       @Resource
43      private WebServiceContext ctx;
44  
45       @WebMethod(operationName = "GetOperatingStatus", action = "urn:org:miloss:fgsms:services:interfaces:opStatusService/GetOperatingStatus")
46       @WebResult(name = "response", targetNamespace = "urn:org:miloss:fgsms:services:interfaces:common")
47       @RequestWrapper(localName = "GetOperatingStatus", targetNamespace = "urn:org:miloss:fgsms:services:interfaces:common", className = "org.miloss.fgsms.services.interfaces.common.GetOperatingStatus")
48       @ResponseWrapper(localName = "GetOperatingStatusResponse", targetNamespace = "urn:org:miloss:fgsms:services:interfaces:common", className = "org.miloss.fgsms.services.interfaces.common.GetOperatingStatusResponse")
49       public GetOperatingStatusResponseMessage getOperatingStatus(
50               @WebParam(name = "request", targetNamespace = "urn:org:miloss:fgsms:services:interfaces:common") GetOperatingStatusRequestMessage request) {
51  
52            try {
53                 return new DAS4jBean(ctx).getOperatingStatus(request);
54            } catch (DatatypeConfigurationException ex) {
55                 Logger.getLogger(OpStat.class.getName()).log(Level.SEVERE, null, ex);
56            }
57            return null;
58       }
59  
60  }