Search in sources :

Example 1 with StatusMessageType

use of no.difi.meldingsutveksling.noarkexchange.schema.StatusMessageType in project efm-integrasjonspunkt by felleslosninger.

the class PutMessageResponseFactory method createErrorResponse.

public static PutMessageResponseType createErrorResponse(String errorMsg) {
    PutMessageResponseType response = new PutMessageResponseType();
    AppReceiptType receipt = new AppReceiptType();
    receipt.setType("ERROR");
    StatusMessageType statusMessageType = new StatusMessageType();
    statusMessageType.setText(errorMsg);
    statusMessageType.setCode("Unknown");
    receipt.getMessage().add(statusMessageType);
    response.setResult(receipt);
    return response;
}
Also used : PutMessageResponseType(no.difi.meldingsutveksling.noarkexchange.schema.PutMessageResponseType) StatusMessageType(no.difi.meldingsutveksling.noarkexchange.schema.StatusMessageType) AppReceiptType(no.difi.meldingsutveksling.noarkexchange.schema.AppReceiptType)

Example 2 with StatusMessageType

use of no.difi.meldingsutveksling.noarkexchange.schema.StatusMessageType in project efm-integrasjonspunkt by felleslosninger.

the class AppReceiptFactory method from.

public AppReceiptType from(ArkivmeldingKvitteringMessage receipt) {
    AppReceiptType appReceipt = new AppReceiptType();
    appReceipt.setType(receipt.getReceiptType());
    if (receipt.getMessages() != null) {
        receipt.getMessages().forEach(sm -> {
            StatusMessageType statusMessageType = new StatusMessageType();
            statusMessageType.setText(sm.getText());
            statusMessageType.setCode(sm.getCode());
            appReceipt.getMessage().add(statusMessageType);
        });
    }
    return appReceipt;
}
Also used : StatusMessageType(no.difi.meldingsutveksling.noarkexchange.schema.StatusMessageType) AppReceiptType(no.difi.meldingsutveksling.noarkexchange.schema.AppReceiptType)

Example 3 with StatusMessageType

use of no.difi.meldingsutveksling.noarkexchange.schema.StatusMessageType in project efm-integrasjonspunkt by felleslosninger.

the class AppReceiptFactory method from.

public AppReceiptType from(String type, String code, String text) {
    AppReceiptType appReceipt = new AppReceiptType();
    appReceipt.setType(type);
    StatusMessageType statusMessage = new StatusMessageType();
    statusMessage.setCode(code);
    statusMessage.setText(text);
    appReceipt.getMessage().add(statusMessage);
    return appReceipt;
}
Also used : StatusMessageType(no.difi.meldingsutveksling.noarkexchange.schema.StatusMessageType) AppReceiptType(no.difi.meldingsutveksling.noarkexchange.schema.AppReceiptType)

Example 4 with StatusMessageType

use of no.difi.meldingsutveksling.noarkexchange.schema.StatusMessageType in project efm-integrasjonspunkt by felleslosninger.

the class PutMessageResponseMarkers method markerFrom.

public static LogstashMarker markerFrom(PutMessageResponseType response) {
    LogstashMarker marker = responseTypeMarker(response.getResult().getType());
    for (StatusMessageType s : response.getResult().getMessage()) {
        marker.and(responseMessageTextMarker(s.getText()));
        marker.and(responseMessageCodeMarker(s.getCode()));
    }
    return marker;
}
Also used : StatusMessageType(no.difi.meldingsutveksling.noarkexchange.schema.StatusMessageType) LogstashMarker(net.logstash.logback.marker.LogstashMarker)

Example 5 with StatusMessageType

use of no.difi.meldingsutveksling.noarkexchange.schema.StatusMessageType in project efm-integrasjonspunkt by felleslosninger.

the class PutMessageResponseFactory method createErrorResponse.

public static PutMessageResponseType createErrorResponse(StatusMessage statusMessage) {
    PutMessageResponseType response = new PutMessageResponseType();
    AppReceiptType receipt = new AppReceiptType();
    receipt.setType("ERROR");
    StatusMessageType statusMessageType = new StatusMessageType();
    statusMessageType.setText(statusMessage.getEndUserMessage());
    statusMessageType.setCode(statusMessage.getId());
    receipt.getMessage().add(statusMessageType);
    response.setResult(receipt);
    return response;
}
Also used : PutMessageResponseType(no.difi.meldingsutveksling.noarkexchange.schema.PutMessageResponseType) StatusMessageType(no.difi.meldingsutveksling.noarkexchange.schema.StatusMessageType) AppReceiptType(no.difi.meldingsutveksling.noarkexchange.schema.AppReceiptType)

Aggregations

StatusMessageType (no.difi.meldingsutveksling.noarkexchange.schema.StatusMessageType)5 AppReceiptType (no.difi.meldingsutveksling.noarkexchange.schema.AppReceiptType)4 PutMessageResponseType (no.difi.meldingsutveksling.noarkexchange.schema.PutMessageResponseType)2 LogstashMarker (net.logstash.logback.marker.LogstashMarker)1