@Override public String[] getNamespaces() { String[] primary = primaryNegotiator.getNamespaces(); String[] secondary = secondaryNegotiator.getNamespaces(); String[] namespaces = new String[primary.length + secondary.length]; System.arraycopy(primary, 0, namespaces, 0, primary.length); System.arraycopy(secondary, 0, namespaces, primary.length, secondary.length); return namespaces; }
protected final IQ initiateIncomingStream(final XMPPConnection connection, StreamInitiation initiation) throws NoResponseException, XMPPErrorException, NotConnectedException { final StreamInitiation response = createInitiationAccept(initiation, getNamespaces()); newStreamInitiation(initiation.getFrom(), initiation.getSessionID()); final String eventKey = initiation.getFrom().toString() + '\t' + initiation.getSessionID(); IQ streamMethodInitiation; try { streamMethodInitiation = initationSetEvents.performActionAndWaitForEvent(eventKey, connection.getReplyTimeout(), new Callback<NotConnectedException>() { @Override public void action() throws NotConnectedException { try { connection.sendStanza(response); } catch (InterruptedException e) { // Ignore } } }); } catch (InterruptedException e) { // TODO remove this try/catch once merged into 4.2's master branch throw new IllegalStateException(e); } if (streamMethodInitiation == null) { throw NoResponseException.newWith(connection, "stream initiation"); } XMPPErrorException.ifHasErrorThenThrow(streamMethodInitiation); return streamMethodInitiation; }
public String[] getNamespaces() { String[] primary = primaryNegotiator.getNamespaces(); String[] secondary = secondaryNegotiator.getNamespaces(); String[] namespaces = new String[primary.length + secondary.length]; System.arraycopy(primary, 0, namespaces, 0, primary.length); System.arraycopy(secondary, 0, namespaces, primary.length, secondary.length); return namespaces; }
public String[] getNamespaces() { String [] primary = primaryNegotiator.getNamespaces(); String [] secondary = secondaryNegotiator.getNamespaces(); String [] namespaces = new String[primary.length + secondary.length]; System.arraycopy(primary, 0, namespaces, 0, primary.length); System.arraycopy(secondary, 0, namespaces, primary.length, secondary.length); return namespaces; }
public String[] getNamespaces() { String[] primary = primaryNegotiator.getNamespaces(); String[] secondary = secondaryNegotiator.getNamespaces(); String[] namespaces = new String[primary.length + secondary.length]; System.arraycopy(primary, 0, namespaces, 0, primary.length); System.arraycopy(secondary, 0, namespaces, primary.length, secondary.length); return namespaces; }
public String[] getNamespaces() { String[] primary = primaryNegotiator.getNamespaces(); String[] secondary = secondaryNegotiator.getNamespaces(); String[] namespaces = new String[primary.length + secondary.length]; System.arraycopy(primary, 0, namespaces, 0, primary.length); System.arraycopy(secondary, 0, namespaces, primary.length, secondary.length); return namespaces; }
Packet initiateIncomingStream(Connection connection, StreamInitiation initiation) throws XMPPException { StreamInitiation response = createInitiationAccept(initiation, getNamespaces()); // establish collector to await response PacketCollector collector = connection .createPacketCollector(getInitiationPacketFilter(initiation.getFrom(), initiation.getSessionID())); connection.sendPacket(response); Packet streamMethodInitiation = collector .nextResult(SmackConfiguration.getPacketReplyTimeout()); collector.cancel(); if (streamMethodInitiation == null) { throw new XMPPException("No response from file transfer initiator"); } return streamMethodInitiation; }
Packet initiateIncomingStream(Connection connection, StreamInitiation initiation) throws XMPPException { StreamInitiation response = createInitiationAccept(initiation, getNamespaces()); // establish collector to await response PacketCollector collector = connection .createPacketCollector(getInitiationPacketFilter(initiation.getFrom(), initiation.getSessionID())); connection.sendPacket(response); Packet streamMethodInitiation = collector .nextResult(SmackConfiguration.getPacketReplyTimeout()); collector.cancel(); if (streamMethodInitiation == null) { throw new XMPPException("No response from file transfer initiator"); } return streamMethodInitiation; }
Packet initiateIncomingStream(Connection connection, StreamInitiation initiation) throws XMPPException { StreamInitiation response = createInitiationAccept(initiation, getNamespaces()); // establish collector to await response PacketCollector collector = connection .createPacketCollector(getInitiationPacketFilter(initiation.getFrom(), initiation.getSessionID())); connection.sendPacket(response); Packet streamMethodInitiation = collector .nextResult(SmackConfiguration.getPacketReplyTimeout()); collector.cancel(); if (streamMethodInitiation == null) { throw new XMPPException("No response from file transfer initiator"); } return streamMethodInitiation; }
Packet initiateIncomingStream(XMPPConnection connection, StreamInitiation initiation) throws XMPPException { StreamInitiation response = createInitiationAccept(initiation, getNamespaces()); // establish collector to await response PacketCollector collector = connection .createPacketCollector(getInitiationPacketFilter(initiation.getFrom(), initiation.getSessionID())); connection.sendPacket(response); Packet streamMethodInitiation = collector .nextResult(SmackConfiguration.getPacketReplyTimeout()); collector.cancel(); if (streamMethodInitiation == null) { throw new XMPPException("No response from file transfer initiator"); } return streamMethodInitiation; }