use of org.objectweb.proactive.core.UniqueID in project scheduling by ow2-proactive.
the class RMCore method configureDeployedNodeSource.
private void configureDeployedNodeSource(String nodeSourceName, NodeSourceDescriptor nodeSourceDescriptor, NodeSource nodeSourceStub, NodeSourcePolicy nodeSourcePolicyStub) {
// Adding access to the core for node source and policy.
// In order to do it node source and policy active objects are added to the clients list.
// They will be removed from this list when node source is unregistered.
UniqueID nsId = Client.getId(nodeSourceStub);
UniqueID policyId = Client.getId(nodeSourcePolicyStub);
if (nsId == null || policyId == null) {
throw new IllegalStateException("Cannot register the node source");
}
BooleanWrapper result = nodeSourceStub.activate();
if (!result.getBooleanValue()) {
logger.error(NODE_SOURCE_STRING + nodeSourceName + " cannot be activated");
}
Client provider = nodeSourceDescriptor.getProvider();
Client nsService = new Client(provider.getSubject(), false);
Client policyService = new Client(provider.getSubject(), false);
nsService.setId(nsId);
policyService.setId(policyId);
RMCore.clients.put(nsId, nsService);
RMCore.clients.put(policyId, policyService);
}
use of org.objectweb.proactive.core.UniqueID in project scheduling by ow2-proactive.
the class RMMonitoringImpl method removeRMEventListener.
/**
* Removes a listener from RMMonitoring. Only listener itself must call this method
*/
public void removeRMEventListener() throws RMException {
UniqueID id = PAActiveObject.getContext().getCurrentRequest().getSourceBodyID();
String shortId = id.shortString();
if (removeRMEventListener(id)) {
logger.debug("Removing the RM listener for " + shortId);
} else {
throw new RMException("Unknown listener found: " + shortId);
}
}
use of org.objectweb.proactive.core.UniqueID in project scheduling by ow2-proactive.
the class SchedulerFrontendState method checkPermissionReturningListeningUser.
synchronized ListeningUser checkPermissionReturningListeningUser(String methodName, String permissionMsg) throws NotConnectedException, PermissionException {
UniqueID id = checkAccess();
ListeningUser ident = identifications.get(id);
// renew session for this user
renewUserSession(id, ident.getUser());
final String fullMethodName = SchedulerFrontend.class.getName() + "." + methodName;
final MethodCallPermission methodCallPermission = new MethodCallPermission(fullMethodName);
try {
ident.getUser().checkPermission(methodCallPermission, permissionMsg);
} catch (PermissionException ex) {
logger.warn(permissionMsg);
throw ex;
}
return ident;
}
use of org.objectweb.proactive.core.UniqueID in project scheduling by ow2-proactive.
the class SchedulerFrontendState method disconnect.
synchronized void disconnect() throws NotConnectedException, PermissionException {
UniqueID id = checkAccess();
disconnect(id);
}
use of org.objectweb.proactive.core.UniqueID in project scheduling by ow2-proactive.
the class SchedulerFrontendState method getCurrentUserData.
public UserData getCurrentUserData() throws NotConnectedException {
UniqueID id = checkAccess();
UserIdentificationImpl ident = identifications.get(id).getUser();
// renew session for this user
renewUserSession(id, ident);
UserData userData = new UserData();
userData.setUserName(ident.getUsername());
userData.setGroups(ident.getGroups());
return userData;
}
Aggregations