org.labkey.remoteapi.domain.GetDomainCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of labkey-client-api Show documentation
Show all versions of labkey-client-api Show documentation
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.
package org.labkey.remoteapi.domain;
import org.json.simple.JSONObject;
import org.labkey.remoteapi.Command;
import java.util.HashMap;
import java.util.Map;
public class GetDomainCommand extends Command
{
private String _schemaName;
private String _queryName;
private Long _domainId;
public GetDomainCommand(String schemaName, String queryName)
{
super("property", "getDomain");
_schemaName = schemaName;
_queryName = queryName;
}
public GetDomainCommand(Long domainId)
{
super("property", "getDomain");
_domainId = domainId;
}
public GetDomainCommand(Command source)
{
super(source);
}
@Override
public Map getParameters()
{
Map params = new HashMap();
if (_schemaName != null && _queryName != null)
{
params.put("schemaName", _schemaName);
params.put("queryName", _queryName);
}
else if (_domainId != null)
{
params.put("domainId", _domainId);
}
return params;
}
@Override
protected DomainResponse createResponse(String text, int status, String contentType, JSONObject json)
{
return new DomainResponse(text, status, contentType, json, this);
}
public String getSchemaName()
{
return _schemaName;
}
public void setSchemaName(String schemaName)
{
_schemaName = schemaName;
}
public String getQueryName()
{
return _queryName;
}
public void setQueryName(String queryName)
{
_queryName = queryName;
}
public Long getDomainId()
{
return _domainId;
}
public void setDomainId(Long domainId)
{
_domainId = domainId;
}
}