Class SubServerImpl
java.lang.Object
net.ME1312.SubServers.Host.Executable.SubServerImpl
Internal SubServer Class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Commands the ServerGet the Server's Executable StringGet the Full Server Directory PathGet Process LoggergetName()
Gets the name of the ServergetPath()
Get the Server Directory Pathint
getPort()
Get the Port of the ServerGrab the Command to Stop the Serverboolean
If the Server is Enabledboolean
If the Server is Loggingboolean
If the Server is Runningvoid
setEnabled
(boolean value) Set if the Server is Enabledvoid
setLogging
(boolean value) Set if the Server is Loggingvoid
setStopCommand
(String value) Set the Command that Stops the Servervoid
Starts the Servervoid
stop()
Stops the Servervoid
Terminates the Servervoid
waitFor()
Waits for the Server to Stop
-
Constructor Details
-
SubServerImpl
public SubServerImpl(ExHost host, String name, boolean enabled, int port, boolean log, String directory, String executable, String stopcmd) throws InvalidServerException Creates a SubServer- Parameters:
host
- SubServers.Hostname
- Nameenabled
- Enabled Statuslog
- Logging Statusdirectory
- Directoryexecutable
- Executable Stringstopcmd
- Stop Command- Throws:
InvalidServerException
-
-
Method Details
-
start
Starts the Server- Parameters:
address
- External Logging Address
-
stop
public void stop()Stops the Server -
terminate
public void terminate()Terminates the Server -
command
Commands the Server- Parameters:
command
- Command to Send
-
waitFor
Waits for the Server to Stop- Throws:
InterruptedException
-
getName
Gets the name of the Server- Returns:
- Server Name
-
isRunning
public boolean isRunning()If the Server is Running- Returns:
- Running Status
-
isEnabled
public boolean isEnabled()If the Server is Enabled- Returns:
- Enabled Status
-
setEnabled
public void setEnabled(boolean value) Set if the Server is Enabled- Parameters:
value
- Value
-
getPort
public int getPort()Get the Port of the Server- Returns:
- Server Port Number
-
isLogging
public boolean isLogging()If the Server is Logging- Returns:
- Logging Status
-
setLogging
public void setLogging(boolean value) Set if the Server is Logging- Parameters:
value
- Value
-
getLogger
Get Process Logger -
getPath
Get the Server Directory Path- Returns:
- Server Directory Path
-
getFullPath
Get the Full Server Directory Path- Returns:
- Full Server Directory Path
-
getExecutable
Get the Server's Executable String- Returns:
- Executable String
-
getStopCommand
Grab the Command to Stop the Server- Returns:
- Stop Command
-
setStopCommand
Set the Command that Stops the Server- Parameters:
value
- Value
-