Simon Hunt | 6c2555b | 2015-05-21 18:17:56 -0700 | [diff] [blame] | 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 | */ |
| 17 | |
| 18 | package org.onosproject.cord.gui.model; |
| 19 | |
| 20 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 21 | |
| 22 | /** |
| 23 | * Default XOS function implementation, that does not have any parameters |
| 24 | * to tweak. |
| 25 | */ |
| 26 | public class DefaultXosFunction implements XosFunction { |
| 27 | |
| 28 | protected static final ObjectMapper MAPPER = new ObjectMapper(); |
| 29 | |
| 30 | private final XosFunctionDescriptor xfd; |
| 31 | |
| 32 | public DefaultXosFunction(XosFunctionDescriptor xfd) { |
| 33 | this.xfd = xfd; |
| 34 | } |
| 35 | |
| 36 | public XosFunctionDescriptor descriptor() { |
| 37 | return xfd; |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * {@inheritDoc} |
| 42 | * <p> |
| 43 | * This default implementation throws an exception. |
| 44 | * |
| 45 | * @param user user to apply the change to |
| 46 | * @param param parameter name |
| 47 | * @param value new parameter value |
| 48 | * @throws UnsupportedOperationException if invoked |
| 49 | */ |
| 50 | public void applyParam(SubscriberUser user, String param, String value) { |
| 51 | throw new UnsupportedOperationException(); |
| 52 | } |
| 53 | |
| 54 | public Memento createMemento() { |
| 55 | return null; |
| 56 | } |
| 57 | |
| 58 | } |