public interface NetworkConfig extends Config<NetworkConfig>
The network configuration defines a collection of components (Vert.x modules and verticles) that can be connected together in a meaningful way.
| Modifier and Type | Field and Description |
|---|---|
static String |
NETWORK_COMPONENTS
components is an object defining network component configurations. |
static String |
NETWORK_CONNECTIONS
connections is an array defining network connection configurations. |
static String |
NETWORK_NAME
name is a string indicating the unique network name. |
| Modifier and Type | Method and Description |
|---|---|
<T extends ComponentConfig<T>> |
addComponent(String name,
String moduleOrMain)
Adds a module or verticle component to the network.
|
<T extends ComponentConfig<T>> |
addComponent(String name,
String moduleOrMain,
int instances)
Adds a module or verticle component to the network.
|
<T extends ComponentConfig<T>> |
addComponent(String name,
String moduleOrMain,
org.vertx.java.core.json.JsonObject config)
Adds a module or verticle component 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 instances)
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 instances)
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 instances)
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 instances)
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.
|
<T extends ComponentConfig<?>> |
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.
|
static final String NETWORK_NAME
name is a string indicating the unique network name. This is the
address at which the network will monitor network components. This field is required.static final String NETWORK_COMPONENTS
components is an object defining network component configurations. Each
item in the object must be keyed by the unique component address, with each item
being an object containing the component configuration. See the ComponentConfig
class for component configuration options.static final String NETWORK_CONNECTIONS
connections is an array defining network connection configurations. Each
item in the array must be an object defining a source and target
configuration.String getName()
The network's name should be unique within a given cluster.
List<ComponentConfig<?>> getComponents()
<T extends ComponentConfig<?>> T getComponent(String name)
name - The component name.IllegalArgumentException - If the given component address does not exist within
the network.boolean hasComponent(String name)
name - The component name.<T extends ComponentConfig> T addComponent(T component)
component - The component to add.<T extends ComponentConfig<T>> T addComponent(String name, String moduleOrMain)
The type of component that's added to the network will be determined based on Vert.x module naming standards. If the module/main is a valid module identifier then a module component will be added, otherwise a verticle component will be added.
name - The component name. This will be used as the basis for internal
component addresses.moduleOrMain - The component module name or verticle main.IllegalArgumentException - If the module name is not a valid module identifier.<T extends ComponentConfig<T>> T addComponent(String name, String moduleOrMain, org.vertx.java.core.json.JsonObject config)
The type of component that's added to the network will be determined based on Vert.x module naming standards. If the module/main is a valid module identifier then a module component will be added, otherwise a verticle component will be added.
name - 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.IllegalArgumentException - If the module name is not a valid module identifier.<T extends ComponentConfig<T>> T addComponent(String name, String moduleOrMain, int instances)
The type of component that's added to the network will be determined based on Vert.x module naming standards. If the module/main is a valid module identifier then a module component will be added, otherwise a verticle component will be added.
name - The component name. This will be used as the basis for internal
component addresses.moduleOrMain - The component module name or verticle main.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.IllegalArgumentException - If the module name is not a valid module identifier.<T extends ComponentConfig<T>> T addComponent(String name, String moduleOrMain, org.vertx.java.core.json.JsonObject config, int instances)
The type of component that's added to the network will be determined based on Vert.x module naming standards. If the module/main is a valid module identifier then a module component will be added, otherwise a verticle component will be added.
name - 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.<T extends ComponentConfig<T>> T removeComponent(T component)
component - The component to remove.<T extends ComponentConfig<T>> T removeComponent(String name)
name - The component name.ModuleConfig addModule(ModuleConfig module)
module - The module to add.ModuleConfig addModule(String name, String moduleName)
name - The component name. This will be used as the basis for internal
component addresses.moduleName - The module name.IllegalArgumentException - If the module name is not a valid module identifier.ModuleConfig addModule(String name, String moduleName, org.vertx.java.core.json.JsonObject config)
name - 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.IllegalArgumentException - If the module name is not a valid module identifier.ModuleConfig addModule(String name, String moduleName, int instances)
name - The component name. This will be used as the basis for internal
component addresses.moduleName - The module name.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.IllegalArgumentException - If the module name is not a valid module identifier.ModuleConfig addModule(String name, String moduleName, org.vertx.java.core.json.JsonObject config, int instances)
name - 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.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.IllegalArgumentException - If the module name is not a valid module identifier.ModuleConfig removeModule(ModuleConfig module)
module - The module component.ModuleConfig removeModule(String name)
name - The module component name.VerticleConfig addVerticle(VerticleConfig verticle)
verticle - The verticle to add.VerticleConfig addVerticle(String name, String main)
name - The component name. This will be used as the basis for internal
component addresses.main - The verticle main.VerticleConfig addVerticle(String name, String main, org.vertx.java.core.json.JsonObject config)
name - 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.VerticleConfig addVerticle(String name, String main, int instances)
name - The component name. This will be used as the basis for internal
component addresses.main - The verticle main.instances - The number of verticle instances. If multiple instances are
defined, groupings will be used to determine how messages are distributed
between multiple component instances.VerticleConfig addVerticle(String name, String main, org.vertx.java.core.json.JsonObject config, int instances)
name - 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.instances - The number of verticle instances. If multiple instances are
defined, groupings will be used to determine how messages are distributed
between multiple component instances.VerticleConfig removeVerticle(VerticleConfig verticle)
verticle - The verticle component.VerticleConfig removeVerticle(String name)
name - The verticle component name.Collection<ConnectionConfig> getConnections()
ConnectionConfig createConnection(ConnectionConfig connection)
connection - The new connection.ConnectionConfig createConnection(String source, String target)
source - The source component.target - The target component.ConnectionConfig createConnection(String source, String target, Selector selector)
source - The source component.target - The target component.selector - The connection selector.ConnectionConfig createConnection(String source, String out, String target, String in)
source - The source component.out - The source output port.target - The target component.in - The target output port.ConnectionConfig createConnection(String source, String out, String target, String in, Selector selector)
source - The source component.out - The source output port.target - The target component.in - The target output port.selector - The connection selector.NetworkConfig destroyConnection(ConnectionConfig connection)
connection - The connection to destroy.NetworkConfig destroyConnection(String source, String target)
source - The source component name and port.target - The target component name and port.NetworkConfig destroyConnection(String source, String out, String target, String in)
source - The source component name.out - The source component out port.target - The target component name.in - The target component in port.Copyright © 2013-2014. All Rights Reserved.