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 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.intent; |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 17 | |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 18 | import org.onosproject.core.ApplicationId; |
| 19 | import org.onosproject.net.ConnectPoint; |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 20 | |
Sho SHIMIZU | d7d1800 | 2015-01-21 14:37:14 -0800 | [diff] [blame] | 21 | import java.util.Collections; |
| 22 | |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 23 | /** |
Jonathan Hart | c9d7673 | 2014-11-18 10:52:20 -0800 | [diff] [blame] | 24 | * An optical layer intent for connectivity from one transponder port to another |
| 25 | * transponder port. No traffic selector or traffic treatment are needed. |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 26 | */ |
weibit | 7e58346 | 2014-10-23 10:14:05 -0700 | [diff] [blame] | 27 | public class OpticalConnectivityIntent extends Intent { |
Jonathan Hart | c9d7673 | 2014-11-18 10:52:20 -0800 | [diff] [blame] | 28 | protected final ConnectPoint src; |
| 29 | protected final ConnectPoint dst; |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 30 | |
| 31 | /** |
Thomas Vachuska | 4b42077 | 2014-10-30 16:46:17 -0700 | [diff] [blame] | 32 | * Creates an optical connectivity intent between the specified |
| 33 | * connection points. |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 34 | * |
Thomas Vachuska | 4b42077 | 2014-10-30 16:46:17 -0700 | [diff] [blame] | 35 | * @param appId application identification |
| 36 | * @param src the source transponder port |
| 37 | * @param dst the destination transponder port |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 38 | */ |
Jonathan Hart | c9d7673 | 2014-11-18 10:52:20 -0800 | [diff] [blame] | 39 | public OpticalConnectivityIntent(ApplicationId appId, |
| 40 | ConnectPoint src, ConnectPoint dst) { |
Ray Milkey | 5b3717e | 2015-02-05 11:44:08 -0800 | [diff] [blame] | 41 | |
| 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) { |
| 57 | super(appId, key, Collections.emptyList()); |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 58 | this.src = src; |
| 59 | this.dst = dst; |
| 60 | } |
| 61 | |
Ray Milkey | 5b3717e | 2015-02-05 11:44:08 -0800 | [diff] [blame] | 62 | |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 63 | /** |
| 64 | * Constructor for serializer. |
| 65 | */ |
| 66 | protected OpticalConnectivityIntent() { |
| 67 | super(); |
| 68 | this.src = null; |
| 69 | this.dst = null; |
| 70 | } |
| 71 | |
| 72 | /** |
Thomas Vachuska | 4b42077 | 2014-10-30 16:46:17 -0700 | [diff] [blame] | 73 | * Returns the source transponder port. |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 74 | * |
Thomas Vachuska | 4b42077 | 2014-10-30 16:46:17 -0700 | [diff] [blame] | 75 | * @return source transponder port |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 76 | */ |
Jonathan Hart | c9d7673 | 2014-11-18 10:52:20 -0800 | [diff] [blame] | 77 | public ConnectPoint getSrc() { |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 78 | return src; |
| 79 | } |
| 80 | |
| 81 | /** |
Thomas Vachuska | 4b42077 | 2014-10-30 16:46:17 -0700 | [diff] [blame] | 82 | * Returns the destination transponder port. |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 83 | * |
Thomas Vachuska | 4b42077 | 2014-10-30 16:46:17 -0700 | [diff] [blame] | 84 | * @return source transponder port |
weibit | f32383b | 2014-10-22 10:17:31 -0700 | [diff] [blame] | 85 | */ |
| 86 | public ConnectPoint getDst() { |
| 87 | return dst; |
| 88 | } |
| 89 | } |