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

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

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

  • 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: apache/shiro

/**
 * Immediately delegates to the underlying proxied session.
 */
public Date getLastAccessTime() {
  return delegate.getLastAccessTime();
}
origin: apache/shiro

public Date getLastAccessTime(SessionKey key) {
  return lookupRequiredSession(key).getLastAccessTime();
}
origin: apache/shiro

public long getLastAccessedTime() {
  return getSession().getLastAccessTime().getTime();
}
origin: Graylog2/graylog2-server

@Override
protected Serializable doCreate(Session session) {
  final Serializable id = generateSessionId(session);
  assignSessionId(session, id);
  Map<String, Object> fields = Maps.newHashMap();
  fields.put("session_id", id);
  fields.put("host", session.getHost());
  fields.put("start_timestamp", session.getStartTimestamp());
  fields.put("last_access_time", session.getLastAccessTime());
  fields.put("timeout", session.getTimeout());
  Map<String, Object> attributes = Maps.newHashMap();
  for (Object key : session.getAttributeKeys()) {
    attributes.put(key.toString(), session.getAttribute(key));
  }
  fields.put("attributes", attributes);
  final MongoDbSession dbSession = new MongoDbSession(fields);
  final String objectId = mongoDBSessionService.saveWithoutValidation(dbSession);
  LOG.debug("Created session {}", objectId);
  return id;
}
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: Graylog2/graylog2-server

dbSession.setTimeout(session.getTimeout());
dbSession.setStartTimestamp(session.getStartTimestamp());
dbSession.setLastAccessTime(session.getLastAccessTime());
origin: Graylog2/graylog2-server

  return SessionResponse.create(new DateTime(s.getLastAccessTime(), DateTimeZone.UTC).plus(s.getTimeout()).toDate(),
      id.toString());
} else {
origin: org.apache.shiro/shiro-core

/**
 * Immediately delegates to the underlying proxied session.
 */
public Date getLastAccessTime() {
  return delegate.getLastAccessTime();
}
origin: wuyouzhuguli/FEBS-Shiro

@Override
public List<UserOnline> list() {
  List<UserOnline> list = new ArrayList<>();
  Collection<Session> sessions = sessionDAO.getActiveSessions();
  for (Session session : sessions) {
    UserOnline userOnline = new UserOnline();
    User user;
    SimplePrincipalCollection principalCollection;
    if (session.getAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY) == null) {
      continue;
    } else {
      principalCollection = (SimplePrincipalCollection) session
          .getAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY);
      user = (User) principalCollection.getPrimaryPrincipal();
      userOnline.setUsername(user.getUsername());
      userOnline.setUserId(user.getUserId().toString());
    }
    userOnline.setId((String) session.getId());
    userOnline.setHost(session.getHost());
    userOnline.setStartTimestamp(session.getStartTimestamp());
    userOnline.setLastAccessTime(session.getLastAccessTime());
    long timeout = session.getTimeout();
    userOnline.setStatus(timeout == 0L ? "0" : "1");
    String address = AddressUtils.getCityInfo(userOnline.getHost());
    userOnline.setLocation(address);
    userOnline.setTimeout(timeout);
    list.add(userOnline);
  }
  return list;
}
origin: org.apache.shiro/shiro-core

