public class SessionServiceImpl extends Object implements SessionService, org.osgi.service.event.EventHandler
| Constructor and Description |
|---|
SessionServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
Session |
createSession(String cert,
String mandatorId,
long timeout,
String sessionId,
Map<String,String> params)
Creates a session to handle resources
|
boolean |
destroy(String cert,
String mandatorId,
String sessionId)
Destroys a session
|
boolean |
exists(String mandatorId,
String sessionId)
Returns true if the session is available.
|
org.osgi.framework.BundleContext |
getBundleContext() |
static Session |
getSession(org.osgi.framework.BundleContext bundleContext,
String cert,
String mandatorId,
String sessionId)
Gets the session with the id
|
Session |
getSession(String cert,
String mandatorId,
String sessionId)
Gets a session or null if the session doesn't exist.
|
org.osgi.framework.ServiceReference<?>[] |
getSessionReference(String mandatorId,
String sessionId)
Gets the session references of the matching sessions
|
void |
handleEvent(org.osgi.service.event.Event event) |
void |
setBundleContext(org.osgi.framework.BundleContext bundleContext) |
void |
startUp()
The startup of the service
|
public void startUp()
throws IOException
IOExceptionpublic void handleEvent(org.osgi.service.event.Event event)
handleEvent in interface org.osgi.service.event.EventHandlerpublic Session createSession(String cert, String mandatorId, long timeout, String sessionId, Map<String,String> params) throws SessionException
SessionServicecreateSession in interface SessionServicecert - The string to authenticatemandatorId - The mandator of the sessiontimeout - The timeout of the sessionsessionId - The id of the session, if the sessionId is null a new id is created.params - The parameter of the session to be put to the service registry (not the session)SessionException - If the session can't be created.public org.osgi.framework.ServiceReference<?>[] getSessionReference(String mandatorId, String sessionId)
getSessionReference in interface SessionServicemandatorId - The id of the mandator (optional)sessionId - The id of the session (optional)public Session getSession(String cert, String mandatorId, String sessionId)
SessionServicegetSession in interface SessionServicecert - The string to authenticatemandatorId - The mandator of the sessionsessionId - The id of the sessionpublic boolean exists(String mandatorId, String sessionId)
SessionServiceReturns true if the session is available.
Note: If the sessionId is '0' the mandator id is not optional.
exists in interface SessionServicemandatorId - The id of the mandator (optional)sessionId - The id of the sessionpublic boolean destroy(String cert, String mandatorId, String sessionId)
SessionServicedestroy in interface SessionServicecert - The string to authenticatemandatorId - The mandator of the sessionsessionId - The id of the sessionpublic org.osgi.framework.BundleContext getBundleContext()
public void setBundleContext(org.osgi.framework.BundleContext bundleContext)
bundleContext - the bundleContext to setpublic static Session getSession(org.osgi.framework.BundleContext bundleContext, String cert, String mandatorId, String sessionId)
bundleContext - The bundle contextcert - The certificatemandatorId - The id of the mandatorsessionId - The id of the sessionCopyright © 2015. All rights reserved.