summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditGetUebClusterEventFactory.java
blob: 792566c8b632597b4b041f03d9c01a95866be23d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package org.openecomp.sdc.be.auditing.impl;

import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
import org.openecomp.sdc.be.resources.data.auditing.AuditingGetUebClusterEvent;
import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;

public class AuditGetUebClusterEventFactory extends AuditBaseEventFactory {

    private static final String LOG_STR = "ACTION = \"%s\" CONSUMER_ID = \"%s\" STATUS_TIME = \"%s\" STATUS = \"%s\" STATUS_DESC = \"%s\"";
    private final AuditingGetUebClusterEvent event;

    public AuditGetUebClusterEventFactory(CommonAuditData commonFields, String consumerId) {

        super(AuditingActionEnum.GET_UEB_CLUSTER);
        event = new AuditingGetUebClusterEvent(getAction().getName(), commonFields, consumerId);
    }

    public AuditGetUebClusterEventFactory(CommonAuditData commonFields, String consumerId, String timestamp) {
        this(commonFields, consumerId);
        this.event.setTimestamp1(timestamp);
    }

    @Override
    public String getLogPattern() {
        return LOG_STR;
    }

    @Override
    public String[] getLogMessageParams() {
        return new String[] {event.getAction(), event.getConsumerId(), event.getTimestamp(), event.getStatus(), event.getDesc()};
    }

    @Override
    public AuditingGenericEvent getDbEvent() {
        return event;
    }

}