IAS拡張APIでは、Integrator Acquisition Systemへの拡張機能を定義し、さらに拡張機能の構成プロパティを定義するJavaアノテーションが提供されます。アノテーションは、構成プロパティが必須であるか任意であるか、デフォルト値および表示プロパティがあるかどうかをias-cmdで記述できます。
拡張機能では、@IasDataSourceまたは@IasManipulatorのいずれかのアノテーションによって、拡張機能がデータソースであるか、マニピュレータであるかを示す必要があります。
Integrator Acquisition Systemは、IASのアプリケーション開発者がプラグインをインストールした後、@IasDataSourceまたは@IasManipulatorのいずれかのアノテーションを持つクラスを確認し、拡張機能IDの一意性を確認することによって拡張機能をスキャンします。
@IasDataSource(displayName="CSV File", description="Reads comma separated files") public class CsvDataSource extends DataSource<CsvDataSourceConfig>
@IasManipulator( supportsIncrementals=true, deleteRecordsBypassManipulator = true, displayName="Substring Manipulator", description="Generates a new property that is a substring of another property value") public class SubstringManipulator extends Manipulator<SubstringManipulatorConfig>
PipelineComponentConfigurationクラスのJavaフィールドを、拡張機能の構成プロパティとしてフィールドを公開するようにアノテートします。アノテートしたフィールドは、IAS Serverコマンドライン・ユーティリティやIAS Server APIで利用可能になります。フィールドをアノテートしない場合には、IAS Serverはそのフィールドを無視します。
アノテーションには、構成プロパティについての追加情報を指定する属性が含まれます。この情報は、フィールドがフィールドのデフォルトの値を表示する順序などを制御できます。
@StringProperty(isRequired=true, name="inputFile", displayName="Input File", description="Path to the input csv file e.g. c:\\incoming\\data.csv") private String mInputFile; @StringProperty(isRequired=true, name="keyColumn", displayName="Key Column", description="Name of the column with the record key") private String mKeyColumn;
@StringProperty(isRequired=true, name="sourcePropertyList", displayName="Source Property List") private List<String> mSourcePropertyList;
@IntegerProperty(isRequired=false, name="startIndex", displayName="Substring Start Index", description="Substring start index (zero based)", defaultValue=0) private int mStartIndex;
拡張機能をアノテートして、フィールドのセットをグループにまとめ、グループ内のフィールドの順序を指定できます。
@ConfigurationGroupアノテーションは、それに含まれたフィールドがIAS Serverコマンドライン・ユーティリティの観点からのグループであることを指定します。
@ConfigurationGroupのgroupName属性はグループのラベルを指定し、propertyOrder属性はプロパティがIAS Serverコマンドライン・ユーティリティのタスクからの出力として表示される順序を指定します。propertyOrder属性を省略した場合、プロパティはアルファベット順にソートされ、ias-cmdから戻った際に、アルファベット順に表示されます。
@ConfigurationGroup(groupName="User Credentials", propertyOrder={"userName","userPassword"})
拡張機能に、フィールドの複数のグループの順序を指定するようにアノテートできます。前述のように、各グループを@ConfigurationGroupアノテーションで指定します。複数のグループの順序は、@ConfigurationGroupOrderアノテーションで指定します。
これは、グループの順序や各グループ内のフィールドの順序を強制する場合に便利です。たとえば、データソース拡張機能がデータベースにアクセスする場合を考えます。最初のグループはUser Credentialsという名前で、userNameプロパティとuserPasswordプロパティを表示します。
次に、Database Settingsという、serverName、databasePathおよびportNumberを表示する2つ目のフィールドのグループが必要と想定します。
最後に、Advanced Settingsという、settingA、settingBおよびsettingCを表示する3つ目のグループを必要と想定します。
@ConfigurationGroupOrder({
@ConfigurationGroup(groupName="User Credentials", propertyOrder={
"userName","userPassword"})
@ConfigurationGroup(groupName="Database settings", propertyOrder={
"serverName","databasePath","portNumber"})
@ConfigurationGroup(groupName="Advanced Settings", propertyOrder={
"settingA","settingB","settingC"})})