Package io.objectbox.sync
Class SyncCredentialsToken
- java.lang.Object
-
- io.objectbox.sync.SyncCredentials
-
- io.objectbox.sync.SyncCredentialsToken
-
@Internal public final class SyncCredentialsToken extends SyncCredentials
Internal credentials implementation. UseSyncCredentialsto build credentials.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.objectbox.sync.SyncCredentials
SyncCredentials.CredentialsType
-
-
Constructor Summary
Constructors Constructor Description SyncCredentialsToken(SyncCredentials.CredentialsType type)SyncCredentialsToken(SyncCredentials.CredentialsType type, byte[] token)SyncCredentialsToken(SyncCredentials.CredentialsType type, java.lang.String token)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear after usage.(package private) SyncCredentialsTokencreateClone()Creates a copy of these credentials.byte[]getTokenBytes()-
Methods inherited from class io.objectbox.sync.SyncCredentials
getType, getTypeId, google, jwtAccessToken, jwtCustomToken, jwtIdToken, jwtRefreshToken, none, obxAdminUser, sharedSecret, sharedSecret, userAndPassword
-
-
-
-
Constructor Detail
-
SyncCredentialsToken
SyncCredentialsToken(SyncCredentials.CredentialsType type)
-
SyncCredentialsToken
SyncCredentialsToken(SyncCredentials.CredentialsType type, byte[] token)
-
SyncCredentialsToken
SyncCredentialsToken(SyncCredentials.CredentialsType type, java.lang.String token)
-
-
Method Detail
-
getTokenBytes
@Nullable public byte[] getTokenBytes()
-
clear
public void clear()
Clear after usage.Note that when the token is passed as a String, that String is removed from memory at the earliest with the next garbage collector run.
Also note that while the token is removed from the Java heap, it is present on the native heap of the Sync component using it.
-
createClone
SyncCredentialsToken createClone()
Description copied from class:SyncCredentialsCreates a copy of these credentials.This can be useful to use the same credentials when creating multiple clients or a server in combination with a client as some credentials may get cleared when building a client or server.
- Specified by:
createClonein classSyncCredentials
-
-