Class RedisClient
java.lang.Object
at.ac.ait.lablink.clients.redisclient.RedisClient
public class RedisClient extends Object
Class RedisClient.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classRedisClient.RedisActuatorClass RedisActuator.(package private) classRedisClient.RedisClientNotifierClass RedisClientNotifier.private static classRedisClient.RedisReader(package private) classRedisClient.RedisSensorClass RedisSensor.private classRedisClient.SensorConf -
Field Summary
Fields Modifier and Type Field Description private at.ac.ait.lablink.core.client.impl.LlClientclientprivate StringclientDescprivate StringclientNameprivate booleangiveShellprivate StringgroupNameprivate booleanisPseudoprivate static redis.clients.jedis.JedisPooljedisPoolprivate Stringllpropprivate Stringllsyncprivate static org.apache.logging.log4j.LoggerloggerLogger.private StringscenarioNameprivate List<RedisClient.SensorConf>sensorList -
Constructor Summary
Constructors Constructor Description RedisClient()RedisClient(String redisIpAddress, int redisPort, String scenarioName, String groupName, String clientName, String clientDesc, String llprop, String llsync)Constructor. -
Method Summary
Modifier and Type Method Description voidaddRedisKeyAsActuator(String key)Add Redis key as actuator.voidaddRedisKeyAsSensor(String key, int msTimeInterval)Add Redis key as sensor.voidstart()Start the client.
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger loggerLogger. -
jedisPool
private static redis.clients.jedis.JedisPool jedisPool -
scenarioName
-
groupName
-
clientName
-
clientDesc
-
llprop
-
llsync
-
giveShell
private boolean giveShell -
isPseudo
private boolean isPseudo -
sensorList
-
client
private at.ac.ait.lablink.core.client.impl.LlClient client
-
-
Constructor Details
-
RedisClient
public RedisClient() -
RedisClient
public RedisClient(String redisIpAddress, int redisPort, String scenarioName, String groupName, String clientName, String clientDesc, String llprop, String llsync) throws at.ac.ait.lablink.core.client.ex.ClientNotReadyException, at.ac.ait.lablink.core.client.ex.CommInterfaceNotSupportedException, at.ac.ait.lablink.core.client.ex.DataTypeNotSupportedException, at.ac.ait.lablink.core.client.ex.NoServicesInClientLogicException, at.ac.ait.lablink.core.client.ex.NoSuchCommInterfaceException, at.ac.ait.lablink.core.client.ex.ServiceIsNotRegisteredWithClientException, at.ac.ait.lablink.core.client.ex.ServiceTypeDoesNotMatchClientType, org.apache.commons.configuration.ConfigurationExceptionConstructor.- Parameters:
redisIpAddress- Redis IP addressredisPort- Redis portscenarioName- scenario namegroupName- group nameclientName- client nameclientDesc- client descriptionllprop- Lablink propertiesllsync- Lablink sync properties- Throws:
at.ac.ait.lablink.core.client.ex.ClientNotReadyException- client not readyat.ac.ait.lablink.core.client.ex.CommInterfaceNotSupportedException- comm interface not supportedat.ac.ait.lablink.core.client.ex.DataTypeNotSupportedException- data type not supportedat.ac.ait.lablink.core.client.ex.NoServicesInClientLogicException- no services in client logicat.ac.ait.lablink.core.client.ex.NoSuchCommInterfaceException- no such comm interfaceat.ac.ait.lablink.core.client.ex.ServiceIsNotRegisteredWithClientException- service is not registered with clientat.ac.ait.lablink.core.client.ex.ServiceTypeDoesNotMatchClientType- service type does not match client typeorg.apache.commons.configuration.ConfigurationException- configuration error
-
-
Method Details
-
addRedisKeyAsSensor
public void addRedisKeyAsSensor(String key, int msTimeInterval) throws at.ac.ait.lablink.core.client.ex.ServiceTypeDoesNotMatchClientTypeAdd Redis key as sensor.- Parameters:
key- Redis keymsTimeInterval- time interval in ms- Throws:
at.ac.ait.lablink.core.client.ex.ServiceTypeDoesNotMatchClientType- service type does not match client type exception
-
addRedisKeyAsActuator
public void addRedisKeyAsActuator(String key) throws at.ac.ait.lablink.core.client.ex.ServiceTypeDoesNotMatchClientTypeAdd Redis key as actuator.- Parameters:
key- Redis key- Throws:
at.ac.ait.lablink.core.client.ex.ServiceTypeDoesNotMatchClientType- service type does not match client type exception
-
start
public void start() throws at.ac.ait.lablink.core.client.ex.ServiceTypeDoesNotMatchClientType, at.ac.ait.lablink.core.client.ex.ClientNotReadyException, at.ac.ait.lablink.core.client.ex.NoSuchCommInterfaceException, org.apache.commons.configuration.ConfigurationException, at.ac.ait.lablink.core.client.ex.NoServicesInClientLogicException, at.ac.ait.lablink.core.client.ex.DataTypeNotSupportedExceptionStart the client.- Throws:
at.ac.ait.lablink.core.client.ex.ServiceTypeDoesNotMatchClientType- service type does not match client type exceptionat.ac.ait.lablink.core.client.ex.ClientNotReadyException- client not ready exceptionat.ac.ait.lablink.core.client.ex.NoSuchCommInterfaceException- no such comm interface exceptionorg.apache.commons.configuration.ConfigurationException- configuration exceptionat.ac.ait.lablink.core.client.ex.NoServicesInClientLogicException- no services in client logic exceptionat.ac.ait.lablink.core.client.ex.DataTypeNotSupportedException- data type not supported exception
-