|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.qtunes.core.Session org.qtunes.auth.spi.SessionImpl
public class SessionImpl
A Session is a single login session and one must be in place for most ControlMethod
objects to be run. Each Session has a unique ID, a record of the Service that created it
and a number of "allowances", which determine what the Session can do. These can be checked
by calling the isAllowed(java.lang.String)
method.
When the session is created a set of Properties can be specified, which can be
retrieved later with the getProperties()
method. Please see the API docs for that method
to get a list of standard properties.
Field Summary |
---|
Fields inherited from class org.qtunes.core.Session |
---|
NONE |
Method Summary | |
---|---|
java.util.Collection<java.lang.String> |
getAllowances()
Return the Set of allowances for this Session |
int |
getCreated()
Return the time this session was created, in seconds since epoch |
int |
getExpiryTime()
Return the time this session should be expired, in seconds since epoch |
int |
getId()
Return the unique numeric ID of this Session |
int |
getLastActivity()
Return the last time any activity occurred on this session, in seconds since epoch |
java.util.Map |
getProperties()
Get the Properties specified when this Session was created. |
Service |
getService()
Return the Service that created this Session |
boolean |
isAllowed(java.lang.String test)
Return whether this Session has the specified allowance. |
java.lang.String |
toString()
|
void |
touch()
Mark the session as active as of this point in time |
Methods inherited from class org.qtunes.core.Session |
---|
bumpTracksCompleted, bumpTracksStarted, bumpTraffic, expire, getCurrentSession, getTracksCompleted, getTracksStarted, getTraffic, isExpired, setCurrentSession |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public int getId()
Session
getId
in class Session
public Service getService()
Session
getService
in class Session
public int getCreated()
Session
getCreated
in class Session
public void touch()
Session
touch
in class Session
public int getLastActivity()
Session
getLastActivity
in class Session
public int getExpiryTime()
Session
getExpiryTime
in class Session
public boolean isAllowed(java.lang.String test)
Session
Authorizer
objects that have been registered with
the Auth.addAuthorizer(org.qtunes.auth.Authorizer)
method - an Authorizer that grants "*"
will allow any action, and passing the value "*" in as the test will
check for any allowance. The Session.NONE
Session does not allow
anything.
isAllowed
in class Session
test
- the allowance we're testing for, or "*" for any allowancepublic java.util.Collection<java.lang.String> getAllowances()
Session
getAllowances
in class Session
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Map getProperties()
Session
ip | The IP address or Hostname for the session, if it was created remotely |
---|---|
user | The username of the user that created the session |
getProperties
in class Session
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |