mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-22 12:51:09 +02:00
CORD GUI - added CDN to both Basic and Family Bundles, but hide it from GUI display.
Change-Id: I5fa1ca6b34ba6b49e5c498f8b3b570715d51d088
This commit is contained in:
parent
50589acc11
commit
30abc9a134
@ -53,7 +53,8 @@ public class BundleFactory extends JsonFactory {
|
|||||||
new DefaultBundleDescriptor(BASIC_ID, BASIC_DISPLAY_NAME,
|
new DefaultBundleDescriptor(BASIC_ID, BASIC_DISPLAY_NAME,
|
||||||
BASIC_DESCRIPTION,
|
BASIC_DESCRIPTION,
|
||||||
XosFunctionDescriptor.INTERNET,
|
XosFunctionDescriptor.INTERNET,
|
||||||
XosFunctionDescriptor.FIREWALL);
|
XosFunctionDescriptor.FIREWALL,
|
||||||
|
XosFunctionDescriptor.CDN);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Designates the FAMILY bundle.
|
* Designates the FAMILY bundle.
|
||||||
@ -63,6 +64,7 @@ public class BundleFactory extends JsonFactory {
|
|||||||
FAMILY_DESCRIPTION,
|
FAMILY_DESCRIPTION,
|
||||||
XosFunctionDescriptor.INTERNET,
|
XosFunctionDescriptor.INTERNET,
|
||||||
XosFunctionDescriptor.FIREWALL,
|
XosFunctionDescriptor.FIREWALL,
|
||||||
|
XosFunctionDescriptor.CDN,
|
||||||
XosFunctionDescriptor.URL_FILTER);
|
XosFunctionDescriptor.URL_FILTER);
|
||||||
|
|
||||||
// all bundles, in the order they should be listed in the GUI
|
// all bundles, in the order they should be listed in the GUI
|
||||||
@ -98,6 +100,8 @@ public class BundleFactory extends JsonFactory {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an object node representation of the given bundle.
|
* Returns an object node representation of the given bundle.
|
||||||
|
* Note that some functions (such as CDN) are not added to the output
|
||||||
|
* as we don't want them to appear in the GUI.
|
||||||
*
|
*
|
||||||
* @param bundle the bundle
|
* @param bundle the bundle
|
||||||
* @return object node
|
* @return object node
|
||||||
@ -113,7 +117,9 @@ public class BundleFactory extends JsonFactory {
|
|||||||
|
|
||||||
ArrayNode funcs = arrayNode();
|
ArrayNode funcs = arrayNode();
|
||||||
for (XosFunctionDescriptor xfd: bundle.descriptor().functions()) {
|
for (XosFunctionDescriptor xfd: bundle.descriptor().functions()) {
|
||||||
funcs.add(XosFunctionFactory.toObjectNode(xfd));
|
if (xfd.visible()) {
|
||||||
|
funcs.add(XosFunctionFactory.toObjectNode(xfd));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
bnode.set(FUNCTIONS, funcs);
|
bnode.set(FUNCTIONS, funcs);
|
||||||
root.set(BUNDLE, bnode);
|
root.set(BUNDLE, bnode);
|
||||||
|
@ -27,7 +27,8 @@ public enum XosFunctionDescriptor {
|
|||||||
INTERNET("internet",
|
INTERNET("internet",
|
||||||
"Internet",
|
"Internet",
|
||||||
"Basic internet connectivity.",
|
"Basic internet connectivity.",
|
||||||
false),
|
false,
|
||||||
|
true),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Firewall function.
|
* Firewall function.
|
||||||
@ -35,6 +36,7 @@ public enum XosFunctionDescriptor {
|
|||||||
FIREWALL("firewall",
|
FIREWALL("firewall",
|
||||||
"Firewall",
|
"Firewall",
|
||||||
"Normal firewall protection.",
|
"Normal firewall protection.",
|
||||||
|
true,
|
||||||
true),
|
true),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -43,6 +45,7 @@ public enum XosFunctionDescriptor {
|
|||||||
URL_FILTER("url_filter",
|
URL_FILTER("url_filter",
|
||||||
"Parental Control",
|
"Parental Control",
|
||||||
"Variable levels of URL filtering.",
|
"Variable levels of URL filtering.",
|
||||||
|
true,
|
||||||
true),
|
true),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -51,20 +54,23 @@ public enum XosFunctionDescriptor {
|
|||||||
CDN("cdn",
|
CDN("cdn",
|
||||||
"CDN",
|
"CDN",
|
||||||
"Content Distribution Network service.",
|
"Content Distribution Network service.",
|
||||||
true);
|
true,
|
||||||
|
false);
|
||||||
|
|
||||||
|
|
||||||
private final String id;
|
private final String id;
|
||||||
private final String displayName;
|
private final String displayName;
|
||||||
private final String description;
|
private final String description;
|
||||||
private final boolean backend;
|
private final boolean backend;
|
||||||
|
private final boolean visible;
|
||||||
|
|
||||||
XosFunctionDescriptor(String id, String displayName, String description,
|
XosFunctionDescriptor(String id, String displayName, String description,
|
||||||
boolean backend) {
|
boolean backend, boolean visible) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.displayName = displayName;
|
this.displayName = displayName;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
this.backend = backend;
|
this.backend = backend;
|
||||||
|
this.visible = visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -103,4 +109,13 @@ public enum XosFunctionDescriptor {
|
|||||||
return backend;
|
return backend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this function should be shown in the GUI, in the
|
||||||
|
* bundle listing.
|
||||||
|
*
|
||||||
|
* @return true if to be displayed
|
||||||
|
*/
|
||||||
|
public boolean visible() {
|
||||||
|
return visible;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user