Package org.apache.storm.flux.model

## Class TopologyDef

- java.lang.Object
- - org.apache.storm.flux.model.TopologyDef

-     public class TopologyDef
      extends Object

  Bean represenation of a topology.

  It consists of the following: 1. The topology name 2. A `java.util.Map` representing the `org.apache.storm.config` for the topology 3. A list of spout definitions 4. A list of bolt definitions 5. A list of stream definitions that define the flow between spouts and bolts.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `TopologyDef()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addAllBolts​(List<BoltDef> bolts, boolean override)` | Adds a list of bolt definitions.
    `void` | `addAllComponents​(List<BeanDef> components, boolean override)` | Adds a list of component definitions.
    `void` | `addAllSpouts​(List<SpoutDef> spouts, boolean override)` | Adds a list of spout definitions.
    `void` | `addAllStreams​(List<StreamDef> streams, boolean override)` | Adds a list of stream definitions.
    `void` | `addAllWorkerHooks​(List<WorkerHookDef> workerHooks, boolean override)` | Adds a list of worker hook definitions.
    `BoltDef` | `getBoltDef​(String id)` |
    `List<BoltDef>` | `getBolts()` | Returns bolt definitions.
    `BeanDef` | `getComponent​(String id)` |
    `List<BeanDef>` | `getComponents()` | Returns a list of all component definitions.
    `Map<String,​Object>` | `getConfig()` |
    `List<IncludeDef>` | `getIncludes()` |
    `String` | `getName()` |
    `SpoutDef` | `getSpoutDef​(String id)` |
    `List<SpoutDef>` | `getSpouts()` | Returns all spout definitions.
    `List<StreamDef>` | `getStreams()` |
    `TopologySourceDef` | `getTopologySource()` |
    `WorkerHookDef` | `getWorkerHook​(String id)` |
    `List<WorkerHookDef>` | `getWorkerHooks()` | Returns worker hook definitions.
    `boolean` | `isDslTopology()` |
    `int` | `parallelismForBolt​(String boltId)` |
    `void` | `setBolts​(List<BoltDef> bolts)` | Sets bolt definitions.
    `void` | `setComponents​(List<BeanDef> components)` | Sets the list of component definitions.
    `void` | `setConfig​(Map<String,​Object> config)` |
    `void` | `setIncludes​(List<IncludeDef> includes)` |
    `void` | `setName​(String name)` |
    `void` | `setName​(String name, boolean override)` | Sets the name of the topology.
    `void` | `setSpouts​(List<SpoutDef> spouts)` | Set spout definitions.
    `void` | `setStreams​(List<StreamDef> streams)` |
    `void` | `setTopologySource​(TopologySourceDef topologySource)` |
    `void` | `setWorkerHooks​(List<WorkerHookDef> workerHooks)` | Sets worker hook definitions.
    `boolean` | `validate()` | Determines is this represents a valid Topology.

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

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

- - ### Constructor Detail

    - #### TopologyDef

          public TopologyDef()

  - ### Method Detail

    - #### getName

          public String getName()

    - #### setName

          public void setName​(String name)

    - #### setName

          public void setName​(String name,
                              boolean override)

      Sets the name of the topology.
      Parameters:
        `name` - topology name
        `override` - whether to override if already set

    - #### getSpouts

          public List<SpoutDef> getSpouts()

      Returns all spout definitions.
      Returns:
        spout definitions.

    - #### setSpouts

          public void setSpouts​(List<SpoutDef> spouts)

      Set spout definitions.
      Parameters:
        `spouts` - spout definitions

    - #### getBolts

          public List<BoltDef> getBolts()

      Returns bolt definitions.
      Returns:
        bolt definitions

    - #### setBolts

          public void setBolts​(List<BoltDef> bolts)

      Sets bolt definitions.
      Parameters:
        `bolts` - bolt definitions

    - #### getStreams

          public List<StreamDef> getStreams()

    - #### setStreams

          public void setStreams​(List<StreamDef> streams)

    - #### getConfig

          public Map<String,​Object> getConfig()

    - #### setConfig

          public void setConfig​(Map<String,​Object> config)

    - #### getComponents

          public List<BeanDef> getComponents()

      Returns a list of all component definitions.
      Returns:
        components

    - #### setComponents

          public void setComponents​(List<BeanDef> components)

      Sets the list of component definitions.
      Parameters:
        `components` - components definitions

    - #### getIncludes

          public List<IncludeDef> getIncludes()

    - #### setIncludes

          public void setIncludes​(List<IncludeDef> includes)

    - #### getWorkerHooks

          public List<WorkerHookDef> getWorkerHooks()

      Returns worker hook definitions.
      Returns:
        worker hook definitions

    - #### setWorkerHooks

          public void setWorkerHooks​(List<WorkerHookDef> workerHooks)

      Sets worker hook definitions.
      Parameters:
        `workerHooks` - worker hook definitions

    - #### parallelismForBolt

          public int parallelismForBolt​(String boltId)

    - #### getBoltDef

          public BoltDef getBoltDef​(String id)

    - #### getSpoutDef

          public SpoutDef getSpoutDef​(String id)

    - #### getComponent

          public BeanDef getComponent​(String id)

    - #### getWorkerHook

          public WorkerHookDef getWorkerHook​(String id)

    - #### addAllBolts

          public void addAllBolts​(List<BoltDef> bolts,
                                  boolean override)

      Adds a list of bolt definitions. Optionally overriding existing definitions if one with the same ID already exists.
      Parameters:
        `bolts` - bolt definitions
        `override` - whether or not to override existing definitions

    - #### addAllSpouts

          public void addAllSpouts​(List<SpoutDef> spouts,
                                   boolean override)

      Adds a list of spout definitions. Optionally overriding existing definitions if one with the same ID already exists.
      Parameters:
        `spouts` - spout definitions
        `override` - whether or not to override existing definitions

    - #### addAllComponents

          public void addAllComponents​(List<BeanDef> components,
                                       boolean override)

      Adds a list of component definitions. Optionally overriding existing definitions if one with the same ID already exists.
      Parameters:
        `components` - component definitions
        `override` - whether or not to override existing definitions

    - #### addAllStreams

          public void addAllStreams​(List<StreamDef> streams,
                                    boolean override)

      Adds a list of stream definitions. Optionally overriding existing definitions if one with the same ID already exists.
      Parameters:
        `streams` - stream definitions
        `override` - whether or not to override existing definitions (currently ignored)

    - #### addAllWorkerHooks

          public void addAllWorkerHooks​(List<WorkerHookDef> workerHooks,
                                        boolean override)

      Adds a list of worker hook definitions. Optionally overriding existing definitions if one with the same ID already exists.
      Parameters:
        `workerHooks` - worker hook definitions
        `override` - whether or not to override existing definitions

    - #### getTopologySource

          public TopologySourceDef getTopologySource()

    - #### setTopologySource

          public void setTopologySource​(TopologySourceDef topologySource)

    - #### isDslTopology

          public boolean isDslTopology()

    - #### validate

          public boolean validate()

      Determines is this represents a valid Topology.
      Returns:
        true if valid