Search in sources :

Example 26 with StringOption

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);
}
Also used : StringOption(util.StringOption) VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep)

Example 27 with StringOption

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);
}
Also used : StringOption(util.StringOption)

Example 28 with StringOption

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);
}
Also used : StringOption(util.StringOption) Util(play.mvc.Util)

Example 29 with StringOption

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));
}
Also used : StringOption(util.StringOption)

Example 30 with StringOption

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);
}
Also used : StringOption(util.StringOption)

Aggregations

StringOption (util.StringOption)44 ArrayList (java.util.ArrayList)26 StorageSystemTypeRestRep (com.emc.storageos.model.storagesystem.type.StorageSystemTypeRestRep)20 StorageSystemTypeList (com.emc.storageos.model.storagesystem.type.StorageSystemTypeList)19 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)4 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)3 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)3 FlashException (controllers.util.FlashException)3 ComputeImageServerRestRep (com.emc.storageos.model.compute.ComputeImageServerRestRep)2 ComputeSystemRestRep (com.emc.storageos.model.compute.ComputeSystemRestRep)2 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)2 URI (java.net.URI)2 DataObjectRestRep (com.emc.storageos.model.DataObjectRestRep)1 AuthnProviderRestRep (com.emc.storageos.model.auth.AuthnProviderRestRep)1 CustomServicesPrimitiveResourceList (com.emc.storageos.model.customservices.CustomServicesPrimitiveResourceList)1 FilePolicyRestRep (com.emc.storageos.model.file.policy.FilePolicyRestRep)1 BucketRestRep (com.emc.storageos.model.object.BucketRestRep)1 ProjectRestRep (com.emc.storageos.model.project.ProjectRestRep)1 ComputeVirtualPoolRestRep (com.emc.storageos.model.vpool.ComputeVirtualPoolRestRep)1 TruststoreSettings (com.emc.vipr.model.keystore.TruststoreSettings)1