Configuring SCP Using Unified API
Declare Variables/Constants
Declare Variables / Constants
String PKID1 = "";
String PKID1_VARIANT = "";
String PKID2 = "";
String PKID2_VARIANT = "";
String YPS_ADDRESS = "";
String FRIENDLY_NAME = "";
String CUSTOMER_ID = "";
Attribute attrProductKey1 = null;
Attribute attrProductKey2 = null;
Attribute attrCustomer = null;
Attribute attrConfig = null;
API Calls
To configure SCP using Unified API, execute the APIs in the specified sequential order only:
# | API Call Sequence | APIs |
---|---|---|
1 | Create multiple objects |
a. attrProductKey1= new Attribute(); b.attrProductKey2= new Attribute(); c.attrCustomer = new Attribute(); d.attrConfig = new Attribute(); |
2 | Enable Unified API to configure SCP |
a.attrConfig.set(LicensingConstants.SNTL_ATTR_CONFIG_SCP_USE_CONFIG_FILE, LicensingConstants.SNTL_ATTR_NO); NOTE SNTL_ATTR_CONFIG_SCP_USE_CONFIG_FILE is the key attribute that determines the SCP configuration setting. By default, this attribute is set to YES; specifying to configure SCP using the configuration file. If you wish to use the RMS API instead of the configuration file, modify the attribute value to NO. |
3 | Set YPS Address in configure object |
attrConfig.set(LicensingConstants.SNTL_ATTR_CONFIG_SCP_YPS_ADDRESS, YPS_ADDRESS); |
4 | Set Fingerprint friendly name in configure object |
attrConfig.set(LicensingConstants.SNTL_ATTR_CONFIG_SCP_FINGERPRINT_FRIENDLYNAME, FRIENDLY_NAME); |
5 | Set customer ID in customer object | attrCustomer.set(LicensingConstants.SNTL_ATTR_CONFIG_SCP_CUSTOMERID, CUSTOMER_ID); |
6 | Set attributes for Product object 1 |
a.attrProductKey1.set(LicensingConstants.SNTL_ATTR_CONFIG_SCP_PKID, PKID1); b.attrProductKey1.set(LicensingConstants.SNTL_ATTR_CONFIG_SCP_PRODUCT_VARIANT, PKID1_VARIANT); |
7 | Set attributes for Product object 2 |
a.attrProductKey2.set(LicensingConstants.SNTL_ATTR_CONFIG_SCP_PKID, PKID2); b.attrProductKey2.set(LicensingConstants.SNTL_ATTR_CONFIG_SCP_PRODUCT_VARIANT, PKID2_VARIANT); |
8 | Add the products object to the customer object |
a.attrCustomer.add_object(LicensingConstants.SNTL_ATTR_CONFIG_SCP_PRODUCT_KEY_LIST,attrProductKey1); b.attrCustomer.add_object(LicensingConstants.SNTL_ATTR_CONFIG_SCP_PRODUCT_KEY_LIST,attrProductKey2); |
9 | Add the customer object to the configure object | attrConfig.add_object(LicensingConstants.SNTL_ATTR_CONFIG_SCP_CUSTOMER_LIST,attrCustomer); |
10 | Pass this configure object to configure API | LicensingAPI.configure(attrConfig); |
NOTE The ApplicationContext creation and other licensing API should be implemented after the configure API. Also, it is mandatory to set customer, YPS address, and Fingerprint Friendly name fields to successfully configure SCP using Unified API.