Commit 5dfb7046 authored by Nikolaos Kyriakoulis's avatar Nikolaos Kyriakoulis
Browse files

Restructured model to use enums for status type of Services, Resources and ServiceOrders

parent 545c6fee
Loading
Loading
Loading
Loading
Loading
+20 −3
Original line number Diff line number Diff line
package org.etsi.osl.tmf.metrics;

public class Resources extends Services{
import com.fasterxml.jackson.annotation.JsonProperty;

    public Resources(int total, GroupByStateAggregations aggregations) {
        super(total, aggregations);
public class Resources{

    @JsonProperty("total")
    private final int total;

    @JsonProperty("aggregations")
    private final ResourcesGroupByStateAggregations aggregations;

    public Resources(int total, ResourcesGroupByStateAggregations aggregations) {
        this.total = total;
        this.aggregations = aggregations;
    }

    public int getTotal() {
        return total;
    }

    public ResourcesGroupByStateAggregations getAggregations() {
        return aggregations;
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ public class ResourcesGroupByState {
        this.resources = resources;
    }

    public Services getResources() {
    public Resources getResources() {
        return resources;
    }
}
+19 −0
Original line number Diff line number Diff line
package org.etsi.osl.tmf.metrics;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

public class ResourcesGroupByStateAggregations {

    @JsonProperty("groupByState")
    private final List<ResourcesGroupByStateItem> groupByState;

    public ResourcesGroupByStateAggregations(List<ResourcesGroupByStateItem> groupByState) {
        this.groupByState = groupByState;
    }

    public List<ResourcesGroupByStateItem> getGroupByState() {
        return groupByState;
    }
}
+27 −0
Original line number Diff line number Diff line
package org.etsi.osl.tmf.metrics;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.etsi.osl.tmf.common.model.service.ServiceStateType;
import org.etsi.osl.tmf.ri639.model.ResourceStatusType;

public class ResourcesGroupByStateItem {

    @JsonProperty("key")
    private final ResourceStatusType key;

    @JsonProperty("count")
    private final int count;

    public ResourcesGroupByStateItem(ResourceStatusType key, int count) {
        this.key = key;
        this.count = count;
    }

    public String getKey() {
        return key.name();
    }

    public int getCount() {
        return count;
    }
}
+0 −7
Original line number Diff line number Diff line
package org.etsi.osl.tmf.metrics;

public class ServiceOrders extends Services{
    public ServiceOrders(int total, GroupByStateAggregations aggregations) {
        super(total, aggregations);
    }
}
Loading