All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.labkey.remoteapi.assay.SaveAssayRunsCommand Maven / Gradle / Ivy

Go to download

The client-side library for Java developers is a separate JAR from the LabKey Server code base. It can be used by any Java program, including another Java web application.

There is a newer version: 6.2.0
Show newest version
package org.labkey.remoteapi.assay;


import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.labkey.remoteapi.PostCommand;

import java.util.List;

/**
 * Saves runs on the server.
 */
public class SaveAssayRunsCommand extends PostCommand
{
    private List _runs;
    private String _protocolName;

    /**
     * @param protocolName name of the protocol to use
     * @param runs the runs to be saved
     */
    public SaveAssayRunsCommand(String protocolName, List runs)
    {
        super("assay", "saveAssayRuns");
        _runs = runs;
        _protocolName = protocolName;
    }

    public SaveAssayRunsCommand(SaveAssayRunsCommand source)
    {
        super(source);
        _runs = source._runs;
    }

    @Override
    public PostCommand copy()
    {
        return new SaveAssayRunsCommand(this);
    }

    @Override
    public JSONObject getJsonObject()
    {
        JSONObject result = new JSONObject();
        JSONArray runs = new JSONArray();
        for (Run run : _runs)
        {
            runs.add(run.toJSONObject());
        }
        result.put("runs", runs);
        result.put("protocolName", getProtocolName());
        return result;
    }

    @Override
    protected SaveAssayRunsResponse createResponse(String text, int status, String contentType, JSONObject json)
    {
        return new SaveAssayRunsResponse(text, status, contentType, json, this);
    }

    public List getRuns()
    {
        return _runs;
    }

    public void setRuns(List runs)
    {
        _runs = runs;
    }

    public String getProtocolName()
    {
        return _protocolName;
    }

    public void setProtocolName(String protocolName)
    {
        _protocolName = protocolName;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy