All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.global.api.gateways.events.ResponseReceivedEvent Maven / Gradle / Ivy

There is a newer version: 14.2.3
Show newest version
package com.global.api.gateways.events;

import org.joda.time.DateTime;

public class ResponseReceivedEvent extends GatewayEvent {
    private DateTime requestSent;

    public String getEventMessage() {
        String rvalue = super.getEventMessage();
        return rvalue.concat(String.format("Host response received. Response time (milliseconds): %sms.", getResponseTime()));
    }
    private long getResponseTime() {
        if(requestSent != null) {
            return timestamp.getMillis() - requestSent.getMillis();
        }
        else return 0;
    }

    public ResponseReceivedEvent(String connectorName, DateTime requestSent) {
        super(connectorName, GatewayEventType.ResponseReceived);
        this.requestSent = requestSent;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy