public LeafNode getLeafNode(String id) throws NotALeafNodeException, NoResponseException, NotConnectedException,
                    InterruptedException, XMPPErrorException, NotAPubSubNodeException {
        Node node;
        try {
            node = getNode(id);
        }
        catch (XMPPErrorException e) {
            if (e.getStanzaError().getCondition() == Condition.service_unavailable) {
                // This could be caused by Prosody bug #805 (see https://prosody.im/issues/issue/805). Prosody does not
                // answer to disco#info requests on the node ID, which makes it undecidable if a node is a leaf or
                // collection node.
                return getLeafNodeProsodyWorkaround(id);
            }
            throw e;
        }

        if (node instanceof LeafNode) {
            return (LeafNode) node;
        }

        throw new PubSubException.NotALeafNodeException(id, pubSubService);
    }
public LeafNode getLeafNode ( String id ) throws NotALeafNodeException , NoResponseException , NotConnectedException , InterruptedException , XMPPErrorException , NotAPubSubNodeException { Node node ; try { node = getNode ( id ) ; } catch ( XMPPErrorException e ) { if ( e . getStanzaError ( ) . getCondition ( ) == Condition . service_unavailable ) { return getLeafNodeProsodyWorkaround ( id ) ; } throw e ; } if ( node instanceof LeafNode ) { return ( LeafNode ) node ; } throw new PubSubException . NotALeafNodeException ( id , pubSubService ) ; }
Try to get a leaf node with the given node ID.

@param id the node ID.
@return the requested leaf node.
@throws NotALeafNodeException in case the node exists but is a collection node.
@throws NoResponseException
@throws NotConnectedException
@throws InterruptedException
@throws XMPPErrorException
@throws NotAPubSubNodeException
@since 4.2.1