Package com.nabalive.server.jabber.packet

Examples of com.nabalive.server.jabber.packet.SleepPacket


                            messageService.sendMessage(mac, packet);
                        }
                        if (action != null) {
                            switch (Integer.parseInt(action)) {
                                case 13:
                                    messageService.sendMessage(mac, new SleepPacket(SleepPacket.Action.WakeUp));
                                    break;
                                case 14:
                                    messageService.sendMessage(mac, new SleepPacket(SleepPacket.Action.Sleep));
                                    break;
                            }
                        }

                        if(commands.length() > 0)
View Full Code Here


        String scheduleKey = String.format("%02d:%02d-%d", hour, minute, day);

        logger.debug("scheduleKey: {}", scheduleKey);

        Query<Nabaztag> queryWakeUp = nabaztagDAO.createQuery().filter("wakeup", scheduleKey);
        sendToAll(queryWakeUp, new SleepPacket(SleepPacket.Action.WakeUp));

        Query<Nabaztag> querySleep = nabaztagDAO.createQuery().filter("sleep", scheduleKey);
        sendToAll(querySleep, new SleepPacket(SleepPacket.Action.Sleep));
    }
View Full Code Here

            } else {
                boolean isSleep = checkSleep(nabaztag);
                logger.debug("WELCOME: ISSLEEP :" + isSleep);
                if (isSleep) {
                    logger.debug("WELCOME: SENDING SLEEP");
                    messageService.sendMessage(nabaztag.getMacAddress(), new SleepPacket(SleepPacket.Action.Sleep));
                }
            }
        }
    }
View Full Code Here

                    @Override
                    public void handle(Request request, Response response, Map<String, String> map) throws Exception {
                        String apikey = checkNotNull(map.get("apikey"));
                        Nabaztag nabaztag = checkNotNull(nabaztagDAO.findOne("apikey", apikey));

                        messageService.sendMessage(nabaztag.getMacAddress(), new SleepPacket(SleepPacket.Action.Sleep));
                        response.writeJSON("ok");
                    }
                })
                .get(new Route("/nabaztags/:apikey/wakeup") {
                    @Override
                    public void handle(Request request, Response response, Map<String, String> map) throws Exception {
                        String apikey = checkNotNull(map.get("apikey"));
                        Nabaztag nabaztag = checkNotNull(nabaztagDAO.findOne("apikey", apikey));

                        messageService.sendMessage(nabaztag.getMacAddress(), new SleepPacket(SleepPacket.Action.WakeUp));
                        response.writeJSON("ok");
                    }
                })
                .get(new Route("/nabaztags/:apikey/tz") {
                    @Override
View Full Code Here

TOP

Related Classes of com.nabalive.server.jabber.packet.SleepPacket

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.