|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.qtunes.auth.spi.AuthImpl
public class AuthImpl
The Auth class handles creation of Sessions and determining what rights
those Sessions have. Each QTunes object has only one Auth service
Different Services may register an Authorizer
with this object: when a Session is created by a call to login(java.util.Map)
,
each Authorizer for the matching Service is queried to see what "allowances"
it gives it.
Constructor Summary | |
---|---|
AuthImpl()
|
Method Summary | |
---|---|
void |
addAuthorizer(Authorizer auth)
Add an Authorizer to the Auth object. |
java.util.Collection<java.lang.String> |
getAllowances(Session session)
Return the set of allowances for the specified Session |
ServiceContext |
getContext()
Return the ServiceContext that was passed into Service.startService(org.qtunes.core.ServiceContext) |
Session |
getSession(int id)
Get the Session with the specified ID, or null if it doesn't exist |
Session |
login(java.util.Map properties)
Create a new Session |
void |
logout(Session session)
Expire the specified Session |
void |
logoutSessions(Service service)
Expire all Sessions created by the specified Service |
void |
removeAuthorizer(Authorizer auth)
Remove the previously added Authorizer from the Auth object |
java.util.Map<java.lang.String,java.lang.Object> |
reportState()
Return a Map describing the state of this Service, for serialization back to any client that needs to know (eg webplayer) - so values should be serializable objects, eg Lists, Maps or simple objects. |
void |
startService(ServiceContext context)
Start the Service |
void |
stopService(ServiceContext context)
Stop the Service |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AuthImpl()
Method Detail |
---|
public void startService(ServiceContext context)
Service
startService
in interface Service
context
- the ServiceContext for this Servicepublic void stopService(ServiceContext context)
Service
stopService
in interface Service
context
- the ServiceContext for this Service (same as was passed into start)public ServiceContext getContext()
Service
Service.startService(org.qtunes.core.ServiceContext)
getContext
in interface Service
public Session getSession(int id)
Auth
getSession
in interface Auth
public Session login(java.util.Map properties)
Auth
login
in interface Auth
properties
- a Map of properties which are part of the session - the exact content
depends on the service (for example, a web service might include the Remote IP address
of the connection). These properties are tested by the various Authorizers
registered with the system to determine the set of allowances. At a minimum the
Map must contain a "session" key with the value as either the name of the Service
or the Service itself.public void logout(Session session)
Auth
logout
in interface Auth
session
- the session to expirepublic java.util.Collection<java.lang.String> getAllowances(Session session)
Auth
getAllowances
in interface Auth
public void addAuthorizer(Authorizer auth)
Auth
addAuthorizer
in interface Auth
public void removeAuthorizer(Authorizer auth)
Auth
removeAuthorizer
in interface Auth
public void logoutSessions(Service service)
Auth
logoutSessions
in interface Auth
public java.util.Map<java.lang.String,java.lang.Object> reportState()
Service
reportState
in interface Service
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |