wsadmin を使用した統合リポジトリー のカスタム・アダプターの構成

Jython または Jacl スクリプト言語を wsadmin ツールとともに使用して、 統合リポジトリー 構成ファイルにカスタム・アダプターを定義できます。

始める前に

WebSphere® Application Server および wsadmin コマンド・ウィンドウをシャットダウンします。

このタスクについて

以下のステップを使用して、統合リポジトリー構成ファイルと、 構成ファイル内で定義されているレルムに、カスタム・アダプターを追加します。

以下の例では、SampleFileRepository リポジトリーをカスタム・リポジトリーの ID として使用します。

注: このトピックで使用するコマンドに関する追加情報については、『AdminTask オブジェクトの IdMgrRepositoryConfig コマンド・グループ』トピックを参照してください。

手順

  1. 次のコマンドを入力して、wsadmin ツールを開始します。
    wsadmin –conntype none
  2. createIdMgrCustomRepository コマンドを使用し、カスタム・リポジトリーを追加してアダプター・クラスを指定します。

    次の例では、com.ibm.ws.wim.adapter.sample.SampleFileAdapter クラスを使用するようにカスタム・リポジトリーを構成し、SampleFileRepository リポジトリーを ID として設定します。

    Jython を使用:
    AdminTask.createIdMgrCustomRepository('-id SampleFileRepository -adapterClassName com.ibm.ws.wim.adapter.sample.SampleFileAdapter')
    Jacl を使用:
    createIdMgrCustomRepository {-id SampleFileRepository -adapterClassName com.ibm.ws.wim.adapter.sample.SampleFileAdapter}
  3. 提供された vmmsampleadapter.jar ファイルを app_server_root/lib にコピーします。
  4. 共通リポジトリー構成内のページングを使用不可にします。 updateIdMgrRepository コマンドの supportPaging パラメーターを false に設定して、ページングを使用不可にします。
    注: サンプル・アダプターはページングをサポートしていないため、このステップを実行する必要があります。

    以下の例では、SampleFileRepository リポジトリーをカスタム・リポジトリーの ID として使用します。

    Jython を使用:
    AdminTask.updateIdMgrRepository('-id SampleFileRepository -supportPaging false')
    Jacl を使用:
    $AdminTask updateIdMgrRepository {-id SampleFileRepository -supportPaging
    false}
    注: サンプル・リポジトリーの構成が完了するまで、警告が表示されます。
  5. アダプターのための必要なカスタム・プロパティーを追加します。 複数のプロパティーを追加するには、setIdMgrCustomProperty コマンドを繰り返し使用します。 複数のプロパティーを構成に追加する場合、このコマンドは、プロパティーごとに 1 回使用します。 指定したリポジトリーのカスタム・プロパティーを追加する場合、 「名前」と「」の両方のパラメーターを使用する必要があります。 例えば、fileName というカスタム・プロパティーを追加するには、次のコマンドを入力します。
    Jython の使用:
    AdminTask.setIdMgrCustomProperty('-id SampleFileRepository -name fileName -value "c:¥sampleFileRegistry.xml"')
    Jacl を使用:
    $AdminTask setIdMgrCustomProperty {-id SampleFileRepository -name fileName
    -value "c:¥sampleFileRegistry.xml"}
  6. アダプター構成にベース・エントリーを追加します。 addIdMgrRepositoryBaseEntry コマンドを使用して、指定したリポジトリーのベース・エントリーの名前を指定します。 以下に例を示します。
    Jython の使用:
    AdminTask.addIdMgrRepositoryBaseEntry('-id SampleFileRepository -name o=sampleFileRepository')
    Jacl を使用:
    $AdminTask addIdMgrRepositoryBaseEntry {-id SampleFileRepository -name
    o=sampleFileRepository}
  7. addIdMgrRealmBaseEntry コマンドを使用して、基本エントリーをレルムに追加します。これにより、レルムがリポジトリーにリンクされます。
    Jython の使用:
    AdminTask.addIdMgrRealmBaseEntry('-name defaultWIMFileBasedRealm -baseEntry o=sampleFileRepository')
    Jacl を使用:
    $AdminTask addIdMgrRealmBaseEntry {-name defaultWIMFileBasedRealm -baseEntry o=sampleFileRepository}
  8. 構成の変更を保存します。 以下のコマンドを入力して新規構成を保存し、wsadmin ツールを閉じます。
    Jython の使用:
    AdminConfig.save()exit
    Jacl を使用:
    $AdminConfig save
    exit
    次の例では、新規に改訂された wimconfig.xml ファイルの完全なテキストを表示します。
    注: 統合リポジトリー構成ファイルの wimconfig.xml は、app_server_root/profiles/profile_name/config/cells/cell_name/wim/config ディレクトリーにあります。
    <!--
      Begin Copyright
    
      Licensed Materials - Property of IBM
    
      virtual member manager
    
      (C) Copyright IBM Corp. 2005 All Rights Reserved.
    
      
      End Copyright
    -->
    <sdo:datagraph xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:config="http://www.ibm.com/websphere/wim
    /config" xmlns:sdo="commonj.sdo">
      <config:configurationProvider maxPagingResults="500" maxSearchResults="4500" maxTotalPagingResults="1000" 
    pagedCacheTimeOut="900" pagingEntityObject="true" searchTimeOut="600000">
        <config:dynamicModel xsdFileName="wimdatagraph.xsd"/>
        <config:supportedEntityTypes defaultParent="o=defaultWIMFileBasedRealm" name="Group">
          <config:rdnProperties>cn</config:rdnProperties>
        </config:supportedEntityTypes>
        <config:supportedEntityTypes defaultParent="o=defaultWIMFileBasedRealm" name="OrgContainer">
          <config:rdnProperties>o</config:rdnProperties>
          <config:rdnProperties>ou</config:rdnProperties>
          <config:rdnProperties>dc</config:rdnProperties>
          <config:rdnProperties>cn</config:rdnProperties>
        </config:supportedEntityTypes>
        <config:supportedEntityTypes defaultParent="o=defaultWIMFileBasedRealm" name="PersonAccount">
          <config:rdnProperties>uid</config:rdnProperties>
        </config:supportedEntityTypes>
        <config:repositories xsi:type="config:FileRepositoryType" adapterClassName="com.ibm.ws.wim.adapter.file.was.FileAdapter" 
    id="InternalFileRepository" supportPaging="false" supportSorting="false" messageDigestAlgorithm="SHA-1">
          <config:baseEntries name="o=defaultWIMFileBasedRealm"/>
        </config:repositories>
        <config:repositories adapterClassName="com.ibm.ws.wim.adapter.sample.SampleFileAdapter" id="SampleFileRepository">
          <config:CustomProperties name="fileName" value="c:¥sampleFileRegistry.xml"/>
          <config:baseEntries name="o=sampleFileRepository"/>
        </config:repositories>
        <config:realmConfiguration defaultRealm="defaultWIMFileBasedRealm">
          <config:realms delimiter="@" name="defaultWIMFileBasedRealm" securityUse="active">
            <config:participatingBaseEntries name="o=defaultWIMFileBasedRealm"/>
            <config:participatingBaseEntries name="o=sampleFileRepository"/>
            <config:uniqueUserIdMapping propertyForInput="uniqueName" propertyForOutput="uniqueName"/>
            <config:userSecurityNameMapping propertyForInput="principalName" propertyForOutput="principalName"/>
            <config:userDisplayNameMapping propertyForInput="principalName" propertyForOutput="principalName"/>
            <config:uniqueGroupIdMapping propertyForInput="uniqueName" propertyForOutput="uniqueName"/>
            <config:groupSecurityNameMapping propertyForInput="cn" propertyForOutput="cn"/>
            <config:groupDisplayNameMapping propertyForInput="cn" propertyForOutput="cn"/>
          </config:realms>
        </config:realmConfiguration>
    </config:configurationProvider></sdo:datagraph>
  9. アプリケーション・サーバーを再始動します。

トピックのタイプを示すアイコン タスク・トピック



タイム・スタンプ・アイコン 最終更新: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=txml_config_vmmca
ファイル名:txml_config_vmmca.html