9cd9aac0881fe31cb78e75e6020c408770802e02
[onosfw.git] /
1 /*
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  */
16 package org.onosproject.incubator.net.domain;
17
18 import com.google.common.annotations.Beta;
19
20 /**
21  * The abstract base class for the resource that satisfies an intent primitive.
22  */
23 @Beta
24 public class IntentResource {
25
26     private final IntentPrimitive primitive;
27     private final long tunnelId;
28     private final IntentDomainId domainId;
29
30     // TODO add other common fields
31     //String ingressTag;
32     //String egressTag;
33     //etc.
34
35     public IntentResource(IntentPrimitive primitive, long tunnelId, IntentDomainId domainId) {
36         this.primitive = primitive;
37         this.tunnelId = tunnelId;
38         this.domainId = domainId;
39     }
40
41     /**
42      * Returns the intent primitive associated with this resource as creation.
43      *
44      * @return this resource's intent primitive
45      */
46     public IntentPrimitive primitive() {
47         return primitive;
48     }
49
50     /**
51      * Returns the tunnel ID associated with this resource as creation.
52      *
53      * @return this resource's tunnel ID
54      */
55     public long tunnelId() {
56         return tunnelId;
57     }
58
59     /**
60      * Returns the domain ID associated with this resource as creation.
61      *
62      * @return this resource's domain ID
63      */
64     public IntentDomainId domainId() {
65         return domainId;
66     }
67
68 }