Class TopicDecl

java.lang.Object
org.apache.juneau.console.TopicDecl

public final class TopicDecl extends Object
A custom topic declaration, for a card's publishes or the page's top-level topics.
Example:

// Published by this card's JS: card.publishes(TopicDecl.of("ssc.focus").retain(true)); // Published by a page script or the server: PageSpec.create().topic(TopicDecl.of("app.region-picked").retain(true) .publisher(TopicDecl.Publisher.SCRIPT));

Since:
10.0.0
  • Method Details

    • of

      public static TopicDecl of(String topic)
      Parameters:
      topic - A custom topic or ns.name:*; or job:*, which is only valid page-level with TopicDecl.Publisher.SERVER.
      Returns:
      A new declaration.
      Throws:
      IllegalArgumentException - E-45 for a framework family or an un-namespaced family; E-40 on bad syntax.
    • retain

      public TopicDecl retain(boolean v)
      Parameters:
      v - Whether the bus keeps the last value for late subscribers. Required. @return This object.
    • publisher

      Parameters:
      p - Who publishes the topic. Page-level only. @return This object.
    • topic

      public String topic()
      Returns:
      The topic.
    • toMap

      public JsonMap toMap()
      Returns:
      The page-level $defs/topicDecl entry.
    • toPublicationMap

      Returns:
      The card-level $defs/publication entry, for CardSpec.publishes.