blob: 627c863f93bdbc17c005ced777eea692e22de174 [file] [log] [blame]
Brian O'Connorb7baf712015-07-28 23:27:03 -07001/*
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.incubator.net.domain;
17
18import com.google.common.annotations.Beta;
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070019import org.onosproject.core.ApplicationId;
20import org.onosproject.net.ConnectPoint;
21
Brian O'Connorb7baf712015-07-28 23:27:03 -070022
23/**
24 * The abstract base class for the resource that satisfies an intent primitive.
25 */
26@Beta
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070027public abstract class IntentResource {
Brian O'Connorb7baf712015-07-28 23:27:03 -070028
29 private final IntentPrimitive primitive;
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070030
31 private final ApplicationId appId;
32 private final ConnectPoint ingress;
33 private final ConnectPoint egress;
34
35 //* QUESTIONABLE ADDITIONS *//
Brian O'Connorb7baf712015-07-28 23:27:03 -070036
37 // TODO add other common fields
38 //String ingressTag;
39 //String egressTag;
40 //etc.
41
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070042 public IntentResource(IntentPrimitive primitive, ApplicationId appId,
43 ConnectPoint ingress, ConnectPoint egress) {
44 this.appId = appId;
45 this.ingress = ingress;
46 this.egress = egress;
Brian O'Connorb7baf712015-07-28 23:27:03 -070047 this.primitive = primitive;
48 }
49
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070050 //TODO when is same package tunnelID should be of type tunnelID and netTunnelId not long.
51
52
Aaron Kruglikovc61d2d12015-09-01 11:10:48 -070053 /**
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070054 * Returns the intent primitive associated with this resource at creation.
Aaron Kruglikovc61d2d12015-09-01 11:10:48 -070055 *
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070056 * @return this resource's intent primitive.
Aaron Kruglikovc61d2d12015-09-01 11:10:48 -070057 */
Brian O'Connorb7baf712015-07-28 23:27:03 -070058 public IntentPrimitive primitive() {
59 return primitive;
60 }
61
Aaron Kruglikovc61d2d12015-09-01 11:10:48 -070062 /**
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070063 * Returns the application ID associated with this resource at creation.
Aaron Kruglikovc61d2d12015-09-01 11:10:48 -070064 *
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070065 * @return this resource's application ID.
Aaron Kruglikovc61d2d12015-09-01 11:10:48 -070066 */
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070067 public ApplicationId appId() {
68 return appId;
Brian O'Connor59a92852015-07-30 19:08:24 -070069 }
70
Aaron Kruglikovc61d2d12015-09-01 11:10:48 -070071 /**
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070072 * Returns the ingress connect point associated with this resource at creation.
Aaron Kruglikovc61d2d12015-09-01 11:10:48 -070073 *
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070074 * @return this resource's ingress connect point.
Aaron Kruglikovc61d2d12015-09-01 11:10:48 -070075 */
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070076 public ConnectPoint ingress() {
77 return ingress;
Aaron Kruglikovc61d2d12015-09-01 11:10:48 -070078 }
79
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070080 /**
81 * Returns the egress connect point associated with this resource at creation.
82 *
83 * @return this resource's connect point.
84 */
85 public ConnectPoint egress() {
86 return egress;
87 }
Brian O'Connorb7baf712015-07-28 23:27:03 -070088}