}
public SessionInfo impersonate(SessionInfo sessionInfo, Credentials credentials)
throws RepositoryException {
SessionInfoImpl si = new SessionInfoImpl();
if (credentials instanceof SimpleCredentials) {
si.setUserID(((SimpleCredentials) credentials).getUserID());
}
if (sessionInfo instanceof SessionImpl) {
si.setUserID(((SessionImpl) sessionInfo).getUserID());
}
return si;
}