in.erail.amazon.lambda.MessageAWSLambda Maven / Gradle / Ivy
package in.erail.amazon.lambda;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import io.vertx.core.MultiMap;
import io.vertx.core.eventbus.DeliveryOptions;
import io.vertx.core.eventbus.Message;
import io.vertx.core.json.JsonObject;
import java.util.concurrent.CompletableFuture;
/**
*
* @author vinay
*/
public class MessageAWSLambda implements Message {
private CompletableFuture mResult;
private T mBody;
public MessageAWSLambda(CompletableFuture pResult) {
this(pResult, null);
}
public MessageAWSLambda(CompletableFuture pResult, T pBody) {
this.mResult = pResult;
this.mBody = pBody;
}
@Override
public String address() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public MultiMap headers() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public T body() {
return mBody;
}
@Override
public String replyAddress() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean isSend() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void reply(Object pMessage) {
mResult.complete((T) pMessage);
}
@Override
public void reply(Object pMessage, Handler>> pReplyHandler) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void reply(Object pMessage, DeliveryOptions pOptions) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void reply(Object pMessage, DeliveryOptions pOptions, Handler>> pReplyHandler) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void fail(int pFailureCode, String pMessage) {
mResult.complete((T) new JsonObject().put("error", pMessage));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy