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