GemFire 7.0.1

com.gemstone.gemfire.distributed
Class LocatorLauncher.Builder

java.lang.Object
  extended by com.gemstone.gemfire.distributed.LocatorLauncher.Builder
Enclosing class:
LocatorLauncher

public static class LocatorLauncher.Builder
extends Object

Following the Builder design pattern, the LocatorLauncher Builder is used to configure and create a properly initialized instance of the LocatorLauncher class for running the Locator and performing other Locator operations.


Constructor Summary
LocatorLauncher.Builder()
          Default constructor used to create an instance of the Builder class for programmatical access.
LocatorLauncher.Builder(String... args)
          Constructor used to create and configure an instance of the Builder class with the specified arguments, often passed from the command-line when launching an instance of this class from the command-line using the Java launcher.
 
Method Summary
 LocatorLauncher build()
          Validates the Builder configuration settings and then constructs an instance of the LocatorLauncher class to invoke operations on a GemFire Locator.
 InetAddress getBindAddress()
          Gets the IP address to which the Locator has bound itself listening for client requests.
 LocatorLauncher.Command getCommand()
          Gets the Locator launcher command used during the invocation of the LocatorLauncher.
 Boolean getDebug()
          Determines whether the new instance of the LocatorLauncher will be set to debug mode.
 Boolean getForce()
          Gets the boolean value used by the Locator to determine if it should overwrite the PID file if it already exists.
 Boolean getHelp()
          Determines whether the new instance of LocatorLauncher will be used to output help information for either a specific command, or for using LocatorLauncher in general.
 String getHostnameForClients()
          Gets the hostname used by clients to lookup the Locator.
 String getMemberName()
          Gets the member name of this Locator in GemFire.
 Integer getPid()
          Gets the process ID (PID) of the running Locator indicated by the user as an argument to the LocatorLauncher.
 Integer getPort()
          Gets the port number used by the Locator to listen for client requests.
 Boolean getRedirectOutput()
          Determines whether the new instance of LocatorLauncher will redirect output to system logs when starting a Locator.
 String getWorkingDirectory()
          Gets the working directory pathname in which the Locator will be ran.
 LocatorLauncher.Builder setBindAddress(String bindAddress)
          Sets the IP address as an java.net.InetAddress to which the Locator has bound itself listening for client requests.
 LocatorLauncher.Builder setCommand(LocatorLauncher.Command command)
          Sets the Locator launcher command used during the invocation of the LocatorLauncher
 LocatorLauncher.Builder setDebug(Boolean debug)
          Sets whether the new instance of the LocatorLauncher will be set to debug mode.
 LocatorLauncher.Builder setForce(Boolean force)
          Sets the boolean value used by the Locator to determine if it should overwrite the PID file if it already exists.
 LocatorLauncher.Builder setHelp(Boolean help)
          Sets whether the new instance of LocatorLauncher will be used to output help information for either a specific command, or for using LocatorLauncher in general.
 LocatorLauncher.Builder setHostnameForClients(String hostnameForClients)
          Sets the hostname used by clients to lookup the Locator.
 LocatorLauncher.Builder setMemberName(String memberName)
          Sets the member name of the Locator in GemFire.
 LocatorLauncher.Builder setPid(Integer pid)
          Sets the process ID (PID) of the running Locator indicated by the user as an argument to the LocatorLauncher.
 LocatorLauncher.Builder setPort(Integer port)
          Sets the port number used by the Locator to listen for client requests.
 LocatorLauncher.Builder setRedirectOutput(Boolean redirectOutput)
          Sets whether the new instance of LocatorLauncher will redirect output to system logs when starting a Locator.
 LocatorLauncher.Builder setWorkingDirectory(String workingDirectory)
          Sets the working directory in which the Locator will be ran.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocatorLauncher.Builder

public LocatorLauncher.Builder()
Default constructor used to create an instance of the Builder class for programmatical access.


LocatorLauncher.Builder

