Package io.objectbox.sync
Class SyncCredentialsToken
java.lang.Object
io.objectbox.sync.SyncCredentials
io.objectbox.sync.SyncCredentialsToken
Internal credentials implementation. Use
SyncCredentials to build credentials.-
Nested Class Summary
Nested classes/interfaces inherited from class io.objectbox.sync.SyncCredentials
SyncCredentials.CredentialsType -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSyncCredentialsToken(SyncCredentials.CredentialsType type, byte[] token) SyncCredentialsToken(SyncCredentials.CredentialsType type, String token) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear after usage.(package private) SyncCredentialsTokenCreates a copy of these credentials.byte[]Methods inherited from class io.objectbox.sync.SyncCredentials
getType, getTypeId, google, jwtAccessToken, jwtCustomToken, jwtIdToken, jwtRefreshToken, none, obxAdminUser, sharedSecret, sharedSecret, userAndPassword
-
Field Details
-
token
@Nullable private byte[] token -
cleared
private volatile boolean cleared
-
-
Constructor Details
-
SyncCredentialsToken
SyncCredentialsToken(SyncCredentials.CredentialsType type) -
SyncCredentialsToken
SyncCredentialsToken(SyncCredentials.CredentialsType type, byte[] token) -
SyncCredentialsToken
SyncCredentialsToken(SyncCredentials.CredentialsType type, String token)
-
-
Method Details
-
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
-