DSM オブジェクトで情報を要求したり、タスクを実行するには、CA_MDB UUID を確認する必要があります。 DSM Web サービスでは、このタスクを容易にする検索機能が提供されています。この機能によって、オブジェクトの UUID 文字列が返されます。 ユーザやコンピュータなどのオブジェクト タイプの多くでは、その表\示名のみを使用して検索できます。 その他のオブジェクトの検索を Web サービスで実行するには、これ以上の情報が必要となる場合があります。
例 4: 名前によるコンピュータの検索
String computerId = "";
//このメソッドによって、指定した名前のコンピュータが検索されます。
private int findTargetComputer(String computerName) throws Exception
{
//要求されたプロパティを設定します(関連するのは UUID のみです)
ComputerPropertiesRequired props =
new ComputerPropertiesRequired();
props.setComputerUUIDRequired(true);
//出力パラメータを設定します
LongWrapperHolder numFound = new LongWrapperHolder();
ArrayOfComputerPropertiesHolder arrOfCompPropsHolder = new ArrayOfComputerPropertiesHolder();
//これにより、Axis エラーが発生する場合があります
wsAPIconnector.findComputer(service.getSessionId(),computerName, props, arrOfCompPropsHolder, numFound );
if(numFound.value.intValue() > 0)
{
computerId = arrOfCompPropsHolder.value.getComputerPropertiesArray(0) getComputerUUID () ;
}
else
{
computerId = "";
return UDSMWebService.NO_MATCHING_COMPUTER;
}
return UDSMWebService.RESULT_OK;
}
このメソ\ッドによって、必要なプロパティの要求、および要求したプロパティの取得が実行されます。 findComputer メソッドによって、すべての DSM Web サービスと同様に、SOAP/Axis の例外が発生する場合があります。
|
Copyright © 2014 CA Technologies.
All rights reserved.
|
|