public class ESignLive extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ESignLive.TransactionsOverviewListener
Interface providing feedback about transactions overview (Only for the last 30 days).
|
static interface |
ESignLive.UpdatePasswordListener
Interface providing feedback after change password request is made.
|
static interface |
ESignLive.UpdateUserInfoListener
Interface providing feedback about updating user details.
|
Modifier and Type | Field and Description |
---|---|
static String |
ON_SDK_EXIT_NOTIFICATION |
Modifier and Type | Method and Description |
---|---|
void |
clearAllTransactionsFromCache()
eSignLive SDK keeps a secure cache of Transactions locally on the device.
|
void |
clearListOfGroups()
Clears list of groups downloaded for the current user
|
void |
clearTemplateFromCache(String templateId)
Deletes a locally downloaded Template.
|
void |
clearTransactionFromCache(String transactionId)
eSignLive SDK keeps a secure cache of Transactions locally.
|
void |
createNewTransactionUsingSdkUserInterface()
Starts the process of creating a new transaction using the pre-built user interface implemented in the SDK.
|
void |
deleteTransaction(String transactionId,
boolean permanently)
Delete or Trash transaction.
|
void |
deleteTransaction(String transactionId,
boolean permanently,
String displayTransactionName)
Delete or Trash transaction.
|
void |
downloadTemplateWithId(String templateId,
TemplateDownloadListener listener)
Downloads a template for offline use.
|
void |
downloadTransactionWithId(String transactionId,
DownloadTransactionListener listener)
Prefetch a Transaction before the start of e-Sign Ceremony.
|
CreateTransactionAddDocumentListener |
getAddDocumentListener()
Returns the Listener for addDocument related events
|
void |
getAllGroupsForCurrentUser(Runnable callback)
Downloads all groups related to current user's account.
|
static Context |
getApplicationContext() |
Transaction |
getCachedTransactionInfo(String transactionId)
Returns the cached Transaction object from class
com.esignlive.sdk.datamodel.manage.Transaction ,
that contains information about the transaction with provided id. |
User |
getCachedUserInfo()
UserData contains account information of the logged-in user.
|
CreateTransactionViewModel.CreateTransactionListener |
getCreateTransactionListener()
ESignLiveListener provides certain events regarding sending transactions and signing ceremony.
|
String |
getEncryptionKey() |
static ESignLive |
getInstance()
Instantiates and returns a reference to singleton ESignLive
|
ESignLiveListener |
getListener()
ESignLiveListener contains information about sending transactions and signing ceremony events
returns a reference to the listener set on SDK
|
String |
getServerAddress() |
void |
getTemplateList(Template.TemplateFilter templateFilter,
int startIndex,
int numberOfTemplates,
TemplateListListener listener)
Method to get the template list for certain type.
|
void |
getTransactionList(Transaction.TransactionFilter transactionFilter,
int startIndex,
int numberOfTransactions,
TransactionListListener listener)
Gets the transaction list for a certain type.
|
String |
getVersion() |
boolean |
isAutoSync()
Set it to true to sync transactions with server automatically, as soon as internet connection is established.
|
boolean |
isEmailFormatValid(String emailFormat)
This is only a mechanism where End-Dev can see what email formats are considered valid by eSignLive
|
boolean |
isSyncOnWifiOnly()
set it to true to sync transactions with server, only on wifi network.
|
boolean |
isTransactionPreFetched(String transactionId)
Checks if the transaction is cached locally
|
void |
login(String sessionToken,
AuthenticationListener listener)
Logs you into the SDK with eSignLive session token - this is useful for applications using external SSO login or any other way of authentication.
|
void |
login(String email,
String password,
AuthenticationListener listener)
Logs you into the SDK with cloud credentials.
|
void |
logout()
Logs the current user out of the SDK.
|
void |
refreshTransactionWithId(String transactionId,
DownloadTransactionListener listener)
Clears the local content of the Transaction and fetches it again from server
|
void |
reloadUserData(UserInfoListener listener)
UserData contains account information of the logged-in user.
|
void |
setAddDocumentListener(CreateTransactionAddDocumentListener addDocumentListener)
Sets the Listener for addDocument related events
|
void |
setAutoSync(boolean autoSync)
Set to true to sync transactions with server automatically, as soon as internet connection is established.
|
static void |
setContextProvider(ESignLiveContextProvider contextProvider)
ESignLiveContextProvider provides a reference to the Application using the SDK.
|
static void |
setCreateTransactionListener(CreateTransactionViewModel.CreateTransactionListener listener)
CreateTransactionListener provides certain events regarding transaction creation.
|
void |
setEncryptionKey(String encryptionKey)
The SDK allows offline e-Sign ceremony ability so locally caches the documents,data and the evidences into a secure store
The Data/documents/evidences are Encrypted/Decrypted with a combination of encryptionKey, Internal SALT and a SECRET stored in secure Keycahin
Can be nil but for better security always provide some value
warning : Its the responsibility of end-developer of this SDK to cache/protect this encryption key
|
void |
setListener(ESignLiveListener listener)
ESignLiveListener provides certain events regarding sending transactions and signing ceremony.
|
void |
setRootActivityProvider(ESignLiveRootActivityProvider rootActivityProvider)
sets a listener to provide the SDK with a reference to Apps activity.
|
void |
setServerAddress(String serverAddress)
Defines the Server Address to perform SDK operations.
|
void |
setSyncOnWifiOnly(boolean syncWifiOnly)
Set to true to sync transactions with server only on wifi network.
|
void |
signup(String firstName,
String lastName,
String email,
String password,
SignUpListener listener)
Signs up for a free account and logs you in automatically after the signup finishes with success.
|
void |
startTransactionWithId(String transactionId,
boolean skipCreationActivity)
Starts the process of Launching a Transaction within the SDK.
|
void |
transactionsActivityOverview(ESignLive.TransactionsOverviewListener listener)
Requests information about the transactions activity overview.
|
void |
updateCurrentUserInfo(User user,
ESignLive.UpdateUserInfoListener listener)
Updates the current user's data on eSignLive server and gives the result to the listener implemented.
|
void |
updatePassword(String currentPassword,
String newPassword,
ESignLive.UpdatePasswordListener listener)
Updates the current user's password on eSignLive server and gives the result to the listener implemented.
|
public static final String ON_SDK_EXIT_NOTIFICATION
@Nullable public ESignLiveListener getListener()
public void setListener(@NonNull ESignLiveListener listener)
listener
- An object implementing ESignLiveListener as listener of the SDK to receive events.@Nullable public CreateTransactionViewModel.CreateTransactionListener getCreateTransactionListener()
public static void setCreateTransactionListener(@NonNull CreateTransactionViewModel.CreateTransactionListener listener)
listener
- An object implementing CreateTransactionListener.public static void setContextProvider(@NonNull ESignLiveContextProvider contextProvider)
contextProvider
- The Application subclass implementing ESignLiveContextProvider to provide a reference to the SDK.public void setAddDocumentListener(@NonNull CreateTransactionAddDocumentListener addDocumentListener)
public void setRootActivityProvider(@Nullable ESignLiveRootActivityProvider rootActivityProvider)
public static ESignLive getInstance()
public String getVersion()
public boolean isAutoSync()
public boolean isSyncOnWifiOnly()
public void setAutoSync(boolean autoSync)
public void setSyncOnWifiOnly(boolean syncWifiOnly)
public String getServerAddress()
public void setServerAddress(@NonNull String serverAddress)
serverAddress
- Server Address can be of Type public void setEncryptionKey(@NonNull String encryptionKey)
public String getEncryptionKey()
public static Context getApplicationContext()
public void signup(@NonNull String firstName, @NonNull String lastName, @NonNull String email, @NonNull String password, SignUpListener listener)
ESignLive.getInstance().setServerAddress("SERVER_ADDRESS_GOES_HERE");
firstName
- first name is required and can not be null or empty.lastName
- last name is required and can not be null or empty.email
- email is required and can not be null or empty.
It is developer's responsibility to validate the email format.password
- email is required and can not be null or empty.listener
- listener gets notified with callback events.public void login(@NonNull String email, @NonNull String password, @Nullable AuthenticationListener listener)
logout()
should always be called before performing login for a different user.email
- email is required and can not be null or empty.password
- password is required and can not be null or empty.listener
- listener will be notified with the callback eventspublic void login(@NonNull String sessionToken, @Nullable AuthenticationListener listener)
sessionToken
- sessionToken is required and can not be null or empty.listener
- listener provides with the callback events.public void logout()
public void reloadUserData(@Nullable UserInfoListener listener)
@Nullable public User getCachedUserInfo()
reloadUserData(UserInfoListener listener)
public void updatePassword(String currentPassword, String newPassword, ESignLive.UpdatePasswordListener listener)
currentPassword
- current password for the accountnewPassword
- the new passwordlistener
- UpdatePasswordListener gives feedback for success or failurepublic void updateCurrentUserInfo(User user, ESignLive.UpdateUserInfoListener listener)
user
- the current user.listener
- Callback listener that has to be implemented in order to get the feedback from the server.public void clearListOfGroups()
public void getAllGroupsForCurrentUser(Runnable callback)
Group.getUserGroups()
after the completion callback being called.callback
- will get called once downloading list of groups is completed.public void downloadTransactionWithId(String transactionId, @Nullable DownloadTransactionListener listener)
transactionId
- Required - transactionId is the unique identifier of the transaction.listener
- in case of success an object containing information about the fetched transaction will be returned.
in case of failure an Error object will be returned.public void getTransactionList(Transaction.TransactionFilter transactionFilter, int startIndex, int numberOfTransactions, @Nullable TransactionListListener listener)
transactionFilter
- Required - the type of the transactions.startIndex
- Required - the starting index of the transactions.numberOfTransactions
- Required - the number of the requested transactions - together with startIndex it could be used to implement paging of the transaction requests.listener
- in case of success a list of Transactions will be returned to the listener, otherwise an error object will be returned.public void createNewTransactionUsingSdkUserInterface()
public void startTransactionWithId(String transactionId, boolean skipCreationActivity)
transactionId
- Unique identifier of the Transaction to be started.skipCreationActivity
- Set true to skip the creation activity.public void clearAllTransactionsFromCache()
public void clearTransactionFromCache(String transactionId)
transactionId
- Unique identifier of the Transactions to be removed from the device.
Warning :: Data not synchronized with the server would be lost.
Warning :: Calling this method would exit the SDK.
This does not delete the Transaction on the server.public void deleteTransaction(String transactionId, boolean permanently)
transactionId
- Unique identifier of the Transactions to be removed from the device.permanently
- if that flag is set to true the transaction will be removed permanently
from the server and the device.
if it is set to false, the transaction will be moved to the trash.
Warning : If permanently is set to true, the transaction can't be restored.public void deleteTransaction(String transactionId, boolean permanently, String displayTransactionName)
transactionId
- Unique identifier of the Transactions to be removed from the devicepermanently
- if that flag is set to true the transaction will be removed permanently
from the server and the device.
if it is set to false, the transaction will be moved to the trash.displayTransactionName
- display name that would appear on sync queue
Warning : If permanently is set to true, the transaction can't be restoredpublic boolean isTransactionPreFetched(String transactionId)
transactionId
- Unique identifier of the Transactionspublic void refreshTransactionWithId(String transactionId, DownloadTransactionListener listener)
transactionId
- Unique identifier of the Transactions to be refreshedlistener
- provides the callback events
Warning : Data not synchronized with the server would be lost@Nullable public CreateTransactionAddDocumentListener getAddDocumentListener()
public void transactionsActivityOverview(ESignLive.TransactionsOverviewListener listener)
listener
- TransactionsOverviewListener interface that has to be implemented, by the developer,
in order to receive the callback information from the server.@Nullable public Transaction getCachedTransactionInfo(String transactionId)
com.esignlive.sdk.datamodel.manage.Transaction
,
that contains information about the transaction with provided id.transactionId
- transaction Identifierpublic void getTemplateList(Template.TemplateFilter templateFilter, int startIndex, int numberOfTemplates, @Nullable TemplateListListener listener)
templateFilter
- Required - the type of the template.startIndex
- Required - the starting index of the templates.numberOfTemplates
- Required - the number of the requested templates - together with startIndex it could be used to implement paging of the templates requests.listener
- in case of success an ArrayList of objects containing information about the fetched templates will be returned.public void clearTemplateFromCache(String templateId)
templateId
- Unique identifier of the Template to be removed from the device.
Warning : Data not synchronized with the server would be lost.
Warning : Calling this method would exit the SDK.
This does not delete the Template on the server.public void downloadTemplateWithId(String templateId, TemplateDownloadListener listener)
templateId
- Unique identifier of the Template to be downloaded.listener
- listener to receive success or failure results.public boolean isEmailFormatValid(String emailFormat)