Implementing Cancel Lease, Resume Lease, and Force Sync

Cancel Lease

Declare Variables/Constants

Attribute attrAppContext = null;
ApplicationContext appContext = null; 
String CONTACT_SERVER = "no-net";
String transferActionCancelLease = "<sync />";

API Calls

To cancel lease, execute the APIs in the specified sequential order only:

attrAppContext = new Attribute();
attrAppContext.set(LicensingConstants.SNTL_ATTR_APPCONTEXT_CONTACT_SERVER, CONTACT_SERVER);
appContext = new ApplicationContext(attrAppContext);
appContext.transfer(transferActionCancelLease, null, null, null);

Resume Lease

Declare Variables/Constants

Attribute attrAppContext = null;
ApplicationContext appContext = null; 
String CONTACT_SERVER = "no-net";
String transferActionResumeLease = "<resumeLease />";

API Calls

To resume lease, execute the APIs in the specified sequential order only:

attrAppContext = new Attribute();
attrAppContext.set(LicensingConstants.SNTL_ATTR_APPCONTEXT_CONTACT_SERVER, CONTACT_SERVER);
appContext = new ApplicationContext(attrAppContext);
appContext.transfer(transferActionResumeLease, null, null, null);

Force Sync Lease

Declare Variables/Constants

Attribute attrAppContext = null;
ApplicationContext appContext = null; 
String CONTACT_SERVER = "no-net";
String transferActionSync = "<sync />";

API Calls

To enforce sync lease, execute the APIs in the specified sequential order only:

attrAppContext = new Attribute();
attrAppContext.set(LicensingConstants.SNTL_ATTR_APPCONTEXT_CONTACT_SERVER, CONTACT_SERVER);
appContext = new ApplicationContext(attrAppContext);
appContext.transfer(transferActionSync, null, null, null);