use of org.ow2.proactive.scheduler.job.UserIdentificationImpl in project scheduling by ow2-proactive.
the class SchedulerFrontendTest method testConnection.
/**
* Related to issue #1849.
* <p>
* https://github.com/ow2-proactive/scheduling/issues/1849
*/
@Test
public void testConnection() throws KeyException, AlreadyConnectedException {
schedulerFrontend.connect(new UniqueID(), new UserIdentificationImpl("admin"), null);
Mockito.verify(spacesSupport, times(1)).registerUserSpace("admin");
}
use of org.ow2.proactive.scheduler.job.UserIdentificationImpl in project scheduling by ow2-proactive.
the class SchedulerFrontendState method checkLinkResourceManager.
synchronized void checkLinkResourceManager() throws NotConnectedException, PermissionException {
UniqueID id = checkAccess();
UserIdentificationImpl ident = identifications.get(id).getUser();
// renew session for this user
renewUserSession(id, ident);
try {
ident.checkPermission(new ConnectToResourceManagerPermission(), ident.getUsername() + " does not have permissions to change RM in the scheduler");
} catch (PermissionException ex) {
logger.info(ex.getMessage());
throw ex;
}
}
use of org.ow2.proactive.scheduler.job.UserIdentificationImpl in project scheduling by ow2-proactive.
the class SchedulerFrontendState method checkChangeJobPriority.
synchronized void checkChangeJobPriority(JobId jobId, JobPriority priority) throws NotConnectedException, UnknownJobException, PermissionException, JobAlreadyFinishedException {
checkPermissions("changeJobPriority", getIdentifiedJob(jobId), YOU_DO_NOT_HAVE_PERMISSION_TO_CHANGE_THE_PRIORITY_OF_THIS_JOB);
UserIdentificationImpl ui = identifications.get(PAActiveObject.getContext().getCurrentRequest().getSourceBodyID()).getUser();
try {
ui.checkPermission(new ChangePriorityPermission(priority.getPriority()), ui.getUsername() + " does not have permissions to set job priority to " + priority);
} catch (PermissionException ex) {
logger.info(ex.getMessage());
throw ex;
}
if (jobs.get(jobId).isFinished()) {
String msg = " is already finished";
jlogger.info(jobId, msg);
throw new JobAlreadyFinishedException("Job " + jobId + msg);
}
}
use of org.ow2.proactive.scheduler.job.UserIdentificationImpl in project scheduling by ow2-proactive.
the class SchedulerFrontendState method getCurrentUser.
public String getCurrentUser() throws NotConnectedException {
UniqueID id = checkAccess();
UserIdentificationImpl ident = identifications.get(id).getUser();
// renew session for this user
renewUserSession(id, ident);
return ident.getUsername();
}
use of org.ow2.proactive.scheduler.job.UserIdentificationImpl in project scheduling by ow2-proactive.
the class SchedulerFrontendState method getSchedulerProperties.
public Map<String, Object> getSchedulerProperties() throws NotConnectedException {
UniqueID id = checkAccess();
UserIdentificationImpl ident = identifications.get(id).getUser();
renewUserSession(id, ident);
return PASchedulerProperties.getPropertiesAsHashMap();
}
Aggregations