Package jmri.server.json.throttle
Class JsonThrottleManager
- java.lang.Object
-
- jmri.server.json.throttle.JsonThrottleManager
-
- All Implemented Interfaces:
InstanceManagerAutoDefault
public class JsonThrottleManager extends java.lang.Object implements InstanceManagerAutoDefault
Manager forJsonThrottleobjects. A manager is needed since multiple JsonThrottle objects may be controlling the sameDccLocoAddress.
-
-
Constructor Summary
Constructors Constructor Description JsonThrottleManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanBeLongAddress(int asInt)booleancanBeShortAddress(int asInt)booleancontainsKey(DccLocoAddress address)JsonThrottleget(DccLocoAddress address)com.fasterxml.jackson.databind.ObjectMappergetObjectMapper()java.util.List<JsonThrottleSocketService>getServers(JsonThrottle throttle)java.util.Collection<JsonThrottle>getThrottles()voidput(DccLocoAddress address, JsonThrottle throttle)voidput(JsonThrottle throttle, JsonThrottleSocketService service)voidremove(DccLocoAddress address)voidremove(JsonThrottle throttle, JsonThrottleSocketService server)booleanrequestThrottle(BasicRosterEntry rosterEntry, ThrottleListener listener)booleanrequestThrottle(DccLocoAddress address, ThrottleListener listener)
-
-
-
Constructor Detail
-
JsonThrottleManager
public JsonThrottleManager()
-
-
Method Detail
-
getThrottles
public java.util.Collection<JsonThrottle> getThrottles()
-
put
public void put(DccLocoAddress address, JsonThrottle throttle)
-
put
public void put(JsonThrottle throttle, JsonThrottleSocketService service)
-
containsKey
public boolean containsKey(DccLocoAddress address)
-
get
public JsonThrottle get(DccLocoAddress address)
-
remove
public void remove(DccLocoAddress address)
-
getServers
public java.util.List<JsonThrottleSocketService> getServers(JsonThrottle throttle)
-
remove
public void remove(JsonThrottle throttle, JsonThrottleSocketService server)
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-
canBeLongAddress
public boolean canBeLongAddress(int asInt)
-
canBeShortAddress
public boolean canBeShortAddress(int asInt)
-
requestThrottle
public boolean requestThrottle(DccLocoAddress address, ThrottleListener listener)
-
requestThrottle
public boolean requestThrottle(BasicRosterEntry rosterEntry, ThrottleListener listener)
-
-