![[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
}
}