initial commit
diff --git a/src/main/java/org.onosproject.xran/entities/RnibCell.java b/src/main/java/org.onosproject.xran/entities/RnibCell.java
new file mode 100644
index 0000000..3aa5c89
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/entities/RnibCell.java
@@ -0,0 +1,171 @@
+/*
+ * Copyright 2015-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.xran.entities;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.onosproject.net.DeviceId;
+import org.onosproject.xran.codecs.api.ECGI;
+import org.onosproject.xran.codecs.api.MMEUES1APID;
+import org.onosproject.xran.codecs.api.PRBUsage;
+import org.onosproject.xran.codecs.pdu.CellConfigReport;
+import org.onosproject.xran.codecs.pdu.L2MeasConfig;
+import org.onosproject.xran.codecs.pdu.RRMConfig;
+import org.onosproject.xran.codecs.pdu.SchedMeasReportPerCell;
+import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
+
+import javax.xml.bind.DatatypeConverter;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * Created by dimitris on 7/22/17.
+ */
+public class RnibCell {
+    private static final String SCHEME = "xran";
+
+    private ECGI ecgi;
+    private CellConfigReport conf;
+    private PrbUsageContainer prbUsage;
+    private SchedMeasReportPerCell.QciVals qci;
+    private RRMConfig rrmConfig;
+    private L2MeasConfig measConfig;
+
+    public RnibCell() {
+        prbUsage = new PrbUsageContainer();
+    }
+
+    public static URI uri(ECGI ecgi) {
+        if (ecgi != null) {
+            try {
+                BerByteArrayOutputStream os = new BerByteArrayOutputStream(4096);
+                ecgi.encode(os);
+                String message = DatatypeConverter.printHexBinary(os.getArray());
+                return new URI(SCHEME, message, null);
+            } catch (URISyntaxException | IOException e) {
+                return null;
+            }
+        }
+        return null;
+    }
+
+    public static ECGI decodeDeviceId(DeviceId deviceId) throws IOException {
+        String uri = deviceId.toString();
+        String hexEcgi = uri.substring(uri.lastIndexOf("xran:") + 5);
+
+        ECGI ecgi = new ECGI();
+        byte[] bytearray = DatatypeConverter.parseHexBinary(hexEcgi);
+        InputStream inputStream = new ByteArrayInputStream(bytearray);
+
+        ecgi.decode(inputStream);
+        return ecgi;
+    }
+
+    public ECGI getEcgi() {
+        return ecgi;
+    }
+
+    public void setEcgi(ECGI ecgi) {
+        this.ecgi = ecgi;
+    }
+
+    public CellConfigReport getConf() {
+        return conf;
+    }
+
+    public void setConf(CellConfigReport conf) {
+        this.conf = conf;
+    }
+
+    public RRMConfig getRrmConfig() {
+        return rrmConfig;
+    }
+
+    public void modifyRrmConfig(JsonNode rrmConfig) {
+        // TODO
+    }
+
+    public SchedMeasReportPerCell.QciVals getQci() {
+        return qci;
+    }
+
+    public void setQci(SchedMeasReportPerCell.QciVals qci) {
+        this.qci = qci;
+    }
+
+    public void setPrimaryPrbUsage(PRBUsage primary) {
+        this.prbUsage.primary = primary;
+    }
+
+    public void setSecondaryPrbUsage(PRBUsage secondary) {
+        this.prbUsage.secondary = secondary;
+    }
+
+    public L2MeasConfig getMeasConfig() {
+        return measConfig;
+    }
+
+    public void setMeasConfig(L2MeasConfig measConfig) {
+        this.measConfig = measConfig;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("{\n")
+                .append(ecgi != null ? "\"ecgi\":" + ecgi : "")
+                .append(conf != null ? ",\n\"config-report\":" + conf : "")
+                .append(prbUsage != null ? ",\n\"prb-usage\":" + prbUsage : "")
+                .append(qci != null ? ",\n\"qci-vals\":" + qci : "")
+                .append(rrmConfig != null ? ",\n\"rrm-config\":" + rrmConfig : "")
+                .append(measConfig != null ? ",\n\"l2-meas-config\":" + measConfig : "")
+                .append("\n}\n");
+        return sb.toString();
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        RnibCell rnibCell = (RnibCell) o;
+
+        return ecgi.equals(rnibCell.ecgi);
+    }
+
+    @Override
+    public int hashCode() {
+        return ecgi.hashCode();
+    }
+
+    class PrbUsageContainer {
+        PRBUsage primary;
+        PRBUsage secondary;
+
+        @Override
+        public String toString() {
+            StringBuilder sb = new StringBuilder();
+            sb.append("{\n")
+                    .append(primary != null ? "\"primary\":" + primary : "")
+                    .append(secondary != null ? ",\n\"secondary\":" + secondary : "")
+                    .append("\n}\n");
+            return sb.toString();
+        }
+    }
+}
diff --git a/src/main/java/org.onosproject.xran/entities/RnibLink.java b/src/main/java/org.onosproject.xran/entities/RnibLink.java
new file mode 100644
index 0000000..eb61120
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/entities/RnibLink.java
@@ -0,0 +1,370 @@
+/*
+ * Copyright 2015-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.xran.entities;
+
+import org.onosproject.xran.codecs.api.*;
+import org.onosproject.xran.codecs.pdu.PDCPMeasReportPerUe;
+import org.onosproject.xran.codecs.pdu.RRMConfig;
+import org.onosproject.xran.identifiers.LinkId;
+import org.openmuc.jasn1.ber.types.BerInteger;
+
+import java.util.Timer;
+
+/**
+ * Created by dimitris on 7/22/17.
+ */
+public class RnibLink {
+    private LinkId linkId;
+    //    private String type;
+    private RRMConfig rrmParameters;
+
+    private TrafficSplitPercentage trafficPercent;
+    private ERABParams bearerParameters;
+
+    private LinkQuality quality;
+    private PDCPThroughput pdcpThroughput;
+    private PDCPPacketDelay pdcpPackDelay;
+    private ResourceUsage resourceUsage;
+    private Type type;
+    private Timer timer;
+
+    public RnibLink() {
+        trafficPercent = new TrafficSplitPercentage();
+        trafficPercent.setTrafficPercentDl(new BerInteger(100));
+        trafficPercent.setTrafficPercentUl(new BerInteger(100));
+
+        pdcpThroughput = new PDCPThroughput();
+        quality = new LinkQuality();
+        pdcpPackDelay = new PDCPPacketDelay();
+        resourceUsage = new ResourceUsage();
+        timer = new Timer();
+    }
+
+    public Timer getTimer() {
+        return timer;
+    }
+
+    public void setTimer(Timer timer) {
+        this.timer.cancel();
+        this.timer.purge();
+        this.timer = timer;
+    }
+
+    public LinkId getLinkId() {
+        return linkId;
+    }
+
+    public void setLinkId(LinkId linkId) {
+        this.linkId = linkId;
+    }
+
+    public void setLinkId(RnibCell cell, RnibUe ue) {
+        this.linkId = new LinkId(cell.getEcgi(), ue.getMmeS1apId());
+        trafficPercent.setEcgi(cell.getEcgi());
+    }
+
+    public Type getType() {
+        return type;
+    }
+
+    public void setType(Type type) {
+        this.type = type;
+    }
+
+    public TrafficSplitPercentage getTrafficPercent() {
+        return trafficPercent;
+    }
+
+    public void setTrafficPercent(TrafficSplitPercentage trafficPercent) {
+        this.trafficPercent = trafficPercent;
+    }
+
+    public ERABParams getBearerParameters() {
+        return bearerParameters;
+    }
+
+    public void setBearerParameters(ERABParams bearerParameters) {
+        this.bearerParameters = bearerParameters;
+    }
+
+    public LinkQuality getQuality() {
+        return quality;
+    }
+
+    public void setQuality(LinkQuality quality) {
+        this.quality = quality;
+    }
+
+    public RRMConfig getRrmParameters() {
+        return rrmParameters;
+    }
+
+    public void setRrmParameters(RRMConfig rrmParameters) {
+        this.rrmParameters = rrmParameters;
+    }
+
+    public PDCPThroughput getPdcpThroughput() {
+        return pdcpThroughput;
+    }
+
+    public void setPdcpThroughput(PDCPThroughput pdcpThroughput) {
+        this.pdcpThroughput = pdcpThroughput;
+    }
+
+    public PDCPPacketDelay getPdcpPackDelay() {
+        return pdcpPackDelay;
+    }
+
+    public void setPdcpPackDelay(PDCPPacketDelay pdcpPackDelay) {
+        this.pdcpPackDelay = pdcpPackDelay;
+    }
+
+    public ResourceUsage getResourceUsage() {
+        return resourceUsage;
+    }
+
+    public void setResourceUsage(ResourceUsage resourceUsage) {
+        this.resourceUsage = resourceUsage;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("{\n")
+                .append(linkId != null ? "\"link-id\":" + linkId : "")
+                .append(type != null ? ",\n\"type\":" + type : "")
+                .append(rrmParameters != null ? ",\n\"rrm-params\":" + rrmParameters : "")
+                .append(trafficPercent != null ? ",\n\"traffic-percent\":" + trafficPercent : "")
+                .append(bearerParameters != null ? ",\n\"bearer-params\":" + bearerParameters : "")
+                .append(quality != null ? ",\n\"quality\":" + quality : "")
+                .append(pdcpThroughput != null ? ",\n\"pdcp-throughput\":" + pdcpThroughput : "")
+                .append(pdcpPackDelay != null ? ",\n\"pdcp-packet-delay\":" + pdcpPackDelay : "")
+                .append(resourceUsage != null ? ",\n\"resource-usage\":" + resourceUsage : "")
+                .append("\n}\n");
+        return sb.toString();
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        RnibLink link = (RnibLink) o;
+
+        return linkId.equals(link.linkId);
+    }
+
+    @Override
+    public int hashCode() {
+        return linkId.hashCode();
+    }
+
+    public enum Type {
+        SERVING_PRIMARY {
+            @Override
+            public String toString() {
+                return "\"serving/primary\"";
+            }
+        },
+        // TODO: Add CA/DC
+        SERVING_SECONDARY {
+            @Override
+            public String toString() {
+                return "\"serving/secondary\"";
+            }
+        },
+        NON_SERVING {
+            @Override
+            public String toString() {
+                return "\"non-serving\"";
+            }
+        }
+    }
+
+    public class PDCPThroughput {
+        private PDCPMeasReportPerUe.ThroughputDl dl;
+        private PDCPMeasReportPerUe.ThroughputUl ul;
+
+        public PDCPMeasReportPerUe.ThroughputDl getDl() {
+            return dl;
+        }
+
+        public void setDl(PDCPMeasReportPerUe.ThroughputDl dl) {
+            this.dl = dl;
+        }
+
+        public PDCPMeasReportPerUe.ThroughputUl getUl() {
+            return ul;
+        }
+
+        public void setUl(PDCPMeasReportPerUe.ThroughputUl ul) {
+            this.ul = ul;
+        }
+
+        @Override
+        public String toString() {
+            StringBuilder sb = new StringBuilder();
+            sb.append("{\n")
+                    .append(dl != null ? "\"dl\":" + dl : "")
+                    .append(ul != null ? ",\n\"ul\":" + ul : "")
+                    .append("\n}\n");
+            return sb.toString();
+        }
+    }
+
+    public class PDCPPacketDelay {
+        PDCPMeasReportPerUe.PktDelayDl dl;
+        PDCPMeasReportPerUe.PktDelayUl ul;
+
+        public PDCPMeasReportPerUe.PktDelayDl getDl() {
+            return dl;
+        }
+
+        public void setDl(PDCPMeasReportPerUe.PktDelayDl dl) {
+            this.dl = dl;
+        }
+
+        public PDCPMeasReportPerUe.PktDelayUl getUl() {
+            return ul;
+        }
+
+        public void setUl(PDCPMeasReportPerUe.PktDelayUl ul) {
+            this.ul = ul;
+        }
+
+        @Override
+        public String toString() {
+            StringBuilder sb = new StringBuilder();
+            sb.append("{\n")
+                    .append(dl != null ? "\"dl\":" + dl : "")
+                    .append(ul != null ? ",\n\"ul\":" + ul : "")
+                    .append("\n}\n");
+            return sb.toString();
+        }
+    }
+
+    public class ResourceUsage {
+        PRBUsage.PrbUsageDl dl;
+        PRBUsage.PrbUsageUl ul;
+
+        public PRBUsage.PrbUsageDl getDl() {
+            return dl;
+        }
+
+        public void setDl(PRBUsage.PrbUsageDl dl) {
+            this.dl = dl;
+        }
+
+        public PRBUsage.PrbUsageUl getUl() {
+            return ul;
+        }
+
+        public void setUl(PRBUsage.PrbUsageUl ul) {
+            this.ul = ul;
+        }
+
+        @Override
+        public String toString() {
+            StringBuilder sb = new StringBuilder();
+            sb.append("{\n")
+                    .append(dl != null ? "\"dl\":" + dl : "")
+                    .append(ul != null ? ",\n\"ul\":" + ul : "")
+                    .append("\n}\n");
+            return sb.toString();
+        }
+    }
+
+    public class LinkQuality {
+        double rsrp;
+        double rsrq;
+        RadioRepPerServCell.CqiHist cqiHist;
+        double cqiMode;
+        double cqiMean;
+        SchedMeasRepPerServCell.McsDl mcs_dl;
+        SchedMeasRepPerServCell.McsUl mcs_ul;
+
+        public double getRsrp() {
+            return rsrp;
+        }
+
+        public void setRsrp(double rsrp) {
+            this.rsrp = rsrp;
+        }
+
+        public double getRsrq() {
+            return rsrq;
+        }
+
+        public void setRsrq(double rsrq) {
+            this.rsrq = rsrq;
+        }
+
+        public RadioRepPerServCell.CqiHist getCqiHist() {
+            return cqiHist;
+        }
+
+        public void setCqiHist(RadioRepPerServCell.CqiHist cqiHist) {
+            this.cqiHist = cqiHist;
+        }
+
+        public double getCqiMode() {
+            return cqiMode;
+        }
+
+        public void setCqiMode(double cqiMode) {
+            this.cqiMode = cqiMode;
+        }
+
+        public double getCqiMean() {
+            return cqiMean;
+        }
+
+        public void setCqiMean(double cqiMean) {
+            this.cqiMean = cqiMean;
+        }
+
+        public SchedMeasRepPerServCell.McsDl getMcs_dl() {
+            return mcs_dl;
+        }
+
+        public void setMcs_dl(SchedMeasRepPerServCell.McsDl mcs_dl) {
+            this.mcs_dl = mcs_dl;
+        }
+
+        public SchedMeasRepPerServCell.McsUl getMcs_ul() {
+            return mcs_ul;
+        }
+
+        public void setMcs_ul(SchedMeasRepPerServCell.McsUl mcs_ul) {
+            this.mcs_ul = mcs_ul;
+        }
+
+        @Override
+        public String toString() {
+            StringBuilder sb = new StringBuilder();
+            sb.append("{\n")
+                    .append("\"rsrp\":" + rsrp)
+                    .append(",\n\"rsrq\":" + rsrq)
+                    .append(",\n\"cqiMode\":" + cqiMode)
+                    .append(",\n\"cqiMean\":" + cqiMean)
+                    .append(mcs_dl != null ? ",\n\"mcs-dl\":" + mcs_dl : "")
+                    .append(mcs_ul != null ? ",\n\"mcs-ul\":" + mcs_ul : "")
+                    .append("\n}\n");
+            return sb.toString();
+        }
+    }
+}
diff --git a/src/main/java/org.onosproject.xran/entities/RnibSlice.java b/src/main/java/org.onosproject.xran/entities/RnibSlice.java
new file mode 100644
index 0000000..349e8ee
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/entities/RnibSlice.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2015-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.xran.entities;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Created by dimitris on 7/22/17.
+ */
+public class RnibSlice {
+    private long sliceId;
+    private Set<RnibLink> links;
+    private Map<String, String> ran2epc;
+    private long validityPeriod;
+    private Object desiredKpis;
+    private Object deliveredKpis;
+    private Object rrmSonConfiguration;
+
+}
diff --git a/src/main/java/org.onosproject.xran/entities/RnibUe.java b/src/main/java/org.onosproject.xran/entities/RnibUe.java
new file mode 100644
index 0000000..2be3e01
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/entities/RnibUe.java
@@ -0,0 +1,231 @@
+/*
+ * Copyright 2015-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.xran.entities;
+
+import org.onlab.packet.MacAddress;
+import org.onosproject.net.HostId;
+import org.onosproject.xran.codecs.api.CRNTI;
+import org.onosproject.xran.codecs.api.ENBUES1APID;
+import org.onosproject.xran.codecs.api.MMEUES1APID;
+import org.onosproject.xran.codecs.pdu.RXSigMeasConfig;
+import org.onosproject.xran.codecs.pdu.UECapabilityInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Timer;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static org.onosproject.net.HostId.hostId;
+
+/**
+ * Created by dimitris on 7/22/17.
+ */
+public class RnibUe {
+
+    private static final String SCHEME = "xran";
+
+    private static final Logger log =
+            LoggerFactory.getLogger(RnibUe.class);
+
+    private String imsi;
+    private ENBUES1APID enbS1apId;
+    private MMEUES1APID mmeS1apId;
+    private CRNTI ranId;
+    private UeState ueState;
+    private UECapabilityInfo capability;
+    private RXSigMeasConfig measConfig;
+    private Timer timer;
+
+    public RnibUe() {
+        ueState = UeState.ACTIVE;
+        timer = new Timer();
+    }
+
+    public static URI uri(RnibUe ue) {
+        MMEUES1APID mmeS1apId = ue.getMmeS1apId();
+        if (mmeS1apId != null) {
+            try {
+                return new URI(SCHEME, mmeS1apId.toString(), null);
+            } catch (URISyntaxException e) {
+                return null;
+            }
+        }
+        return null;
+    }
+
+    public static MMEUES1APID hostIdtoMME(HostId hostId) {
+        String mac = hostId.mac().toString();
+        mac = mac.replace(":", "");
+        long l = Long.parseLong(mac, 16);
+        return new MMEUES1APID(l);
+    }
+
+    public Timer getTimer() {
+        return timer;
+    }
+
+    public void setTimer(Timer timer) {
+        this.timer.cancel();
+        this.timer.purge();
+        this.timer = timer;
+    }
+
+    public MMEUES1APID getMmeS1apId() {
+        return mmeS1apId;
+    }
+
+    public void setMmeS1apId(MMEUES1APID mmeS1apId) {
+        this.mmeS1apId = mmeS1apId;
+    }
+
+    public ENBUES1APID getEnbS1apId() {
+        return enbS1apId;
+    }
+
+    public void setEnbS1apId(ENBUES1APID enbS1apId) {
+        this.enbS1apId = enbS1apId;
+    }
+
+    public CRNTI getRanId() {
+        return ranId;
+    }
+
+    public void setRanId(CRNTI ranId) {
+        this.ranId = ranId;
+    }
+
+    public String getImsi() {
+        return imsi;
+    }
+
+    public void setImsi(String imsi) {
+        this.imsi = imsi;
+    }
+
+    public HostId getHostId() {
+        try {
+            String text = this.mmeS1apId.value.toString(16),
+                    res = "";
+            int charsLeft = 12 - text.length();
+            if (charsLeft > 0) {
+                res += Stream.generate(() -> "0").limit(charsLeft).collect(Collectors.joining(""));
+            } else if (charsLeft < 0) {
+                return null;
+            }
+            res += text;
+
+            String insert = ":";
+            int period = 2;
+
+            StringBuilder builder = new StringBuilder(
+                    res.length() + insert.length() * (res.length() / period) + 1);
+
+            int index = 0;
+            String prefix = "";
+            while (index < res.length()) {
+                // Don't putPrimaryLink the insert in the very first iteration.
+                // This is easier than appending it *after* each substring
+                builder.append(prefix);
+                prefix = insert;
+                builder.append(res.substring(index,
+                        Math.min(index + period, res.length())));
+                index += period;
+            }
+
+            return hostId(MacAddress.valueOf(builder.toString()));
+        } catch (Exception e) {
+            log.warn(e.getMessage());
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+
+    public RXSigMeasConfig getMeasConfig() {
+        return measConfig;
+    }
+
+    public void setMeasConfig(RXSigMeasConfig measConfig) {
+        this.measConfig = measConfig;
+    }
+
+    public UECapabilityInfo getCapability() {
+        return capability;
+    }
+
+    public void setCapability(UECapabilityInfo capability) {
+        this.capability = capability;
+    }
+
+    public UeState getUeState() {
+        return ueState;
+    }
+
+    public void setUeState(UeState ueState) {
+        this.ueState = ueState;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("{\n")
+                .append(mmeS1apId != null ? "\n\"mme-s1-ap-id\":" + mmeS1apId : "")
+                .append(enbS1apId != null ? ",\n\"enb-s1-ap-id\":" + enbS1apId : "")
+                .append(imsi != null ? ",\"imsi\":" + imsi : "")
+                .append(ranId != null ? ",\n\"ran-id\":" + ranId : "")
+                .append(ueState != null ? ",\n\"state\":" + ueState : "")
+                .append(capability != null ? ",\n\"capability\":" + capability : "")
+                .append(measConfig != null ? ",\n\"meas-config\":" + measConfig : "")
+                .append("\n}\n");
+        return sb.toString();
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        RnibUe rnibUe = (RnibUe) o;
+
+        return mmeS1apId.equals(rnibUe.mmeS1apId) && ranId.equals(rnibUe.ranId);
+    }
+
+    @Override
+    public int hashCode() {
+        int result = mmeS1apId.hashCode();
+        result = 31 * result + ranId.hashCode();
+        return result;
+    }
+
+    public enum UeState {
+        ACTIVE {
+            @Override
+            public String toString() {
+                return "\"ACTIVE\"";
+            }
+        },
+        IDLE {
+            @Override
+            public String toString() {
+                return "\"IDLE\"";
+            }
+        }
+    }
+}
diff --git a/src/main/java/org.onosproject.xran/entities/package-info.java b/src/main/java/org.onosproject.xran/entities/package-info.java
new file mode 100644
index 0000000..6b2c4c4
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/entities/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2015-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Created by dimitris on 7/22/17.
+ */
+package org.onosproject.xran.entities;
\ No newline at end of file