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

org.labkey.remoteapi.domain.SaveDomainCommand 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.

The newest version!
package org.labkey.remoteapi.domain;

import org.json.simple.JSONObject;

public class SaveDomainCommand extends AbstractDomainUpdateCommand
{
    private String _schemaName;
    private String _queryName;
    private Long _domainId;

    public SaveDomainCommand(String schemaName, String queryName)
    {
        super("property", "saveDomain");
        _schemaName = schemaName;
        _queryName = queryName;
    }

    public SaveDomainCommand(Long domainId)
    {
        super("property", "saveDomain");
        _domainId = domainId;
    }

    @Override
    public JSONObject getJsonObject()
    {
        JSONObject result = super.getJsonObject();

        if (_schemaName != null && _queryName != null)
        {
            result.put("schemaName", _schemaName);
            result.put("queryName", _queryName);
        }
        else if (_domainId != null)
        {
            result.put("domainId", _domainId);
        }
        return result;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy