public class APISession extends Object implements ISessionCallbacks
Constructor and Description |
---|
APISession(String serverUrl)
APISession constructor
|
APISession(String serverUrl,
String subDomain)
APISession constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addApiSessionEventListener(IAPISessionEvent listener)
addApiSessionEventListener helper method for IAPISessionEvent classes to register themselves
|
void |
caughtSocketException(SocketException socketException)
caughtSocketException
|
boolean |
connected()
connected
|
NetworkConnectionManager |
connection()
connection
|
void |
endSession()
EndSession Clear the SessionID value and stop the renewal timer
|
void |
establishedConnectionToTheInternet()
establishedConnectionToTheInternet
|
long |
expiryTimeInSeconds()
expiryTimeInSeconds
|
String |
getAccessToken()
getAccessToken
|
String |
getActiveEmail()
getActiveEmail
|
Authentication |
getAuthenticationResource()
getAuthenticationResource retrieves an instance of an Authentication resource
|
NetworkConnectionManager |
getConnection()
getConnection
|
DownloadManager |
getDownloadManager()
get a new DownloadManager instance.
|
String |
getEmailFromSessionId(String id)
getEmailFromSessionId
|
Files |
getFilesResource()
getFilesResource retrieves an instance of an Files resource
|
boolean |
getGlobalDownloadPermission()
getGlobalDownloadPermission
|
IManageWorkspaces |
getIManageWorkspacesResource()
getIManageWorkspacesResource retrieves an instance of
IManageWorkspaces resource
|
boolean |
getIsUploading()
getIsUploading if there is a file being uploaded right now in a thread safe manner
|
Date |
getLastSignInTime()
getLastSignInTime
|
Notifications |
getNotificationsResource()
getNotificationsResource retrieves an instance of an Notifications resource
|
OneDriveManagement |
getOneDriveManagementResource()
getOneDriveManagementResource retrieves an instance of an OneDriveManagement resource
|
Organizations |
getOrganizationsResource()
getOrganizationsResource retrieves an instance of an Organizations resource
|
Calendar[] |
getServerTime()
getServerTime
|
String |
getServiceAccountToken(String userEmail,
String issuer,
int expiresInMinutes,
PrivateKey privateKey,
String encryptionAlgorithm)
getServiceAccountToken A helper method for formulating an authorization token when using Service Accounts for
user authentication.
|
String |
getSessionID()
getSessionID
|
Sessions |
getSessionsResource()
getSessionsResource retrieves an instance of an Sessions resource
|
SharePoint |
getSharePointResource()
getSharePointResource retrieves an instance of an SharePoint resource
|
Enums.SignInType |
getSignInMethods(String email)
getSignInMethods
|
String[] |
getSupportedFileTypes()
getSupportedFileTypes
|
SystemProperties |
getSystemPropertiesResource()
getSystemPropertiesResource retrieves an instance of SystemProperties resource
|
TransientWorkspaces |
getTransientWorkspacesResource()
getTransientWorkspacesResource retrieves an instance of TransientWorkspaces resource
|
UploadManager |
getUploadManager()
get a new UploadManager instance.
|
Users |
getUsersResource()
getUsersResource retrieves an instance of a Users resource
|
Workspaces |
getWorkspacesResource()
getWorkspacesResource retrieves an instance of a Workspaces resource
|
boolean |
isServiceAccount()
isServiceAccount
|
Date |
lastUserPlansRefreshTime()
lastUserPlansRefreshTime
|
ItemListJson<WorkspaceInfoJson> |
listAvailableVDRs(List<String> roomTypes)
listAvailableVDRs helper method to return list of Workspaces info for specific roomTypes.
|
Enums.LoginResult |
loadExistingSession(String sessionId)
loadExistingSession having obtained an authentication token from the other module, it would then passed to the loadExistingSession method.
|
Enums.LoginResult |
loadExistingSession(String sessionId,
boolean useServerCertificateValidationCallback,
boolean loadUserData)
loadExistingSession having obtained an authentication token from the other module, it would then passed to the loadExistingSession method.
|
boolean |
logOff()
logOff
|
void |
lostConnectionToTheInternet()
lostConnectionToTheInternet helper to inform whether connection lost to the Internet.
|
String |
refreshToken()
refreshToken
|
void |
reportProxyAuthenticationRequired()
reportProxyAuthenticationRequired
|
long |
SentBytes()
SentBytes
|
Enums.RestartStatus |
sessionIdExpired(String oldSid)
sessionIdExpired
|
void |
setActiveEmail(String activeEmail)
setActiveEmail
|
void |
setConnection(NetworkConnectionManager m_Connection)
setConnection
|
void |
setGlobalDownloadPermission(boolean GlobalDownloadPermission)
setGlobalDownloadPermission
|
void |
setIsUploading(boolean m_IsUploading)
setIsUploading
|
void |
setNetworkBandwidthLimit(int download,
int upload)
setNetworkBandwidthLimit
|
void |
setServerTime(Calendar serverTime)
setServerTime sets server time.
|
void |
setSessionID(String m_SessionID)
setSessionID
|
SignInManager |
signInManager()
signInManager
|
Enums.LoginResult |
startSessionWithOAuth(String email,
String refreshToken,
boolean showUiIfRefreshFails)
startSessionWithOAuth is a way to authenticate users using OAuth.
|
Enums.LoginResult |
startSessionWithServiceAccount(String userEmail,
String issuer,
int expiresInMinutes,
PrivateKey privateKey,
String encryptionAlgorithm)
startSessionWithServiceAccount is a way to authenticate users using ServiceAccount.
|
int |
SyncDownloadLimit()
SyncDownloadLimit
|
int |
syncUploadLimit()
syncUploadLimit
|
boolean |
testConnection()
testConnection helper method to test the connection to the Internet.
|
void |
updateBytesSent(long bytes)
updateBytesSent
|
void |
updateUploadSpeed(float speed)
updateUploadSpeed
|
float |
uploadSpeed()
uploadSpeed
|
User |
userPlan()
userPlan
|
void |
waitForRenewal()
waitForRenewal Waits for renewal
|
public APISession(String serverUrl)
serverUrl
- public NetworkConnectionManager getConnection()
public void setConnection(NetworkConnectionManager m_Connection)
m_Connection
- public String getSessionID()
public void setSessionID(String m_SessionID)
m_SessionID
- public Date getLastSignInTime()
public boolean connected()
public String getActiveEmail()
public void setActiveEmail(String activeEmail)
activeEmail
- public NetworkConnectionManager connection()
public SignInManager signInManager()
public boolean getGlobalDownloadPermission()
public void setGlobalDownloadPermission(boolean GlobalDownloadPermission)
GlobalDownloadPermission
- public boolean getIsUploading()
public void setIsUploading(boolean m_IsUploading)
m_IsUploading
- public User userPlan()
public long SentBytes()
public float uploadSpeed()
public Date lastUserPlansRefreshTime()
@Nullable public int syncUploadLimit()
@Nullable public int SyncDownloadLimit()
public Enums.LoginResult startSessionWithServiceAccount(String userEmail, String issuer, int expiresInMinutes, PrivateKey privateKey, String encryptionAlgorithm)
userEmail
- the user email associated to login.issuer
- service account id associated with the account (e.g. com.watchdox.system.1f32.2)expiresInMinutes
- minutes to expire.privateKey
- the private key from the certificate.encryptionAlgorithm
- algorithm that was used to create the certificate.(RSA/DSA/SHA256withRSA)Login successful;other wise one of login results
,
Enums.LoginResult
public Enums.LoginResult startSessionWithOAuth(String email, String refreshToken, boolean showUiIfRefreshFails)
email
- the user email associated to login.refreshToken
- refresh token if available or null.showUiIfRefreshFails
- if true the login page pop ups when the refresh fails.Enums.LoginResult
public void endSession()
public boolean logOff()
public Enums.LoginResult loadExistingSession(String sessionId)
sessionId
- existing authentication token.Enums.LoginResult
public Enums.LoginResult loadExistingSession(String sessionId, boolean useServerCertificateValidationCallback, boolean loadUserData)
sessionId
- existing authentication token.useServerCertificateValidationCallback
- loadUserData
- true if to load user data.Enums.LoginResult
public boolean testConnection()
public ItemListJson<WorkspaceInfoJson> listAvailableVDRs(@Nullable List<String> roomTypes)
roomTypes
- list of room typespublic Calendar[] getServerTime()
public Authentication getAuthenticationResource()
public Files getFilesResource()
public Notifications getNotificationsResource()
public OneDriveManagement getOneDriveManagementResource()
public Organizations getOrganizationsResource()
public Sessions getSessionsResource()
public SharePoint getSharePointResource()
public Enums.SignInType getSignInMethods(String email)
email
- public SystemProperties getSystemPropertiesResource()
public TransientWorkspaces getTransientWorkspacesResource()
public IManageWorkspaces getIManageWorkspacesResource()
public Users getUsersResource()
public Workspaces getWorkspacesResource()
public UploadManager getUploadManager()
public DownloadManager getDownloadManager()
public void setNetworkBandwidthLimit(@Nullable int download, @Nullable int upload)
download
- Sync download user limitupload
- Sync upload user limitpublic String getEmailFromSessionId(String id)
id
- public String refreshToken()
public long expiryTimeInSeconds()
public String[] getSupportedFileTypes()
public boolean isServiceAccount()
public String getServiceAccountToken(String userEmail, String issuer, int expiresInMinutes, PrivateKey privateKey, String encryptionAlgorithm)
userEmail
- the user email associated to login.issuer
- service account id associated with the account (e.g. com.watchdox.system.1f32.2)expiresInMinutes
- minutes to expire.privateKey
- the private key from the certificate.encryptionAlgorithm
- algorithm that was used to create the certificate.(RSA/DSA/SHA256withRSA)public void addApiSessionEventListener(IAPISessionEvent listener)
listener
- public void updateUploadSpeed(float speed)
updateUploadSpeed
in interface ISessionCallbacks
speed
- public void updateBytesSent(long bytes)
updateBytesSent
in interface ISessionCallbacks
bytes
- public Enums.RestartStatus sessionIdExpired(String oldSid)
sessionIdExpired
in interface ISessionCallbacks
oldSid
- existing session ID.public void lostConnectionToTheInternet()
lostConnectionToTheInternet
in interface ISessionCallbacks
public void reportProxyAuthenticationRequired()
ISessionCallbacks
reportProxyAuthenticationRequired
in interface ISessionCallbacks
public void setServerTime(Calendar serverTime)
setServerTime
in interface ISessionCallbacks
serverTime
- public void waitForRenewal()
waitForRenewal
in interface ISessionCallbacks
public String getAccessToken()
getAccessToken
in interface ISessionCallbacks
public void caughtSocketException(SocketException socketException)
ISessionCallbacks
caughtSocketException
in interface ISessionCallbacks
socketException
- SocketExceptionpublic void establishedConnectionToTheInternet()
ISessionCallbacks
establishedConnectionToTheInternet
in interface ISessionCallbacks
Copyright © 2019. All rights reserved.