Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
| 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 | */ |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 16 | package org.onlab.onos.net.intent; |
| 17 | |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 18 | import org.onlab.onos.core.ApplicationId; |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 19 | import org.onlab.onos.net.ConnectPoint; |
| 20 | |
| 21 | /** |
Jonathan Hart | c9d7673 | 2014-11-18 10:52:20 -0800 | [diff] [blame] | 22 | * An optical layer intent for connectivity from one transponder port to another |
| 23 | * transponder port. No traffic selector or traffic treatment are needed. |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 24 | */ |
weibit | 7e58346 | 2014-10-23 10:14:05 -0700 | [diff] [blame] | 25 | public class OpticalConnectivityIntent extends Intent { |
Jonathan Hart | c9d7673 | 2014-11-18 10:52:20 -0800 | [diff] [blame] | 26 | protected final ConnectPoint src; |
| 27 | protected final ConnectPoint dst; |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 28 | |
| 29 | /** |
Thomas Vachuska | 4b42077 | 2014-10-30 16:46:17 -0700 | [diff] [blame] | 30 | * Creates an optical connectivity intent between the specified |
| 31 | * connection points. |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 32 | * |
Thomas Vachuska | 4b42077 | 2014-10-30 16:46:17 -0700 | [diff] [blame] | 33 | * @param appId application identification |
| 34 | * @param src the source transponder port |
| 35 | * @param dst the destination transponder port |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 36 | */ |
Jonathan Hart | c9d7673 | 2014-11-18 10:52:20 -0800 | [diff] [blame] | 37 | public OpticalConnectivityIntent(ApplicationId appId, |
| 38 | ConnectPoint src, ConnectPoint dst) { |
Brian O'Connor | 520c052 | 2014-11-23 23:50:47 -0800 | [diff] [blame] | 39 | super(appId, null); |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 40 | this.src = src; |
| 41 | this.dst = dst; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Constructor for serializer. |
| 46 | */ |
| 47 | protected OpticalConnectivityIntent() { |
| 48 | super(); |
| 49 | this.src = null; |
| 50 | this.dst = null; |
| 51 | } |
| 52 | |
| 53 | /** |
Thomas Vachuska | 4b42077 | 2014-10-30 16:46:17 -0700 | [diff] [blame] | 54 | * Returns the source transponder port. |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 55 | * |
Thomas Vachuska | 4b42077 | 2014-10-30 16:46:17 -0700 | [diff] [blame] | 56 | * @return source transponder port |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 57 | */ |
Jonathan Hart | c9d7673 | 2014-11-18 10:52:20 -0800 | [diff] [blame] | 58 | public ConnectPoint getSrc() { |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 59 | return src; |
| 60 | } |
| 61 | |
| 62 | /** |
Thomas Vachuska | 4b42077 | 2014-10-30 16:46:17 -0700 | [diff] [blame] | 63 | * Returns the destination transponder port. |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 64 | * |
Thomas Vachuska | 4b42077 | 2014-10-30 16:46:17 -0700 | [diff] [blame] | 65 | * @return source transponder port |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 66 | */ |
| 67 | public ConnectPoint getDst() { |
| 68 | return dst; |
| 69 | } |
| 70 | } |