blob: 4372d8be129f912cb565f9943b062e7c33a3c990 [file] [log] [blame]
slowrc86750e2017-08-22 17:26:47 -07001/*
2 * Copyright 2015-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.xran.identifiers;
18
19import org.onosproject.xran.codecs.pdu.HOComplete;
20import org.onosproject.xran.codecs.pdu.UEAdmissionStatus;
21import org.onosproject.xran.codecs.pdu.UEContextUpdate;
22
slowr577f3222017-08-28 10:49:08 -070023/**
24 * Class to handle UE Context Update packet.
25 */
26public class ContextUpdateHandler {
slowrc86750e2017-08-22 17:26:47 -070027 private UEContextUpdate contextUpdate;
28 private UEAdmissionStatus admissionStatus;
29 private HOComplete hoComplete;
30
slowr577f3222017-08-28 10:49:08 -070031 /**
32 * Get Context Update.
33 * @return UEContextUpdate
34 */
slowrc86750e2017-08-22 17:26:47 -070035 public UEContextUpdate getContextUpdate() {
36 return contextUpdate;
37 }
38
slowr577f3222017-08-28 10:49:08 -070039 /**
40 * Set Context Update.
41 * @param contextUpdate UEContextUpdate
42 * @return boolean to check context update was for admissionStatus packet or HOComplete packet
43 */
slowrc86750e2017-08-22 17:26:47 -070044 public boolean setContextUpdate(UEContextUpdate contextUpdate) {
45 this.contextUpdate = contextUpdate;
46
47 return admissionStatus != null || hoComplete != null;
48
49 }
50
slowr577f3222017-08-28 10:49:08 -070051 /**
52 * Get UEAdmissionStatus.
53 * @return UEAdmissionStatus
54 */
slowrc86750e2017-08-22 17:26:47 -070055 public UEAdmissionStatus getAdmissionStatus() {
56 return admissionStatus;
57 }
58
slowr577f3222017-08-28 10:49:08 -070059 /**
60 * Set UEAdmissionStatus.
61 * @param admissionStatus UEAdmissionStatus
62 * @return boolean contextUpdate exists or not
63 */
slowrc86750e2017-08-22 17:26:47 -070064 public boolean setAdmissionStatus(UEAdmissionStatus admissionStatus) {
65 this.admissionStatus = admissionStatus;
66
67 return contextUpdate != null;
68 }
69
slowr577f3222017-08-28 10:49:08 -070070 /**
71 * Get HOComplete.
72 * @return HOComplete
73 */
slowrc86750e2017-08-22 17:26:47 -070074 public HOComplete getHoComplete() {
75 return hoComplete;
76 }
77
slowr577f3222017-08-28 10:49:08 -070078 /**
79 * Set HOComplete.
80 * @param hoComplete HOComplete
81 * @return boolean contextUpdate exists or not
82 */
slowrc86750e2017-08-22 17:26:47 -070083 public boolean setHoComplete(HOComplete hoComplete) {
84 this.hoComplete = hoComplete;
85
86 return contextUpdate != null;
87 }
88
89 @Override
90 public String toString() {
slowr577f3222017-08-28 10:49:08 -070091 return "ContextUpdateHandler{" +
slowrc86750e2017-08-22 17:26:47 -070092 "contextUpdate=" + (contextUpdate != null) +
93 ", admissionStatus=" + (admissionStatus != null) +
94 ", hoComplete=" + (hoComplete != null) +
95 '}';
96 }
97}