Package jmri.jmrit.z21server
Class ClientManager
- java.lang.Object
-
- jmri.jmrit.z21server.ClientManager
-
- All Implemented Interfaces:
java.util.EventListener
,ThrottleListener
public class ClientManager extends java.lang.Object implements ThrottleListener
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.ThrottleListener
ThrottleListener.DecisionType
-
-
Field Summary
Fields Modifier and Type Field Description static float
speedMultiplier
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClientManager
getInstance()
byte[]
getLocoStatusMessage(java.net.InetAddress address, java.lang.Integer locoAddress)
void
handleExpiredClients()
void
heartbeat(java.net.InetAddress clientAddress)
void
notifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question)
Get notification that a throttle request is in use by another device, and a "steal", "share", or "steal/share" decision may be required.void
notifyFailedThrottleRequest(LocoAddress address, java.lang.String reason)
Get notification that an attempt to request a throttle has failed.void
notifyThrottleFound(DccThrottle t)
Get notification that a throttle has been found as requested.void
registerLocoIfNeeded(java.net.InetAddress clientAddress, int locoAddress)
void
setLocoFunction(java.net.InetAddress clientAddress, int locoAddress, int functionNumber, boolean bOn)
void
setLocoSpeedAndDirection(java.net.InetAddress clientAddress, int locoAddress, int speed, boolean forward)
static byte
xor(byte[] packet)
-
-
-
Field Detail
-
speedMultiplier
public static float speedMultiplier
-
-
Method Detail
-
getInstance
public static ClientManager getInstance()
-
registerLocoIfNeeded
public void registerLocoIfNeeded(java.net.InetAddress clientAddress, int locoAddress)
-
setLocoSpeedAndDirection
public void setLocoSpeedAndDirection(java.net.InetAddress clientAddress, int locoAddress, int speed, boolean forward)
-
setLocoFunction
public void setLocoFunction(java.net.InetAddress clientAddress, int locoAddress, int functionNumber, boolean bOn)
-
heartbeat
public void heartbeat(java.net.InetAddress clientAddress)
-
handleExpiredClients
public void handleExpiredClients()
-
getLocoStatusMessage
public byte[] getLocoStatusMessage(java.net.InetAddress address, java.lang.Integer locoAddress)
-
notifyThrottleFound
public void notifyThrottleFound(DccThrottle t)
Description copied from interface:ThrottleListener
Get notification that a throttle has been found as requested.- Specified by:
notifyThrottleFound
in interfaceThrottleListener
- Parameters:
t
- the throttle with the requested address
-
notifyFailedThrottleRequest
public void notifyFailedThrottleRequest(LocoAddress address, java.lang.String reason)
Description copied from interface:ThrottleListener
Get notification that an attempt to request a throttle has failed.- Specified by:
notifyFailedThrottleRequest
in interfaceThrottleListener
- Parameters:
address
- address of the failed requestreason
- failure cause
-
notifyDecisionRequired
public void notifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question)
Description copied from interface:ThrottleListener
Get notification that a throttle request is in use by another device, and a "steal", "share", or "steal/share" decision may be required.- Specified by:
notifyDecisionRequired
in interfaceThrottleListener
- Parameters:
address
- The LocoAddress that needs the decision.question
- The question being asked, steal / cancel, share / cancel, steal / share / cancel
-
xor
public static byte xor(byte[] packet)
-
-