GigaSpaces XAP 7.0 API

org.openspaces.admin.space
Class SpaceDeployment

java.lang.Object
  extended by org.openspaces.admin.space.SpaceDeployment

public class SpaceDeployment
extends Object

A deployment of a pure Space processing unit (comes built in under [GS ROOT]/deploy/templates/datagrid).

Author:
kimchy
See Also:
GridServiceManager.deploy(SpaceDeployment), GridServiceManagers.deploy(SpaceDeployment)

Constructor Summary
SpaceDeployment(String spaceName)
          Constructs a new Space deployment with the space name that will be created (it will also be the processing unit name).
 
Method Summary
 SpaceDeployment addZone(String zone)
          Adds a zone where the processing unit is allowed to be deployed on.
 SpaceDeployment clusterSchema(String clusterSchema)
          Sets the cluster schema of the Space.
 String getSpaceName()
          Returns the Space name of the deployment.
 SpaceDeployment maxInstancesPerMachine(int maxInstancesPerMachine)
          Sets the maximum number of instances per machine.
 SpaceDeployment maxInstancesPerVM(int maxInstancesPerVM)
          Sets the maximum number of instances per virtual machine.
 SpaceDeployment maxInstancesPerZone(String zone, int maxInstancesPerZone)
          Sets the maximum number of instances per zone.
 SpaceDeployment numberOfBackups(int numberOfBackups)
          Sets the number of backups per instance of the space deployment.
 SpaceDeployment numberOfInstances(int numberOfInstances)
          Sets the number of instances of the space deployment.
 SpaceDeployment partitioned(int numberOfParitions, int numberOfBackups)
          A convenient method allowing to easily configure the space deployment to deploy a Partitioned topology with numberOfParitions instances each with numberOfBackups.
 SpaceDeployment replicated(boolean async, int numberOfInstances)
          A convenient method allowing to easily configure the space deployment to deploy a replicated (either sync or async) topology with numberOfInstances instances.
 SpaceDeployment secured(boolean secured)
          Will deploy a secured space.
 SpaceDeployment setContextProperty(String key, String value)
          Sets a context deploy time property overriding any ${...}
 ProcessingUnitDeployment toProcessingUnitDeployment()
          Transforms the space deployment to a processing unit deployment (it is a processing unit after all, that simply starts an embedded space).
 SpaceDeployment userDetails(String userName, String password)
          Sets the username and password (effectively making the processing unit secured) for the processing unit deployment.
 SpaceDeployment userDetails(UserDetails userDetails)
          Advance: Sets the security user details for authentication and autherization of the processing unit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpaceDeployment

public SpaceDeployment(String spaceName)
Constructs a new Space deployment with the space name that will be created (it will also be the processing unit name).

Method Detail

getSpaceName

public String getSpaceName()
Returns the Space name of the deployment.


partitioned

public SpaceDeployment partitioned(int numberOfParitions,
                                   int numberOfBackups)
A convenient method allowing to easily configure the space deployment to deploy a Partitioned topology with numberOfParitions instances each with numberOfBackups.

Exactly the same like calling clusterSchema("partitioned-sync2backup"), followed by numberOfInstances(numberOfParitions) and numberOfBackups(numberOfBackups).

Parameters:
numberOfParitions - The number of partitions
numberOfBackups - The number of backups
Returns:
This space deployment

replicated

public SpaceDeployment replicated(boolean async,
                                  int numberOfInstances)
A convenient method allowing to easily configure the space deployment to deploy a replicated (either sync or async) topology with numberOfInstances instances.

Exactly the same like calling clusterSchema("sync_replicated") or clusterSchema("async_replicated"), followed by numberOfInstances(numberOfInstances) and numberOfBackups(0).

Parameters:
numberOfInstances - The number of instances to form the replicated space
Returns:
This space deployment

clusterSchema

public SpaceDeployment clusterSchema(String clusterSchema)
Sets the cluster schema of the Space.

See Also:
partitioned(int, int)

numberOfInstances

public SpaceDeployment numberOfInstances(int numberOfInstances)
Sets the number of instances of the space deployment.


numberOfBackups

public SpaceDeployment numberOfBackups(int numberOfBackups)
Sets the number of backups per instance of the space deployment.


maxInstancesPerVM

public SpaceDeployment maxInstancesPerVM(int maxInstancesPerVM)
Sets the maximum number of instances per virtual machine.

On partitioned topology with backups topology, controls that a primary and a backup won't run on the same virtual machine if set to 1.

On a non partitioned with backups topology, controls the maximum number of instances running on the same virtual machine.


maxInstancesPerMachine

public SpaceDeployment maxInstancesPerMachine(int maxInstancesPerMachine)
Sets the maximum number of instances per machine.

On partitioned topology with backups topology, controls that a primary and a backup won't run on the same machine if set to 1.

On a non partitioned with backups topology, controls the maximum number of instances running on the same machine.


maxInstancesPerZone

public SpaceDeployment maxInstancesPerZone(String zone,
                                           int maxInstancesPerZone)
Sets the maximum number of instances per zone.

On partitioned topology with backups topology, controls that a primary and a backup won't run on the same zone if set to 1. Note, for each zone this will have to be set.

On a non partitioned with backups topology, controls the maximum number of instances running on the same zone.


addZone

public SpaceDeployment addZone(String zone)
Adds a zone where the processing unit is allowed to be deployed on.


setContextProperty

public SpaceDeployment setContextProperty(String key,
                                          String value)
Sets a context deploy time property overriding any ${...} defined within a processing unit configuration.


secured

public SpaceDeployment secured(boolean secured)
Will deploy a secured space. Note, by setting user details the space will be secured automatically.


userDetails

public SpaceDeployment userDetails(UserDetails userDetails)
Advance: Sets the security user details for authentication and autherization of the processing unit.


userDetails

public SpaceDeployment userDetails(String userName,
                                   String password)
Sets the username and password (effectively making the processing unit secured) for the processing unit deployment.


toProcessingUnitDeployment

public ProcessingUnitDeployment toProcessingUnitDeployment()
Transforms the space deployment to a processing unit deployment (it is a processing unit after all, that simply starts an embedded space).


GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.