use of org.apache.xmlrpc.XmlRpcException in project intellij-plugins by JetBrains.
the class NetworkUtil method sendMessage.
private static Object sendMessage(XmlRpcTarget target, String xmlRpcId, String method, List<Object> parameters) {
checkParameters(parameters, method);
String url = "http://" + target.getAddress().getHostAddress() + ':' + target.getPort() + "/rpc2";
String fullMethodName = xmlRpcId + '.' + method;
String logLine = "Call [" + url + "] " + fullMethodName;
if (LOG.isDebugEnabled()) {
LOG.info(buildFullLogLine(logLine, parameters));
}
for (int i = 0; i < parameters.size(); i++) {
Object o = parameters.get(i);
assert o != null : "Null parameter in position " + i;
}
try {
return new XmlRpcClient(url).execute(fullMethodName, new Vector<>(parameters));
} catch (MalformedURLException e) {
LOG.info(buildFullLogLine(logLine, parameters) + ' ' + e.getLocalizedMessage());
} catch (IOException e) {
LOG.info(buildFullLogLine(logLine, parameters) + ' ' + e.getLocalizedMessage());
} catch (XmlRpcException e) {
LOG.info(buildFullLogLine(logLine, parameters) + ' ' + e.getLocalizedMessage());
}
return null;
}
use of org.apache.xmlrpc.XmlRpcException in project intellij-community by JetBrains.
the class GitAskPassXmlRpcClient method askPassword.
// Obsolete collection usage because of the XmlRpcClientLite API
@SuppressWarnings({ "UseOfObsoleteCollectionType", "unchecked" })
String askPassword(String token, @NotNull String url) {
Vector parameters = new Vector();
parameters.add(token);
parameters.add(url);
try {
return (String) myClient.execute(methodName("askPassword"), parameters);
} catch (XmlRpcException | IOException e) {
throw new RuntimeException("Invocation failed " + e.getMessage(), e);
}
}
use of org.apache.xmlrpc.XmlRpcException in project intellij-community by JetBrains.
the class GitAskPassXmlRpcClient method askUsername.
// Obsolete collection usage because of the XmlRpcClientLite API
@SuppressWarnings({ "UseOfObsoleteCollectionType", "unchecked" })
String askUsername(String token, @NotNull String url) {
Vector parameters = new Vector();
parameters.add(token);
parameters.add(url);
try {
return (String) myClient.execute(methodName("askUsername"), parameters);
} catch (XmlRpcException | IOException e) {
throw new RuntimeException("Invocation failed " + e.getMessage(), e);
}
}
use of org.apache.xmlrpc.XmlRpcException in project intellij-community by JetBrains.
the class GitSSHXmlRpcClient method verifyServerHostKey.
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
public boolean verifyServerHostKey(String token, final String hostname, final int port, final String serverHostKeyAlgorithm, final String serverHostKey, final boolean isNew) {
if (myClient == null) {
return false;
}
Vector parameters = new Vector();
parameters.add(token);
parameters.add(hostname);
parameters.add(port);
parameters.add(serverHostKeyAlgorithm);
parameters.add(serverHostKey);
parameters.add(isNew);
try {
return ((Boolean) myClient.execute(methodName("verifyServerHostKey"), parameters)).booleanValue();
} catch (XmlRpcException | IOException e) {
throw new RuntimeException("Invocation failed " + e.getMessage(), e);
}
}
use of org.apache.xmlrpc.XmlRpcException in project intellij-community by JetBrains.
the class GitSSHXmlRpcClient method askPassword.
/**
* {@inheritDoc}
*/
@Nullable
@SuppressWarnings("unchecked")
public String askPassword(String token, final String username, final boolean resetPassword, final String lastError) {
if (myClient == null) {
return null;
}
Vector parameters = new Vector();
parameters.add(token);
parameters.add(username);
parameters.add(resetPassword);
parameters.add(lastError);
try {
return adjustNull(((String) myClient.execute(methodName("askPassword"), parameters)));
} catch (XmlRpcException | IOException e) {
throw new RuntimeException("Invocation failed " + e.getMessage(), e);
}
}
Aggregations