Customizing the Entitlement ID (EID)
Sentinel LDK-EMS uses a default EID format to uniquely identify an entitlement. The default format consists of 32 characters that are generated randomly. You can customize the EID according to your requirements. A customized EID must have a minimum of 6 characters.
To replace the default Sentinel LDK-EMS EID generator:
1.Create and compile a Java class that implements the com.sfnt.ems.services.EidGenerator interface. This interface has the following method:
public interface EidGenerator {
/**
* @return generated EID which is unique.
*/
public String generateID(Object[] args);
/**
* retrieves the new EID based on the state of the passed entitlement
* @param entitlement - the entitlement's state, represented as Map(name value pair)
* @return new EID - if it is null, or less than 6 characters long, Sentinel LDK-EMS will not
* overwrite the previous EID
*/
public String getNewEIDOnCommit(Map entitlement);
}
2.Package the custom EidGenerator Java file in the same way that %EMS_Home%\Plugins\samples\SampleEidGenerator.java file is packaged.
3.In the %EMS_Home%\Plugins\samples\SampleEidGenerator\EidGeneratorBuild.xml file, rename the .jar destination file name, for example, customEidGenerator.jar.
4.Run the Ant script using the ant -file EidGeneratorBuild.xml command. This generates a .jar file with the destination file name, for example, customEidGenerator.jar.
5.Place the customized file, for example, customEidGenerator.jar, in the %EMS_HOME%\EMSServer\webapps\ems\WEB-INF\lib folder.
6.Edit the %EMS_HOME%\EMSServer\webapps\ems\WEB-INF\ems-servlet.xml file, as follows:
Change:
<bean id="eidGenerator" class="com.sfnt.ems.service.EidGeneratorDefaultImpl"/>
To:
<bean id="eidGenerator" class="{fully qualified class name of custom implementation}"/>
7.Restart the Sentinel LDK-EMS Service.