現在のバージョンの Sentinel EMS はデフォルトのライセンスジェネレータとして Sentinel RMS をサポートしています。ただし、別のライセンスジェネレータをプラグインとして追加することもできます。その場合、アプリケーションバイナリに変更を加える必要はありません。
自社製/サードパーティのライセンスジェネレータは、Java コードから呼び出し可能な API を備えていれば、Sentinel EMS に組み込むことができます。API としてC、C++、C#、VB その他のプログラミング言語がサポートされています。
SafeNet プロフェッショナルサービスは、カスタムライセンスジェネレータを EMS に安全にプラグインするための支援サービスを提供しています。
EMSデータベースにライセンスジェネレータ名、属性、ライセンスモデルなどを入力する必要があります。ここに記載された手順に従ってライセンスジェネレータのシードスクリプトを作成して実行し、EMSデータベースを更新してください。シードスクリプトには以下に記載されているオペレーションを含める必要があります。
シードスクリプトのサンプルは、 <EMS_Install_Dir>\samples\DEMOLicenseGenerator ディレクトリにあります。
Insert into dbo.T_ENF
(ENFName, Ver, Descr, IsEnabled, IsDeployed, VendorString1, VendorString2, EnfLicLevel, EnfGroupId, ENFCode)
Values ('DEMO Lic Gen', '1.0', 'DEMO License Generator 1.0', 1,1,NULL,NULL,1,2, 'DEMO')
INSERT INTO T_ENF (ENFId, ENFName, Ver, Descr, IsEnabled, IsDeployed, VendorString1, VendorString2, EnfLicLevel, EnfGroupId, ENFCode ) VALUES (v_ENFId, 'DEMO License Generator', '1.0', 'DEMO License Generator 1.0 License Enforcement', 1, 1, NULL, NULL, 1, 2, 'DEMO' );
エンフォースメント名(ENFName)、バージョン(Ver)、エンフォースメントコード(ENFCode)などを指定します。ここで指定する ENFCode はライセンスジェネレータのインプリメンテーションで使用されます。以下の手順の中に記載されているサンプルは、接頭辞 DEMO を使用してエンタイトルメント/アクティベーション固有のページ用の独自の JSP を作成する方法を示しています。
エンフォースメントのための新しいライセンスモデル定義をデータベースに追加する前に、グループとサブグループを作成する必要があります。ライセンスモデルはライセンス属性で構成されます。ライセンス属性をグループやサブグループに含めることができます。たとえば、「License End Date」や「Number of Days」などの属性を「Time」というグループに含めることができます。
/* Groups */ DECLARE @GroupId INT Insert into T_ENF_LM_GROUPS(ENFId, GroupName, ShowToEndUser) Values(@ENFId, 'Time',0) SET @GroupId = @@IDENTITY Insert into T_ENF_LM_GROUPS(ENFId, GroupName, ShowToEndUser) Values(@ENFId, 'Policy',0) Insert into T_ENF_LM_GROUPS(ENFId, GroupName, ShowToEndUser) Values(@ENFId, 'Limit',0) Insert into T_ENF_LM_GROUPS(ENFId, GroupName, ShowToEndUser) Values(@ENFId, 'Locking',0)
v_GroupId := ENF_LM_GROUPS_SQ.nextVal; INSERT INTO T_ENF_LM_GROUPS (ENFLMGroupId, ENFId, GroupName, ShowToEndUser ) VALUES (v_GroupId, v_ENFId, 'Time', 0 ); v_GroupId := ENF_LM_GROUPS_SQ.nextVal; INSERT INTO T_ENF_LM_GROUPS (ENFLMGroupId, ENFId, GroupName, ShowToEndUser ) VALUES (v_GroupId, v_ENFId, 'Policy', 0 ); v_GroupId := ENF_LM_GROUPS_SQ.nextVal; INSERT INTO T_ENF_LM_GROUPS (ENFLMGroupId, ENFId, GroupName, ShowToEndUser ) VALUES (v_GroupId, v_ENFId, 'Limit', 0 ); v_GroupId := ENF_LM_GROUPS_SQ.nextVal; INSERT INTO T_ENF_LM_GROUPS (ENFLMGroupId, ENFId, GroupName, ShowToEndUser ) VALUES (v_GroupId, v_ENFId, 'Locking', 0 );
DECLARE @SubGroupId INT Insert into T_ENF_LM_SUBGROUPS(ENFLMGroupId, SubGroupName) Values(@GroupId, 'Sub Time') SET @SubGroupId = @@IDENTITY Insert into T_ENF_LM_SUBGROUPS(ENFLMGroupId, SubGroupName) Values(@GroupId + 1, 'Sub Policy') Insert into T_ENF_LM_SUBGROUPS(ENFLMGroupId, SubGroupName) Values(@GroupId + 2, 'Sub Limit') Insert into T_ENF_LM_SUBGROUPS(ENFLMGroupId, SubGroupName) Values(@GroupId + 3, 'Sub Locking')
v_SubGroupId := ENF_LM_SUBGROUPS_SQ.nextVal; INSERT INTO T_ENF_LM_SUBGROUPS (SubGroupId, ENFLMGroupId, SubGroupName ) VALUES (v_SubGroupId, v_GroupId - 3, 'Sub Time' ); v_SubGroupId := ENF_LM_SUBGROUPS_SQ.nextVal; INSERT INTO T_ENF_LM_SUBGROUPS (SubGroupId, ENFLMGroupId, SubGroupName ) VALUES (v_SubGroupId, v_GroupId - 2, 'Sub Policy' ); v_SubGroupId := ENF_LM_SUBGROUPS_SQ.nextVal; INSERT INTO T_ENF_LM_SUBGROUPS (SubGroupId, ENFLMGroupId, SubGroupName ) VALUES (v_SubGroupId, v_GroupId - 1, 'Sub Limit' ); v_SubGroupId := ENF_LM_SUBGROUPS_SQ.nextVal; INSERT INTO T_ENF_LM_SUBGROUPS (SubGroupId, ENFLMGroupId, SubGroupName ) VALUES (v_SubGroupId, v_GroupId , 'Sub Locking' );
Insert into dbo.T_ENF_LM_GROUP_ATTR_MASTER(EnfLMGroupId, AttrName, DataType, IsEnabled, SubGroupId, DisplayOrder) Values(@GroupId, 'Expiry Date', 5, 1, null, 1) Insert into dbo.T_ENF_LM_GROUP_ATTR_MASTER(EnfLMGroupId, AttrName, DataType, IsEnabled, SubGroupId, DisplayOrder) Values(@GroupId, 'Number of Days', 3, 1, null, 2) ............. .............
v_AttrId := ENF_LM_GROUP_ATTR_MASTER_SQ.nextVal; INSERT INTO T_ENF_LM_GROUP_ATTR_MASTER (AttrId, EnfLMGroupId, AttrName, DataType, IsEnabled, SubGroupId, DisplayOrder ) VALUES (v_AttrId, v_GroupId - 3, 'Expiry Date', 5, 1, NULL, 1 ); v_AttrId := ENF_LM_GROUP_ATTR_MASTER_SQ.nextVal; INSERT INTO T_ENF_LM_GROUP_ATTR_MASTER (AttrId, EnfLMGroupId, AttrName, DataType, IsEnabled, SubGroupId, DisplayOrder ) VALUES (v_AttrId, v_GroupId - 3, 'Number of Days', 3, 1, NULL, 2 ); v_AttrId := ENF_LM_GROUP_ATTR_MASTER_SQ.nextVal; INSERT INTO T_ENF_LM_GROUP_ATTR_MASTER (AttrId, EnfLMGroupId, AttrName, DataType, IsEnabled, SubGroupId, DisplayOrder ) VALUES (v_AttrId, v_GroupId - 2, 'Enforce Clock Tamper', 4, 1, NULL, 2 ); v_AttrId := ENF_LM_GROUP_ATTR_MASTER_SQ.nextVal; INSERT INTO T_ENF_LM_GROUP_ATTR_MASTER (AttrId, EnfLMGroupId, AttrName, DataType, IsEnabled, SubGroupId, DisplayOrder ) VALUES (v_AttrId, v_GroupId - 3, 'Concurrent Users', 3, 1, NULL, 2 ); v_AttrId := ENF_LM_GROUP_ATTR_MASTER_SQ.nextVal; INSERT INTO T_ENF_LM_GROUP_ATTR_MASTER (AttrId, EnfLMGroupId, AttrName, DataType, IsEnabled, SubGroupId, DisplayOrder ) VALUES (v_AttrId, v_GroupId - 3, 'Execution Count', 3, 1, NULL, 2 ); v_AttrId := ENF_LM_GROUP_ATTR_MASTER_SQ.nextVal; INSERT INTO T_ENF_LM_GROUP_ATTR_MASTER (AttrId, EnfLMGroupId, AttrName, DataType, IsEnabled, SubGroupId, DisplayOrder ) VALUES (v_AttrId, v_GroupId, 'Locking Code', 1, 1, NULL, 2 );
リスト型の属性を作成した場合は、その属性がSentinel EMSポータルにドロップダウンリストとして表示されます。ドロップダウンリストに表示される値をテーブル T_LM_LIST_ATTR_VALUES に入力する必要があります。次のサンプルクエリを参照してください。
INSERT INTO [T_LM_LIST_ATTR_VALUES]([AttrId],[ValueId],[DisplayText]) VALUES (1, 1,'5') INSERT INTO [T_LM_LIST_ATTR_VALUES]([AttrId],[ValueId],[DisplayText]) VALUES (1, 2,'10') INSERT INTO [T_LM_LIST_ATTR_VALUES]([AttrId],[ValueId],[DisplayText]) VALUES (1, 3,'15')
Insert into T_LM_LIST_ATTR_VALUES (ATTRID, VALUEID, DISPLAYTEXT) Values (14, '0', 'No Capacity'); Insert into T_LM_LIST_ATTR_VALUES (ATTRID, VALUEID, DISPLAYTEXT) Values (14, '1', 'Non-pooled capacity'); Insert into T_LM_LIST_ATTR_VALUES (ATTRID, VALUEID, DISPLAYTEXT) Values (14, '2', 'Pooled Capacity');
DECLARE @LMId INT Insert Into dbo.T_LM (LMName, Descr, ENFId, IsEnabled, IsDeployed, ParentLMId) Values('Expiry Date Based', 'License will run until the specified expiry date is reached.', @ENFId, 1, 0, 0) SET @LMId = @@IDENTITY Insert Into dbo.T_LM (LMName, Descr, ENFId, IsEnabled, IsDeployed, ParentLMId) Values('Days Based', 'License will run for the specified number of days.', @ENFId, 1, 0, 0) Insert Into dbo.T_LM (LMName, Descr, ENFId, IsEnabled, IsDeployed, ParentLMId) Values('Execution Based', 'License will run for the specified number of executions.', @ENFId, 1, 0, 0)
v_LMId := LM_SQ.nextVal; INSERT INTO T_LM (LMId, LMName, Descr, ENFId, IsEnabled, IsDeployed, ParentLMId ) VALUES (v_LMId, 'Expiry Date Based', 'License will run until the specified expiry date is reached.', v_ENFId, 1, 0, 0 ); v_LMId := LM_SQ.nextVal; INSERT INTO T_LM (LMId, LMName, Descr, ENFId, IsEnabled, IsDeployed, ParentLMId ) VALUES (v_LMId, 'Days based', 'License will run for the specified number of days.', v_ENFId, 1, 0, 0 ); v_LMId := LM_SQ.nextVal; INSERT INTO T_LM (LMId, LMName, Descr, ENFId, IsEnabled, IsDeployed, ParentLMId ) VALUES (v_LMId, 'Execution based', 'License will run for the specified number of executions.', v_ENFId, 1, 0, 0 );
/* End Date */ Insert into dbo.T_LM_ATTR (LMId, AttrId, AttrValue, IsNullable, ISVPermission, EndUserPermission) Values(@LMId , @AttrId, '2012-12-31', 0, 2, 1) /* Clock Tamper */ Insert into dbo.T_LM_ATTR (LMId, AttrId, AttrValue, IsNullable, ISVPermission, EndUserPermission) Values(@LMId , @AttrId + 2, 1, 0, 2, 1) .............. ..............
INSERT INTO T_LM_ATTR ( LMId, AttrId, AttrValue, IsNullable, ISVPermission, EndUserPermission ) VALUES ( v_LMId - 2, v_AttrId - 5, '2012-12-31', 0, 2, 1 ); INSERT INTO T_LM_ATTR ( LMId, AttrId, AttrValue, IsNullable, ISVPermission, EndUserPermission ) VALUES ( v_LMId - 2, v_AttrId - 3, '1', 0, 2, 1 ); INSERT INTO T_LM_ATTR ( LMId, AttrId, AttrValue, IsNullable, ISVPermission, EndUserPermission ) VALUES ( v_LMId - 2, v_AttrId - 2, '5', 0, 2, 1 );
............. .............
Sentinel EMS には、<EMS_Install_Dir>\samples\DemoLicenseGenerator ディレクトリに、汎用的なライセンスジェネレータのサンプルが用意されています。このサンプルに変更を加えて独自のライセンスジェネレータを作成できます。
LicenseGenerator インターフェースのインプリメンテーション(DEMOLicenseGenerator など)を記述します。LicenseGenerator インターフェースには次のメソッドが含まれます。
public interface LicenseGenerator { /** * Gets the license generator vendor name. * * @return the vendor name */ String getVendorName(); /** * Gets the license generator version. * * @return the version */ String getVersion(); /** * Gets the license generator name. * * @return the generator name */ String getGeneratorName(); /** * List all supported actions. * * @return the list< string> of all the supported actions of the generator */ List<String> listActions(); /** * Initialize the license generator. * * @throws EMSException * the EMS exception */ void init() throws EMSException; /** * perform the generator supported actions, such as generate license, get * meter key information and so on. * * @param request * the request * @param response * the response * * @return the result * * @throws EMSException * the EMS exception */ String service(LicenseGeneratorRequest request, LicenseGeneratorResponse response) throws EMSException; // /** * Destroy the license generator. */ void destroy(); }
LicenseGenerator インターフェースをインプリメントする際の重要なポイントは次のとおりです。
else if (listAction.get(i).compareToIgnoreCase(DEMOLicGenActions.GetStandaloneRevokedLicenses.toString()) == 0) { response.setResult(DEMOLicGenActions.GetStandaloneRevokedLicenses.toString(), new ArrayList<String>()); } else if (listAction.get(i).compareToIgnoreCase(DEMOLicGenActions.GetNetworkRevocationOutput.toString()) == 0) { response.setResult(DEMOLicGenActions.GetNetworkRevocationOutput.toString(), new ArrayList<String>());}
このような要件がない場合は、license_ Type を上記 2 つの値のどちらにもハードコードできます。
RevocationHandler インターフェースのインプリメンテーション(例: RevocationHandlerImpl)を記述します。このインターフェースには次のメソッドが含まれます。
package com.sfnt.ems.service; import java.util.Map; import com.sfnt.ems.domain.License; import com.sfnt.ems.util.EMSException; public interface RevocationHandler { public boolean validateToken( Map<String,String> revocationAttribs)throws EMSException; }
RevocationHandler インターフェースのサンプルインプリメンテーション RevocationHandlerImpl は、『Sentinel EMS 2.8 Web Services Guide』に記載されています。
RevocationHandler インターフェースをインプリメントする際の重要なポイントは次のとおりです。
%EMS_HOME%\EMSServer\webapps\ems\WEB-INF\classes\com\sfnt\ems\service
サードパーティライセンスジェネレータは JAR ファイルの形式でパッケージ化する必要があります。
この JAR ファイルを次のディレクトリに置きます。
%EMSSERVER_HOME%\webapps\ems\WEB-INF\lib
独自の JSP ファイルを提供することにより、Sentinel EMSポータルの一部の画面の外観を変更したり、特定のフィールド/パラメータを表示/非表示にしたりできます。独自の JSP ファイルを作成するには、以下に記載された JSP ファイルをコピーし、ファイル名の TP_ の部分を独自のライセンスジェネレータ(例: DEMO_)に置き換えることにより、ファイル名を変更します。既存のファイルは削除しないでください。新しい JSP ファイルは同じ場所に置いてください。
例: TP_productKeyAttributeNewUI.jsp のコピーの名前は、DEMO_productKeyAttributeNewUI.jsp に変更する必要があります。
JSP ファイルは次の場所にあります。
%EMSSERVER_HOME%\web\WEB-INF\jsp\
TP_ActivationDetails.jsp | TP_addEntitlementItemFeatureListNewUI.jsp |
TP_AddLineItem.jsp | TP_EditLineItem.jsp |
TP_editProductKeyAttributeNewUI.jsp | TP_entitlementItemFeatureListNewUI.jsp |
TP_LineItemFeatures.jsp | TP_productKeyAttribute.jsp |
TP_productKeyAttributeNewUI.jsp | TP_RMSLineItemActivation.jsp |
TP_ViewLineItem.jsp | TP_viewProductKeyAttributeNewUI.jsp |
UI に既存のフィールドを非表示にするには、display プロパティを false に設定します。事前定義されたフィールドを JSP ファイルから削除すると、エラーが発生することがあります。
この JSP に表示されるデータ(フィーチャのリスト)は、選択されたプロダクトに応じて動的に変化します。独自のスタティック値のフィールドを追加して、追加情報を指定できます。新しい入力フィールドはデータベースには保存されません。
ほとんどの場合、JSP に表示される情報の変更のみ可能です。
カスタムライセンスジェネレータの統合を完了するために、次の 2 つの XML ファイルを変更する必要があります。
パス:%EMSSERVER_HOME%\webapps\ems\WEB-INF
<bean id="DEMO" class="com.sfnt.ems.service.generator.model.Generator"> <property name="jarName" value="DEMOLicGen.jar"/> <property name="clazzName" value="com.sfnt.ems.service.generator.
plugin.protectionPlus.ProtectionPlusLicenseGeneratorImpl"
/> </bean>
<bean id="licenseGeneratorManager" class="com.sfnt.ems.service.generator.
LicenseGeneratorManager" > <property name="classLoaderFactory" ref="classLoaderFactory"/> <property name="generators"> <list> <ref bean="RMS"/> ...
...
<ref bean="DEMO"/> </list> </property> </bean>
<bean id="revocationHandler" class="com.sfnt.ems.service.RevocationHandlerImpl"> <property name="licenseGeneratorManager" ref="licenseGeneratorManager" />
</bean>
上の例の RevocationHandlerImpl は、RevocationHandler インターフェースをインプリメントするためにユーザが作成したクラスファイルの名前です。
<property name="viewNameMapper"> <map> <entry key="TP"> <list> <value type="java.lang.String">DEMO_productKeyAttributeNewUI</value> <value type="java.lang.String">DEMO_addEntitlementItemFeatureListNewUI</value> <value type="java.lang.String">DEMO_AddLineItem</value> <value type="java.lang.String">DEMO_productKeyAttribute</value> <value type="java.lang.String">DEMO_EditLineItem</value> <value type="java.lang.String">DEMO_editProductKeyAttributeNewUI</value> <value type="java.lang.String">DEMO_viewProductKeyAttributeNewUI</value> <value type="java.lang.String">DEMO_entitlementItemFeatureListNewUI</value> <value type="java.lang.String">DEMO_RMSLineItemActivation</value> <value type="java.lang.String">DEMO_LineItemFeatures</value> <value type="java.lang.String">DEMO_ActivationDetails</value> <value type="java.lang.String">DEMO_ViewLineItem</value> </list> </entry> </map> </property>
パス:%EMSSERVER_HOME%\webapps\ems\WEB-INF\classes
<Enforcement name="DEMO License Generator" version="1.0"> <ProductKeyAttribute> <attributeName>Locking Code</attributeName> <attributeValue>777</attributeValue> <SameAttributeName></SameAttributeName> <associatedAttributeName></associatedAttributeName> <displayOrder>3</displayOrder> <attributePriority>0</attributePriority> <isUpgradable>true</isUpgradable> <LicenseType></LicenseType> </ProductKeyAttribute> </Enforcement>
属性についてエンドユーザに入力を要求するためには、XML ファイルで関連属性として指定します。
<ProductKeyAttribute> <attributeName>PRIMARY_2_CRITERIA</attributeName> <attributeValue>5</attributeValue> <SameAttributeName>CLIENT_2_CRITERIA</SameAttributeName> <associatedAttributeName>PRIMARY_2_INFO</associatedAttributeName> <displayOrder>6</displayOrder> <attributePriority>2</attributePriority> <isUpgradable>false</isUpgradable> <LicenseType>Network</LicenseType> </ProductKeyAttribute>
%EMSSERVER_HOME% にある \work および \temp ディレクトリを削除して、Apache Tomcat を再起動します。
|
|
http://www.safenet-inc.com/Support | |
© Copyright 2013, SafeNet, Inc. All rights reserved. | |