public class DefaultNetworkConfig extends Object implements NetworkConfig
NETWORK_CLUSTER, NETWORK_COMPONENTS, NETWORK_NAME| Constructor and Description |
|---|
DefaultNetworkConfig() |
DefaultNetworkConfig(String name) |
| Modifier and Type | Method and Description |
|---|---|
<T extends ComponentConfig<T>> |
addComponent(String name,
String moduleOrMain)
Adds a module to the network.
|
<T extends ComponentConfig<T>> |
addComponent(String name,
String moduleOrMain,
int instances)
Adds a module to the network.
|
<T extends ComponentConfig<T>> |
addComponent(String name,
String moduleOrMain,
org.vertx.java.core.json.JsonObject config)
Adds a module to the network.
|
<T extends ComponentConfig<T>> |
addComponent(String name,
String moduleOrMain,
org.vertx.java.core.json.JsonObject config,
int instances)
Adds a module or verticle component to the network.
|
<T extends ComponentConfig> |
addComponent(T component)
Adds a component to the network.
|
ModuleConfig |
addModule(ModuleConfig module)
Adds a module to the network.
|
ModuleConfig |
addModule(String name,
String moduleName)
Adds a module to the network.
|
ModuleConfig |
addModule(String name,
String moduleName,
int numInstances)
Adds a module to the network.
|
ModuleConfig |
addModule(String name,
String moduleName,
org.vertx.java.core.json.JsonObject config)
Adds a module to the network.
|
ModuleConfig |
addModule(String name,
String moduleName,
org.vertx.java.core.json.JsonObject config,
int numInstances)
Adds a module to the network.
|
VerticleConfig |
addVerticle(String name,
String main)
Adds a verticle to the network.
|
VerticleConfig |
addVerticle(String name,
String main,
int numInstances)
Adds a verticle to the network.
|
VerticleConfig |
addVerticle(String name,
String main,
org.vertx.java.core.json.JsonObject config)
Adds a verticle to the network.
|
VerticleConfig |
addVerticle(String name,
String main,
org.vertx.java.core.json.JsonObject config,
int numInstances)
Adds a verticle to the network.
|
VerticleConfig |
addVerticle(VerticleConfig verticle)
Adds a verticle to the network.
|
ConnectionConfig |
createConnection(ConnectionConfig connection)
Creates a connection between two components.
|
ConnectionConfig |
createConnection(String source,
String target)
Creates a connection between two components.
|
ConnectionConfig |
createConnection(String source,
String target,
Selector selector)
Creates a connection between two components.
|
ConnectionConfig |
createConnection(String source,
String out,
String target,
String in)
Creates a connection between two components.
|
ConnectionConfig |
createConnection(String source,
String out,
String target,
String in,
Selector selector)
Creates a connection between two components.
|
NetworkConfig |
destroyConnection(ConnectionConfig connection)
Destroys a connection between two components.
|
NetworkConfig |
destroyConnection(String source,
String target)
Destroys a connection between two components.
|
NetworkConfig |
destroyConnection(String source,
String out,
String target,
String in)
Destroys a connection between two components.
|
ClusterConfig |
getClusterConfig()
Returns the network's cluster configuration.
|
<T extends ComponentConfig<T>> |
getComponent(String name)
Gets a component by name.
|
List<ComponentConfig<?>> |
getComponents()
Gets a list of network components.
|
Collection<ConnectionConfig> |
getConnections()
Returns a collection of network connections.
|
String |
getName()
Returns the network name.
|
boolean |
hasComponent(String name)
Returns a boolean indicating whether the network has a component.
|
<T extends ComponentConfig<T>> |
removeComponent(String name)
Removes a component from the network.
|
<T extends ComponentConfig<T>> |
removeComponent(T component)
Removes a component from the network.
|
ModuleConfig |
removeModule(ModuleConfig module)
Removes a module from the network.
|
ModuleConfig |
removeModule(String name)
Removes a module from the network.
|
VerticleConfig |
removeVerticle(String name)
Removes a verticle configuration from the network.
|
VerticleConfig |
removeVerticle(VerticleConfig verticle)
Removes a verticle configuration from the network.
|
NetworkConfig |
setClusterConfig(ClusterConfig cluster)
Sets the network's cluster configuration.
|
String |
toString() |
public DefaultNetworkConfig()
public DefaultNetworkConfig(String name)
public String getName()
NetworkConfiggetName in interface NetworkConfigpublic NetworkConfig setClusterConfig(ClusterConfig cluster)
NetworkConfigsetClusterConfig in interface NetworkConfigcluster - The cluster configuration.public ClusterConfig getClusterConfig()
NetworkConfiggetClusterConfig in interface NetworkConfigpublic List<ComponentConfig<?>> getComponents()
NetworkConfiggetComponents in interface NetworkConfigpublic <T extends ComponentConfig<T>> T getComponent(String name)
NetworkConfiggetComponent in interface NetworkConfigname - The component name.public <T extends ComponentConfig> T addComponent(T component)
NetworkConfigaddComponent in interface NetworkConfigcomponent - The component to add.public <T extends ComponentConfig<T>> T addComponent(String name, String moduleOrMain)
NetworkConfigaddComponent in interface NetworkConfigname - The component name. This will be used as the basis for internal
component addresses.public <T extends ComponentConfig<T>> T addComponent(String name, String moduleOrMain, org.vertx.java.core.json.JsonObject config)
NetworkConfigaddComponent in interface NetworkConfigname - The component name. This will be used as the basis for internal
component addresses.config - The module configuration. This configuration will be made
available as the verticle configuration within deployed module instances.public <T extends ComponentConfig<T>> T addComponent(String name, String moduleOrMain, int instances)
NetworkConfigaddComponent in interface NetworkConfigname - The component name. This will be used as the basis for internal
component addresses.instances - The number of module instances. If multiple instances are
defined, groupings will be used to determine how messages are distributed
between multiple component instances.public <T extends ComponentConfig<T>> T addComponent(String name, String moduleOrMain, org.vertx.java.core.json.JsonObject config, int instances)
NetworkConfigaddComponent in interface NetworkConfigname - The component name. This will be used as the basis for internal
component addresses.moduleOrMain - The component module name or verticle main.config - The component configuration. This configuration will be made
available as the verticle configuration within deployed module instances.instances - The number of component instances. If multiple instances are
defined, groupings will be used to determine how messages are distributed
between multiple component instances.public boolean hasComponent(String name)
NetworkConfighasComponent in interface NetworkConfigname - The component name.public <T extends ComponentConfig<T>> T removeComponent(T component)
NetworkConfigremoveComponent in interface NetworkConfigcomponent - The component to remove.public <T extends ComponentConfig<T>> T removeComponent(String name)
NetworkConfigremoveComponent in interface NetworkConfigname - The component name.public ModuleConfig addModule(ModuleConfig module)
NetworkConfigaddModule in interface NetworkConfigmodule - The module to add.public ModuleConfig addModule(String name, String moduleName)
NetworkConfigaddModule in interface NetworkConfigname - The component name. This will be used as the basis for internal
component addresses.moduleName - The module name.public ModuleConfig addModule(String name, String moduleName, org.vertx.java.core.json.JsonObject config)
NetworkConfigaddModule in interface NetworkConfigname - The component name. This will be used as the basis for internal
component addresses.moduleName - The module name.config - The module configuration. This configuration will be made
available as the verticle configuration within deployed module instances.public ModuleConfig addModule(String name, String moduleName, int numInstances)
NetworkConfigaddModule in interface NetworkConfigname - The component name. This will be used as the basis for internal
component addresses.moduleName - The module name.numInstances - The number of module instances. If multiple instances are
defined, groupings will be used to determine how messages are distributed
between multiple component instances.public ModuleConfig addModule(String name, String moduleName, org.vertx.java.core.json.JsonObject config, int numInstances)
NetworkConfigaddModule in interface NetworkConfigname - The component name. This will be used as the basis for internal
component addresses.moduleName - The module name.config - The module configuration. This configuration will be made
available as the verticle configuration within deployed module instances.numInstances - The number of module instances. If multiple instances are
defined, groupings will be used to determine how messages are distributed
between multiple component instances.public ModuleConfig removeModule(ModuleConfig module)
NetworkConfigremoveModule in interface NetworkConfigmodule - The module component.public ModuleConfig removeModule(String name)
NetworkConfigremoveModule in interface NetworkConfigname - The module component name.public VerticleConfig addVerticle(VerticleConfig verticle)
NetworkConfigaddVerticle in interface NetworkConfigverticle - The verticle to add.public VerticleConfig addVerticle(String name, String main)
NetworkConfigaddVerticle in interface NetworkConfigname - The component name. This will be used as the basis for internal
component addresses.main - The verticle main.public VerticleConfig addVerticle(String name, String main, org.vertx.java.core.json.JsonObject config)
NetworkConfigaddVerticle in interface NetworkConfigname - The component name. This will be used as the basis for internal
component addresses.main - The verticle main.config - The verticle configuration. This configuration will be made
available as the verticle configuration within deployed module instances.public VerticleConfig addVerticle(String name, String main, int numInstances)
NetworkConfigaddVerticle in interface NetworkConfigname - The component name. This will be used as the basis for internal
component addresses.main - The verticle main.numInstances - The number of verticle instances. If multiple instances are
defined, groupings will be used to determine how messages are distributed
between multiple component instances.public VerticleConfig addVerticle(String name, String main, org.vertx.java.core.json.JsonObject config, int numInstances)
NetworkConfigaddVerticle in interface NetworkConfigname - The component name. This will be used as the basis for internal
component addresses.main - The verticle main.config - The verticle configuration. This configuration will be made
available as the verticle configuration within deployed module instances.numInstances - The number of verticle instances. If multiple instances are
defined, groupings will be used to determine how messages are distributed
between multiple component instances.public VerticleConfig removeVerticle(VerticleConfig verticle)
NetworkConfigremoveVerticle in interface NetworkConfigverticle - The verticle component.public VerticleConfig removeVerticle(String name)
NetworkConfigremoveVerticle in interface NetworkConfigname - The verticle component name.public ConnectionConfig createConnection(ConnectionConfig connection)
NetworkConfigcreateConnection in interface NetworkConfigconnection - The new connection.public ConnectionConfig createConnection(String source, String target)
NetworkConfigcreateConnection in interface NetworkConfigsource - The source component.target - The target component.public ConnectionConfig createConnection(String source, String target, Selector selector)
NetworkConfigcreateConnection in interface NetworkConfigsource - The source component.target - The target component.selector - The connection selector.public ConnectionConfig createConnection(String source, String out, String target, String in)
NetworkConfigcreateConnection in interface NetworkConfigsource - The source component.out - The source output port.target - The target component.in - The target output port.public ConnectionConfig createConnection(String source, String out, String target, String in, Selector selector)
NetworkConfigcreateConnection in interface NetworkConfigsource - The source component.out - The source output port.target - The target component.in - The target output port.selector - The connection selector.public NetworkConfig destroyConnection(ConnectionConfig connection)
NetworkConfigdestroyConnection in interface NetworkConfigconnection - The connection to destroy.public NetworkConfig destroyConnection(String source, String target)
NetworkConfigdestroyConnection in interface NetworkConfigsource - The source component name and port.target - The target component name and port.public NetworkConfig destroyConnection(String source, String out, String target, String in)
NetworkConfigdestroyConnection in interface NetworkConfigsource - The source component name.out - The source component out port.target - The target component name.in - The target component in port.public Collection<ConnectionConfig> getConnections()
NetworkConfiggetConnections in interface NetworkConfigCopyright © 2013-2014. All Rights Reserved.