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", |
Bri Prebilic Cole | 8b66a85 | 2015-06-10 17:15:10 -0700 | [diff] [blame] | 29 | "Discover the joys of high-speed, reliable Internet" + |
| 30 | " connectivity delivered seamlessly to your home.", |
Simon Hunt | 30abc9a | 2015-06-09 17:13:51 -0700 | [diff] [blame] | 31 | false, |
| 32 | true), |
Simon Hunt | f844f63 | 2015-05-20 19:06:35 -0700 | [diff] [blame] | 33 | |
| 34 | /** |
| 35 | * Firewall function. |
| 36 | */ |
| 37 | FIREWALL("firewall", |
| 38 | "Firewall", |
Bri Prebilic Cole | 8b66a85 | 2015-06-10 17:15:10 -0700 | [diff] [blame] | 39 | "Simple access control and filtering with minimal set-up.", |
Simon Hunt | 30abc9a | 2015-06-09 17:13:51 -0700 | [diff] [blame] | 40 | true, |
Simon Hunt | 90dc8c5 | 2015-05-27 16:56:03 -0700 | [diff] [blame] | 41 | true), |
Simon Hunt | f844f63 | 2015-05-20 19:06:35 -0700 | [diff] [blame] | 42 | |
| 43 | /** |
| 44 | * URL Filtering function (parental controls). |
| 45 | */ |
Simon Hunt | a29c87b | 2015-05-21 09:56:19 -0700 | [diff] [blame] | 46 | URL_FILTER("url_filter", |
| 47 | "Parental Control", |
Bri Prebilic Cole | 8b66a85 | 2015-06-10 17:15:10 -0700 | [diff] [blame] | 48 | "Parental Control is peace of mind that your kids are safe" + |
| 49 | " - whether you are around or away. Indicate with a " + |
| 50 | "few clicks what online content is appropriate for " + |
| 51 | "your children, and voila - you have control over" + |
| 52 | " what your kids can and cannot view.", |
Simon Hunt | 30abc9a | 2015-06-09 17:13:51 -0700 | [diff] [blame] | 53 | true, |
Simon Hunt | 90dc8c5 | 2015-05-27 16:56:03 -0700 | [diff] [blame] | 54 | true), |
| 55 | |
| 56 | /** |
| 57 | * Content Distribution function. |
| 58 | */ |
| 59 | CDN("cdn", |
| 60 | "CDN", |
| 61 | "Content Distribution Network service.", |
Simon Hunt | 30abc9a | 2015-06-09 17:13:51 -0700 | [diff] [blame] | 62 | true, |
| 63 | false); |
Simon Hunt | 90dc8c5 | 2015-05-27 16:56:03 -0700 | [diff] [blame] | 64 | |
Simon Hunt | f844f63 | 2015-05-20 19:06:35 -0700 | [diff] [blame] | 65 | |
| 66 | private final String id; |
| 67 | private final String displayName; |
| 68 | private final String description; |
Simon Hunt | 90dc8c5 | 2015-05-27 16:56:03 -0700 | [diff] [blame] | 69 | private final boolean backend; |
Simon Hunt | 30abc9a | 2015-06-09 17:13:51 -0700 | [diff] [blame] | 70 | private final boolean visible; |
Simon Hunt | f844f63 | 2015-05-20 19:06:35 -0700 | [diff] [blame] | 71 | |
Simon Hunt | 90dc8c5 | 2015-05-27 16:56:03 -0700 | [diff] [blame] | 72 | XosFunctionDescriptor(String id, String displayName, String description, |
Simon Hunt | 30abc9a | 2015-06-09 17:13:51 -0700 | [diff] [blame] | 73 | boolean backend, boolean visible) { |
Simon Hunt | f844f63 | 2015-05-20 19:06:35 -0700 | [diff] [blame] | 74 | this.id = id; |
| 75 | this.displayName = displayName; |
| 76 | this.description = description; |
Simon Hunt | 90dc8c5 | 2015-05-27 16:56:03 -0700 | [diff] [blame] | 77 | this.backend = backend; |
Simon Hunt | 30abc9a | 2015-06-09 17:13:51 -0700 | [diff] [blame] | 78 | this.visible = visible; |
Simon Hunt | f844f63 | 2015-05-20 19:06:35 -0700 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | /** |
| 82 | * Returns this function's internal identifier. |
| 83 | * |
| 84 | * @return the identifier |
| 85 | */ |
| 86 | public String id() { |
| 87 | return id; |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * Returns this function's display name. |
| 92 | * |
| 93 | * @return display name |
| 94 | */ |
| 95 | public String displayName() { |
| 96 | return displayName; |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Returns a short, textual description of the function. |
| 101 | * |
| 102 | * @return textual description |
| 103 | */ |
| 104 | public String description() { |
| 105 | return description; |
| 106 | } |
| 107 | |
Simon Hunt | 90dc8c5 | 2015-05-27 16:56:03 -0700 | [diff] [blame] | 108 | /** |
| 109 | * Returns true if this function is supported by the XOS backend. |
| 110 | * |
| 111 | * @return true if backend function exists |
| 112 | */ |
| 113 | public boolean backend() { |
| 114 | return backend; |
| 115 | } |
| 116 | |
Simon Hunt | 30abc9a | 2015-06-09 17:13:51 -0700 | [diff] [blame] | 117 | /** |
| 118 | * Returns true if this function should be shown in the GUI, in the |
| 119 | * bundle listing. |
| 120 | * |
| 121 | * @return true if to be displayed |
| 122 | */ |
| 123 | public boolean visible() { |
| 124 | return visible; |
| 125 | } |
Simon Hunt | f844f63 | 2015-05-20 19:06:35 -0700 | [diff] [blame] | 126 | } |