Class BrokerAdminClient

    • Method Detail

      • reconnectAdmin

        public static BrokerAdminClient reconnectAdmin​(java.lang.String broker_host,
                                                       java.lang.String broker_name,
                                                       java.lang.String client_id,
                                                       BrokerConnectionDescriptor desc)
                                                throws BrokerException
        Reconnects an administrative client. 'broker_name' can be null to request the default broker. 'desc' can be null to request a default connection. The state sharing flag in the descriptor is ignored by this call. Whether or not the client shares state can only be set when making a new client. For non-shared state clients, only one active connection can be made to the broker for a given client_id, so an error can be returned on reconnect if the client_id is already in use. For clients with shared state, multiple reconnects to the client_id can be made, but an error can be returned if the share limit is exceeded.
        Throws:
        BrokerClientContentionException - If the client ID is already in use by another client. For shared state clients, this means the maximum number of reconnects has been exceeded.
        BrokerCommFailureException - If problems occur establishing the connection.
        BrokerHostNotFoundException - If the specified host does not exist.
        BrokerInvalidClientIdException - If the ID contains illegal characters.
        BrokerNoPermissionException - If permission to join the specified client group is denied.
        BrokerNotRunningException - If the host exists but no broker is running on that host.
        BrokerNullParameterException - If broker_host or client_id are null.
        BrokerSecurityException - If a secure connection is attempted but is rejected by the broker.
        BrokerUnknownBrokerNameException - If the specified broker does not exist. If broker_name is null, this indicates that there is no default broker.
        BrokerUnknownClientIdException - If the specified client ID does not exist on the broker.
        BrokerException
      • destroyClientGroup

        public void destroyClientGroup​(java.lang.String client_group_name,
                                       boolean force_destroy)
                                throws BrokerException
        Destroy the named client group. If the force_destroy flag is true, then any clients using the client group are destroyed. If the flag is false, then an error is returned if any clients exist which are members of the client group. Use getClientIdsByClientGroup() to get the list of clients using the client group.
        Throws:
        BrokerDependencyException - If force_destroy is false and there are clients which are members of the client group.
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to modify the client group.
        BrokerNullParameterException - If client_group_name is null.
        BrokerUnknownClientGroupException - If the client group does not exist on the broker.
        BrokerException
      • getClientGroupNames

        public java.lang.String[] getClientGroupNames()
                                               throws BrokerException
        Get the list of client group names from the broker. Only returns client groups which this client can browse. Clients can always browse their own client group.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerException
      • getClientGroupsWhichCanSubscribe

        public java.lang.String[] getClientGroupsWhichCanSubscribe​(java.lang.String event_type_name)
                                                            throws BrokerException
        Get the list of client groups which can subscribe the specified event type. Only returns client groups which this client can browse. Clients can always browse their own client group.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNullParameterException - If event_type_name is null.
        BrokerUnknownEventTypeException - If the event type does not exist on the broker.
        BrokerException
      • getClientGroupsWhichCanLogPublish

        public java.lang.String[] getClientGroupsWhichCanLogPublish​(java.lang.String event_type_name)
                                                             throws BrokerException
        Get the list of client groups which can log publish of the specified event type. Only returns client groups which this client can browse. Clients can always browse their own client group.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNullParameterException - If event_type_name is null.
        BrokerUnknownEventTypeException - If the event type does not exist on the broker.
        BrokerException
      • getClientGroupsWhichCanLogAcknowledge

        public java.lang.String[] getClientGroupsWhichCanLogAcknowledge​(java.lang.String event_type_name)
                                                                 throws BrokerException
        Get the list of client groups which can log acknowledgement of the specified event type. Only returns client groups which this client can browse. Clients can always browse their own client group.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNullParameterException - If event_type_name is null.
        BrokerUnknownEventTypeException - If the event type does not exist on the broker.
        BrokerException
      • getClientGroupInfos

        public BrokerClientGroupInfo[] getClientGroupInfos​(java.lang.String[] client_group_names)
                                                    throws BrokerException
        Get the client group information for the requested client groups. If client_group_names is null, gets the client group info for all client groups. Only returns client groups which this client can browse. Clients can always browse their own client group. The returned array is the same size as the client_group_names array. Entries will be returned as null if they cannot be browsed because of permission failure or because the client group does not exist.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNullParameterException - If an entry in client_group_names is null.
        BrokerException
      • getClientGroupStats

        public BrokerEvent getClientGroupStats​(java.lang.String client_group_name)
                                        throws BrokerException
        Get the specified client group's statistics. The statistics are set into a BrokerEvent as fields. The available values are:
        • now -- (date) Current time on the broker host.
        • createTime -- (date) Time when the client group was created.
        • updateTime -- (date) Time when the client group was last updated. Forever (zero date and time) if not updated after created.
        • numEventsPublished -- (int) Number of events published by member clients.
        • numEventsDelivered -- (int) Number of events delivered by member clients.
        • lastEventPublishTime -- (date) Time when last event was published by a member. Forever (zero date and time) if no member ever published.
        • lastEventDeliveryTime -- (date) Time when last event was delivered by a member. Forever (zero date and time) if no member ever delivered.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to browse the client group.
        BrokerNullParameterException - If client_group_name is null.
        BrokerUnknownClientGroupException - If the client group does not exist on the broker.
        BrokerException
      • getClientIds

        public java.lang.String[] getClientIds()
                                        throws BrokerException
        Get the IDs of all the clients in the Broker. Only returns the IDs of clients which this client can browse. Clients can always browse their own client.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerException
      • getClientIdsWhichAreSubscribed

        public java.lang.String[] getClientIdsWhichAreSubscribed​(java.lang.String event_type_name)
                                                          throws BrokerException
        Get the IDs of all the clients in the Broker which are subscribed to the specified event type. Only returns the IDs of clients which this client can browse. Clients can always browse their own client.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNullParameterException - If event_type_name is null.
        BrokerUnknownEventTypeException - If the event type does not exist on the broker.
        BrokerException
      • createClient

        public void createClient​(java.lang.String client_id,
                                 java.lang.String client_group,
                                 java.lang.String app_name,
                                 java.lang.String user_name,
                                 java.lang.String authenticator_name,
                                 BrokerConnectionDescriptor desc)
                          throws BrokerException
        Create a new client on the broker. Since this does not open a connection to the broker for that client, this only works for clients in client groups with explicit destroy life cycle. To create a client with an owner, pass values in for user_name and authenticator_name. If either one is null, then the client will be created without an owner. The only aspects of the BrokerConnectionDescriptor which is looked at are the shared state setting and the access label hint.
        Throws:
        BrokerClientExistsException - If a client using the specified client ID already exists.
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerInvalidClientIdException - If the ID contains illegal characters.
        BrokerInvalidNameException - If the app_name contains illegal characters.
        BrokerNoPermissionException - If the client does not have permission to modify clients in the specified client group.
        BrokerNullParameterException - If client_id, client_group or app_name are null.
        BrokerUnknownClientGroupException - If the specified client group does not exist on the broker.
        BrokerException
      • getClientInfosById

        public BrokerClientInfo[] getClientInfosById​(java.lang.String[] client_ids)
                                              throws BrokerException
        Get the client information for the requested clients. If client_ids is null, gets the client info for all clients. Only returns information on clients which this client can browse. Clients can always browse their own client. The returned array is the same size as the client_ids array. Entries will be returned as null if they cannot be read because lack of permission to browse the client or because the client does not exist.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNullParameterException - If an entry in client_ids is null.
        BrokerException
      • createClientSubscriptionsById

        public void createClientSubscriptionsById​(java.lang.String client_id,
                                                  BrokerSubscription[] subs)
                                           throws BrokerException
        Open multiple subscriptions for a client at one time. If a subscription with the same name and filter already exists on the broker, the create subscription request is ignored. You can use doesSubscriptionExistById() to test for existing subscriptions.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerInvalidSubscriptionException - If the filter string contains a parse error. All other subscriptions are created if this error occurs.
        BrokerNoPermissionException - If the client does not have permission to modify the specified client , or if the client does not have permission to subscribe to all the event types.
        BrokerNullParameterException - If client_id or subs are null, or if any element in the array is null, or if any element's event_type_name is null.
        BrokerOutOfRangeException - If any element's sub_id is less than zero.
        BrokerUnknownClientIdException - If the client does not exist on the broker.
        BrokerUnknownEventTypeException - If the event type does not exist on the broker. All other subscriptions are created if this error occurs.
        BrokerException
      • destroyClientSubscriptionsById

        public void destroyClientSubscriptionsById​(java.lang.String client_id,
                                                   BrokerSubscription[] subs)
                                            throws BrokerException
        Cancel multiple subscriptions for a client with matching event types and filters. The 'sub_id' field of the subscription is ignored. Only the event type name and filter are used to match the subscription.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerInvalidSubscriptionException - If there is no existing subscription that matches one or more of the subscriptions. If this error occurs, the other subscriptions are still destroyed.
        BrokerNoPermissionException - If the client does not have permission to modify the specified client.
        BrokerNullParameterException - If client_id or subs are null, or if any element in the array is null, or if any element's event_type_name is null.
        BrokerUnknownClientIdException - If the client does not exist on the broker.
        BrokerException
      • setClientStateShareLimitById

        public void setClientStateShareLimitById​(java.lang.String client_id,
                                                 int limit)
                                          throws BrokerException
        Set a client's state share limit. This is the number of clients which can be simultaneously connected using the client ID. Only usable on shared state clients. A value of BrokerClient.NO_SHARE_LIMIT (-1) means there is no limit. The current value can be acquiring using getClientInfoById().
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to modify the specified client, or if the client is not a shared state client.
        BrokerNullParameterException - If client_id is null.
        BrokerOutOfRangeException - If limit is zero or less than -1.
        BrokerUnknownClientIdException - If the client does not exist on the broker.
        BrokerException
      • setClientLastPublishSequenceNumberById

        public void setClientLastPublishSequenceNumberById​(java.lang.String client_id,
                                                           long seqn)
                                                    throws BrokerException
        Set a client's high publisher sequence number. This is the sequnece i number of the most recently published event by the client, and is used to by the broker to discard duplicate events. The current value can be acquiring using getClientInfoById().
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to modify the specified client, or if the client is not a shared state client.
        BrokerNullParameterException - If client_id is null.
        BrokerOutOfRangeException - If seqn is less than 0.
        BrokerUnknownClientIdException - If the client does not exist on the broker.
        BrokerException
      • getClientStatsById

        public BrokerEvent getClientStatsById​(java.lang.String client_id)
                                       throws BrokerException
        Get a client's statistics. The statistics are set into a BrokerEvent as fields. The available values are:
        • now -- (date) Current time on the broker host.
        • createTime -- (date) Time when the client was created.
        • numEventsPublished -- (long) Number of events published by this client.
        • numEventsPublished -- (int) Deprecated. Number of events published by this client.
        • numEventsDelivered -- (long) Number of events delivered by this client.
        • numEventsDelivered -- (int) Deprecated. Number of events delivered by this client.
        • numEventsQueued -- (int) Number of events queued for this client.
        • numEventsRetrieved -- (int) Number of events retrieved by this client.
        • numEventsUnacked -- (int) Number of unacknowledged events for this client.
        • lastEventPublishTime -- (date) Time when last event was published by this client. Forever (zero date and time) if never published.
        • lastEventDeliveryTime -- (date) Time when last event was delivered by this client. Forever (zero date and time) if never delivered.
        • lastEventQueueTime -- (date) Time when last event was queued for this client. Forever (zero date and time) if never had an event queued.
        • lastEventRetrieveTime -- (date) Time when last event was retrieved by this client. Forever (zero date and time) if never retrieved an event.
        • lastRetrieveSession -- (int) Session Id of the last retrieve session.
        • lastConnectTime -- (date) Time when last session connected.
        • lastConnectSession -- (long) Session Id of the last connected session.
        • lastConnectSession -- (int) Deprecated. Session Id of the last connected session.
        • lastDisconnectTime -- (date) Time when last session disconnected.
        • lastDisconnectSession -- (long) Session Id of the last disconnected session.
        • lastDisconnectSession -- (int) Deprecated. Session Id of the last disconnected session.
        • queueLength -- (long) Number of events in client queue.
        • queueByteSize -- (long) Number of bytes worth of events in client queue.
        • queueHighestLength -- (long) Highest value of queueLength.
        • queueHighestLengthTime -- (date) Time when queueHighestLength was last set. Forever (zero date and time) if never had an event queued.
        • queueScans -- (long) Number of queue scans.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to browse the specified client.
        BrokerNullParameterException - If client_id is null.
        BrokerUnknownClientIdException - If the client does not exist on the broker.
        BrokerException
      • getClientStatsByIds

        public BrokerEvent[] getClientStatsByIds​(java.lang.String[] client_ids)
                                          throws BrokerException
        Get statistics for the list of client IDs. The return value is array of BrokerEvent objects The statistics are set into a BrokerEvent as fields. The available values are:
        • now -- (date) Current time on the broker host.
        • createTime -- (date) Time when the client was created.
        • numEventsPublished -- (long) Number of events published by this client.
        • numEventsPublished -- (int) Deprecated. Number of events published by this client.
        • numEventsDelivered -- (long) Number of events delivered by this client.
        • numEventsDelivered -- (int) Deprecated. Number of events delivered by this client.
        • numEventsQueued -- (int) Number of events queued for this client.
        • numEventsRetrieved -- (int) Number of events retrieved by this client.
        • numEventsUnacked -- (int) Number of unacknowledged events for this client.
        • lastEventPublishTime -- (date) Time when last event was published by this client. Forever (zero date and time) if never published.
        • lastEventDeliveryTime -- (date) Time when last event was delivered by this client. Forever (zero date and time) if never delivered.
        • lastEventQueueTime -- (date) Time when last event was queued for this client. Forever (zero date and time) if never had an event queued.
        • lastEventRetrieveTime -- (date) Time when last event was retrieved by this client. Forever (zero date and time) if never retrieved an event.
        • lastRetrieveSession -- (int) Session Id of the last retrieve session.
        • lastConnectTime -- (date) Time when last session connected.
        • lastConnectSession -- (long) Session Id of the last connected session.
        • lastConnectSession -- (int) Deprecated. Session Id of the last connected session.
        • lastDisconnectTime -- (date) Time when last session disconnected.
        • lastDisconnectSession -- (long) Session Id of the last disconnected session.
        • lastDisconnectSession -- (int) Deprecated. Session Id of the last disconnected session.
        • queueLength -- (long) Number of events in client queue.
        • queueByteSize -- (long) Number of bytes worth of events in client queue.
        • queueHighestLength -- (long) Highest value of queueLength.
        • queueHighestLengthTime -- (date) Time when queueHighestLength was last set. Forever (zero date and time) if never had an event queued.
        • queueScans -- (long) Number of queue scans.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to browse the specified client.
        BrokerException
      • getAllQueueStats

        @Deprecated
        public BrokerAllQueueStat[] getAllQueueStats()
                                              throws BrokerException
        Deprecated.
        Deprecated in webMethods Broker 10.5, instead use getClientStatsById(java.lang.String), getClientStatsByIds(java.lang.String[]) Get All client's statistics. The statistics are set into a BrokerEvent as fields. The available values are:
        • now -- (date) Current time on the broker host.
        • createTime -- (date) Time when the client was created.
        • numEventsPublished -- (int) Number of events published by this client. OR
        • numEventsForwarded -- (int) Number of events forwarded by this forward queue.
        • numEventsDelivered -- (int) Number of events delivered by this client. OR
        • numEventsReceived -- (int) Number of events received by this forward queue.
        • numEventsQueued -- (int) Number of events queued for this client. OR
        • numEventsEnqueued -- (int) Number of events enqueued for this forward queue.
        • numEventsRetrieved -- (int) Number of events retrieved by this client.
        • lastEventPublishTime -- (date) Time when last event was published by this client. Forever (zero date and time) if never published. OR
        • lastEventForwardTime -- (date) Time when last event was forwarded by this forward queue. Forever (zero date and time) if never forwarded.
        • lastEventDeliveryTime -- (date) Time when last event was delivered by this client. Forever (zero date and time) if never delivered. OR
        • lastEventReceiveTime -- (date) Time when last event was received by this forward queue. Forever (zero date and time) if never received.
        • lastEventQueueTime -- (date) Time when last event was queued for this client. Forever (zero date and time) if never had an event queued.
        • lastEventRetrieveTime -- (date) Time when last event was retrieved by this client. Forever (zero date and time) if never retrieved an event.
        • lastConnectTime -- (date) Time when last session connected.
        • lastConnectSession -- (int) Session Id of the last connected session.
        • lastDisconnectTime -- (date) Time when last session disconnected.
        • lastDisconnectSession -- (int) Session Id of the last disconnected session.
        • queueLength -- (long) Number of events in client queue.
        • queueByteSize -- (long) Number of bytes worth of events in client queue.
        • queueHighestLength -- (long) Highest value of queueLength.
        • queueScans -- (long) Number of queue scan.
        • queueHighestLengthTime -- (date) Time when queueHighestLength was last set. Forever (zero date and time) if never had an event queued.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to browse the specified client.
        BrokerIncompatibleVersionException - Broker Server does not support this operation.
        BrokerException
      • destroyEventType

        public void destroyEventType​(java.lang.String event_type_name,
                                     boolean force_destroy)
                              throws BrokerException
        Destroy the named event type. If the force_destroy flag is true, then any client subscriptions using the event type are also destroyed, as are any can publish and can subscribe entries in client groups. If the flag is false, then an error is returned if any subscriptions exist which use the event type, or if any client group can publish or subscribe to the event type. Use getClientIdsWhichAreSubscribed(), getClientGroupsWhichCanPublish(), and getClientGroupsWhichCanSubscribe() to get the list of dependencies.
        Throws:
        BrokerDependencyException - If force_destroy is false and there are clients which have subscriptions to the event type, or client groups which have can publish or can subscribe permission to the event type.
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to modify the event type.
        BrokerNullParameterException - If event_type_name is null.
        BrokerUnknownEventTypeException - If the event type does not exist on the broker.
        BrokerException
      • destroyEventTypes

        public void destroyEventTypes​(java.lang.String[] event_type_names,
                                      boolean force_destroy)
                               throws BrokerException
        Destroy the named event types. If the force_destroy flag is true, then any client subscriptions using the event types are also destroyed, as are any can publish and can subscribe entries in client groups. If the flag is false, then an error is returned if any subscriptions exist which use the event types, or if any client group can publish or subscribe to the event type. Use getClientIdsWhichAreSubscribed(), getClientGroupsWhichCanPublish(), and getClientGroupsWhichCanSubscribe() to get the list of dependencies. No error is returned if any of the listed event types do not exist.
        Throws:
        BrokerDependencyException - If force_destroy is false and there are clients which have subscriptions to the one or more of the event types, or client groups which have can publish or can subscribe permission to the event type. No events will be destroyed if this occurs.
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to modify one or more of the event types. All the other event types are still destroyed.
        BrokerNullParameterException - If event_type_names is null, or any entry in the array is null.
        BrokerException
      • getEventAdminTypeDefs

        public BrokerAdminTypeDef[] getEventAdminTypeDefs​(java.lang.String[] event_type_names)
                                                   throws BrokerException
        Get the definitions for the requested event types. If event_type_names is null, gets definitions for all event types. Only returns the event types which this client can browse. Clients can always browse the event types which they can publish or subscribe to. The returned array is the same size as the event_type_names array. Entries will be returned as null if they cannot be read because of permission failure or because the event type does not exist.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNullParameterException - If event_type_names is not null, but at least one entry in the array is null.
        BrokerException
      • getEventTypeStats

        public BrokerEvent getEventTypeStats​(java.lang.String event_type_name)
                                      throws BrokerException
        Get statistics for an event type. Statistics are set into a BrokerEvent as fields. The available values are:
        • now -- (date) Current time on the broker host.
        • createTime -- (date) Time when the event type was created.
        • updateTime -- (date) Time when the event type was last changed. This includes changes to the definition, time to live, or any infoset. Forever (zero date and time) if never changed after created.
        • numEventsPublished -- (int) Number of events of this type published.
        • numEventsDelivered -- (int) Number of events of this type delivered.
        • lastEventPublishTime -- (date) Time when last event of this type was published. Forever (zero date and time) if never published.
        • lastEventDeliveryTime -- (date) Time when last event of this type was delivered. Forever (zero date and time) if never delivered.
        • numClientSubscriptions -- (int) Number of subscriptions open which include this event type.
        • numForwardsReceived -- (int) Number of events of this type received via forwarding from another broker.
        • lastForwardReceivedTime -- (date) Time when last event of this type was received via forwarding from another broker.
        • numGroupsCanPublish -- (int) Number of client groups that can publish this event type.
        • numGroupsCanSubscribe -- (int) Number of client groups that can subscribe to this event type.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to browse the event type.
        BrokerNullParameterException - If event_type_name is null.
        BrokerUnknownEventTypeException - If the event type does not exist on the broker.
        BrokerException
      • destroyEventTypeInfosets

        public void destroyEventTypeInfosets​(java.lang.String event_type_name,
                                             java.lang.String[] infoset_names)
                                      throws BrokerException
        Destroy the specified infosets for the specified event type. If infoset_names is null, then all infosets on the event type are destroyed. No error is issued if an attempt is made to destroy infosets that do not exist.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to modify the event type.
        BrokerNullParameterException - If event_type_name is null, or if any entry in the array is null.
        BrokerUnknownEventTypeException - If the event type does not exist on the broker.
        BrokerException
      • setEventTypesAndClientGroups

        public BrokerSetFailureInfo setEventTypesAndClientGroups​(java.lang.String[] event_type_names_to_destroy,
                                                                 java.lang.String[] client_group_names_to_destroy,
                                                                 BrokerCompleteEventType[] event_types,
                                                                 BrokerCompleteClientGroup[] client_groups,
                                                                 boolean forced)
                                                          throws BrokerException
        Creates, modifies, and destroys event types and client groups as an atomic operation. All deletions take place first, then all the other values are modified (or created if they did not exist). Any parameter can be null to ignore that aspect of the operation. For example, if client_group_names_to_destroy is null, then no client groups will be destroyed. And if a client group entry has its acl field set to null, the access control list will not be updated. If the infosets portion of an event type is non-null, then the replace_all_infosets flag in the BrokerCompleteEventType class is used to determine if the infosets are merged in or if they completely replace the existing infosets. To delete infosets using this method, you must get the existing infosets, remove the ones you want to delete, and then set the replace_all_infosets flag to true. The return value is null if all operations completed successfully, and is an object describing what could not be completed if the operations were not completed successfully. If the 'force' option is false, then nothing is done in the broker if any aspect of the set operation fails. The return value will be an object describing what could not be done. If there are any permission problems, then only permission problems are reported. If there are no permission problems, then only dependency failures are reported. If the 'force' option is true, then as much work as possible is completed. Any permission errors still causes it to fail, but if there are only dependencies, they are forced.
        Throws:
        BrokerInvalidAccessListException - If the access list is not valid.
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerInvalidClientGroupNameException - If an invalid client group name is specified to be created.
        BrokerInvalidEventTypeNameException - If an invalid event type name is specified to be created.
        BrokerNullParameterException - If any array is non-null but one or more elements in it is null, or if any BrokerCompleteEventType's type_def field is null, or if any BrokerCompleteClientGroup's client_group_info field is null, of if any client_group_info's name is null.
        BrokerOutOfRangeException - If any BrokerCompleteClientGroup's client_group_info field has an invalid life_cycle or storage_type value.
        BrokerUnknownEventTypeException - If an unknown event type is specified in a can publish or can subscribe list.
        BrokerException
      • getBrokerStats

        public BrokerEvent getBrokerStats()
                                   throws BrokerException
        Get the Broker statistics. Statistics are set into a BrokerEvent as fields. The available values are:
        • now -- (date) Current time on the Broker host.
        • createTime -- (date) Time when the Broker was created.
        • numClients -- (int) Number of clients on the Broker (connected or not).
        • numEventTypes -- (int) Number of event types installed.
        • numEventsPublished -- (long) Number of events published by all clients.
        • numEventsPublished -- (int) Deprecated. Number of events published by all clients.
        • numEventsDelivered -- (long) Number of events delivered by all clients.
        • numEventsDelivered -- (int) Deprecated. Number of events delivered by all clients.
        • numTracesPublished -- (long) Number of trace events published by the Broker.
        • numTracesPublished -- (int) Deprecated. Number of trace events published by the Broker.
        • numEventsQueued -- (long) Number of events placed in client queues.
        • numEventsQueued -- (int) Deprecated. Number of events placed in client queues.
        • retryQueueMaxPublishes -- (int) Maximum number of publishes.This number starts at 1024 and grows.
        • retryQueueMaxEvents -- (int) Maximum number of events.This number starts at 2560 and grows.
        • retryQueueNextOpsSequenceNum -- (int) Next operation sequence number.
        • retryQueueReservedTotalPublishes -- (int) Total number of reserved publishes.
        • retryQueueReservedGuaranteedPublishes -- (int) Number of guaranteed publishes.
        • retryQueueReservedVolatilePublishes -- (int) Number of volatile publishes.
        • retryQueueReservedGuaranteedEvents -- (int) Number of guaranteed events.
        • retryQueueReservedVolatileEvents -- (int) Number of volatile events.
        • retryQueueCurrentPublishes -- (int) Number of current publishes.
        • retryQueueCurrentEvents -- (int) Number of current events.
        • traceNumEventsQueued -- (int) Number of events placed in queue.
        • traceLastEventEnqueueTime -- (date) Time when last event was enqueued.
        • traceQueueLength -- (long) Number of events in queue.
        • traceQueueByteSize -- (long) Number of bytes worth of events in queue.
        • traceQueueHighestLength -- (long) Highest value of traceQueueLength.
        • traceQueueHighestLengthTime -- (date) Time when traceQueueHighestLength was last set. Forever (zero date and time) if never had an event queued.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to browse the Broker.
        BrokerException
      • acquireChangeLock

        public BrokerChangeLockInfo acquireChangeLock()
                                               throws BrokerException
        Acquire the per-Broker change lock. If the lock is acquired, a BrokerChangeLockInfo object is returned with its "acquired" member set to true. If the lock is already held by a different client, the "acquired" member is set to false, and the client ID, session ID and the time of locking is returned in the BrokerChangeLockInfo object. Does not require any permissions. It is safe to call this method again after having acquired the lock.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerIncompatibleVersionException - If the broker does not support changelocks.
        BrokerException
      • getTerritoryStats

        public BrokerEvent getTerritoryStats()
                                      throws BrokerException
        Get the territory statistics. Statistics are set into a BrokerEvent as fields. The available values are:
        • now -- (date) Current time on the broker host.
        • territoryName -- (unicode string) The name of the territory.
        • brokers -- (structure array) An array of structures describing statistics about other each broker in the territory.
        • brokers[].brokerHost -- (unicode string) Broker host name.
        • brokers[].brokerName -- (unicode string) Broker name.
        • brokers[].description -- (unicode string) Broker description.
        • brokers[].connectedFrom -- (unicode string) IP address where broker is currently connected from. "" if not connected.
        • brokers[].lastConnectTime -- (date) The time when the broker last connected. Forever (zero date and time) if never connected.
        • brokers[].numEventsForwarded -- (int) Number of events forwarded to the broker.
        • brokers[].numEventsReceived -- (int) Number of events received from the broker.
        • brokers[].lastEventForwardTime -- (date) Time when an event was last forwarded to the broker. Forever (zero date and time) if never forwarded.
        • brokers[].lastEventReceiveTime -- (date) Time when an event was last received from the broker. Forever (zero date and time) if never received.
        • brokers[].numEventsEnqueued -- (int) Number of events enqueued for the broker.
        • brokers[].lastEventEnqueueTime -- (date) Time when an event was last enqueued for the broker.
        • brokers[].queueLength -- (long) The current size (in number of events) of the broker's queue.
        • brokers[].queueByteSize -- (long) The current size (in bytes) of the broker's queue.
        • brokers[].queueHighestLength -- (long) The highest length (in number of events) of the broker's queue.
        • brokers[].queueHighestLengthTime -- (date) Time when queueHighestLength was last changed.
        • brokers[].encryptProtocol -- (unicode string) The protocol being used for encryption to this broker. This field is set only if connectedFrom is not "" and if encryption is used. The only currently supported value is "SSL".
        • brokers[].encryptVersion -- (unicode string) The version of the encryption protocol. Not set if encryptProtocol is not set. Currently supported values are "2" and "3".
        • brokers[].encryptLevel -- (unicode string) The level of encryption being used to this broker. Not set if encryptProtocol is not set. Currently supported values are "USDomestic" and "USExport".
        • brokers[].authProtocol -- (unicode string) The protocol being used to authenticate the broker. This field is only set if connectedFrom is not "" and if authentication is used. The only currently supported value is "SSL".
        • brokers[].authVersion -- (unicode string) The version of the authentication protocol. Not set if authProtocol is not set. Currently supported values are "2" and "3".
        • brokers[].sslDistinguishedName -- (unicode string) The distinguished name of the other broker. This field is only set if authProtocol is set to "SSL".
        • brokers[].sslIssuerDistinguishedName -- (unicode string) The distinguished name of the issuer of the other broker's certificate. This field is only set if authProtocol is set to "SSL".
        • brokers[].sslCertStatus -- (unicode string) The status of the other broker's certificate. This field is only set if authProtocol is set to "SSL".
        • brokers[].sslCertSerialNumber -- (unicode string) The serial number of the other broker's certificate. This field is only set if authProtocol is set to "SSL".
        • brokers[].sslCertBeginDate -- (date) The beginning date that the other broker's certificate is valid from. This field is only set if authProtocol is set to "SSL".
        • brokers[].sslCertEndDate -- (date) The end date to which the other broker's certificate is valid to. This field is only set if authProtocol is set to "SSL".
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to browse the broker.
        BrokerNotInTerritoryException - If the broker is not part of a territory.
        BrokerException
      • leaveTerritory

        public void leaveTerritory​(int msecs,
                                   boolean forced)
                            throws BrokerException
        Make this broker leave its current territory. This operation may take a while to complete because it requires talking to other brokers. Set msecs to BrokerClient.TIME_INFINITE (-1) if you want this operation to block until the leave operation is completed. If set to a shorter time, a timeout exception may be thrown before the operation is completed. Note that even if the timeout happens, any other operation on the broker made while the leave operation is in progress may also block and time out. If forced is true, then the broker will leave the territory even if it cannot contact other members of the territory to let them know within the broker's timeout period.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to modify the broker.
        BrokerNotInTerritoryException - If the broker is not a member of a territory.
        BrokerException
      • setTerritorySecurity

        public void setTerritorySecurity​(int auth_type,
                                         int encrypt_level)
                                  throws BrokerException
        Set the type of security used in the territory. The current settings can be acquired using getTerritoryInfo(). The auth_type value can be any of the AUTH_TYPE_* values. The encrypt_level value can be any of the BrokerConnectionDescriptor.ENCRYPT_LEVEL_* values. Changing this value on a territory can have major repercussions, so it should not be done lightly. It is recommended that all brokers in the territory be checked to make sure they are properly configured for the new mode prior to changing the mode. The change may take some time to propagate among the brokers. WARNING: May cause your territory to become partially disconnected if any member brokers are not properly configured for this connection type. For example, requring SSL authentication or encryption when one or more brokers are not even configured for SSL.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to modify the broker.
        BrokerNotInTerritoryException - If the broker is not a member of a territory.
        BrokerOutOfRangeException - If auth_type or encrypt_level are not valid values.
        BrokerException
      • updateRemoteBrokerHostname

        public int updateRemoteBrokerHostname​(java.lang.String remote_broker_name,
                                              java.lang.String new_hostname)
                                       throws BrokerException
        Updates the hostname for the particular remote broker. If the remote broker is found in the territory/cluster, its corresponding hostname is changed to the new hostname. This change is also persisted in the broker's storage. It does not propagates any updates to rest of the territory/cluster. If there are more brokers in territory/cluster/gateways that needs the change, they must be updated individually using this API.
        Returns:
        0 for success. 1 for failure. 2 for Remote broker hostname update is successful. It will take effect after the connection to remote broker is restarted.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNullParameterException - If the arguments remote_broker_name or new_hostname is null or empty.
        BrokerNoPermissionException - If the client does not have permission to modify the broker.
        BrokerNotInTerritoryException - If the broker is not a member of a territory/cluster.
        BrokerIncompatibleVersionException - If the Broker version does not support this feature.
        BrokerException
      • setTerritoryGatewaySecurity

        public void setTerritoryGatewaySecurity​(java.lang.String territory_name,
                                                int auth_type,
                                                int encrypt_level)
                                         throws BrokerException
        Set the type of security used for the territory gateway. The current settings can be acquired using getLocalTerritoryGateways() or getAllTerritoryGateways(). The auth_type value can be any of the AUTH_TYPE_* values. The encrypt_level value can be any of the BrokerConnectionDescriptor.ENCRYPT_LEVEL_* values. Changing this value on a gateway can have major repercussions, so it should not be done lightly. It is recommended that the other broker be checked to make sure it is properly configured for the new mode prior to changing the mode. The change may take some time to take effect. WARNING: May cause your territory gateway to become disconnected if the other brokers is not properly configured for this connection type. For example, requring SSL authentication or encryption when the other broker is not configured for SSL.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to modify the broker.
        BrokerNotInTerritoryException - If the broker is not a member of a territory.
        BrokerNullParameterException - If territory_name is null.
        BrokerOutOfRangeException - If auth_type or encrypt_level are not valid values.
        BrokerUnknownTerritoryException - If there is no gateway to the specified territory from this broker.
        BrokerException
      • getTerritoryGatewayStats

        public BrokerEvent getTerritoryGatewayStats​(java.lang.String territory_name)
                                             throws BrokerException
        Get the territory gateway statistics. Statistics are set into a BrokerEvent as fields. The available values are:
        • now -- (date) Current time on the broker host.
        • remoteTerritoryName -- (unicode string) The name of the territory remote to Broker.
        • gatewayHost -- (unicode string) Gateway broker's host name.
        • gatewayBrokerName -- (unicode string) Gateway broker's name.
        • connectedFrom -- (unicode string) IP address where broker is currently connected from. "" if not connected.
        • lastConnectTime -- (date) The time when the broker last connected. Forever (zero date and time) if never connected.
        • numEventsForwarded -- (int) Number of events forwarded across the gateway.
        • numEventsReceived -- (int) Number of events received across the gateway.
        • lastEventForwardTime -- (date) Time when an event was last forwarded across the gateway. Forever (zero date and time) if never forwarded.
        • lastEventReceiveTime -- (date) Time when an event was last received across the gateway. Forever (zero date and time) if never received.
        • numEventsEnqueued -- (int) Number of events enqueued for the gateway.
        • lastEventEnqueueTime -- (date) Time when an event was last enqueued for the gateway.
        • queueLength -- (long) The current size (in number of events) of the gateway's queue.
        • queueByteSize -- (long) The current size (in bytes) of the gateway's queue.
        • queueHighestLength -- (long) The highest length (in number of events) of the gateway's queue.
        • queueHighestLengthTime -- (date) Time when queueHighestLength was last changed.
        • encryptProtocol -- (unicode string) The protocol being used for encryption to this broker. This field is set only if connectedFrom is not "" and if encryption is used. The only currently supported value is "SSL".
        • encryptVersion -- (unicode string) The version of the encryption protocol. Not set if encryptProtocol is not set. Currently supported values are "SSLv2", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", and "TLSv1.3"
        • encryptLevel -- (unicode string) The level of encryption being used to this broker. Not set if encryptProtocol is not set. Currently supported values are "USDomestic" and "USExport".
        • authProtocol -- (unicode string) The protocol being used to authenticate the broker. This field is only set if connectedFrom is not "" and if authentication is used. The only currently supported value is "SSL".
        • authVersion -- (unicode string) The version of the authentication protocol. Not set if authProtocol is not set. Currently supported values are "SSLv2", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", and "TLSv1.3"
        • sslDistinguishedName -- (unicode string) The distinguished name of the other broker. This field is only set if authProtocol is set to "SSL".
        • sslIssuerDistinguishedName -- (unicode string) The distinguished name of the issuer of the other broker's certificate. This field is only set if authProtocol is set to "SSL".
        • sslCertStatus -- (unicode string) The status of the other broker's certificate. This field is only set if authProtocol is set to "SSL".
        • sslCertSerialNumber -- (unicode string) The serial number of the other broker's certificate. This field is only set if authProtocol is set to "SSL".
        • sslCertBeginDate -- (date) The beginning date that the other broker's certificate is valid from. This field is only set if authProtocol is set to "SSL".
        • sslCertEndDate -- (date) The end date to which the other broker's certificate is valid to. This field is only set if authProtocol is set to "SSL".
        • gateway_pause --(boolean) state of the gateway (true - paused)
        • gateway_pause_time -- (date) The time when the gateway was paused
        • gateway_pause_client -- (string) The client id of the administrator who paused the gateway
        • gateway_pause_session -- (integer) The session id that the gateway was paused from
        Parameters:
        territory_name - The name of the remote territory that identifies the gateway to which the Broker connects to.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to browse the broker.
        BrokerNotInTerritoryException - If the broker is not a member of a territory.
        BrokerNullParameterException - If territory_name is null.
        BrokerUnknownTerritoryException - If there is no gateway to the specified territory from this broker.
        BrokerException
      • getActivityTraces

        public BrokerTraceEvent[] getActivityTraces​(int seqn,
                                                    int msecs)
                                             throws BrokerException
        Get an array of broker activity traces. 'seqn' is zero on the first call and should be the value of 1 greater than the sequence number on the last element returned for future calls. Blocks for a given number of milliseconds then gives up. If 'msecs' is BrokerClient.TIME_INFINITE (-1), it waits forever. Note that if traces are not picked up regularly or if the broker is exceptionally busy, that some may be missed. Note that when using the automatic reconnect feature, you should reset your expected sequence number to zero again each time you are reconnected to the broker.
        Throws:
        BrokerInterruptedException - If this operation is interrupted.
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to access diagnostics on the broker.
        BrokerTimeoutException - If no traces arrive before the specified number of milliseconds pass.
        BrokerException
      • getLogEvents

        public BrokerEvent[] getLogEvents​(int from_index,
                                          int max_events,
                                          int msecs)
                                   throws BrokerException
        Gets one or more events from the brokers event log at the given zero-based index. The number of events being returned is not guaranteed to be 'max_events' even if there are more than max_events in the client's queue. Any number of events up to the value of 'max_events' may be returned. In addition to the listed exceptions, any communications exception can be thrown. Throws an exception with the following major code setting: INVALID_CLIENT if the client is not valid. In addition, any of the communications errors can occur.
        Parameters:
        from_index - - return events starting from this zero-based index
        max_events - - maximum number of events from the given index
        msecs - - maximum amount of time that the events are peeked for in the queue.
        Throws:
        BrokerInvalidClientException - - the admin client not connected
        BrokerOutOfRangeException - - from_index < 0
        BrokerNullParameterException - - max_events, msecs = 0
        BrokerNullParameterException - - if there are no logged events
        BrokerTimeoutException - - reply from Broker is null
        BrokerException
      • deleteLogEvents

        public int deleteLogEvents​(int from_index,
                                   int num_events)
                            throws BrokerException
        Deletes one or more events from the broker's log. The number of events being deleted is not guaranteed to be 'num_events' Returns the number of events deleted
        Parameters:
        from_index - - events to be deleted starting from this index
        num_events - - number of events to be deleted
        Throws:
        BrokerInvalidClientException - if the client is not valid.
        BrokerNullParameterException - if num_events are NULL.
        BrokerOutOfRangeException - if index is < 0 In addition, any of the communications errors can occur.
        BrokerException
      • setLogFilter

        protected void setLogFilter​(java.lang.String event_name,
                                    java.lang.String filter_expr)
                             throws BrokerException
        Allows filtering of log content. If a filter is set on the broker's log then only those events that match the filter will be processed by log operations such as getLogEvent and deleteLogEvent This method can be called repeatedly with different event types to create a filter list. Each event type can have at most one filter. Passing in NULL values for both et_name and filter_expr will reset the filters on the log.
        Parameters:
        event_name - - event name on which the filter should be set
        filter_expr - - filter string to be set
        Throws:
        BrokerFailureException
        BrokerInvalidEventTypeNameException
        BrokerInvalidClientException - if the client is not valid.
        BrokerNullParameterException - if events are NULL.
        BrokerOutOfRageException - if index or lock_id is < 0 (or) if lock is invalid (or) if lock is held by other
        BrokerException
      • setTerritoryGatewayKeepAlive

        public void setTerritoryGatewayKeepAlive​(java.lang.String territory_name,
                                                 int KeepAlive)
                                          throws BrokerException
        Sets or disables KeepAlive interval on the gateway.
        Parameters:
        territory_name - - name of the territory
        KeepAlive - - interval in seconds to send keep alive messages. If zero, sending Keep Alive messages will be disabled
        Throws:
        BrokerInvalidClientException - if the client is not valid.
        BrokerNullParameterException - if territory name is null
        BrokerOutOfRangeException - if KeepALive is < 0
        BrokerException
      • getTerritoryGatewayKeepAlive

        public int getTerritoryGatewayKeepAlive​(java.lang.String territory_name)
                                         throws BrokerException
        Returns KeepAlive interval on the gateway. Zero return value indicates sending Keep Alive events is disabled
        Parameters:
        territory_name - - name of the territory
        Throws:
        BrokerInvalidClientException - if the client is not valid.
        BrokerNullParameterException - if territory name is null
        BrokerException
      • checkAndRestartForwarding

        public int checkAndRestartForwarding​(java.lang.String remote_broker_name)
                                      throws BrokerException
        Check for inactivity and restart forwarding documemnts across the specfied territory or gateway broker. Returns zero if the remote broker was restrted. otherwise returns a non-zero value.
        Parameters:
        remote_broker_name - - name of the remote broker
        Throws:
        BrokerInvalidClientException - if the client is not valid.
        BrokerNullParameterException - if remote broker name is null
        BrokerException
      • checkAndRestartForwarding

        public int checkAndRestartForwarding()
                                      throws BrokerException
        Check for inactivity and restart forwarding documemnts on all territory and gateway brokers on this broker. Returns zero if no remote brokers was restrted. A non-zero return indicates the number of remote broker connections that were restarted.
        Throws:
        BrokerInvalidClientException - if the client is not valid.
        BrokerNullParameterException - if remote broker name is null
        BrokerException
      • getTransactions

        public BrokerEvent getTransactions()
                                    throws BrokerException
        Get the list of current transactions in the Broker transaction manager. The transaction information is stored in a Broker event as follows:
           transaction context info {
             date now;
             struct {
               long          transactionId;
               UnicodeString externalId;
               UnicodeString clientId;
               int           sessionId;
               int           state;
               date          createdTime;
               date          endedTime;
               date          preparedTime;
               date          closedTime;
               int           closedReason;
               date          unpreparedTimeout;
               int           preparedTimeoutInterval;
               date          preparedTimeout;
               int           numEventsReceived;
               int           numEventsAcknowledged;
               int           numEventsPublished;
             } transactions[];
           }
         
        Returns:
        A Broker event containing information on all of the current transactions.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have sufficient permissions.
        BrokerIncompatibleVersionException - If the broker does not support transaction administration.
        BrokerException
      • getTransactionsByClient

        public BrokerEvent getTransactionsByClient​(java.lang.String client_id)
                                            throws BrokerException
        Get the list of a client's transactions in the Broker transaction manager. The transaction information is stored in a Broker event as follows:
           transaction context info {
             date now;
             struct {
               long          transactionId;
               UnicodeString externalId;
               UnicodeString clientId;
               int           sessionId;
               int           state;
               date          createdTime;
               date          endedTime;
               date          preparedTime;
               date          closedTime;
               int           closedReason;
               date          unpreparedTimeout;
               int           preparedTimeoutInterval;
               date          preparedTimeout;
               int           numEventsReceived;
               int           numEventsAcknowledged;
               int           numEventsPublished;
             } transactions[];
           }
         
        Returns:
        A Broker event containing information on all of the client's transactions.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerInvalidClientIdException - If the client_id contains illegal characters.
        BrokerNullParameterException - If the client_id is null.
        BrokerNoPermissionException - If the client does not have sufficient permissions.
        BrokerIncompatibleVersionException - If the broker does not support transaction administration.
        BrokerException
      • getHeuristicTransactions

        public BrokerEvent getHeuristicTransactions()
                                             throws BrokerException
        Get the list of heuristic transactions in the Broker transaction manager. The transaction information is stored in a Broker event as follows:
           transaction context info {
             date now;
             struct {
               long          transactionId;
               UnicodeString externalId;
               UnicodeString clientId;
               int           sessionId;
               int           state;
               date          createdTime;
               date          endedTime;
               date          preparedTime;
               date          closedTime;
               int           closedReason;
               date          unpreparedTimeout;
               int           preparedTimeoutInterval;
               date          preparedTimeout;
               int           numEventsReceived;
               int           numEventsAcknowledged;
               int           numEventsPublished;
             } transactions[];
           }
         
        Returns:
        A Broker event containing information on all of the heuristic transactions.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have sufficient permissions.
        BrokerIncompatibleVersionException - If the broker does not support transaction administration.
        BrokerException
      • setRecoverMode

        public void setRecoverMode​(int mode)
                            throws BrokerException
        Sets the global recover mode to either restricted (the default) or global. Restricted mode only allows a client to recover transactions to which it participated. Global mode allows a client to recover all recoverable transactions.
        Parameters:
        mode - The recover mode to set, either RECOVER_GLOBAL or RECOVER_RESTRICTED.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerOutOfRangeException - If the recovery mode is invalid.
        BrokerNoPermissionException - If the client does not have sufficient permissions.
        BrokerException
      • transactionStateToString

        public static java.lang.String transactionStateToString​(int state)
        Returns a String object representing the specified Broker Transaction Manager's transaction state.
        Parameters:
        state - The Broker Transaction Manager's transaction state to be converted.
        Returns:
        The string representation of the specified state.
      • createClientQueueBrowser

        public BrokerClientQueueBrowser createClientQueueBrowser​(java.lang.String client_id)
                                                          throws BrokerException
        Creates a queue browser on the specified client. This queue browser can be used to browse events from the client's queue without holding queue lock. Since the queue is not locked, the queue content may change between operations on this browser.
        Parameters:
        client_id - The client on which the queue browser is requested.
        Returns:
        BrokerClientQueueBrowser object.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerUnknownClientIdException - If the client id specified does not exist on the broker.
        BrokerException
      • createForwardQueueBrowser

        public BrokerQueueBrowser createForwardQueueBrowser​(java.lang.String remoteBroker)
                                                     throws BrokerException
        Creates a queue browser on the forwarding queue of the specified remote broker. This queue browser can be used to browse events from the forward queue without holding queue lock. Since the queue is not locked, the queue content may change between operations on this browser.
        Parameters:
        remoteBroker - The name of the remote broker for which the forward queue browser is requested.
        Returns:
        BrokerQueueBrowser object.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerQueueBrowserException - If the forward queue for the remote broker specified does not exist on the broker.
        BrokerIncompatibleVersionException - If the broker does not support forwad queue browsing.
        BrokerException
      • createLockedForwardQueueBrowser

        public BrokerLockedQueueBrowser createLockedForwardQueueBrowser​(java.lang.String remoteBroker)
                                                                 throws BrokerException
        Creates a locked queue browser on the forwarding queue of the specified remote broker. The forward queue is locked for the entire duration of this browser existence.
        Parameters:
        remoteBroker - The name of the remote broker for which the forward queue browser is requested.
        Returns:
        BrokerLockedQueueBrowser object.
        Throws:
        BrokerInvalidClientException - If the forward queue has been destroyed or disconnected.
        BrokerUnknownClientIdException - If the forward queue for the remote broker specified does not exist on the broker.
        BrokerQueueBrowserException - If the specified forward queue is locked by some other queue browser.
        BrokerException
      • getClientQueueBrowsers

        public BrokerClientQueueBrowserInfo[] getClientQueueBrowsers​(java.lang.String client_id)
                                                              throws BrokerException
        Gets the list of QueueBrowsers opened by the specified client.
        Parameters:
        client_id - The client on which the list of queue browsers is requested.
        Returns:
        Array of BrokerQueueBrowserInfo
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerException
      • leaveCluster

        public void leaveCluster​(int msecs,
                                 boolean forced)
                          throws BrokerException
        Make this broker leave its current cluster. This operation may take a while to complete because it requires talking to other brokers. Set msecs to BrokerClient.TIME_INFINITE (-1) if you want this operation to block until the leave operation is completed. If set to a shorter time, a timeout exception may be thrown before the operation is completed. Note that even if the timeout happens, any other operation on the broker made while the leave operation is in progress may also block and time out. If forced is true, then the broker will leave the cluster even if it cannot contact other members of the cluster to let them know within the broker's timeout period.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to modify the broker.
        BrokerNotInClusterException - If the broker is not a member of a cluster.
        BrokerException
      • createClusterGateway

        public void createClusterGateway​(java.lang.String cluster_name,
                                         java.lang.String broker_host,
                                         java.lang.String broker_name,
                                         boolean isPrimary)
                                  throws BrokerException
        Create a gateway to the specified cluster by having the current broker communicate with the broker specified by broker_host and broker_name. Note that this only creates one half of the cluster gateway. A similar call must be made on the other broker to complete the gateway. Until that is done, the gateway will be in an incomplete status.
        Throws:
        BrokerHostNotFoundException - If the specified host does not exist.
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to modify the broker.
        BrokerNotInClusterException - If the broker is not a member of a cluster.
        BrokerNotRunningException - If the host is found, but no server is running on that host.
        BrokerNullParameterException - If cluster_name, broker_host, or broker_name are null.
        BrokerOutOfRangeException - If this cluster is already connected to the named cluster through some other gateway, or if the primary gateway already exists to the specified cluster
        BrokerUnknownBrokerNameException - If the specified broker does not exist.
        BrokerUnknownClusterException - If the specified broker is not a member of the specified cluster.
        BrokerException
      • getClusterGatewayStats

        public BrokerEvent getClusterGatewayStats​(java.lang.String cluster_name,
                                                  java.lang.String broker_name)
                                           throws BrokerException
        Get the cluster gateway statistics. Statistics are set into a BrokerEvent as fields. The available values are:
        • now -- (date) Current time on the broker host.
        • remoteClusterName -- (unicode string) The name of the cluster.
        • gatewayHost -- (unicode string) Gateway broker's host name.
        • gatewayBrokerName -- (unicode string) Gateway broker's name.
        • connectedFrom -- (unicode string) IP address where broker is currently connected from. "" if not connected.
        • lastConnectTime -- (date) The time when the broker last connected. Forever (zero date and time) if never connected.
        • numEventsForwarded -- (int) Number of events forwarded across the gateway.
        • numEventsReceived -- (int) Number of events received across the gateway.
        • lastEventForwardTime -- (date) Time when an event was last forwarded across the gateway. Forever (zero date and time) if never forwarded.
        • lastEventReceiveTime -- (date) Time when an event was last received across the gateway. Forever (zero date and time) if never received.
        • numEventsEnqueued -- (int) Number of events enqueued for the gateway.
        • lastEventEnqueueTime -- (date) Time when an event was last enqueued for the gateway.
        • queueLength -- (int) The current size (in number of events) of the gateway's queue.
        • queueByteSize -- (int) The current size (in bytes) of the gateway's queue.
        • queueHighestLength -- (int) The highest length (in number of events) of the gateway's queue.
        • queueHighestLengthTime -- (date) Time when queueHighestLength was last changed.
        • encryptProtocol -- (unicode string) The protocol being used for encryption to this broker. This field is set only if connectedFrom is not "" and if encryption is used. The only currently supported value is "SSL".
        • encryptVersion -- (unicode string) The version of the encryption protocol. Not set if encryptProtocol is not set. Currently supported values are "SSLv2", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", and "TLSv1.3".
        • encryptLevel -- (unicode string) The level of encryption being used to this broker. Not set if encryptProtocol is not set. Currently supported values are "USDomestic" and "USExport".
        • authProtocol -- (unicode string) The protocol being used to authenticate the broker. This field is only set if connectedFrom is not "" and if authentication is used. The only currently supported value is "SSL".
        • authVersion -- (unicode string) The version of the authentication protocol. Not set if authProtocol is not set. Currently supported values are "SSLv2", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", and "TLSv1.3".
        • sslDistinguishedName -- (unicode string) The distinguished name of the other broker. This field is only set if authProtocol is set to "SSL".
        • sslIssuerDistinguishedName -- (unicode string) The distinguished name of the issuer of the other broker's certificate. This field is only set if authProtocol is set to "SSL".
        • sslCertStatus -- (unicode string) The status of the other broker's certificate. This field is only set if authProtocol is set to "SSL".
        • sslCertSerialNumber -- (unicode string) The serial number of the other broker's certificate. This field is only set if authProtocol is set to "SSL".
        • sslCertBeginDate -- (date) The beginning date that the other broker's certificate is valid from. This field is only set if authProtocol is set to "SSL".
        • sslCertEndDate -- (date) The end date to which the other broker's certificate is valid to. This field is only set if authProtocol is set to "SSL".
        • gateway_pause --(boolean) state of the gateway (true - paused)
        • gateway_pause_time -- (date) The time when the gateway was paused
        • gateway_pause_client -- (string) The client id of the administrator who paused the gateway
        • gateway_pause_session -- (integer) The session id that the gateway was paused from
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to browse the broker.
        BrokerNotInClusterException - If the broker is not a member of a cluster.
        BrokerNullParameterException - If cluster_name or broker_name is null.
        BrokerUnknownClusterException - If there is no gateway to the specified territory from this broker.
        BrokerException
      • setClusterGatewaySecurity

        public void setClusterGatewaySecurity​(java.lang.String cluster_name,
                                              java.lang.String broker_name,
                                              int auth_type,
                                              int encrypt_level)
                                       throws BrokerException
        Set the type of security used for the Cluster gateway. The current settings can be acquired using getLocalTerritoryGateways() or getAllTerritoryGateways(). The auth_type value can be any of the AUTH_TYPE_* values. The encrypt_level value can be any of the BrokerConnectionDescriptor.ENCRYPT_LEVEL_* values. Changing this value on a gateway can have major repercussions, so it should not be done lightly. It is recommended that the other broker be checked to make sure it is properly configured for the new mode prior to changing the mode. The change may take some time to take effect. WARNING: May cause your cluster gateway to become disconnected if the other brokers is not properly configured for this connection type. For example, requring SSL authentication or encryption when the other broker is not configured for SSL.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to modify the broker.
        BrokerNotInClusterException - If the broker is not a member of a cluster.
        BrokerNullParameterException - If cluster_name or broker_name is null.
        BrokerOutOfRangeException - If auth_type or encrypt_level are not valid values.
        BrokerUnknownClusterException - If there is no gateway to the specified cluster from this broker.
        BrokerException
      • setClusterStaticGatewayForwarding

        public void setClusterStaticGatewayForwarding​(java.lang.String cluster_name,
                                                      java.lang.String broker_name,
                                                      boolean enable)
                                               throws BrokerException
        Enable or disable static gateway forwarding,
        Parameters:
        cluster_name - - name of the remote cluster
        broker_name - - name of the remote broker
        enable - - state of the static gateway subscription to set (true - enable, false - disable)
        Throws:
        BrokerNotInClusterException - If the broker is not part of a cluster.
        BrokerUnknownClusterException - If there is no gateway to the specified cluster.
        BrokerInvalidClientException - if the client is not valid.
        BrokerNullParameterException - if cluster_name or broker_name is null
        BrokerException
      • getClusterStats

        public BrokerEvent getClusterStats()
                                    throws BrokerException
        Get the cluster statistics. Statistics are set into a BrokerEvent as fields. The available values are:
        • now -- (date) Current time on the broker host.
        • territoryName -- (unicode string) The name of the cluster.
        • brokers -- (structure array) An array of structures describing statistics about other each broker in the cluster.
        • brokers[].brokerHost -- (unicode string) Broker host name.
        • brokers[].brokerName -- (unicode string) Broker name.
        • brokers[].description -- (unicode string) Broker description.
        • brokers[].connectedFrom -- (unicode string) IP address where broker is currently connected from. "" if not connected.
        • brokers[].lastConnectTime -- (date) The time when the broker last connected. Forever (zero date and time) if never connected.
        • brokers[].numEventsForwarded -- (int) Number of events forwarded to the broker.
        • brokers[].numEventsReceived -- (int) Number of events received from the broker.
        • brokers[].lastEventForwardTime -- (date) Time when an event was last forwarded to the broker. Forever (zero date and time) if never forwarded.
        • brokers[].lastEventReceiveTime -- (date) Time when an event was last received from the broker. Forever (zero date and time) if never received.
        • brokers[].numEventsEnqueued -- (int) Number of events enqueued for the broker.
        • brokers[].lastEventEnqueueTime -- (date) Time when an event was last enqueued for the broker.
        • brokers[].queueLength -- (long) The current size (in number of events) of the broker's queue.
        • brokers[].queueByteSize -- (long) The current size (in bytes) of the broker's queue.
        • brokers[].queueHighestLength -- (long) The highest length (in number of events) of the broker's queue.
        • brokers[].queueHighestLengthTime -- (date) Time when queueHighestLength was last changed.
        • brokers[].encryptProtocol -- (unicode string) The protocol being used for encryption to this broker. This field is set only if connectedFrom is not "" and if encryption is used. The only currently supported value is "SSL".
        • brokers[].encryptVersion -- (unicode string) The version of the encryption protocol. Not set if encryptProtocol is not set. Currently supported values are "2" and "3".
        • brokers[].encryptLevel -- (unicode string) The level of encryption being used to this broker. Not set if encryptProtocol is not set. Currently supported values are "USDomestic" and "USExport".
        • brokers[].authProtocol -- (unicode string) The protocol being used to authenticate the broker. This field is only set if connectedFrom is not "" and if authentication is used. The only currently supported value is "SSL".
        • brokers[].authVersion -- (unicode string) The version of the authentication protocol. Not set if authProtocol is not set. Currently supported values are "2" and "3".
        • brokers[].sslDistinguishedName -- (unicode string) The distinguished name of the other broker. This field is only set if authProtocol is set to "SSL".
        • brokers[].sslIssuerDistinguishedName -- (unicode string) The distinguished name of the issuer of the other broker's certificate. This field is only set if authProtocol is set to "SSL".
        • brokers[].sslCertStatus -- (unicode string) The status of the other broker's certificate. This field is only set if authProtocol is set to "SSL".
        • brokers[].sslCertSerialNumber -- (unicode string) The serial number of the other broker's certificate. This field is only set if authProtocol is set to "SSL".
        • brokers[].sslCertBeginDate -- (date) The beginning date that the other broker's certificate is valid from. This field is only set if authProtocol is set to "SSL".
        • brokers[].sslCertEndDate -- (date) The end date to which the other broker's certificate is valid to. This field is only set if authProtocol is set to "SSL".
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to browse the broker.
        BrokerNotInClusterException - If the broker is not part of a cluster.
        BrokerException
      • setClusterSecurity

        public void setClusterSecurity​(int auth_type,
                                       int encrypt_level)
                                throws BrokerException
        Set the type of security used in the cluster. The current settings can be acquired using getClusterInfo(). The auth_type value can be any of the AUTH_TYPE_* values. The encrypt_level value can be any of the BrokerConnectionDescriptor.ENCRYPT_LEVEL_* values. Changing this value on a cluster can have major repercussions, so it should not be done lightly. It is recommended that all brokers in the cluster be checked to make sure they are properly configured for the new mode prior to changing the mode. The change may take some time to propagate among the brokers. WARNING: May cause your cluster to become partially disconnected if any member brokers are not properly configured for this connection type. For example, requring SSL authentication or encryption when one or more brokers are not even configured for SSL.
        Throws:
        BrokerInvalidClientException - If the client has been destroyed or disconnected.
        BrokerNoPermissionException - If the client does not have permission to modify the broker.
        BrokerNotInClusterException - If the broker is not a member of a cluster.
        BrokerOutOfRangeException - If auth_type or encrypt_level are not valid values.
        BrokerException