blob: bb5c44060c7a674d9550be4647735f8e25af26d3 [file] [log] [blame]
Jonathan Hart5573d322015-01-21 10:13:25 -08001/*
2 * Copyright 2015 Open Networking Laboratory
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 */
16package org.onosproject.store.intent.impl;
17
18import org.onosproject.net.intent.Intent;
19import org.onosproject.net.intent.IntentId;
20import org.onosproject.net.intent.IntentState;
21import org.onosproject.store.Timestamp;
22
23/**
24 * Information published by GossipIntentStore to notify peers of an intent
25 * creation or state update event.
26 */
27public class InternalIntentEvent {
28
29 private final IntentId intentId;
30 private final Intent intent;
31 private final IntentState state;
32 private final Timestamp timestamp;
33
34 public InternalIntentEvent(IntentId intentId, Intent intent, IntentState state,
35 Timestamp timestamp) {
36 this.intentId = intentId;
37 this.intent = intent;
38 this.state = state;
39 this.timestamp = timestamp;
40 }
41
42 public IntentId intentId() {
43 return intentId;
44 }
45
46 public Intent intent() {
47 return intent;
48 }
49
50 public IntentState state() {
51 return state;
52 }
53
54 public Timestamp timestamp() {
55 return timestamp;
56 }
57
58 // Needed for serialization.
59 @SuppressWarnings("unused")
60 private InternalIntentEvent() {
61 intentId = null;
62 intent = null;
63 state = null;
64 timestamp = null;
65 }
66}