blob: 091ebc54d30eb51a55ec149d8b41b10f0a5ed823 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
2 * Copyright 2014 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 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net.intent;
weibitf32383b2014-10-22 10:17:31 -070017
Brian O'Connorabafb502014-12-02 22:26:20 -080018import org.onosproject.core.ApplicationId;
19import org.onosproject.net.ConnectPoint;
weibitf32383b2014-10-22 10:17:31 -070020
Sho SHIMIZUd7d18002015-01-21 14:37:14 -080021import java.util.Collections;
22
weibitf32383b2014-10-22 10:17:31 -070023/**
Jonathan Hartc9d76732014-11-18 10:52:20 -080024 * An optical layer intent for connectivity from one transponder port to another
25 * transponder port. No traffic selector or traffic treatment are needed.
weibitf32383b2014-10-22 10:17:31 -070026 */
Ray Milkeybd4f0112015-03-02 17:07:09 -080027public final class OpticalConnectivityIntent extends Intent {
28 private final ConnectPoint src;
29 private final ConnectPoint dst;
weibitf32383b2014-10-22 10:17:31 -070030
31 /**
Thomas Vachuska4b420772014-10-30 16:46:17 -070032 * Creates an optical connectivity intent between the specified
33 * connection points.
weibitf32383b2014-10-22 10:17:31 -070034 *
Thomas Vachuska4b420772014-10-30 16:46:17 -070035 * @param appId application identification
36 * @param src the source transponder port
37 * @param dst the destination transponder port
weibitf32383b2014-10-22 10:17:31 -070038 */
Jonathan Hartc9d76732014-11-18 10:52:20 -080039 public OpticalConnectivityIntent(ApplicationId appId,
40 ConnectPoint src, ConnectPoint dst) {
Ray Milkey5b3717e2015-02-05 11:44:08 -080041
42 this(appId, null, src, dst);
43 }
44
45 /**
46 * Creates an optical connectivity intent between the specified
47 * connection points.
48 *
49 * @param appId application identification
50 * @param key intent key
51 * @param src the source transponder port
52 * @param dst the destination transponder port
53 */
54 public OpticalConnectivityIntent(ApplicationId appId,
55 Key key,
56 ConnectPoint src, ConnectPoint dst) {
Ray Milkeyc24cde32015-03-10 18:20:18 -070057 super(appId, key, Collections.emptyList(), DEFAULT_INTENT_PRIORITY);
weibitf32383b2014-10-22 10:17:31 -070058 this.src = src;
59 this.dst = dst;
60 }
61
Ray Milkey5b3717e2015-02-05 11:44:08 -080062
weibitf32383b2014-10-22 10:17:31 -070063 /**
64 * Constructor for serializer.
65 */
66 protected OpticalConnectivityIntent() {
67 super();
68 this.src = null;
69 this.dst = null;
70 }
71
72 /**
Thomas Vachuska4b420772014-10-30 16:46:17 -070073 * Returns the source transponder port.
weibitf32383b2014-10-22 10:17:31 -070074 *
Thomas Vachuska4b420772014-10-30 16:46:17 -070075 * @return source transponder port
weibitf32383b2014-10-22 10:17:31 -070076 */
Jonathan Hartc9d76732014-11-18 10:52:20 -080077 public ConnectPoint getSrc() {
weibitf32383b2014-10-22 10:17:31 -070078 return src;
79 }
80
81 /**
Thomas Vachuska4b420772014-10-30 16:46:17 -070082 * Returns the destination transponder port.
weibitf32383b2014-10-22 10:17:31 -070083 *
Thomas Vachuska4b420772014-10-30 16:46:17 -070084 * @return source transponder port
weibitf32383b2014-10-22 10:17:31 -070085 */
86 public ConnectPoint getDst() {
87 return dst;
88 }
89}