@Override public IQRequestHandler registerIQRequestHandler(final IQRequestHandler iqRequestHandler) { final String key = XmppStringUtils.generateKey(iqRequestHandler.getElement(), iqRequestHandler.getNamespace()); switch (iqRequestHandler.getType()) { case set: synchronized (setIqRequestHandler) { return setIqRequestHandler.put(key, iqRequestHandler); } case get: synchronized (getIqRequestHandler) { return getIqRequestHandler.put(key, iqRequestHandler); } default: throw new IllegalArgumentException("Only IQ type of 'get' and 'set' allowed"); } }
@Override public IQRequestHandler unregisterIQRequestHandler(String element, String namespace, IQ.Type type) { final String key = XmppStringUtils.generateKey(element, namespace); switch (type) { case set: synchronized (setIqRequestHandler) { return setIqRequestHandler.remove(key); } case get: synchronized (getIqRequestHandler) { return getIqRequestHandler.remove(key); } default: throw new IllegalArgumentException("Only IQ type of 'get' and 'set' allowed"); } }
@Override public final IQRequestHandler unregisterIQRequestHandler(IQRequestHandler iqRequestHandler) { return unregisterIQRequestHandler(iqRequestHandler.getElement(), iqRequestHandler.getNamespace(), iqRequestHandler.getType()); }
public Set<IQRequestHandler> getSetIqRequestHandler() { return setIqRequestHandler; }
public void setSetIqRequestHandler(Set<IQRequestHandler> setIqRequestHandler) { this.setIqRequestHandler = setIqRequestHandler; }
public Set<IQRequestHandler> getGetIqRequestHandler() { return getIqRequestHandler; }
public void setGetIqRequestHandler(Set<IQRequestHandler> getIqRequestHandler) { this.getIqRequestHandler = getIqRequestHandler; }
public IQRequestHandler registerIQRequestHandler(IQRequestHandler iqRequestHandler) { return delegate.registerIQRequestHandler(iqRequestHandler); }
public IQRequestHandler unregisterIQRequestHandler(IQRequestHandler iqRequestHandler) { return delegate.unregisterIQRequestHandler(iqRequestHandler); }
public IQRequestHandler unregisterIQRequestHandler(String arg0, String arg1, Type arg2) { return delegate.unregisterIQRequestHandler(arg0, arg1, arg2); }
/** * Register an IQ request handler with this connection. * <p> * IQ request handler process incoming IQ requests, i.e. incoming IQ stanzas of type 'get' or 'set', and return a result. * </p> * @param iqRequestHandler the IQ request handler to register. * @return the previously registered IQ request handler or null. */ public IQRequestHandler registerIQRequestHandler(IQRequestHandler iqRequestHandler);
/** * Convenience method for {@link #unregisterIQRequestHandler(String, String, org.jivesoftware.smack.packet.IQ.Type)}. * * @param iqRequestHandler * @return the previously registered IQ request handler or null. */ public IQRequestHandler unregisterIQRequestHandler(IQRequestHandler iqRequestHandler);
/** * Unregister an IQ request handler with this connection. * * @param element the IQ element the IQ request handler is responsible for. * @param namespace the IQ namespace the IQ request handler is responsible for. * @param type the IQ type the IQ request handler is responsible for. * @return the previously registered IQ request handler or null. */ public IQRequestHandler unregisterIQRequestHandler(String element, String namespace, IQ.Type type);