public Date getLastAccessTime(SessionKey key) {
  return lookupRequiredSession(key).getLastAccessTime();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.shiro

/**
 * Immediately delegates to the underlying proxied session.
 */
public Date getLastAccessTime() {
  return delegate.getLastAccessTime();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.shiro

public Date getLastAccessTime(SessionKey key) {
  return lookupRequiredSession(key).getLastAccessTime();
}
origin: com.gitee.qdbp/qdbp-base-ctl

public void touch(SessionKey key) throws InvalidSessionException {
  if (key instanceof RealSessionKey) {
    RealSessionKey realKey = ((RealSessionKey) key);
    Date lastAccessTime = realKey.getSession().getLastAccessTime();
    if (lastAccessTime != null) {
      long interval = new Date().getTime() - lastAccessTime.getTime();
      if (interval < touchInterval) {
        log.trace("LastAccessTimeInterval={}, touchInterval={}, do nothing.", interval, touchInterval);
        return;
      }
    }
  }
  super.touch(key);
}
origin: com.gitee.zhaohuihua/bdp-general-web

public void touch(SessionKey key) throws InvalidSessionException {
  if (key instanceof RealSessionKey) {
    RealSessionKey realKey = ((RealSessionKey) key);
    Date lastAccessTime = realKey.getSession().getLastAccessTime();
    if (lastAccessTime != null) {
      long interval = new Date().getTime() - lastAccessTime.getTime();
      if (interval < touchInterval) {
        log.trace("LastAccessTimeInterval={}, touchInterval={}, do nothing.", interval, touchInterval);
        return;
      }
    }
  }
  super.touch(key);
}
origin: org.kill-bill.billing/killbill-jaxrs

public SessionJson(final Session session) {
  this.id = session.getId() == null ? null : session.getId().toString();
  this.startDate = session.getStartTimestamp() == null ? null : new DateTime(session.getStartTimestamp(), DateTimeZone.UTC);
  this.lastAccessDate = session.getLastAccessTime() == null ? null : new DateTime(session.getLastAccessTime(), DateTimeZone.UTC);
  this.timeout = session.getTimeout();
  this.host = session.getHost();
}
origin: com.ning.billing/killbill-jaxrs

public SessionJson(final Session session) {
  this.id = session.getId() == null ? null : session.getId().toString();
  this.startDate = session.getStartTimestamp() == null ? null : new DateTime(session.getStartTimestamp(), DateTimeZone.UTC);
  this.lastAccessDate = session.getLastAccessTime() == null ? null : new DateTime(session.getLastAccessTime(), DateTimeZone.UTC);
  this.timeout = session.getTimeout();
  this.host = session.getHost();
}
origin: com.ning.billing/killbill-util

public SessionModelDao(final Session session) {
  this.recordId = (Long) session.getId();
  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 (IOException e) {
    this.sessionData = new byte[]{};
  }
}
origin: org.kill-bill.billing/killbill-util

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: org.graylog2/graylog2-server

@Override
protected Serializable doCreate(Session session) {
  final Serializable id = generateSessionId(session);
  assignSessionId(session, id);
  Map<String, Object> fields = Maps.newHashMap();
  fields.put("session_id", id);
  fields.put("host", session.getHost());
  fields.put("start_timestamp", session.getStartTimestamp());
  fields.put("last_access_time", session.getLastAccessTime());
  fields.put("timeout", session.getTimeout());
  Map<String, Object> attributes = Maps.newHashMap();
  for (Object key : session.getAttributeKeys()) {
    attributes.put(key.toString(), session.getAttribute(key));
  }
  fields.put("attributes", attributes);
  final MongoDbSession dbSession = new MongoDbSession(fields);
  final String objectId = mongoDBSessionService.saveWithoutValidation(dbSession);
  LOG.debug("Created session {}", objectId);
  return id;
}
origin: com.github.fartherp/shiro-redisson

public void setSession(Session session) {
  this.id = session.getId();
  this.startTimestamp = session.getStartTimestamp();
  this.lastAccessTime = session.getLastAccessTime();
  this.timeout = session.getTimeout();
  this.host = session.getHost();
  if (session instanceof SimpleSession) {
    this.stopTimestamp = ((SimpleSession) session).getStopTimestamp();
    this.expired = ((SimpleSession) session).isExpired();
    this.attributes = ((SimpleSession) session).getAttributes();
  }
}
org.apache.shiro.sessionSessiongetLastAccessTime

Javadoc

Returns the last time the application received a request or method invocation from the user associated with this session. Application calls to this method do not affect this access time.

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
  • getId
    Returns the unique identifier assigned by the system upon session creation. All return values from t
  • 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
  • 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

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Path (java.nio.file)
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Top 17 PhpStorm Plugins
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