View Javadoc
1   /**
2    * This Source Code Form is subject to the terms of the Mozilla Public
3    * License, v. 2.0. If a copy of the MPL was not distributed with this
4    * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5    *
6    * If it is not possible or desirable to put the notice in a particular
7    * file, then You may include the notice in a location (such as a LICENSE
8    * file in a relevant directory) where a recipient would be likely to look
9    * for such a notice.
10  
11   * 
12   */
13   
14  /*  ---------------------------------------------------------------------------
15   *  U.S. Government, Department of the Army
16   *  Army Materiel Command
17   *  Research Development Engineering Command
18   *  Communications Electronics Research Development and Engineering Center
19   *  ---------------------------------------------------------------------------
20   */
21  package org.miloss.fgsms.plugins.sla.alertservice;
22  
23  import javax.jws.Oneway;
24  import javax.jws.WebMethod;
25  import javax.jws.WebParam;
26  import javax.jws.WebService;
27  import javax.xml.bind.annotation.XmlSeeAlso;
28  import java.util.Calendar;
29  import javax.xml.ws.RequestWrapper;
30  import org.apache.log4j.Level;
31  import org.miloss.fgsms.common.Logger;;
32  
33  @WebService(name = "AlertRecieverPortType", targetNamespace = "urn:mil:army:cerdec:fgsms:plugins:sla:alertservice")
34  @XmlSeeAlso({
35      ObjectFactory.class
36  })
37  public class AlertRecieverTestImpl {
38  
39      static final Logger log = Logger.getLogger("RecieverServiceAlertsSample");
40      public static int count=0;
41      /**
42       *
43       * @param message
44       * @param timestamp
45       */
46      @WebMethod(operationName = "RecieveServiceAlert", action = "urn:RecieveServiceAlert")
47      @Oneway
48      @RequestWrapper(localName = "RecieveServiceAlert", targetNamespace = "urn:mil:army:cerdec:fgsms:plugins:sla:alertservice", className = "mil.army.cerdec.fgsms.plugins.sla.alertservice.RecieveServiceAlert")
49      public void recieveServiceAlert(
50              @WebParam(name = "utcdatetime", targetNamespace = "urn:mil:army:cerdec:fgsms:plugins:sla:alertservice") Calendar timestamp,
51              @WebParam(name = "message", targetNamespace = "urn:mil:army:cerdec:fgsms:plugins:sla:alertservice") String message) {
52          count++;
53          if (timestamp != null) {
54              log.log(Level.WARN, "Alert Recieved " + timestamp.toString() + " " + message);
55          } else {
56              log.log(Level.WARN, "Alert Recieved " + " null timestamp " + " " + message);
57          }
58      }
59  }