Simon Hunt | f844f63 | 2015-05-20 19:06:35 -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 | /** |
| 21 | * Designates XOS Functions. |
| 22 | */ |
| 23 | public enum XosFunctionDescriptor { |
| 24 | /** |
| 25 | * Internet function. |
| 26 | */ |
| 27 | INTERNET("internet", |
| 28 | "Internet", |
Simon Hunt | 90dc8c5 | 2015-05-27 16:56:03 -0700 | [diff] [blame] | 29 | "Basic internet connectivity.", |
| 30 | false), |
Simon Hunt | f844f63 | 2015-05-20 19:06:35 -0700 | [diff] [blame] | 31 | |
| 32 | /** |
| 33 | * Firewall function. |
| 34 | */ |
| 35 | FIREWALL("firewall", |
| 36 | "Firewall", |
Simon Hunt | 90dc8c5 | 2015-05-27 16:56:03 -0700 | [diff] [blame] | 37 | "Normal firewall protection.", |
| 38 | true), |
Simon Hunt | f844f63 | 2015-05-20 19:06:35 -0700 | [diff] [blame] | 39 | |
| 40 | /** |
| 41 | * URL Filtering function (parental controls). |
| 42 | */ |
Simon Hunt | a29c87b | 2015-05-21 09:56:19 -0700 | [diff] [blame] | 43 | URL_FILTER("url_filter", |
| 44 | "Parental Control", |
Simon Hunt | 90dc8c5 | 2015-05-27 16:56:03 -0700 | [diff] [blame] | 45 | "Variable levels of URL filtering.", |
| 46 | true), |
| 47 | |
| 48 | /** |
| 49 | * Content Distribution function. |
| 50 | */ |
| 51 | CDN("cdn", |
| 52 | "CDN", |
| 53 | "Content Distribution Network service.", |
| 54 | true); |
| 55 | |
Simon Hunt | f844f63 | 2015-05-20 19:06:35 -0700 | [diff] [blame] | 56 | |
| 57 | private final String id; |
| 58 | private final String displayName; |
| 59 | private final String description; |
Simon Hunt | 90dc8c5 | 2015-05-27 16:56:03 -0700 | [diff] [blame] | 60 | private final boolean backend; |
Simon Hunt | f844f63 | 2015-05-20 19:06:35 -0700 | [diff] [blame] | 61 | |
Simon Hunt | 90dc8c5 | 2015-05-27 16:56:03 -0700 | [diff] [blame] | 62 | XosFunctionDescriptor(String id, String displayName, String description, |
| 63 | boolean backend) { |
Simon Hunt | f844f63 | 2015-05-20 19:06:35 -0700 | [diff] [blame] | 64 | this.id = id; |
| 65 | this.displayName = displayName; |
| 66 | this.description = description; |
Simon Hunt | 90dc8c5 | 2015-05-27 16:56:03 -0700 | [diff] [blame] | 67 | this.backend = backend; |
Simon Hunt | f844f63 | 2015-05-20 19:06:35 -0700 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Returns this function's internal identifier. |
| 72 | * |
| 73 | * @return the identifier |
| 74 | */ |
| 75 | public String id() { |
| 76 | return id; |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Returns this function's display name. |
| 81 | * |
| 82 | * @return display name |
| 83 | */ |
| 84 | public String displayName() { |
| 85 | return displayName; |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Returns a short, textual description of the function. |
| 90 | * |
| 91 | * @return textual description |
| 92 | */ |
| 93 | public String description() { |
| 94 | return description; |
| 95 | } |
| 96 | |
Simon Hunt | 90dc8c5 | 2015-05-27 16:56:03 -0700 | [diff] [blame] | 97 | /** |
| 98 | * Returns true if this function is supported by the XOS backend. |
| 99 | * |
| 100 | * @return true if backend function exists |
| 101 | */ |
| 102 | public boolean backend() { |
| 103 | return backend; |
| 104 | } |
| 105 | |
Simon Hunt | f844f63 | 2015-05-20 19:06:35 -0700 | [diff] [blame] | 106 | } |