public final class GoogleSessionService extends java.lang.Object implements IGoogleSessionService
IGoogleSessionService
implementation.
TODO : Handle preference feature ?.Modifier and Type | Field and Description |
---|---|
private Session |
session
Current user session.
|
MESSAGE, TITLE
Constructor and Description |
---|
GoogleSessionService()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
java.util.Optional<com.google.api.client.http.HttpRequestFactory> |
createRequestFactory()
Creates and returns a
HttpRequestFactory using internal session. |
void |
login()
Uses OAuth mechanism to create a persistent Google account
session that will be used for interacting with google services.
|
void |
logout()
Destroy the current logged OAuth session.
|
private void |
setSession(Session session)
Session setter.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, requireLogin
private Session session
public GoogleSessionService()
private void setSession(Session session)
Session
Consumer
.session
- Session to be consumed.public void login() throws java.io.IOException, java.security.GeneralSecurityException
login
in interface IGoogleSessionService
java.io.IOException
- If any error occurs while creating session.java.security.GeneralSecurityException
- If any error occurs during the OAuth phase.public void logout()
logout
in interface IGoogleSessionService
public java.util.Optional<com.google.api.client.http.HttpRequestFactory> createRequestFactory()
HttpRequestFactory
using internal session.createRequestFactory
in interface IGoogleSessionService