public IQ sendSessionTerminateAlternativeSession(FullJid recipient, String sessionId, String altSessionId) throws InterruptedException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, SmackException.NoResponseException { Jingle jingle = createSessionTerminateAlternativeSession(recipient, sessionId, altSessionId); return connection.createStanzaCollectorAndSend(jingle).nextResultOrThrow(); }
public IQ sendSessionTerminateContentCancel(FullJid recipient, String sessionId, JingleContent.Creator contentCreator, String contentName) throws SmackException.NotConnectedException, InterruptedException, XMPPException.XMPPErrorException, SmackException.NoResponseException { Jingle jingle = createSessionTerminateContentCancel(recipient, sessionId, contentCreator, contentName); return connection.createStanzaCollectorAndSend(jingle).nextResultOrThrow(); }
public IQ sendSessionInitiateFileOffer(FullJid recipient, String sessionId, JingleContent.Creator contentCreator, String contentName, JingleContentDescription description, JingleContentTransport transport) throws SmackException.NotConnectedException, InterruptedException, XMPPException.XMPPErrorException, SmackException.NoResponseException { Jingle jingle = createSessionInitiateFileOffer(recipient, sessionId, contentCreator, contentName, description, transport); return connection.createStanzaCollectorAndSend(jingle).nextResultOrThrow(); }
public IQ sendSessionTerminateCancel(FullJid recipient, String sessionId) throws InterruptedException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, SmackException.NoResponseException { Jingle jingle = createSessionTerminateCancel(recipient, sessionId); return connection.createStanzaCollectorAndSend(jingle).nextResultOrThrow(); }
public IQ sendSessionAccept(FullJid recipient, String sessionId, JingleContent.Creator contentCreator, String contentName, JingleContent.Senders contentSenders, JingleContentDescription description, JingleContentTransport transport) throws SmackException.NotConnectedException, InterruptedException { Jingle jingle = createSessionAccept(recipient, sessionId, contentCreator, contentName, contentSenders, description, transport); return connection.createStanzaCollectorAndSend(jingle).nextResult(); }
public IQ sendSessionTerminateSuccess(FullJid recipient, String sessionId) throws InterruptedException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, SmackException.NoResponseException { Jingle jingle = createSessionTerminateSuccess(recipient, sessionId); return connection.createStanzaCollectorAndSend(jingle).nextResultOrThrow(); }
public IQ sendSessionTerminateBusy(FullJid recipient, String sessionId) throws InterruptedException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, SmackException.NoResponseException { Jingle jingle = createSessionTerminateBusy(recipient, sessionId); return connection.createStanzaCollectorAndSend(jingle).nextResultOrThrow(); }
public IQ sendSessionTerminateUnsupportedTransports(FullJid recipient, String sessionId) throws InterruptedException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, SmackException.NoResponseException { Jingle jingle = createSessionTerminateUnsupportedTransports(recipient, sessionId); return connection.createStanzaCollectorAndSend(jingle).nextResultOrThrow(); }
public IQ sendSessionTerminateFailedApplication(FullJid recipient, String sessionId) throws InterruptedException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, SmackException.NoResponseException { Jingle jingle = createSessionTerminateFailedApplication(recipient, sessionId); return connection.createStanzaCollectorAndSend(jingle).nextResultOrThrow(); }
public IQ sendSessionTerminateIncompatibleParameters(FullJid recipient, String sessionId) throws InterruptedException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, SmackException.NoResponseException { Jingle jingle = createSessionTerminateIncompatibleParameters(recipient, sessionId); return connection.createStanzaCollectorAndSend(jingle).nextResultOrThrow(); }
private boolean changePushNotificationsStatus(IQ iq) throws NotConnectedException, InterruptedException, NoResponseException, XMPPErrorException { final XMPPConnection connection = connection(); IQ responseIQ = connection.createStanzaCollectorAndSend(iq).nextResultOrThrow(); return responseIQ.getType() != Type.error; }
@SuppressWarnings("unchecked") private <T extends Item> List<T> getItems(PubSub request, List<ExtensionElement> returnedExtensions) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { PubSub result = pubSubManager.getConnection().createStanzaCollectorAndSend(request).nextResultOrThrow(); ItemsExtension itemsElem = result.getExtension(PubSubElementType.ITEMS); if (returnedExtensions != null) { returnedExtensions.addAll(result.getExtensions()); } return (List<T>) itemsElem.getItems(); }
private MamPrefsResult queryMamPrefs(MamPrefsIQ mamPrefsIQ) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException, NotLoggedInException { final XMPPConnection connection = getAuthenticatedConnectionOrThrow(); MamPrefsIQ mamPrefsResultIQ = connection.createStanzaCollectorAndSend(mamPrefsIQ).nextResultOrThrow(); return new MamPrefsResult(mamPrefsResultIQ, DataForm.from(mamPrefsIQ)); }
public void removeThing(Jid registry, BareJid thing, NodeInfo nodeInfo) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { interactWithRegistry(registry); IoTRemove iotRemove = new IoTRemove(thing, nodeInfo); iotRemove.setTo(registry); connection().createStanzaCollectorAndSend(iotRemove).nextResultOrThrow(); // We no not update the ThingState here, as this is done in the <removed/> IQ handler above.; }
public void makeRoomOwner(XMPPConnection con, String sessionID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { MonitorPacket request = new MonitorPacket(); request.setType(IQ.Type.set); request.setTo(workgroupJID); request.setSessionID(sessionID); connection.createStanzaCollectorAndSend(request).nextResultOrThrow(); } }
public Time getTime(Jid jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { if (!isTimeSupported(jid)) return null; Time request = new Time(); // TODO Add Time(Jid) constructor and use this constructor instead request.setTo(jid); return connection().createStanzaCollectorAndSend(request).nextResultOrThrow(); } }
public void disownThing(Jid registry, Jid thing, NodeInfo nodeInfo) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { interactWithRegistry(registry); IoTDisown iotDisown = new IoTDisown(thing, nodeInfo); iotDisown.setTo(registry); connection().createStanzaCollectorAndSend(iotDisown).nextResultOrThrow(); }
private void changeAffiliationByAdmin(Collection<? extends Jid> jids, MUCAffiliation affiliation) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { MUCAdmin iq = new MUCAdmin(); iq.setTo(room); iq.setType(IQ.Type.set); for (Jid jid : jids) { // Set the new affiliation. MUCItem item = new MUCItem(affiliation, jid); iq.addItem(item); } connection.createStanzaCollectorAndSend(iq).nextResultOrThrow(); }
private void changeRole(Collection<Resourcepart> nicknames, MUCRole role) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { MUCAdmin iq = new MUCAdmin(); iq.setTo(room); iq.setType(IQ.Type.set); for (Resourcepart nickname : nicknames) { // Set the new role. MUCItem item = new MUCItem(role, nickname); iq.addItem(item); } connection.createStanzaCollectorAndSend(iq).nextResultOrThrow(); }
public void unregister(Jid registry, NodeInfo nodeInfo) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { interactWithRegistry(registry); IoTUnregister iotUnregister = new IoTUnregister(nodeInfo); iotUnregister.setTo(registry); connection().createStanzaCollectorAndSend(iotUnregister).nextResultOrThrow(); ThingState state = getStateFor(nodeInfo); state.setUnregistered(); final XMPPConnection connection = connection(); IoTDataManager.getInstanceFor(connection).uninstallThing(nodeInfo); IoTControlManager.getInstanceFor(connection).uninstallThing(nodeInfo); }