Package tigase.server

Class Iq

    • Field Detail

      • IQ_QUERY_PATH

        public static final java.lang.String[] IQ_QUERY_PATH
      • IQ_PUBSUB_PATH

        public static final java.lang.String[] IQ_PUBSUB_PATH
      • IQ_ERROR_PATH

        public static final java.lang.String[] IQ_ERROR_PATH
      • IQ_COMMAND_PATH

        public static final java.lang.String[] IQ_COMMAND_PATH
      • IQ_CHAT_PATH

        public static final java.lang.String[] IQ_CHAT_PATH
      • IQ_BIND_RESOURCE_PATH

        public static final java.lang.String[] IQ_BIND_RESOURCE_PATH
      • IQ_BIND_PATH

        public static final java.lang.String[] IQ_BIND_PATH
    • Method Detail

      • createRosterPacket

        public static Iq createRosterPacket​(java.lang.String iq_type,
                                            java.lang.String iq_id,
                                            JID from,
                                            JID to,
                                            JID item_jid,
                                            java.lang.String item_name,
                                            java.lang.String[] item_groups,
                                            java.lang.String subscription,
                                            java.lang.String item_type)
        Method creates a new Packet instance or Iq instance more specificly with a roster entry content. TODO: Remove dependency on RosterAbstract class, possibly move the method again to more proper location but it needs to be accessible from all parts of the application.
        Parameters:
        iq_type - is a String value with the stanza type: 'set', 'get', 'result'.
        iq_id - is a String value with the stanza unique id.
        from - is a JID instance with the packet source address.
        to - is a JID instance with the packet destination address.
        item_jid - is a JID instance with the roster item JID, note in most cases the jid should not have a resource part, but this method does not cut it off. This is because there are cases when we want to have a resource part in the roster item.
        item_name - is a String vakue with the roster item name.
        item_groups - is a String[] array with all groups the item belongs to.
        subscription - is a String instance with the item subscription state.
        item_type - is a String of the user item type. This is null in most cases as this is not part of the XMPP RFC. Some deployments needs some extra information about the roster item type though.
        Returns:
        a new Packet instance or Iq instance more specificly with a roster entry content.
      • getCommand

        public Command getCommand()
        Description copied from class: Packet
        The method always returns NULL. It is overwritten in the Iq class where it returns a command identifier if the iq stanza represents an ad-hoc command. It is provided here is a convenience so the developer does not have to cast the packet to IQ before retrieving the command id.
        Overrides:
        getCommand in class Packet
        Returns:
        the method always returns a NULL.
      • getIQChildName

        public java.lang.String getIQChildName()
      • getIQXMLNS

        public java.lang.String getIQXMLNS()
      • getStrCommand

        public java.lang.String getStrCommand()
      • isCommand

        public boolean isCommand()
        Description copied from class: Packet
        The method checks whether the stanza enclosed by this Packet instance is an ad-hoc command. This is a generic method which in fact always returns false. It is overwritten in the Iq class where the real checking is performed. This class has been provided as a convenience method to perform the check without a need for casting the Packet instance to the Iq class.
        Overrides:
        isCommand in class Packet
        Returns:
        a boolean value true if the stanza is an ad-hoc command and false otherwise.
      • isServiceDisco

        public boolean isServiceDisco()
        Description copied from class: Packet
        A convenience method which checks whether the enclosed stanza is a service discovery query. This is a generic method which in fact always returns false. It is overwritten in the Iq class where the real checking is performed. This class has been provided as a convenience method to perform the check without a need for casting the Packet instance to the Iq class.
        Overrides:
        isServiceDisco in class Packet
        Returns:
        a boolean value true if the stanza is a a service discovery query and false otherwise.
      • getElNameErrorPath

        protected java.lang.String[] getElNameErrorPath()
        Description copied from class: Packet
        A convenience method to provide XML path as String[] to error element. This method should be override by all classes extending this class.
        Overrides:
        getElNameErrorPath in class Packet
        Returns:
        XML path to error element.