Package info.mikethomas.jfold
Class ClientConnection
java.lang.Object
info.mikethomas.jfold.SocketConnection
info.mikethomas.jfold.ClientConnection
- All Implemented Interfaces:
Connection
ClientConnection class.
- Version:
- 7.5.1
- Author:
- Michael Thomas (mikepthomas@outlook.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
ConstantDEFAULT_HOST="localhost"
.static final int
ConstantDEFAULT_PORT=36330
.Fields inherited from class info.mikethomas.jfold.SocketConnection
CLRSCR, COMMAND_PROMPT, ENCODING, WELCOME_MSG
-
Constructor Summary
ConstructorsConstructorDescriptionDefault Constructor for ClientConnection.ClientConnection
(String address, int port) Constructor for ClientConnection. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
bond
(Inet4Address ip, int port, String input) Bond a packet file to a outgoing debug socket connection.final void
Return a configuration indicating if the client has set a user, team or passkey.final void
doCycle()
Run one client cycle.final void
downloadCore
(String type, URL url) Download a core.final void
finish()
Finish all slots.final void
finish
(int slot) Finish requested slot.final String
Print application information for requestedInfoItem
.final String
Print application information for requestedcategory
andkey
.final List
info()
List application information.final void
inject
(Inet4Address ip, int port, String input) Inject a packet file to a listening debug socket.final void
Disable specified unit states.final int
numSlots()
Get number of slots.final String
Get a configuration option.final String
Set a configuration option.final Options
options()
List all options with their non-default values.final Options
options
(boolean listDefault, boolean listUnset) List all options with their non-default values.final void
pause()
Pause all slots.final void
pause
(int slot) Pause requested slot.final int
ppd()
Get current total estimated Points Per Day.Get work unit queue information.final void
Request an ID from the assignment server.final void
Request work server assignment from the assignment server.final void
save()
Save the configuration either to the file the configuration was last loaded from.final void
Save the configuration either to the specified file.final void
shutdown()
Shutdown the application.final SimulationInfo
simulationInfo
(int slot) Get current simulation information.final void
Add a new slot.final void
slotDelete
(int slot) Delete a slot.slotInfo()
Get slot information.final void
slotModify
(String id, String type) Modify an existing slot.final SlotOptions
slotOptions
(int slot) Get slot options.final void
trajectory
(int slot) Get current protein trajectory.final void
Trigger config save after a delay.final void
unpause()
Unpause all slots.final void
unpause
(int slot) Unpause requested slot.final String
uptime()
Print application uptime.final void
Wait for all running units to finish.
-
Field Details
-
DEFAULT_HOST
ConstantDEFAULT_HOST="localhost"
.- See Also:
-
DEFAULT_PORT
public static final int DEFAULT_PORTConstantDEFAULT_PORT=36330
.- See Also:
-
-
Constructor Details
-
ClientConnection
Default Constructor for ClientConnection.
- Throws:
IOException
- if any.
-
ClientConnection
Constructor for ClientConnection.
- Parameters:
address
- aString
object.port
- a int.- Throws:
IOException
- a int.
-
-
Method Details
-
bond
Bond a packet file to a outgoing debug socket connection.- Specified by:
bond
in interfaceConnection
- Parameters:
ip
- aInet4Address
object.port
- a int.input
- aString
object.
-
configured
public final void configured()Return a configuration indicating if the client has set a user, team or passkey.- Specified by:
configured
in interfaceConnection
-
doCycle
public final void doCycle()Run one client cycle.- Specified by:
doCycle
in interfaceConnection
-
downloadCore
Download a core.- Specified by:
downloadCore
in interfaceConnection
- Parameters:
type
- of coreurl
- of core
-
finish
public final void finish()Finish all slots.- Specified by:
finish
in interfaceConnection
-
finish
public final void finish(int slot) Finish requested slot.- Specified by:
finish
in interfaceConnection
- Parameters:
slot
- number
-
getInfo
Print application information for requestedcategory
andkey
.- Specified by:
getInfo
in interfaceConnection
- Parameters:
category
- to return information fromkey
- to return information from- Returns:
- String value from information
-
getInfo
Print application information for requestedInfoItem
.- Specified by:
getInfo
in interfaceConnection
- Parameters:
infoItem
- aInfoItem
object.- Returns:
- a
String
object. - Throws:
InfoException
- if any.
-
info
List application information.- Specified by:
info
in interfaceConnection
- Returns:
- List
- Throws:
InfoException
- if any.
-
inject
Inject a packet file to a listening debug socket. Will wait until packet is processed.- Specified by:
inject
in interfaceConnection
- Parameters:
ip
- aInet4Address
object.port
- a int.input
- aString
object.
-
maskUnitState
public final void maskUnitState()Disable specified unit states.- Specified by:
maskUnitState
in interfaceConnection
-
numSlots
Get number of slots.- Specified by:
numSlots
in interfaceConnection
- Returns:
- integer number of slots
- Throws:
NumSlotsException
- if any.
-
option
Get a configuration option.- Specified by:
option
in interfaceConnection
- Parameters:
name
- of option- Returns:
- requested option
-
option
Set a configuration option.- Specified by:
option
in interfaceConnection
- Parameters:
name
- of optionvalue
- to set- Returns:
- requested option
-
options
List all options with their non-default values.- Specified by:
options
in interfaceConnection
- Returns:
- Options
- Throws:
OptionsException
- if any.
-
options
List all options with their non-default values.- Specified by:
options
in interfaceConnection
- Parameters:
listDefault
- if true defaulted options will be listedlistUnset
- if true unset options will also be listed- Returns:
- Options
- Throws:
OptionsException
- if any.
-
pause
public final void pause()Pause all slots.- Specified by:
pause
in interfaceConnection
-
pause
public final void pause(int slot) Pause requested slot.- Specified by:
pause
in interfaceConnection
- Parameters:
slot
- number
-
ppd
Get current total estimated Points Per Day.- Specified by:
ppd
in interfaceConnection
- Returns:
- points per day
- Throws:
PpdException
- if any.
-
queueInfo
Get work unit queue information.- Specified by:
queueInfo
in interfaceConnection
- Returns:
- List Unit
- Throws:
QueueInfoException
- if any.
-
requestId
public final void requestId()Request an ID from the assignment server.- Specified by:
requestId
in interfaceConnection
-
requestWs
public final void requestWs()Request work server assignment from the assignment server.- Specified by:
requestWs
in interfaceConnection
-
save
public final void save()Save the configuration either to the file the configuration was last loaded from.- Specified by:
save
in interfaceConnection
-
save
Save the configuration either to the specified file.- Specified by:
save
in interfaceConnection
- Parameters:
file
- to save to
-
shutdown
public final void shutdown()Shutdown the application.- Specified by:
shutdown
in interfaceConnection
-
simulationInfo
Get current simulation information.- Specified by:
simulationInfo
in interfaceConnection
- Parameters:
slot
- number- Returns:
- SimulationInfo
- Throws:
SimulationInfoException
- if any.
-
slotAdd
Add a new slot.- Specified by:
slotAdd
in interfaceConnection
- Parameters:
type
- of slot
-
slotDelete
public final void slotDelete(int slot) Delete a slot. If it is running a unit it will be stopped.- Specified by:
slotDelete
in interfaceConnection
- Parameters:
slot
- number
-
slotInfo
Get slot information.- Specified by:
slotInfo
in interfaceConnection
- Returns:
- List Slot
- Throws:
SlotInfoException
- if any.
-
slotModify
Modify an existing slot.- Specified by:
slotModify
in interfaceConnection
- Parameters:
id
- stringtype
- string
-
slotOptions
Get slot options.- Specified by:
slotOptions
in interfaceConnection
- Parameters:
slot
- a int.- Returns:
- SlotOptions options
- Throws:
SlotOptionsException
- if any.
-
trajectory
public final void trajectory(int slot) Get current protein trajectory.- Specified by:
trajectory
in interfaceConnection
- Parameters:
slot
- number
-
triggerSave
public final void triggerSave()Trigger config save after a delay.- Specified by:
triggerSave
in interfaceConnection
-
unpause
public final void unpause()Unpause all slots.- Specified by:
unpause
in interfaceConnection
-
unpause
public final void unpause(int slot) Unpause requested slot.- Specified by:
unpause
in interfaceConnection
- Parameters:
slot
- number
-
uptime
Print application uptime.- Specified by:
uptime
in interfaceConnection
- Returns:
- uptime value in "HH\h MM\m SS\s" format
-
waitForUnits
public final void waitForUnits()Wait for all running units to finish.- Specified by:
waitForUnits
in interfaceConnection
-