Listener がアップロードした配信確認情報を処理するには、このイベントを設定します。ステータス・パラメータが 0 を返す場合、request_id で識別された Push 要求は、remote_device パラメータで識別された Listener によって正常に受信されています。
request_option パラメータを使用すると、配信確認への応答としてアクションを開始できます。request_option が 0 の場合、confirmation_handler イベントはデフォルトのアクションを開始します。つまり、request_delete イベントが実行されて、元の Push 要求が削除されます。配信確認を送信するデバイスが request_id で識別されたデバイスと一致しない場合、デフォルトのアクションでは、元の Push 要求がセカンダリ・ゲートウェイを使用して送信されます。
Listener が配信確認情報をアップロードできるようにするには、dblsn -x オプションを使用します。配信確認は必要だが IP 追跡は不要な場合は、dblsn -ni オプションを使用します。Windows 用の Listener オプションを参照してください。
このイベントにはシステム・プロシージャの使用が必要です。Sybase Central を使用する方法では、このイベントを直接設定できません。サーバ起動同期の Mobile Link サーバ設定を参照してください。
confirmation_handler イベントを使用して、次のパラメータを取得できます。
スクリプト・パラメータ | 型 | 説明 |
---|---|---|
request_option (out) | Integer |
ハンドラが戻った後に Notifier が要求に対して実行する処理を制御します。次の値が返されます。
|
status (in) | Integer |
状況の概要。ステータスは、開発時に不適切なフィルタやハンドラ属性などの問題の識別に使用できます。次の値が返されます。
|
request_id (in) | Integer | 要求 ID。request_cursor イベントには、confirmation_handler イベントを使用するための要求 ID カラムが含まれている必要があります。 |
remote_code (in) | Integer |
リモート Listener からレポートされた概要です。次の値が返されます。
|
remote_device (in) | varchar | 応答 Listener のデバイス名です。 |
remote_mluser (in) | varchar | 応答 Listener の Mobile Link ユーザ名です。 |
remote_action_return (in) | varchar | リモート・アクションのリターン・コードです。 |
remote_action (in) | varchar | アクション・コマンド用に予約済みです。 |
gateway (in) | varchar | 要求に関連付けられているゲートウェイです。 |
address (in) | varchar | 要求に関連付けられているアドレスです。 |
subject (in) | varchar | 要求に関連付けられている件名です。 |
content (in) | varchar | 要求に関連付けられている内容です。 |
次の例では、CustomConfirmation というテーブルを作成し、CustomConfirmationHandler という名前のストアド・プロシージャを使用して確認をログ記録します。出力パラメータ request_option は常に 0 に設定され、デフォルト Notifier 処理が使用されます。
CREATE TABLE CustomConfirmation( error_code integer, request_id integer, remote_code integer, remote_device varchar(128), remote_mluser varchar(128), remote_action_return varchar(128), remote_action varchar(128), gateway varchar(255), address varchar(255), subject varchar(255), content varchar(255), occurAt timestamp not null default timestamp ) CREATE PROCEDURE CustomConfirmationHandler( out @request_option integer, in @error_code integer, in @request_id integer, in @remote_code integer, in @remote_device varchar(128), in @remote_mluser varchar(128), in @remote_action_return varchar(128), in @remote_action varchar(128), in @gateway varchar(255), in @address varchar(255), in @subject varchar(255), in @content varchar(255) ) BEGIN INSERT INTO CustomConfirmation( error_code, request_id, remote_code, remote_device, remote_mluser, remote_action_return, remote_action, gateway, address, subject, content) VALUES ( @error_code, @request_id, @remote_code, @remote_device, @remote_mluser, @remote_action_return, @remote_action, @gateway, @address, @subject, @content ); SET @request_option = 0; END |
ml_add_property システム・プロシージャを SQL Anywhere 統合データベースで使用するには、次のコマンドを実行します。
call ml_add_property( 'SIS', 'Notifier(myNotifier)', 'confirmation_handler', 'call CustomConfirmation(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); |
または、Notifier 設定ファイルに次の行を追加して、このイベントを呼び出すこともできます。
Notifier(myNotifier).confirmation_handler = call CustomConfirmation(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) |
mlsrv11 -notifier オプションを使用してファイルを実行します。Notifier 設定ファイルを設定する方法については、Notifier 設定ファイルを使用したサーバ側設定の実行を参照してください。
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |