blob: dff1d131eeab084a2349755eb2195e2c3774b7c6 [file] [log] [blame]
Yoonseon Han096cea02017-05-15 15:10:41 -07001/*
2 * Copyright 2017-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.incubator.net.virtual.impl.intent.phase;
18
19import org.onosproject.net.intent.IntentData;
20
21import static com.google.common.base.Preconditions.checkNotNull;
22import static org.onosproject.net.intent.IntentState.FAILED;
23
24/**
25 * Represents a phase where the compile has failed.
26 */
27public class VirtualIntentFailed extends VirtualFinalIntentProcessPhase {
28
29 private final IntentData data;
30
31 /**
32 * Create an instance with the specified data.
33 *
34 * @param data intentData
35 */
36 VirtualIntentFailed(IntentData data) {
37 this.data = IntentData.nextState(checkNotNull(data), FAILED);
38 }
39
40 @Override
41 public IntentData data() {
42 return data;
43 }
44}