/** * Logs in the same workspace with the given credentials. * <p> * The default implementation: * <ul> * <li>Retrieves the {@link Repository} instance using * {@link Session#getRepository()} * <li>Retrieves the current workspace using {@link Session#getWorkspace()} * <li>Retrieves the name of the current workspace using * {@link Workspace#getName()} * <li>Calls {@link Repository#login(Credentials, String)} on the * retrieved repository with the given credentials and the retrieved * workspace name. * </ul> * * @param credentials login credentials * @return logged in session * @throws RepositoryException if an error occurs */ public Session impersonate(Credentials credentials) throws RepositoryException { return getRepository().login(credentials, getWorkspace().getName()); }
/** * Logs in the same workspace with the given credentials. * <p> * The default implementation: * <ul> * <li>Retrieves the {@link Repository} instance using * {@link Session#getRepository()} * <li>Retrieves the current workspace using {@link Session#getWorkspace()} * <li>Retrieves the name of the current workspace using * {@link Workspace#getName()} * <li>Calls {@link Repository#login(Credentials, String)} on the * retrieved repository with the given credentials and the retrieved * workspace name. * </ul> * * @param credentials login credentials * @return logged in session * @throws RepositoryException if an error occurs */ public Session impersonate(Credentials credentials) throws RepositoryException { return getRepository().login(credentials, getWorkspace().getName()); }
/** * Logs in the same workspace with the given credentials. * <p> * The default implementation: * <ul> * <li>Retrieves the {@link Repository} instance using * {@link Session#getRepository()} * <li>Retrieves the current workspace using {@link Session#getWorkspace()} * <li>Retrieves the name of the current workspace using * {@link Workspace#getName()} * <li>Calls {@link Repository#login(Credentials, String)} on the * retrieved repository with the given credentials and the retrieved * workspace name. * </ul> * * @param credentials login credentials * @return logged in session * @throws RepositoryException if an error occurs */ public Session impersonate(Credentials credentials) throws RepositoryException { return getRepository().login(credentials, getWorkspace().getName()); }
/** * Logs in the same workspace with the given credentials. * <p> * The default implementation: * <ul> * <li>Retrieves the {@link Repository} instance using * {@link Session#getRepository()} * <li>Retrieves the current workspace using {@link Session#getWorkspace()} * <li>Retrieves the name of the current workspace using * {@link Workspace#getName()} * <li>Calls {@link Repository#login(Credentials, String)} on the * retrieved repository with the given credentials and the retrieved * workspace name. * </ul> * * @param credentials login credentials * @return logged in session * @throws RepositoryException if an error occurs */ public Session impersonate(Credentials credentials) throws RepositoryException { return getRepository().login(credentials, getWorkspace().getName()); }