use of org.ow2.proactive.resourcemanager.exception.RMException in project scheduling by ow2-proactive.
the class SharedSessionStoreTestUtils method createValidSession.
public static String createValidSession(RMProxyUserInterface rm) throws ActiveObjectCreationException, NodeException, RMException, KeyException, LoginException {
SchedulerRMProxyFactory schedulerFactory = mock(SchedulerRMProxyFactory.class);
when(schedulerFactory.connectToRM(Matchers.<CredData>any())).thenReturn(rm);
SharedSessionStore.getInstance().setSchedulerRMProxyFactory(schedulerFactory);
// login
Session session = SharedSessionStore.getInstance().createUnnamedSession();
session.connectToRM(new CredData());
return session.getSessionId();
}
use of org.ow2.proactive.resourcemanager.exception.RMException in project scheduling by ow2-proactive.
the class NodeSourceTest method testDetectedPingedDownNodeCallingInfrastructureManagerInternalRemoveNodeTrueFlag.
@Test
public void testDetectedPingedDownNodeCallingInfrastructureManagerInternalRemoveNodeTrueFlag() throws RMException, ClassNotFoundException {
Node node = createNode(PROACTIVE_PROGRAMMING_NODE_URL);
nodeSource.internalAddNode(node);
nodeSource.detectedPingedDownNode(node.getNodeInformation().getName(), node.getNodeInformation().getURL());
verify(infrastructureManager).internalNotifyDownNode(anyString(), anyString(), any(Node.class));
}
use of org.ow2.proactive.resourcemanager.exception.RMException in project scheduling by ow2-proactive.
the class RMListenerProxy method init.
public boolean init(String url, Credentials credentials) throws RMException, KeyException, LoginException {
this.credentials = credentials;
this.rmAuth = RMConnection.join(url);
this.target = rmAuth.login(credentials);
rebindListener();
// here we log on using an empty login field to ensure that
// credentials are used.
this.jmxClient = new JMXClientHelper(rmAuth, new Object[] { "", credentials });
this.jmxClient.connect();
return true;
}
use of org.ow2.proactive.resourcemanager.exception.RMException in project scheduling by ow2-proactive.
the class RMListenerProxy method init.
public boolean init(String url, CredData credData) throws RMException, KeyException, LoginException {
this.rmAuth = RMConnection.join(url);
Credentials cred = Credentials.createCredentials(credData, rmAuth.getPublicKey());
return init(url, cred);
}
use of org.ow2.proactive.resourcemanager.exception.RMException in project scheduling by ow2-proactive.
the class PluginDescriptor method packParameters.
/**
* Packs parameters inputed by user into appropriate parameters set required for this plugin.
* Performs some operations such as file loading on user side.
*
* @param parameters input parameters
* @return output parameters
* @throws RMException when error occurs
*/
public Object[] packParameters(Object[] parameters) throws RMException {
int configurableFieldsSize = configurableFields.size();
List<Object> resultParams = new ArrayList<>(configurableFieldsSize);
if (parameters.length != configurableFieldsSize) {
throw new RMException("Incorrect number of parameters: expected " + configurableFieldsSize + ", provided " + parameters.length);
}
int counter = 0;
for (ConfigurableField field : configurableFields) {
Object value = parameters[counter++];
Configurable configurable = field.getMeta();
boolean credentialsFilePath = configurable.credential() && value instanceof String;
if (configurable.fileBrowser() || credentialsFilePath) {
try {
if (value.toString().length() > 0) {
value = FileToBytesConverter.convertFileToByteArray(new File(value.toString()));
} else {
// in case if file path is not specified propagate null to plugin
// it will decide then if it's acceptable or not
value = null;
}
} catch (IOException e) {
throw new RMException("Cannot load file", e);
}
}
resultParams.add(value);
}
return resultParams.toArray();
}
Aggregations