cciGetBrokerInfo

この関数は、現行のブローカー環境 (例えば、ブローカー名、実行グループ名、キュー・マネージャー名についての情報) を照会します。 この情報は、タイプ CCI_BROKER_INFO_ST の構造に戻されます。
注: これは、CciNode* ハンドルを指定する必要がない点、および cciGetBrokerInfo はメッセージ・フローについての情報を戻さないという点で、既存の cniGetBrokerInfo (cniGetBrokerInfo をクリックして、この関数の説明を参照してください) と異なっています。したがって、cciGetBrokerInfo は、初期化関数 (例えば、bipInitializeUserExitsbipGetMessageParserFactory、および bipGetMessageFlowNodeFactory) から呼び出すことができます。

構文

void cciGetBrokerInfo(
                      int*                returnCode,
                      CCI_BROKER_INFO_ST* broker_info_st);

パラメーター

returnCode (出力)
関数からの戻りコードを受け取ります (出力)。
考えられる戻りコードは以下のとおりです。
  • CCI_SUCCESS
  • CCI_INV_BROKER_INFO_ST
  • CCI_EXCEPTION
broker_info_st (出力)
以下は、正常終了時に関連する値を取り込む CCI_BROKER_INFO_ST 構造のアドレスです。
typedef struct cci_broker_info_st {
int	versionId;			/*Structure version identification*/
CCI_STRING_ST brokerName;		/*The label of the broker*/
CCI_STRING_ST executionGroupName;	/*The label of the current execution group*/
CCI_STRING_ST queueManagerName;		/*The name of the MQ Queue Manager for the broker*/
CCI_STRING_ST dataSourceUserId;		/*The userid broker connects to datasource as*/
} CCI_BROKER_INFO_ST;

戻り値

なし。エラーが発生した場合、returnCode パラメーターがエラーの理由を示します。

int rc = CCI_SUCCESS;

CCI_BROKER_INFO_ST brokerInfo = {CCI_BROKER_INFO_ST_DEFAULT};

#define INTITIAL_STR_LEN 256
CciChar brokerNameStr[INTITIAL_STR_LEN];
CciChar executionGroupNameStr[INTITIAL_STR_LEN];
CciChar queueManagerNameStr[INTITIAL_STR_LEN];

brokerInfo.brokerName.bufferLength = INTITIAL_STR_LEN;
brokerInfo.brokerName.buffer = brokerNameStr;

brokerInfo.executionGroupName.bufferLength = INTITIAL_STR_LEN;
brokerInfo.executionGroupName.buffer = executionGroupNameStr;

brokerInfo.queueManagerName.bufferLength = INTITIAL_STR_LEN;
brokerInfo.queueManagerName.buffer = queueManagerNameStr;

cciGetBrokerInfo(&rc,&brokerInfo);

/* just in case any of the buffers were too short*/
if ((brokerInfo.brokerName.bytesOutput < brokerInfo.brokerName.dataLength) ||
    (brokerInfo.executionGroupName.bytesOutput < brokerInfo.executionGroupName.dataLength) ||
    (brokerInfo.queueManagerName.bytesOutput < brokerInfo.queueManagerName.dataLength)) {

  /*at least one of the buffer were too short, need to rerty*/
  /* NOTE this is unlikely given that the initial sizes were reasonably large*/

  brokerInfo.brokerName.bufferLength =
     brokerInfo.brokerName.dataLength;
  brokerInfo.brokerName.buffer =
    (CciChar*)malloc (brokerInfo.brokerName.bufferLength * sizeof(CciChar));

  brokerInfo.executionGroupName.bufferLength =
    brokerInfo.executionGroupName.dataLength;
  brokerInfo.executionGroupName.buffer =
    (CciChar*)malloc (brokerInfo.executionGroupName.bufferLength * sizeof(CciChar));

  brokerInfo.queueManagerName.bufferLength =
    brokerInfo.queueManagerName.dataLength;
  brokerInfo.queueManagerName.buffer =
    (CciChar*)malloc (brokerInfo.queueManagerName.bufferLength * sizeof(CciChar));

  cciGetBrokerInfo(&rc,&brokerInfo);

  /*now do something sensible with these strings before the buffers go out of scope*/
  /* for example call a user written function to copy them away*/
  copyBrokerInfo(brokerInfo.brokerName.buffer,
                 brokerInfo.executionGroupName.buffer,
                 brokerInfo.queueManagerName.buffer);

  free((void*)brokerInfo.brokerName.buffer);
  free((void*)brokerInfo.executionGroupName.buffer);
  free((void*)brokerInfo.queueManagerName.buffer);

}else{
  /*now do something sensible with these strings before the buffers go out of scope*/
  /* for example call a user written function to copy them away*/
  copyBrokerInfo(brokerInfo.brokerName.buffer,
                 brokerInfo.executionGroupName.buffer,
                 brokerInfo.queueManagerName.buffer);
}
関連概念
ユーザー出口
特記事項 | 商標 | ダウンロード | ライブラリー | サポート | フィードバック

Copyright IBM Corporation 1999, 2009Copyright IBM Corporation 1999, 2009.
最終更新 : 2009-02-20 12:44:42

as36040_