public class DefaultClusterManager extends Object implements ClusterManager
| Constructor and Description |
|---|
DefaultClusterManager(String address,
org.vertx.java.platform.Verticle verticle) |
DefaultClusterManager(String address,
org.vertx.java.core.Vertx vertx,
org.vertx.java.platform.Container container) |
DefaultClusterManager(org.vertx.java.platform.Verticle verticle) |
DefaultClusterManager(org.vertx.java.core.Vertx vertx,
org.vertx.java.platform.Container container) |
| Modifier and Type | Method and Description |
|---|---|
String |
address()
Returns the cluster address.
|
ClusterManager |
deployNetwork(org.vertx.java.core.json.JsonObject network)
Deploys a json network to the cluster.
|
ClusterManager |
deployNetwork(org.vertx.java.core.json.JsonObject network,
org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<ActiveNetwork>> doneHandler)
Deploys a json network to the cluster.
|
ClusterManager |
deployNetwork(NetworkConfig network)
Deploys a network to the cluster.
|
ClusterManager |
deployNetwork(NetworkConfig network,
org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<ActiveNetwork>> doneHandler)
Deploys a network to the cluster.
|
ClusterManager |
deployNetwork(String name)
Deploys a bare network to the cluster.
|
ClusterManager |
deployNetwork(String name,
org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<ActiveNetwork>> doneHandler)
Deploys a bare network to the cluster.
|
boolean |
equals(Object other) |
ClusterManager |
getNetwork(String name,
org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<ActiveNetwork>> resultHandler)
Gets a network reference for a deployed network.
|
ClusterManager |
getNetworks(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Collection<ActiveNetwork>>> resultHandler)
Gets a list of networks deployed in the cluster.
|
ClusterManager |
isDeployed(String name,
org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Boolean>> resultHandler)
Checks whether a network is deployed in the cluster.
|
String |
toString() |
ClusterManager |
undeployNetwork(org.vertx.java.core.json.JsonObject network)
Undeploys a network from json.
|
ClusterManager |
undeployNetwork(org.vertx.java.core.json.JsonObject network,
org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Undeploys a network from json.
|
ClusterManager |
undeployNetwork(NetworkConfig network)
Undeploys a network from the cluster.
|
ClusterManager |
undeployNetwork(NetworkConfig network,
org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Undeploys a network from the cluster.
|
ClusterManager |
undeployNetwork(String name)
Undeploys a complete network from the cluster.
|
ClusterManager |
undeployNetwork(String name,
org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Undeploys a complete network from the cluster.
|
public DefaultClusterManager(org.vertx.java.platform.Verticle verticle)
public DefaultClusterManager(String address, org.vertx.java.platform.Verticle verticle)
public DefaultClusterManager(org.vertx.java.core.Vertx vertx,
org.vertx.java.platform.Container container)
public DefaultClusterManager(String address, org.vertx.java.core.Vertx vertx, org.vertx.java.platform.Container container)
public String address()
ClusterManageraddress in interface ClusterManagerpublic ClusterManager getNetworks(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Collection<ActiveNetwork>>> resultHandler)
ClusterManagergetNetworks in interface ClusterManagerresultHandler - An asynchronous handler to be called with a collection of
ActiveNetwork instances, each representing a network running in
the cluster.public ClusterManager getNetwork(String name, org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<ActiveNetwork>> resultHandler)
ClusterManager
If the network is running in the cluster then an ActiveNetwork
instance will be returned to the asynchronous handler. The ActiveNetwork
can be used to arbitrarily and asynchronously alter the structure of the
running network.
getNetwork in interface ClusterManagername - The name of the network to get.resultHandler - An asynchronous handler to be called with the result. If the
network exists then an ActiveNetwork instance which references the
running network will be provided, otherwise, the result will be nullpublic ClusterManager isDeployed(String name, org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Boolean>> resultHandler)
ClusterManagerIn order to check whether a network is deployed, the cluster manager attempts to load the network's configuration from the internal Vertigo coordination cluster. If the configuration exists then the cluster manager then checks to see if the network is actually running.
isDeployed in interface ClusterManagername - The name of the network to check.resultHandler - An asynchronous handler to be called with the result.public ClusterManager deployNetwork(String name)
ClusterManager
The network will be deployed with no components and no connections. You
can add components and connections to the network with an ActiveNetwork
instance.
deployNetwork in interface ClusterManagername - The name of the network to deploy.public ClusterManager deployNetwork(String name, org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<ActiveNetwork>> doneHandler)
ClusterManager
The network will be deployed with no components and no connections. You
can add components and connections to the network with an ActiveNetwork
instance.
deployNetwork in interface ClusterManagername - The name of the network to deploy.doneHandler - An asynchronous handler to be called once the network has
completed deployment. The handler will be called with an ActiveNetwork
instance which can be used to add or remove components and connections from
the network.public ClusterManager deployNetwork(org.vertx.java.core.json.JsonObject network)
ClusterManager
The JSON network configuration will be converted to a NetworkConfig before
being deployed to the cluster. The conversion is done synchronously, so if the
configuration is invalid then this method may throw an exception.
deployNetwork in interface ClusterManagernetwork - The JSON network configuration. For the configuration format see
the project documentation.public ClusterManager deployNetwork(org.vertx.java.core.json.JsonObject network, org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<ActiveNetwork>> doneHandler)
ClusterManager
The JSON network configuration will be converted to a NetworkConfig before
being deployed to the cluster. The conversion is done synchronously, so if the
configuration is invalid then this method may throw an exception. Once the network
has been deployed an ActiveNetwork will be provided which can be used to
add and remove components and connections from the network.
deployNetwork in interface ClusterManagernetwork - The JSON network configuration. For the configuration format see
the project documentation.doneHandler - An asynchronous handler to be called once the network has
completed deployment. The handler will be called with an ActiveNetwork
instance which can be used to add or remove components and connections from
the network.public ClusterManager deployNetwork(NetworkConfig network)
ClusterManagerIf the given network configuration's name matches the name of a network that is already running in the cluster then the given configuration will be merged with the running network's configuration. This allows networks to be dynamically updated with partial configurations. If the configuration matches the already running configuration then no changes will occur, so it's not necessary to check whether a network is already running if the configuration has not been altered.
deployNetwork in interface ClusterManagernetwork - The configuration of the network to deploy.public ClusterManager deployNetwork(NetworkConfig network, org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<ActiveNetwork>> doneHandler)
ClusterManagerIf the given network configuration's name matches the name of a network that is already running in the cluster then the given configuration will be merged with the running network's configuration. This allows networks to be dynamically updated with partial configurations. If the configuration matches the already running configuration then no changes will occur, so it's not necessary to check whether a network is already running if the configuration has not been altered.
deployNetwork in interface ClusterManagernetwork - The configuration of the network to deploy.doneHandler - An asynchronous handler to be called once the deployment is complete.
The handler will be called with an ActiveNetwork instance that references
the running network. The ActiveNetwork can be used to arbitrarily
and asynchronously update the live network configuration.public ClusterManager undeployNetwork(String name)
ClusterManagerThis method does not require a network configuration for undeployment. Vertigo will load the configuration from the fault-tolerant data store and undeploy components internally. This allows networks to be undeployed without the network configuration.
undeployNetwork in interface ClusterManagername - The name of the network to undeploy.public ClusterManager undeployNetwork(String name, org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
ClusterManagerThis method does not require a network configuration for undeployment. Vertigo will load the configuration from the fault-tolerant data store and undeploy components internally. This allows networks to be undeployed without the network configuration.
undeployNetwork in interface ClusterManagername - The name of the network to undeploy.doneHandler - An asynchronous handler to be called once the network is undeployed.public ClusterManager undeployNetwork(org.vertx.java.core.json.JsonObject network)
ClusterManager
The JSON configuration will immediately be converted to a NetworkConfig prior
to undeploying the network. In order to undeploy the entire network, the configuration
should be the same as the deployed configuration. Vertigo will use configuration
components to determine whether two configurations are identical. If the given
configuration is not identical to the running configuration, any components or
connections in the json configuration that are present in the running network
will be closed and removed from the running network.
undeployNetwork in interface ClusterManagernetwork - The JSON configuration to undeploy. For the configuration format see
the project documentation.public ClusterManager undeployNetwork(org.vertx.java.core.json.JsonObject network, org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
ClusterManager
The JSON configuration will immediately be converted to a NetworkConfig prior
to undeploying the network. In order to undeploy the entire network, the configuration
should be the same as the deployed configuration. Vertigo will use configuration
components to determine whether two configurations are identical. If the given
configuration is not identical to the running configuration, any components or
connections in the json configuration that are present in the running network
will be closed and removed from the running network.
undeployNetwork in interface ClusterManagernetwork - The JSON configuration to undeploy. For the configuration format see
the project documentation.doneHandler - An asynchronous handler to be called once the configuration is undeployed.public ClusterManager undeployNetwork(NetworkConfig network)
ClusterManager
This method supports both partial and complete undeployment of networks. When
undeploying networks by specifying a NetworkConfig, the network configuration
should contain all components and connections that are being undeployed. If the
configuration's components and connections match all deployed components and
connections then the entire network will be undeployed.
undeployNetwork in interface ClusterManagernetwork - The network configuration to undeploy.public ClusterManager undeployNetwork(NetworkConfig network, org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
ClusterManager
This method supports both partial and complete undeployment of networks. When
undeploying networks by specifying a NetworkConfig, the network configuration
should contain all components and connections that are being undeployed. If the
configuration's components and connections match all deployed components and
connections then the entire network will be undeployed.
undeployNetwork in interface ClusterManagernetwork - The network configuration to undeploy.doneHandler - An asynchronous handler to be called once the configuration is undeployed.Copyright © 2013-2014. All Rights Reserved.