![[16.0.0.3 and later]](../ng_v16003plus.gif)
Liberty でのカスタム・ユーザー・リポジトリーの開発
Liberty サーバーで com.ibm.wsspi.security.wim.CustomRepository インターフェースを実装することによって、カスタム・ユーザー・リポジトリーをユーザー・フィーチャーとして開発できます。このカスタム・リポジトリー・インターフェースは、ほとんどのタイプのアカウント・リポジトリーのサポートを可能にします。

始める前に
開発者ツールを使用してカスタム・リポジトリー・インターフェースを実装する場合、『開発者ツールでのカスタム・ユーザー・リポジトリー SPI の構成』の説明に従って、SPI を使用するようにそれらのツールを構成します。
手順
リポジトリー・インターフェース例
package com.myorg;
import java.util.Map;
import com.ibm.wsspi.security.wim.exception.WIMException;
import com.ibm.wsspi.security.wim.model.Root;
import com.ibm.wsspi.security.wim.CustomRepository;
public class MyCustomRepository implements CustomRepository {
public CustomRepository() {
System.out.println(“In my custom repository implementation”);
}
@Override
public Root create(Root arg0) throws WIMException {
System.out.println(“In my create method”);
//Add your code here
}
@Override
public Root delete(Root arg0) throws WIMException {
System.out.println(“In my delete method”);
//Add your code here
}
@Override
public Root get(Root arg0) throws WIMException {
System.out.println(“In my get method”);
//Add your code here
}
@Override
public String getRealm() {
return "customRepository";
}
@Override
public Root login(Root arg0) throws WIMException {
System.out.println(“In my login method”);
//Add your code here
}
@Override
public Root search(Root arg0) throws WIMException {
System.out.println(“In my search method”);
//Add your code here
}
@Override
public Root update(Root arg0) throws WIMException {
System.out.println(“In my update method”);
//Add your code here
}
@Override
public Map<String, String> getRepositoryBaseEntries() {
System.out.println(“In my getRepositoryBaseEntries method”);
//Add your code here
}
@Override
public String[] getRepositoriesForGroups() {
System.out.println(“In my getRepositoriesForGroups method”);
//Add your code here
}
}