String writeValueAsString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(methodCallRequest);
System.out.println(writeValueAsString);
}
public static void createRegisterMessage() throws IOException {
MethodCall methodCall = new MethodCall("registerConnector", new String[]{ "example-remote", "jms-json",
"tcp://127.0.0.1:%s?example-remote" });
Map<String, String> metaData = new HashMap<String, String>();
metaData.put("serviceId", "connectorManager");
methodCall.setMetaData(metaData);
MethodCallMessage methodCallRequest = new MethodCallMessage(methodCall, false);
BeanDescription auth = BeanDescription.fromObject(new Password("password"));
methodCallRequest.setPrincipal("admin");
methodCallRequest.setCredentials(auth);