use of util.StringOption in project coprhd-controller by CoprHD.
the class BlockVirtualPools method listSrdfVirtualArraysJson.
public static void listSrdfVirtualArraysJson(BlockVirtualPoolForm vpool) {
if (vpool == null) {
renderJSON(Collections.emptyList());
}
vpool.deserialize();
List<StringOption> actualOptions = Lists.newArrayList();
List<VirtualArrayRestRep> virtualArrays = await(vpool.srdfVirtualArrays().asPromise());
for (StringOption option : dataObjectOptions(virtualArrays)) {
if (!varrayAlreadyInSRDFCopies(option.id, vpool.srdfCopies)) {
actualOptions.add(option);
}
}
renderJSON(actualOptions);
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class FileProtectionPolicies method addRenderApplyPolicysAt.
private static void addRenderApplyPolicysAt() {
List<StringOption> applyPolicyAtOptions = Lists.newArrayList();
applyPolicyAtOptions.add(new StringOption(FilePolicyApplyLevel.vpool.name(), MessagesUtils.get("assignPolicy.applyAtVPool")));
applyPolicyAtOptions.add(new StringOption(FilePolicyApplyLevel.project.name(), MessagesUtils.get("assignPolicy.applyAtProject")));
applyPolicyAtOptions.add(new StringOption(FilePolicyApplyLevel.file_system.name(), MessagesUtils.get("assignPolicy.applyAtFs")));
renderArgs.put("applyPolicyOptions", applyPolicyAtOptions);
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class FileProtectionPolicies method addRenderArgs.
@Util
private static void addRenderArgs() {
List<StringOption> policyTypeOptions = Lists.newArrayList();
policyTypeOptions.add(new StringOption("file_snapshot", MessagesUtils.get("schedulePolicy.snapshot")));
policyTypeOptions.add(new StringOption("file_replication", MessagesUtils.get("schedulePolicy.replication")));
renderArgs.put("policyTypeOptions", policyTypeOptions);
List<StringOption> replicationTypeOptions = Lists.newArrayList();
replicationTypeOptions.add(new StringOption("REMOTE", MessagesUtils.get("schedulePolicy.replicationRemote")));
replicationTypeOptions.add(new StringOption("LOCAL", MessagesUtils.get("schedulePolicy.replicationLocal")));
renderArgs.put("replicationTypeOptions", replicationTypeOptions);
List<StringOption> replicationCopyTypeOptions = Lists.newArrayList();
replicationCopyTypeOptions.add(new StringOption("ASYNC", MessagesUtils.get("schedulePolicy.replicationAsync")));
renderArgs.put("replicationCopyTypeOptions", replicationCopyTypeOptions);
List<StringOption> policyPriorityOptions = Lists.newArrayList();
policyPriorityOptions.add(new StringOption("Normal", MessagesUtils.get("schedulePolicy.priorityNormal")));
policyPriorityOptions.add(new StringOption("High", MessagesUtils.get("schedulePolicy.priorityHigh")));
renderArgs.put("policyPriorityOptions", policyPriorityOptions);
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class FileProtectionPolicies method addDateTimeRenderArgs.
private static void addDateTimeRenderArgs() {
// Days of the Week
Map<String, String> daysOfWeek = Maps.newLinkedHashMap();
for (int i = 1; i <= 7; i++) {
String num = String.valueOf(i);
daysOfWeek.put(MessagesUtils.get("datetime.daysOfWeek." + num).toLowerCase(), MessagesUtils.get("datetime.daysOfWeek." + num));
}
renderArgs.put("daysOfWeek", daysOfWeek);
// Days of the Month
Map<String, String> daysOfMonth = Maps.newLinkedHashMap();
for (int i = 1; i <= 31; i++) {
String num = String.valueOf(i);
daysOfMonth.put(num, num);
}
renderArgs.put("daysOfMonth", daysOfMonth);
List<StringOption> expirationTypeOptions = Lists.newArrayList();
expirationTypeOptions.add(new StringOption("hours", MessagesUtils.get("schedulePolicy.hours")));
expirationTypeOptions.add(new StringOption("days", MessagesUtils.get("schedulePolicy.days")));
expirationTypeOptions.add(new StringOption("weeks", MessagesUtils.get("schedulePolicy.weeks")));
expirationTypeOptions.add(new StringOption("months", MessagesUtils.get("schedulePolicy.months")));
renderArgs.put("expirationTypeOptions", expirationTypeOptions);
String[] hoursOptions = new String[24];
for (int i = 0; i < 24; i++) {
String num = "";
if (i < 10) {
num = "0" + String.valueOf(i);
} else {
num = String.valueOf(i);
}
hoursOptions[i] = num;
}
String[] minutesOptions = new String[60];
for (int i = 0; i < 60; i++) {
String num = "";
if (i < 10) {
num = "0" + String.valueOf(i);
} else {
num = String.valueOf(i);
}
minutesOptions[i] = num;
}
renderArgs.put("hours", StringOption.options(hoursOptions));
renderArgs.put("minutes", StringOption.options(minutesOptions));
}
use of util.StringOption in project coprhd-controller by CoprHD.
the class Tasks method addMaxTasksRenderArgs.
private static void addMaxTasksRenderArgs() {
Integer maxTasks = params.get("maxTasks", Integer.class);
if (maxTasks == null) {
maxTasks = 100;
}
int[] tasks = { 100, 1000, 2000, 5000, 10000, -1 };
List<StringOption> options = Lists.newArrayList();
options.add(new StringOption(String.valueOf(maxTasks), MessagesUtils.get("tasks.nTasks", maxTasks)));
for (int taskCount : tasks) {
if (taskCount == maxTasks) {
options.remove(0);
}
options.add(new StringOption(String.valueOf(taskCount), MessagesUtils.get("tasks." + taskCount + "tasks")));
}
renderArgs.put("maxTasks", maxTasks);
renderArgs.put("maxTasksOptions", options);
}
Aggregations