public Session login(Credentials credentials, String workspaceName) throws RepositoryException {
// TODO: needs complete refactoring
RepositoryService service = context.getInstance(RepositoryService.class);
try {
Connection connection = service.login(credentials, workspaceName);
return new SessionImpl(context, connection);
} catch (LoginException e) {
throw new javax.jcr.LoginException(e.getMessage());
}