postEvent(String sessionID, String eventName, NameValuePairImpl[] eventParameters)
![]() |
sessionID - セッション id を識別する文字列。
|
![]() |
eventName - イベントの名前を識別する文字列。
|
![]() |
eventParameters - イベントを使用して渡す必要のあるパラメーターを識別する NameValuePairImpl オブジェクト。 これらの値はセッション・データに格納されます。
|
![]() |
このイベントがレスポンス履歴への記録を行う場合は、オファーの処理コードを渡す必要があります。 NameValuePair の名前を "UACIOfferTrackingCode" として定義する必要があります。
|
![]() |
postEvent で使用されるその他の予約パラメーターとその他のメソッドがいくつかあり、これらについては、このセクションの後半で説明します。
|
String eventName = "SearchExecution";
NameValuePair parmB1 = new NameValuePairImpl();
parmB1.setName("SearchString");
parmB1.setValueAsString("mortgage");
parmB1.setValueDataType(NameValuePair.DATA_TYPE_STRING);
NameValuePair parmB2 = new NameValuePairImpl();
parmB2.setName("TimeStamp");
parmB2.setValueAsDate(new Date());
parmB2.setValueDataType(NameValuePair.DATA_TYPE_DATETIME);
NameValuePair parmB3 = new NameValuePairImpl();
parmB3.setName("Browser");
parmB3.setValueAsString("IE6");
parmB3.setValueDataType(NameValuePair.DATA_TYPE_STRING);
NameValuePair parmB4 = new NameValuePairImpl();
parmB4.setName("FlashEnabled");
parmB4.setValueAsNumeric(1.0);
parmB4.setValueDataType(NameValuePair.DATA_TYPE_NUMERIC);
NameValuePair parmB5 = new NameValuePairImpl();
parmB5.setName("TxAcctValueChange");
parmB5.setValueAsNumeric(0.0);
parmB5.setValueDataType(NameValuePair.DATA_TYPE_NUMERIC);
NameValuePair parmB6 = new NameValuePairImpl();
parmB6.setName("PageTopic");
parmB6.setValueAsString("");
parmB6.setValueDataType(NameValuePair.DATA_TYPE_STRING);
NameValuePair[] postEventParameters = { parmB1,
parmB2,
parmB3,
parmB4,
parmB5,
parmB6
};
/** Make the call */
response = api.postEvent(sessionId, eventName, postEventParameters);
/** Process the response appropriately */
// check if response is successful or not
if(response.getStatusCode() == Response.STATUS_SUCCESS)
{
System.out.println("postEvent call processed with no warnings or errors");
}
else if(response.getStatusCode() == Response.STATUS_WARNING)
{
System.out.println("postEvent call processed with a warning");
}
else
{
System.out.println("postEvent call processed with an error");
}
// For any non-successes, there should be advisory messages explaining why
if(response.getStatusCode() != Response.STATUS_SUCCESS)
printDetailMessageOfWarningOrError("postEvent",
response.getAdvisoryMessages());
Copyright IBM Corporation 2013. All Rights Reserved.
|