Package com.microstrategy.webapi.acm
Class ACMTimeToLive
- java.lang.Object
-
- com.microstrategy.webapi.acm.ACMTimeToLive
-
- Direct Known Subclasses:
ACMTimeToLive.MasterSessionTTL
,ACMTimeToLive.RealSessionTTL
public abstract class ACMTimeToLive extends java.lang.Object
ACMTimeToLive holds the precise time at which a session will time out. It also knows the idle timeout period of the IServers (they are all the same within the same cluster)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ACMTimeToLive.MasterSessionTTL
static class
ACMTimeToLive.RealSessionTTL
-
Field Summary
Fields Modifier and Type Field Description protected int
mIdleTimeout
protected RWLock
mLock
protected java.util.Calendar
mTtl
protected int
mTtlSecsSinceMidnight
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
extendTtlByIdleTimeout(java.util.Calendar iNow)
protected void
extendTtlByIdleTimeout(java.util.Calendar iNow, int iIdleTimeout)
int
getIdleTimeout()
int
getSecsSinceMidnight()
getSecsSinceMidnight returns only the number of seconds since midnight that the time to live is set for.java.util.Calendar
getTtl()
Deprecated.boolean
isExpired(java.util.Calendar iNow)
isExpired will check the internal time to live calendar against the input iNow Calendar and return true if the time to live has expired.void
setTtl(java.util.Calendar iIServerTtl)
setTtl will set the time to live directly overwriting whatever was there before.
-
-
-
Field Detail
-
mIdleTimeout
protected int mIdleTimeout
-
mTtl
protected final java.util.Calendar mTtl
-
mTtlSecsSinceMidnight
protected int mTtlSecsSinceMidnight
-
mLock
protected final RWLock mLock
-
-
Method Detail
-
getIdleTimeout
public int getIdleTimeout()
-
getTtl
@Deprecated public java.util.Calendar getTtl()
Deprecated.getTtl will return the Calendar that represents the time to live moment.
DEPRECATED: Since there is a complex relationship between IdleTimeout and Ttl, if you call this method and use the answer in any type of calculation, you will probably get it wrong! Instead useisExpired
which will do the calculation for you- Returns:
-
setTtl
public void setTtl(java.util.Calendar iIServerTtl)
setTtl will set the time to live directly overwriting whatever was there before. This is tricky, because the Ttl and the idle timeout are not independent. Thus, if the idle timeout is -1 (unlimited), then setting the ttl will ultimately do nothing! The timeout will still be unlimited.
This method is known to be called in the workflow where a remote application (via session sharing) has upped the timeout and the ACMRefreshThread checks that timeout- Parameters:
iIServerTtl
-
-
isExpired
public boolean isExpired(java.util.Calendar iNow)
isExpired will check the internal time to live calendar against the input iNow Calendar and return true if the time to live has expired.- Parameters:
iNow
-- Returns:
-
getSecsSinceMidnight
public int getSecsSinceMidnight()
getSecsSinceMidnight returns only the number of seconds since midnight that the time to live is set for. This is just a simplified version so that log files are easier to read. Do not use this method for anything but logging.- Returns:
-
extendTtlByIdleTimeout
public void extendTtlByIdleTimeout(java.util.Calendar iNow)
-
extendTtlByIdleTimeout
protected void extendTtlByIdleTimeout(java.util.Calendar iNow, int iIdleTimeout)
-
-