Generating Locking Code Using fingerprintInfo and lockCodeInfo

Additional Prerequisites

In addition to the prerequisites listed here, the FingerPrint Output XML(FingerPrint_XML, the output of get_info query “fingerprintInfo”) is also required when a user wants to generate the locking code for a remote system.

Generating Fingerprints

Declare Variables/Constants

String LOCK_SELECTOR = "0x04";
Attribute attrAppContext = null;
ApplicationContext appContext = null;
String fingerprintQuery = "<sentinelQuery query=\"fingerprintInfo\" version=\"1.1\">"+
                              "<rawValue>Yes</rawValue>"+
                          "</sentinelQuery>";
String fingerprintScope = "<sentinelScope >"+
                              "<lockSelector >”+ LOCK_SELECTOR +”</lockSelector >"+
                          "</sentinelScope >";

API Calls

To obtain fingerprint information, execute the APIs in the specified sequential order only:

>attrAppContext = new Attribute();

>appContext = new ApplicationContext(attrAppContext);

>String fingerprintInfo = appContext.getInfo(fingerprintScope, fingerprintQuery);

If the appContext.getInfo call is successful, then fingerprintInfo String contains an XML-based output having the detailed information of fingerPrint for the lock selector specified in the scope.

Generating LockCode

Declare Variables/Constants

String LOCK_SELECTOR = "0x04";
Attribute attrAppContext = null;
ApplicationContext appContext = null;

/*Generating Lock Code using local system FingerPrint*/

String pcLockCodeQuery1 = "<sentinelQuery query=\"lockCodeInfo\" version=\"1.0\"/>";
String pcLockCodeScope1 = "<sentinelScope>"+
			       "<lockSelector>"+LOCK_SELECTOR+"</lockSelector>"+
			   "</sentinelScope>"; 

/*Generating Lock Code using remote system FingerPrint*/

String pcLockCodeQuery2 = "<sentinelQuery query=\"lockCodeInfo\" version=\"1.0\"/>";
String  pcLockCodeScope2 = "<sentinelScope>"+
			        "<lockSelector>"+LOCK_SELECTOR+"</lockSelector>"+
                               /* fingerPrint element of FingerPrint_XML (output of get_info query fingerprintInfo”) */
                               "<fingerprint type=\"SentinelRMS\" version=\"1.1\" checksum=\"DA6A103462D10694\">"+
                                     "<criteria>"+
                                         "<name>Disk ID</name>"+
                                         "<selector>0x4</selector>"+
                                         "<hash>99E8F6FF9C193B11</hash>"+
                                         "<item>"+
                                              "<rawValue>0x5060CD50</rawValue>"+
                                              "<hashValue>99E8F6FF9C193B11</hashValue>"+
                                         "</item>"+
                                     "</criteria>"+
                               "</fingerprint>"+
                          "</sentinelScope>";

API Calls

Use the following API calls in your application to get the fingerprint:

>attrAppContext = new Attribute();

>appContext = new ApplicationContext(attrAppContext);

/*To get Lock Code using the system fingerPrint*/

>String lockCodeInfo = appContext.getInfo(pcLockCodeScope1, pcLockCodeQuery1) ;

/* To get Lock Code using remote system FingerPrint */

>String lockCodeInfo = appContext.getInfo(pcLockCodeScope2, pcLockCodeQuery2) ;

If the appContext.getInfo call is successful, then lockCodeInfo String contains an XML-based output having the detailed information of lock code.

Notes

>While generating fingerprint, set the “rawValue” element in the Scope of “fingerprintInfo” query version 1.1.

>The “lockSelector” in the “fingerprintInfo” query is optional. If it is not set, then fingerprint Info of all criteria will be fetched.

>If the given locking criteria of a system contains multiple fingerprints, the first value is used for generating the locking code.