Package sample.model

Examples of sample.model.Response


    public void getHumidity(final Location location) {
        new Timer().scheduleAtFixedRate(new TimerTask() {

            @Override
            public void run() {
                final Response response = new Response();
                response.setDate(new Date());
                response.setData(Helper.randomInt(90) + "%");
                WebsocketStatus status = callback.sendMessage(response);
                if (status == WebsocketStatus.CLOSED) {
                    System.out.println("Client disconnected from HumidityService.");
                    this.cancel();
                }
View Full Code Here


    public void getTemperature(final Location location) {
        new Timer().scheduleAtFixedRate(new TimerTask() {

            @Override
            public void run() {
                final Response response = new Response();
                response.setDate(new Date());
                final String data = "" + Helper.randomInt(40);
                response.setData(data);
                WebsocketStatus status = callback.sendMessage(response);
                if (status == WebsocketStatus.CLOSED) {
                    System.out.println("Client disconnected from TemperatureService.");
                    this.cancel();
                }
View Full Code Here

    public void getPrecipitation(final Location location) {
        new Timer().scheduleAtFixedRate(new TimerTask() {

            @Override
            public void run() {
                Response response = new Response();
                response.setDate(new Date());
                response.setData(Helper.randomInt(100) + "%");
                WebsocketStatus status = client.sendMessage(response);
                if (status == WebsocketStatus.CLOSED) {
                    System.out.println("Client disconnected from PrecipitationService.");
                    this.cancel();
                }
View Full Code Here

TOP

Related Classes of sample.model.Response

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.