use of org.apache.camel.Message in project camel by apache.
the class KeypairProducer method doCreate.
private void doCreate(Exchange exchange) {
final Message msg = exchange.getIn();
final String name = msg.getHeader(OpenstackConstants.NAME, String.class);
ObjectHelper.notEmpty(name, "Keypair name");
final String body = msg.getBody(String.class);
final Keypair kp = os.compute().keypairs().create(name, body);
msg.setBody(kp);
}
use of org.apache.camel.Message in project camel by apache.
the class KeypairProducer method doGet.
private void doGet(Exchange exchange) {
final Message msg = exchange.getIn();
final String keypairName = msg.getHeader(OpenstackConstants.NAME, String.class);
ObjectHelper.notEmpty(keypairName, "Keypair name");
final Keypair kp = os.compute().keypairs().get(keypairName);
msg.setBody(kp);
}
use of org.apache.camel.Message in project camel by apache.
the class KeypairProducer method doDelete.
private void doDelete(Exchange exchange) {
final Message msg = exchange.getIn();
final String keypairName = msg.getHeader(OpenstackConstants.NAME, String.class);
ObjectHelper.notEmpty(keypairName, "Keypair name");
final ActionResponse response = os.compute().keypairs().delete(keypairName);
checkFailure(response, msg, "Delete keypair " + keypairName);
}
use of org.apache.camel.Message in project camel by apache.
the class ServerProducer method doGet.
private void doGet(Exchange exchange) {
final Message msg = exchange.getIn();
final String serverId = msg.getHeader(OpenstackConstants.ID, String.class);
ObjectHelper.notEmpty(serverId, "Server ID");
final Server result = os.compute().servers().get(serverId);
msg.setBody(result);
}
use of org.apache.camel.Message in project camel by apache.
the class ProjectProducer method doUpdate.
private void doUpdate(Exchange exchange) {
final Message msg = exchange.getIn();
final Project in = messageToProject(msg);
final Project out = osV3Client.identity().projects().update(in);
msg.setBody(out);
}
Aggregations