public LocatorLauncher.Builder(String... args)
Constructor used to create and configure an instance of the Builder class with the specified arguments, often passed from the command-line when launching an instance of this class from the command-line using the Java launcher.

Parameters:
args - the array of arguments used to configure the Builder.
Method Detail

getCommand

public LocatorLauncher.Command getCommand()
Gets the Locator launcher command used during the invocation of the LocatorLauncher.

Returns:
the Locator launcher command used to invoke (run) the LocatorLauncher class.
See Also:
setCommand(com.gemstone.gemfire.distributed.LocatorLauncher.Command), LocatorLauncher.Command

setCommand

public LocatorLauncher.Builder setCommand(LocatorLauncher.Command command)
Sets the Locator launcher command used during the invocation of the LocatorLauncher

Parameters:
command - the targeted Locator launcher command used during the invocation (run) of LocatorLauncher.
Returns:
this Builder instance.
See Also:
getCommand(), LocatorLauncher.Command

getDebug

public Boolean getDebug()
Determines whether the new instance of the LocatorLauncher will be set to debug mode.

Returns:
a boolean value indicating whether debug mode is enabled or disabled.
See Also:
setDebug(Boolean)

setDebug

public LocatorLauncher.Builder setDebug(Boolean debug)
Sets whether the new instance of the LocatorLauncher will be set to debug mode.

Parameters:
debug - a boolean value indicating whether debug mode is to be enabled or disabled.
Returns:
this Builder instance.
See Also:
getHelp()

getForce

public Boolean getForce()
Gets the boolean value used by the Locator to determine if it should overwrite the PID file if it already exists.

Returns:
the boolean value specifying whether or not to overwrite the PID file if it already exists.
See Also:
LocalProcessLauncher, setForce(Boolean)

setForce

public LocatorLauncher.Builder setForce(Boolean force)
Sets the boolean value used by the Locator to determine if it should overwrite the PID file if it already exists.

Parameters:
force - a boolean value indicating whether to overwrite the PID file when it already exists.
Returns:
this Builder instance.
See Also:
LocalProcessLauncher, getForce()

getHelp

public Boolean getHelp()
Determines whether the new instance of LocatorLauncher will be used to output help information for either a specific command, or for using LocatorLauncher in general.

Returns:
a boolean value indicating whether help will be output during the invocation of LocatorLauncher.
See Also:
setHelp(Boolean)

setHelp

public LocatorLauncher.Builder setHelp(Boolean help)
Sets whether the new instance of LocatorLauncher will be used to output help information for either a specific command, or for using LocatorLauncher in general.

Parameters:
help - a boolean indicating whether help information is to be displayed during invocation of LocatorLauncher.
Returns:
this Builder instance.
See Also:
getHelp()

getBindAddress

public InetAddress getBindAddress()
Gets the IP address to which the Locator has bound itself listening for client requests.

Returns:
an InetAddress with the IP address or hostname on which the Locator is bound and listening.
See Also:
setBindAddress(String), InetAddress

setBindAddress

public LocatorLauncher.Builder setBindAddress(String bindAddress)
Sets the IP address as an java.net.InetAddress to which the Locator has bound itself listening for client requests.

Parameters:
bindAddress - the InetAddress with the IP address or hostname on which the Locator is bound and listening.
Returns:
this Builder instance.
Throws:
IllegalArgumentException - wrapping the UnknownHostException if the IP address or hostname for the bind address is unknown.
See Also:
getBindAddress(), InetAddress

getHostnameForClients

public String getHostnameForClients()
Gets the hostname used by clients to lookup the Locator.

Returns:
a String indicating the hostname Locator binding used in client lookups.
See Also:
setHostnameForClients(String)

setHostnameForClients

public LocatorLauncher.Builder setHostnameForClients(String hostnameForClients)
Sets the hostname used by clients to lookup the Locator.

Parameters:
hostnameForClients - a String indicating the hostname Locator binding used in client lookups.
Returns:
this Builder instance.
Throws:
IllegalArgumentException - if the hostname was not specified (is blank or empty), such as when the --hostname-for-clients command-line option may have been specified without any argument.
See Also:
getHostnameForClients()

