@SuppressWarnings("ObjectToString") @Override public IQ handleIQRequest(IQ iqRequest) { if (!isRegistry(iqRequest.getFrom())) { LOGGER.log(Level.SEVERE, "Received control stanza from non-registry entity: " + iqRequest); return null; } IoTDisowned iotDisowned = (IoTDisowned) iqRequest; Jid from = iqRequest.getFrom(); NodeInfo nodeInfo = iotDisowned.getNodeInfo(); ThingState state = getStateFor(nodeInfo); if (!from.equals(state.getRegistry())) { LOGGER.severe("Received <disowned/> for " + nodeInfo + " from " + from + " but this is not the registry " + state.getRegistry() + " of the thing."); return null; } if (state.isOwned()) { state.setUnowned(); } else { LOGGER.fine("Received <disowned/> for " + nodeInfo + " but thing was not owned."); } return IQ.createResultIQ(iqRequest); } });
@Override public IQ handleIQRequest(IQ iqRequest) { if (!isRegistry(iqRequest.getFrom())) { LOGGER.log(Level.SEVERE, "Received control stanza from non-registry entity: " + iqRequest); return null; } IoTDisowned iotDisowned = (IoTDisowned) iqRequest; Jid from = iqRequest.getFrom(); NodeInfo nodeInfo = iotDisowned.getNodeInfo(); ThingState state = getStateFor(nodeInfo); if (!from.equals(state.getRegistry())) { LOGGER.severe("Received <disowned/> for " + nodeInfo + " from " + from + " but this is not the registry " + state.getRegistry() + " of the thing."); return null; } if (state.isOwned()) { state.setUnowned(); } else { LOGGER.fine("Received <disowned/> for " + nodeInfo + " but thing was not owned."); } return IQ.createResultIQ(iqRequest); } });