use of org.ow2.proactive.resourcemanager.exception.RMNodeException in project scheduling by ow2-proactive.
the class RMRest method loginWithCredential.
/*
* (non-Javadoc)
*
* @see org.ow2.proactive_grid_cloud_portal.SchedulerRestInterface#loginWithCredential(org.ow2.
* proactive_grid_cloud_portal.LoginForm)
*/
@Override
public String loginWithCredential(@MultipartForm LoginForm multipart) throws RMActiveObjectCreationException, RMNodeException, KeyException, IOException, LoginException, RMException {
Session session;
try {
if (multipart.getCredential() != null) {
session = sessionStore.createUnnamedSession();
Credentials credentials = Credentials.getCredentials(multipart.getCredential());
session.connectToRM(credentials);
} else {
session = sessionStore.create(multipart.getUsername());
CredData credData = new CredData(CredData.parseLogin(multipart.getUsername()), CredData.parseDomain(multipart.getUsername()), multipart.getPassword(), multipart.getSshKey());
session.connectToRM(credData);
}
} catch (ActiveObjectCreationException e) {
throw new RMActiveObjectCreationException(e);
} catch (NodeException e) {
throw new RMNodeException(e);
}
return session.getSessionId();
}
use of org.ow2.proactive.resourcemanager.exception.RMNodeException in project scheduling by ow2-proactive.
the class RMRest method releaseNode.
@Override
public boolean releaseNode(String sessionId, String url) throws RMNodeException, NotConnectedException, PermissionRestException {
ResourceManager rm = checkAccess(sessionId);
Node n;
try {
n = NodeFactory.getNode(url);
} catch (NodeException e) {
throw new RMNodeException(e);
}
return orThrowRpe(rm.releaseNode(n).getBooleanValue());
}
Aggregations