この章では、通知APIのユースケースについて説明します。このユースケースで、新しい読込み通知置換リストを作成する方法およびOracle Enterprise Repositoryの通知を作成する方法について解説します。
この章では、次の項目について説明します。
この項では、通知APIを使用するユースケースについて説明します。内容は次のとおりです。
説明
読込み通知置換リストを作成し、Oracle Enterprise Repositoryの通知を作成します。
サンプル・コード
例24-1 ユースケース: 読込み通知置換リストの作成と通知の作成
String[] lSubstitutions = null;
String[] lRecipients = null;
String lTemplateType = "asset_registered";
NameValue[] lNameValues = null;
lRecipients = new String[] {"recipient@xyz.com"};
try {
//////////////////////////
// read the existing substitutions based on the given template
lSubstitutions = mFlashlineRegistry.notificationSubstitutionsRead(mAuthToken, lTemplateType);
//////////////////////////
// create an array of namevalue pairs; a namevalue pair for each required substitution
lNameValues = new NameValue[lSubstitutions.length];
// populate the namevalues
for(int i=0; i<lSubstitutions.length; i++) {
lNameValues[i] = new NameValue();
lNameValues[i].setName(lSubstitutions[i]);
lNameValues[i].setValue("valueof-"+lSubstitutions[i]);
}
////////////////////////////////////////////
// create the notification
mFlashlineRegistry.notificationCreate(mAuthToken, lTemplateType, lRecipients, lNameValues);
} catch(Exception e) {
fail(e.getMessage());
}