Tabnine Logo
Session.getId
Code IndexAdd Tabnine to your IDE (free)

How to use
getId
method
in
com.ecwid.consul.v1.session.model.Session

Best Java code snippets using com.ecwid.consul.v1.session.model.Session.getId (Showing top 4 results out of 315)

origin: alipay/sofa-rpc

public Boolean registerEphemralNode(ConsulEphemeralNode ephemralNode) {
  String sessionId = null;
  List<Session> sessions = client.getSessionList(QueryParams.DEFAULT).getValue();
  if (sessions != null && !sessions.isEmpty()) {
    for (Session session : sessions) {
      if (session.getName().equals(ephemralNode.getSessionName())) {
        sessionId = session.getId();
      }
    }
  }
  if (sessionId == null) {
    NewSession newSession = ephemralNode.getNewSession();
    synchronized (lock) {
      sessionId = client.sessionCreate(newSession, QueryParams.DEFAULT).getValue();
    }
  }
  ConsulSession session = new ConsulSession(sessionId, ephemralNode);
  ttlScheduler.addHeartbeatSession(session);
  PutParams kvPutParams = new PutParams();
  kvPutParams.setAcquireSession(sessionId);
  client.getKVValue(ephemralNode.getEphemralNodeKey());
  return client.setKVValue(ephemralNode.getEphemralNodeKey(), ephemralNode.getEphemralNodeValue(),
    kvPutParams).getValue();
}
origin: alipay/sofa-rpc

public Boolean registerEphemralNode(ConsulEphemeralNode ephemralNode) {
  String sessionId = null;
  List<Session> sessions = client.getSessionList(QueryParams.DEFAULT).getValue();
  if (sessions != null && !sessions.isEmpty()) {
    for (Session session : sessions) {
      if (session.getName().equals(ephemralNode.getSessionName())) {
        sessionId = session.getId();
      }
    }
  }
  if (sessionId == null) {
    NewSession newSession = ephemralNode.getNewSession();
    synchronized (lock) {
      sessionId = client.sessionCreate(newSession, QueryParams.DEFAULT).getValue();
    }
  }
  ConsulSession session = new ConsulSession(sessionId, ephemralNode);
  ttlScheduler.addHeartbeatSession(session);
  PutParams kvPutParams = new PutParams();
  kvPutParams.setAcquireSession(sessionId);
  client.getKVValue(ephemralNode.getEphemralNodeKey());
  return client.setKVValue(ephemralNode.getEphemralNodeKey(), ephemralNode.getEphemralNodeValue(),
    kvPutParams).getValue();
}
origin: venus-boot/saluki

public Boolean registerEphemralNode(ConsulEphemralNode ephemralNode) {
  String sessionId = null;
  List<Session> sessions = client.getSessionList(QueryParams.DEFAULT).getValue();
  if (sessions != null && !sessions.isEmpty()) {
    for (Session session : sessions) {
      if (session.getName().equals(ephemralNode.getSessionName())) {
        sessionId = session.getId();
      }
    }
  }
  if (sessionId == null) {
    NewSession newSession = ephemralNode.getNewSession();
    synchronized (lock) {
      sessionId = client.sessionCreate(newSession, QueryParams.DEFAULT).getValue();
    }
  }
  ConsulSession session = new ConsulSession(sessionId, ephemralNode);
  ttlScheduler.addHeartbeatSession(session);
  PutParams kvPutParams = new PutParams();
  kvPutParams.setAcquireSession(sessionId);
  return client.setKVValue(ephemralNode.getEphemralNodeKey(), ephemralNode.getEphemralNodeValue(),
               kvPutParams).getValue();
}
origin: com.alipay.sofa/sofa-rpc-all

public Boolean registerEphemralNode(ConsulEphemeralNode ephemralNode) {
  String sessionId = null;
  List<Session> sessions = client.getSessionList(QueryParams.DEFAULT).getValue();
  if (sessions != null && !sessions.isEmpty()) {
    for (Session session : sessions) {
      if (session.getName().equals(ephemralNode.getSessionName())) {
        sessionId = session.getId();
      }
    }
  }
  if (sessionId == null) {
    NewSession newSession = ephemralNode.getNewSession();
    synchronized (lock) {
      sessionId = client.sessionCreate(newSession, QueryParams.DEFAULT).getValue();
    }
  }
  ConsulSession session = new ConsulSession(sessionId, ephemralNode);
  ttlScheduler.addHeartbeatSession(session);
  PutParams kvPutParams = new PutParams();
  kvPutParams.setAcquireSession(sessionId);
  client.getKVValue(ephemralNode.getEphemralNodeKey());
  return client.setKVValue(ephemralNode.getEphemralNodeKey(), ephemralNode.getEphemralNodeValue(),
    kvPutParams).getValue();
}
com.ecwid.consul.v1.session.modelSessiongetId

Popular methods of Session

  • getName

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • ImageIO (javax.imageio)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now