Package org.labkey.remoteapi.domain
Class CreateDomainCommand
java.lang.Object
org.labkey.remoteapi.Command<ResponseType,org.apache.hc.client5.http.classic.methods.HttpPost>
- All Implemented Interfaces:
HasRequiredVersion
Command class for creating a new domain.
The domain definition can be customized by modifying the Domain
returned by getDomainDesign()
.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.labkey.remoteapi.Command
Command.CommonParameters, Command.Response
-
Field Summary
Fields inherited from class org.labkey.remoteapi.Command
CONTENT_TYPE_JSON
-
Constructor Summary
ConstructorsConstructorDescriptionCreateDomainCommand
(String kind, String domainName) Initialize command to create a domain of the specified "kind". -
Method Summary
Modifier and TypeMethodDescriptionprotected DomainResponse
createResponse
(String text, int status, String contentType, org.json.JSONObject json) Creates an instance of the response class, initialized with the response text, the HTTP status code, and parsed JSONObject.Get the domain design that will be POSTed by this command.org.json.JSONObject
Returns the JSON object to post or null for no JSON.getKind()
Get the 'options' map for the domain to be created.void
setDomainDesign
(Domain design) Set the domain design that will be POSTed by this command.void
Set the "kind" of the domain to be created.void
setOptions
(Map<String, Object> options) Set options for the domain to be created.Methods inherited from class org.labkey.remoteapi.PostCommand
createRequest
Methods inherited from class org.labkey.remoteapi.Command
_execute, createParameterMap, execute, getActionName, getControllerName, getHttpRequest, getParameters, getParamValueAsString, getRequiredVersion, getTimeout, setRequiredVersion, setTimeout
-
Constructor Details
-
CreateDomainCommand
Initialize command to create a domain of the specified "kind". Available domain kinds depends on the modules installed on the target server.- Parameters:
kind
- the "kind" of domain to create (e.g. "IntList", "DataClass")domainName
- name for the created domain
-
-
Method Details
-
getJsonObject
public org.json.JSONObject getJsonObject()Description copied from class:PostCommand
Returns the JSON object to post or null for no JSON. Override this method to provide parameters as JSON.- Returns:
- The JSON object to post.
-
getKind
- Returns:
- the "kind" of domain to be created
-
setKind
Set the "kind" of the domain to be created.- Parameters:
kind
- the "kind" of domain to create (e.g. "IntList", "DataClass")
-
getOptions
Get the 'options' map for the domain to be created.- Returns:
- domain options
-
setOptions
Set options for the domain to be created. Recognized options vary based on the domain kind specified.- Parameters:
options
- domain options
-
createResponse
protected DomainResponse createResponse(String text, int status, String contentType, org.json.JSONObject json) Description copied from class:Command
Creates an instance of the response class, initialized with the response text, the HTTP status code, and parsed JSONObject.Override this method to create an instance of a different class that extends CommandResponse
- Overrides:
createResponse
in classCommand<DomainResponse,
org.apache.hc.client5.http.classic.methods.HttpPost> - Parameters:
text
- The response text from the server.status
- The HTTP status code.contentType
- The Content-Type header value.json
- The parsed JSONObject (or null if no JSON was returned).- Returns:
- An instance of the response object.
-
getDomainDesign
Get the domain design that will be POSTed by this command. The design is mutable.- Returns:
- reference to the domain design
-
setDomainDesign
Set the domain design that will be POSTed by this command.- Parameters:
design
- domain design to be used by this command.
-