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 forJsonThrottle
objects. 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 boolean
canBeLongAddress(int asInt)
boolean
canBeShortAddress(int asInt)
boolean
containsKey(DccLocoAddress address)
JsonThrottle
get(DccLocoAddress address)
com.fasterxml.jackson.databind.ObjectMapper
getObjectMapper()
java.util.List<JsonThrottleSocketService>
getServers(JsonThrottle throttle)
java.util.Collection<JsonThrottle>
getThrottles()
void
put(DccLocoAddress address, JsonThrottle throttle)
void
put(JsonThrottle throttle, JsonThrottleSocketService service)
void
remove(DccLocoAddress address)
void
remove(JsonThrottle throttle, JsonThrottleSocketService server)
boolean
requestThrottle(BasicRosterEntry rosterEntry, ThrottleListener listener)
boolean
requestThrottle(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)
-
-