rama-huawei | c78f309 | 2016-05-19 18:09:29 +0530 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2016-present 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.sfcweb; |
| 17 | |
| 18 | import org.onosproject.net.DeviceId; |
| 19 | import org.onosproject.net.HostId; |
| 20 | import org.onosproject.ui.UiTopoOverlay; |
| 21 | import org.onosproject.ui.topo.PropertyPanel; |
| 22 | |
| 23 | |
| 24 | /** |
| 25 | * Our sfcweb topology overlay. |
| 26 | */ |
| 27 | public class SfcwebUiTopovOverlay extends UiTopoOverlay { |
| 28 | |
| 29 | // NOTE: this must match the ID defined in sfcwebTopov.js |
| 30 | private static final String OVERLAY_ID = "SFC-Service-overlay"; |
| 31 | private static final String MY_DEVICE_TITLE = "SFF specific device details"; |
| 32 | private static final String MY_HOST_TITLE = "SF specific host details"; |
| 33 | |
| 34 | public SfcwebUiTopovOverlay() { |
| 35 | super(OVERLAY_ID); |
| 36 | } |
| 37 | |
| 38 | @Override |
| 39 | public void modifyDeviceDetails(PropertyPanel pp, DeviceId deviceId) { |
| 40 | pp.title(MY_DEVICE_TITLE); |
| 41 | pp.removeAllProps(); |
| 42 | pp.addProp("SFF Device Id", deviceId.toString()); |
| 43 | } |
| 44 | |
| 45 | @Override |
| 46 | public void modifyHostDetails(PropertyPanel pp, HostId hostId) { |
| 47 | pp.title(MY_HOST_TITLE); |
| 48 | pp.removeAllProps(); |
| 49 | pp.addProp("SF host Address", hostId.toString()); |
| 50 | } |
| 51 | |
| 52 | } |