
es.tid.topologyModuleBase.plugins.updaters.RedisDatabaseHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of topology Show documentation
Show all versions of topology Show documentation
Traffic Engineering Database, BGP-LS peer, Topology Module
The newest version!
package es.tid.topologyModuleBase.plugins.updaters;
import redis.clients.jedis.Jedis;
/**
*
* Redis database communication control
*
* @author Fernando Mu�oz del Nuevo
*
*/
public class RedisDatabaseHandler {
String host="localhost";
int port=6379;
public boolean write(String key, String json){
//System.out.println("WRITING IN "+host+" port "+port);
Jedis jedis = new Jedis(host,port);
jedis.connect();
String ret = jedis.set(key, json);
jedis.sadd("TEDB",key);
jedis.disconnect();
return true;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy