congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Session.getId
Code IndexAdd Tabnine to your IDE (free)

How to use
getId
method
in
org.apache.shiro.session.Session

Best Java code snippets using org.apache.shiro.session.Session.getId (Showing top 20 results out of 441)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: shuzheng/zheng

@Override
public void onStop(Session session) {
  LOGGER.debug("会话停止:" + session.getId());
}
origin: apache/shiro

/**
 * Immediately delegates to the underlying proxied session.
 */
public Serializable getId() {
  return delegate.getId();
}
origin: shuzheng/zheng

@Override
public void onStart(Session session) {
  LOGGER.debug("会话创建:" + session.getId());
}
origin: shuzheng/zheng

@Override
public void onExpiration(Session session) {
  LOGGER.debug("会话过期:" + session.getId());
}
origin: killbill/killbill

public void disableUpdatesForSession(final Session session) {
  noUpdateSessionsCache.put(session.getId(), Boolean.TRUE);
}
origin: apache/shiro

public void delete(Session session) {
  if (session == null) {
    throw new NullPointerException("session argument cannot be null.");
  }
  Serializable id = session.getId();
  if (id != null) {
    sessions.remove(id);
  }
}
origin: Graylog2/graylog2-server

@Override
protected void doDelete(Session session) {
  LOG.debug("Deleting session {}", session);
  final Serializable id = session.getId();
  final MongoDbSession dbSession = mongoDBSessionService.load(id.toString());
  if (dbSession != null) {
    final int deleted = mongoDBSessionService.destroy(dbSession);
    LOG.debug("Deleted {} sessions with ID {} from database", deleted, id);
  } else {
    LOG.debug("Session {} not found in database", id);
  }
}
origin: apache/shiro

public String getId() {
  return getSession().getId().toString();
}
origin: killbill/killbill

public void enableUpdatesForSession(final Session session) {
  noUpdateSessionsCache.invalidate(session.getId());
  doUpdate(session);
}
origin: apache/shiro

public void update(Session session) throws UnknownSessionException {
  storeSession(session.getId(), session);
}
origin: killbill/killbill

public SessionModelDao(final Session session) {
  this.id = session.getId() == null ? null : session.getId().toString();
  this.startTimestamp = new DateTime(session.getStartTimestamp(), DateTimeZone.UTC);
  this.lastAccessTime = new DateTime(session.getLastAccessTime(), DateTimeZone.UTC);
  this.timeout = session.getTimeout();
  this.host = session.getHost();
  try {
    this.sessionData = serializeSessionData(session);
  } catch (final IOException e) {
    this.sessionData = new byte[]{};
  }
}
origin: shuzheng/zheng

@Override
protected void doUpdate(Session session) {
  // 如果会话过期/停止 没必要再更新了
  if(session instanceof ValidatingSession && !((ValidatingSession)session).isValid()) {
    return;
  }
  // 更新session的最后一次访问时间
  UpmsSession upmsSession = (UpmsSession) session;
  UpmsSession cacheUpmsSession = (UpmsSession) doReadSession(session.getId());
  if (null != cacheUpmsSession) {
    upmsSession.setStatus(cacheUpmsSession.getStatus());
    upmsSession.setAttribute("FORCE_LOGOUT", cacheUpmsSession.getAttribute("FORCE_LOGOUT"));
  }
  RedisUtil.set(ZHENG_UPMS_SHIRO_SESSION_ID + "_" + session.getId(), SerializableUtil.serialize(session), (int) session.getTimeout() / 1000);
  // 更新ZHENG_UPMS_SERVER_SESSION_ID、ZHENG_UPMS_SERVER_CODE过期时间 TODO
  LOGGER.debug("doUpdate >>>>> sessionId={}", session.getId());
}
origin: apache/shiro

protected void onExpiration(Session s, ExpiredSessionException ese, SessionKey key) {
  log.trace("Session with id [{}] has expired.", s.getId());
  try {
    onExpiration(s);
    notifyExpiration(s);
  } finally {
    afterExpired(s);
  }
}
origin: apache/shiro

