com.aispeech.dui

## Class BusClient

- java.lang.Object
- - com.aispeech.dui.BusClient

-     public class BusClient
      extends java.lang.Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `BusClient.BusClientImplementException`
    `static class` | `BusClient.BusClientRuntimeException`
    `static interface` | `BusClient.Handler`
    `static class` | `BusClient.Multipart`
    `static class` | `BusClient.RPCResult`
    `static class` | `BusClient.XSocket`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DEFAULT_BUS_SERVER`
    `static int` | `DEFAULT_LOGLEVEL`
    `static java.lang.String` | `TAG`
    `static java.lang.String` | `TAG_HIGHFREQ`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BusClient()`
    `BusClient(java.lang.String names)`
    `BusClient(java.lang.String names, int size)`
    `BusClient(java.lang.String names, java.lang.String addr, int sockBufferSize)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.concurrent.Future<BusClient.RPCResult>` | `acall(java.lang.String url, java.lang.String... args)` Deprecated.
    `BusClient.RPCResult` | `call(java.lang.String url)`
    `BusClient.RPCResult` | `call(java.lang.String url, byte[]... args)`
    `BusClient.RPCResult` | `call(java.lang.String url, java.util.List<java.lang.String> args)`
    `BusClient.RPCResult` | `call(java.lang.String url, java.lang.String... args)`
    `static BusClient.Multipart` | `createRemoveStickyTopic(java.lang.String topic)` create a multipart contains a removesticky topic
    `static BusClient.Multipart` | `createStickyTopic(java.lang.String topic, java.lang.String... parts)` create a multipart contains a sticky topic
    `void` | `delete()`
    `void` | `dump(java.io.PrintWriter pw)`
    `void` | `interrupt()`
    `boolean` | `isReady()`
    `void` | `killTimer(long id)`
    `boolean` | `publish(BusClient.Multipart multipart)`
    `void` | `publish(java.lang.String topic)`
    `void` | `publish(java.lang.String topic, byte[]... parts)`
    `void` | `publish(java.lang.String topic, java.lang.String... parts)`
    `boolean` | `publishSticky(java.lang.String topic, java.lang.String... parts)` The topic will always be delivered to subscribers 1.
    `boolean` | `removeSticky(java.lang.String topic)` The topic will be not sticky anymore Remove the recent sticky topic kept in memory
    `long` | `setTimer(java.lang.Runnable runnable, long timeout)`
    `void` | `spin(BusClient.Handler handler)`
    `void` | `subscribe(java.lang.String... topics)`
    `void` | `unsubscribe(java.lang.String... topics)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TAG

          public static java.lang.String TAG

    - #### TAG_HIGHFREQ

          public static java.lang.String TAG_HIGHFREQ

    - #### DEFAULT_LOGLEVEL

          public static int DEFAULT_LOGLEVEL

    - #### DEFAULT_BUS_SERVER

          public static java.lang.String DEFAULT_BUS_SERVER

  - ### Constructor Detail

    - #### BusClient

          public BusClient()

    - #### BusClient

          public BusClient(java.lang.String names)

    - #### BusClient

          public BusClient(java.lang.String names,
                           int size)

    - #### BusClient

          public BusClient(java.lang.String names,
                           java.lang.String addr,
                           int sockBufferSize)

  - ### Method Detail

    - #### createStickyTopic

          public static BusClient.Multipart createStickyTopic(java.lang.String topic,
                                                              java.lang.String... parts)

      create a multipart contains a sticky topic

    - #### createRemoveStickyTopic

          public static BusClient.Multipart createRemoveStickyTopic(java.lang.String topic)

      create a multipart contains a removesticky topic

    - #### isReady

          public boolean isReady()

    - #### delete

          public void delete()

    - #### subscribe

          public void subscribe(java.lang.String... topics)

    - #### unsubscribe

          public void unsubscribe(java.lang.String... topics)

    - #### publish

          public void publish(java.lang.String topic)

    - #### publish

          public void publish(java.lang.String topic,
                              java.lang.String... parts)

    - #### publish

          public void publish(java.lang.String topic,
                              byte[]... parts)

    - #### publishSticky

          public boolean publishSticky(java.lang.String topic,
                                       java.lang.String... parts)

      The topic will always be delivered to subscribers 1. no matter aios has ready or not. 2. no matter subscriber invokes bc.subscribe earlier or later. The most recent sticky topic is kept in memory for future access by subscribers
      Parameters:
        `topic` - sticky topic to publish
        `parts` - content

    - #### removeSticky

          public boolean removeSticky(java.lang.String topic)

      The topic will be not sticky anymore Remove the recent sticky topic kept in memory
      Parameters:
        `topic` - sticky topic to remove

    - #### publish

          public boolean publish(BusClient.Multipart multipart)

    - #### call

          public BusClient.RPCResult call(java.lang.String url)

    - #### call

          public BusClient.RPCResult call(java.lang.String url,
                                          java.util.List<java.lang.String> args)

    - #### call

          public BusClient.RPCResult call(java.lang.String url,
                                          java.lang.String... args)

    - #### call

          public BusClient.RPCResult call(java.lang.String url,
                                          byte[]... args)

    - #### dump

          public void dump(java.io.PrintWriter pw)

    - #### spin

          public void spin(BusClient.Handler handler)

    - #### setTimer

          public long setTimer(java.lang.Runnable runnable,
                               long timeout)

    - #### killTimer

          public void killTimer(long id)

    - #### interrupt

          public void interrupt()

    - #### acall

          public java.util.concurrent.Future<BusClient.RPCResult> acall(java.lang.String url,
                                                                        java.lang.String... args)

      Deprecated.
      only for instrumentation test