Simon Hunt

CORD Subscriber GUI -- Minor tweaks.

Change-Id: I0cfcb4702366170d433b4d9b45d36b59a24597df
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;
19 +
20 +/**
21 + * In memory cache of the model of the subscriber's account.
22 + */
23 +public class CordModelCache {
24 +
25 +}
...@@ -59,4 +59,12 @@ public class CordWebResource { ...@@ -59,4 +59,12 @@ public class CordWebResource {
59 return fakeData("users", suffix); 59 return fakeData("users", suffix);
60 } 60 }
61 61
62 + @GET
63 + @Produces(MediaType.APPLICATION_JSON)
64 + @Path("dashboard")
65 + public Response dashboard() {
66 + // TODO:
67 + return Response.ok().build();
68 + }
69 +
62 } 70 }
......
...@@ -44,7 +44,7 @@ public class BundleFactory { ...@@ -44,7 +44,7 @@ public class BundleFactory {
44 new DefaultBundleDescriptor(FAMILY_ID, FAMILY_DISPLAY_NAME, 44 new DefaultBundleDescriptor(FAMILY_ID, FAMILY_DISPLAY_NAME,
45 XosFunctionDescriptor.INTERNET, 45 XosFunctionDescriptor.INTERNET,
46 XosFunctionDescriptor.FIREWALL, 46 XosFunctionDescriptor.FIREWALL,
47 - XosFunctionDescriptor.URL_FILTERING); 47 + XosFunctionDescriptor.URL_FILTER);
48 48
49 /** 49 /**
50 * Returns the list of available bundles. 50 * Returns the list of available bundles.
......
...@@ -38,9 +38,9 @@ public enum XosFunctionDescriptor { ...@@ -38,9 +38,9 @@ public enum XosFunctionDescriptor {
38 /** 38 /**
39 * URL Filtering function (parental controls). 39 * URL Filtering function (parental controls).
40 */ 40 */
41 - URL_FILTERING("url_filtering", 41 + URL_FILTER("url_filter",
42 - "Parental Control", 42 + "Parental Control",
43 - "Variable levels of URL filtering."); 43 + "Variable levels of URL filtering.");
44 44
45 private final String id; 45 private final String id;
46 private final String displayName; 46 private final String displayName;
......
...@@ -16,5 +16,9 @@ ...@@ -16,5 +16,9 @@
16 "params": {} 16 "params": {}
17 } 17 }
18 ] 18 ]
19 - } 19 + },
20 + "bundles": [
21 + { "id": "basic", "name": "Basic Bundle" },
22 + { "id": "family", "name": "Family Bundle" }
23 + ]
20 } 24 }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
16 "params": {} 16 "params": {}
17 }, 17 },
18 { 18 {
19 - "id": "url_filtering", 19 + "id": "url_filter",
20 "name": "Parental Control", 20 "name": "Parental Control",
21 "desc": "Variable levels of URL filtering", 21 "desc": "Variable levels of URL filtering",
22 "params": { 22 "params": {
...@@ -25,5 +25,9 @@ ...@@ -25,5 +25,9 @@
25 } 25 }
26 } 26 }
27 ] 27 ]
28 - } 28 + },
29 + "bundles": [
30 + { "id": "basic", "name": "Basic Bundle" },
31 + { "id": "family", "name": "Family Bundle" }
32 + ]
29 } 33 }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
5 "name": "Mom's MacBook", 5 "name": "Mom's MacBook",
6 "mac": "01:02:03:04:05:06", 6 "mac": "01:02:03:04:05:06",
7 "profile": { 7 "profile": {
8 - "url_filtering": { 8 + "url_filter": {
9 "level": "R" 9 "level": "R"
10 } 10 }
11 } 11 }
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
15 "name": "Dad's iPad", 15 "name": "Dad's iPad",
16 "mac": "01:02:03:04:05:77", 16 "mac": "01:02:03:04:05:77",
17 "profile": { 17 "profile": {
18 - "url_filtering": { 18 + "url_filter": {
19 "level": "R" 19 "level": "R"
20 } 20 }
21 } 21 }
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
25 "name": "Dick's laptop", 25 "name": "Dick's laptop",
26 "mac": "01:02:03:04:05:88", 26 "mac": "01:02:03:04:05:88",
27 "profile": { 27 "profile": {
28 - "url_filtering": { 28 + "url_filter": {
29 "level": "PG-13" 29 "level": "PG-13"
30 } 30 }
31 } 31 }
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
35 "name": "Jane's laptop", 35 "name": "Jane's laptop",
36 "mac": "01:02:03:04:05:99", 36 "mac": "01:02:03:04:05:99",
37 "profile": { 37 "profile": {
38 - "url_filtering": { 38 + "url_filter": {
39 "level": "PG" 39 "level": "PG"
40 } 40 }
41 } 41 }
......
...@@ -43,7 +43,7 @@ public class BundleFactoryTest { ...@@ -43,7 +43,7 @@ public class BundleFactoryTest {
43 Set<XosFunctionDescriptor> funcs = bundle.functions(); 43 Set<XosFunctionDescriptor> funcs = bundle.functions();
44 assertTrue("missing internet", funcs.contains(INTERNET)); 44 assertTrue("missing internet", funcs.contains(INTERNET));
45 assertTrue("missing firewall", funcs.contains(FIREWALL)); 45 assertTrue("missing firewall", funcs.contains(FIREWALL));
46 - assertFalse("unexpected url-f", funcs.contains(URL_FILTERING)); 46 + assertFalse("unexpected url-f", funcs.contains(URL_FILTER));
47 } 47 }
48 48
49 @Test 49 @Test
...@@ -54,7 +54,7 @@ public class BundleFactoryTest { ...@@ -54,7 +54,7 @@ public class BundleFactoryTest {
54 Set<XosFunctionDescriptor> funcs = bundle.functions(); 54 Set<XosFunctionDescriptor> funcs = bundle.functions();
55 assertTrue("missing internet", funcs.contains(INTERNET)); 55 assertTrue("missing internet", funcs.contains(INTERNET));
56 assertTrue("missing firewall", funcs.contains(FIREWALL)); 56 assertTrue("missing firewall", funcs.contains(FIREWALL));
57 - assertTrue("missing url-f", funcs.contains(URL_FILTERING)); 57 + assertTrue("missing url-f", funcs.contains(URL_FILTER));
58 } 58 }
59 59
60 } 60 }
......
...@@ -49,8 +49,8 @@ public class XosFunctionDescriptorTest { ...@@ -49,8 +49,8 @@ public class XosFunctionDescriptorTest {
49 49
50 @Test 50 @Test
51 public void urlFiltering() { 51 public void urlFiltering() {
52 - assertEquals("wrong id", "url_filtering", URL_FILTERING.id()); 52 + assertEquals("wrong id", "url_filtering", URL_FILTER.id());
53 - assertEquals("wrong display", "Parental Control", URL_FILTERING.displayName()); 53 + assertEquals("wrong display", "Parental Control", URL_FILTER.displayName());
54 - assertTrue("wrong desc", URL_FILTERING.description().startsWith("Variable")); 54 + assertTrue("wrong desc", URL_FILTER.description().startsWith("Variable"));
55 } 55 }
56 } 56 }
......