protected void onInvalidation(Session s, InvalidSessionException ise, SessionKey key) {
  if (ise instanceof ExpiredSessionException) {
    onExpiration(s, (ExpiredSessionException) ise, key);
    return;
  }
  log.trace("Session with id [{}] is invalid.", s.getId());
  try {
    onStop(s);
    notifyStop(s);
  } finally {
    afterStopped(s);
  }
}
origin: apache/shiro

public void stop(SessionKey key) throws InvalidSessionException {
  Session session = lookupRequiredSession(key);
  try {
    if (log.isDebugEnabled()) {
      log.debug("Stopping session with id [" + session.getId() + "]");
    }
    session.stop();
    onStop(session, key);
    notifyStop(session);
  } finally {
    afterStopped(session);
  }
}
origin: apache/shiro

protected Session createExposedSession(Session session, SessionContext context) {
  if (!WebUtils.isWeb(context)) {
    return super.createExposedSession(session, context);
  }
  ServletRequest request = WebUtils.getRequest(context);
  ServletResponse response = WebUtils.getResponse(context);
  SessionKey key = new WebSessionKey(session.getId(), request, response);
  return new DelegatingSession(this, key);
}
origin: apache/shiro

protected Session createExposedSession(Session session, SessionKey key) {
  if (!WebUtils.isWeb(key)) {
    return super.createExposedSession(session, key);
  }
  ServletRequest request = WebUtils.getRequest(key);
  ServletResponse response = WebUtils.getResponse(key);
  SessionKey sessionKey = new WebSessionKey(session.getId(), request, response);
  return new DelegatingSession(this, sessionKey);
}
origin: apache/shiro

@Test
public void testSessionListenerStopNotification() {
  final boolean[] stopped = new boolean[1];
  SessionListener listener = new SessionListenerAdapter() {
    public void onStop(Session session) {
      stopped[0] = true;
    }
  };
  sm.getSessionListeners().add(listener);
  Session session = sm.start(null);
  sm.stop(new DefaultSessionKey(session.getId()));
  assertTrue(stopped[0]);
}
origin: apache/shiro

@Test
public void testGlobalTimeout() {
  long timeout = 1000;
  sm.setGlobalSessionTimeout(timeout);
  Session session = sm.start(null);
  assertNotNull(session);
  assertNotNull(session.getId());
  assertEquals(session.getTimeout(), timeout);
}
origin: apache/shiro

@Before
public void setup() {
  ThreadContext.remove();
  sm = new DefaultSessionManager();
  this.session = new DelegatingSession(sm, new DefaultSessionKey(sm.start(null).getId()));
}
org.apache.shiro.sessionSessiongetId

Javadoc

Returns the unique identifier assigned by the system upon session creation.

All return values from this method are expected to have proper toString(), equals(), and hashCode() implementations. Good candidates for such an identifier are java.util.UUIDs, java.lang.Integers, and java.lang.Strings.

Popular methods of Session

  • getAttribute
    Returns the object bound to this session identified by the specified key. If there is no object boun
  • setAttribute
    Binds the specified value to this session, uniquely identified by the specifed key name. If there is
  • removeAttribute
    Removes (unbinds) the object bound to this session under the specified key name.
  • getHost
    Returns the host name or IP string of the host that originated this session, or nullif the host is u
  • getTimeout
    Returns the time in milliseconds that the session session may remain idle before expiring. * A negat
  • getLastAccessTime
    Returns the last time the application received a request or method invocation from the user associat
  • getStartTimestamp
    Returns the time the session was started; that is, the time the system created the instance.
  • setTimeout
    Sets the time in milliseconds that the session may remain idle before expiring. * A negative val
  • getAttributeKeys
    Returns the keys of all the attributes stored under this session. If there are no attributes, this r
  • stop
    Explicitly stops (invalidates) this session and releases all associated resources. If this session h
  • touch
    Explicitly updates the #getLastAccessTime() of this session to the current time when this method is
  • touch

Popular in Java

  • Reading from database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Table (org.hibernate.mapping)
    A relational table
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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