getMemberName

public String getMemberName()
Gets the member name of this Locator in GemFire.

Returns:
a String indicating the member name of this Locator in GemFire.
See Also:
setMemberName(String)

setMemberName

public LocatorLauncher.Builder setMemberName(String memberName)
Sets the member name of the Locator in GemFire.

Parameters:
memberName - a String indicating the member name of this Locator in GemFire.
Returns:
this Builder instance.
Throws:
IllegalArgumentException - if the member name is invalid.
See Also:
getMemberName()

getPid

public Integer getPid()
Gets the process ID (PID) of the running Locator indicated by the user as an argument to the LocatorLauncher. This PID is used by the Locator launcher to determine the Locator's status, or invoke shutdown on the Locator.

Returns:
a user specified Integer value indicating the process ID of the running Locator.
See Also:
setPid(Integer)

setPid

public LocatorLauncher.Builder setPid(Integer pid)
Sets the process ID (PID) of the running Locator indicated by the user as an argument to the LocatorLauncher. This PID will be used by the Locator launcher to determine the Locator's status, or invoke shutdown on the Locator.

Parameters:
pid - a user specified Integer value indicating the process ID of the running Locator.
Returns:
this Builder instance.
Throws:
IllegalArgumentException - if the process ID (PID) is not valid (greater than zero if not null).
See Also:
getPid()

getPort

public Integer getPort()
Gets the port number used by the Locator to listen for client requests. If the port was not specified, then the default Locator port (10334) is returned.

Returns:
the specified Locator port or the default port if unspecified.
See Also:
setPort(Integer)

setPort

public LocatorLauncher.Builder setPort(Integer port)
Sets the port number used by the Locator to listen for client requests. The port number must be between 1 and 65535 inclusive.

Parameters:
port - an Integer value indicating the port used by the Locator to listen for client requests.
Returns:
this Builder instance.
Throws:
IllegalArgumentException - if the port number is not valid.
See Also:
getPort()

getRedirectOutput

public Boolean getRedirectOutput()
Determines whether the new instance of LocatorLauncher will redirect output to system logs when starting a Locator.

Returns:
a boolean value indicating if output will be redirected to system logs when starting a Locator
See Also:
setRedirectOutput(Boolean)

setRedirectOutput

public LocatorLauncher.Builder setRedirectOutput(Boolean redirectOutput)
Sets whether the new instance of LocatorLauncher will redirect output to system logs when starting a Locator.

Parameters:
redirectOutput - a boolean value indicating if output will be redirected to system logs when starting a Locator.
Returns:
this Builder instance.
See Also:
getRedirectOutput()

getWorkingDirectory

public String getWorkingDirectory()
Gets the working directory pathname in which the Locator will be ran. If the directory is unspecified, then working directory defaults to the current directory.

Returns:
a String indicating the working directory pathname.
See Also:
setWorkingDirectory(String)

setWorkingDirectory

public LocatorLauncher.Builder setWorkingDirectory(String workingDirectory)
Sets the working directory in which the Locator will be ran. This also the directory in which all Locator files (such as log and license files) will be written. If the directory is unspecified, then the working directory defaults to the current directory.

Parameters:
workingDirectory - a String indicating the pathname of the directory in which the Locator will be ran.
Returns:
this Builder instance.
Throws:
IllegalArgumentException - wrapping a FileNotFoundException if the working directory pathname cannot be found.
See Also:
getWorkingDirectory(), FileNotFoundException

build

public LocatorLauncher build()
Validates the Builder configuration settings and then constructs an instance of the LocatorLauncher class to invoke operations on a GemFire Locator.

Returns:
a newly constructed instance of LocatorLauncher configured with this Builder.
See Also:
validate(), LocatorLauncher

GemFire 7.0.1

Copyright © 1997-2013 VMware, Inc. All rights reserved.