blob: 089d9345221f12695e397153b1904442f780e0a4 [file] [log] [blame]
Carmelo Casconede3b6842018-09-05 17:45:10 -07001/*
Carmelo Cascone4c289b72019-01-22 15:30:45 -08002 * Copyright 2019-present Open Networking Foundation
Carmelo Casconede3b6842018-09-05 17:45:10 -07003 *
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
Carmelo Cascone4c289b72019-01-22 15:30:45 -080017package org.onosproject.p4runtime.ctl.controller;
Carmelo Casconede3b6842018-09-05 17:45:10 -070018
19import org.onosproject.net.DeviceId;
20import org.onosproject.p4runtime.api.P4RuntimeEventSubject;
21
22/**
23 * Base P4Runtime event subject that carries just the device ID that originated
24 * the event.
25 */
Carmelo Cascone4c289b72019-01-22 15:30:45 -080026public final class BaseEventSubject implements P4RuntimeEventSubject {
Carmelo Casconede3b6842018-09-05 17:45:10 -070027
28 private DeviceId deviceId;
29
30 /**
31 * Creates an event subject.
32 *
33 * @param deviceId the device
34 */
Carmelo Cascone4c289b72019-01-22 15:30:45 -080035 public BaseEventSubject(DeviceId deviceId) {
Carmelo Casconede3b6842018-09-05 17:45:10 -070036 this.deviceId = deviceId;
37 }
38
39 @Override
40 public DeviceId deviceId() {
41 return deviceId;
42 }
43}