public Subscription subscribe ( String jid , SubscribeForm subForm ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { PubSub request = createPubsubPacket ( Type . set , new SubscribeExtension ( jid , getId ( ) ) ) ; request . addExtension ( new FormNode ( FormNodeType . OPTIONS , subForm ) ) ; PubSub reply = sendPubsubPacket ( request ) ; return reply . getExtension ( PubSubElementType . SUBSCRIPTION ) ; }
The user subscribes to the node using the supplied jid and subscription options . The bare jid portion of this one must match the jid for the connection .