public abstract class DXDataObject extends DXObject
Instances of this class are JSON-serialized as a DNAnexus link, which
makes it suitable to provide an object with references to DXDataObjects as
the input when running a DXApplet
, etc.
Modifier and Type | Class and Description |
---|---|
protected static class |
DXDataObject.Builder<T extends DXDataObject.Builder<T,U>,U extends DXDataObject>
Abstract builder class for creating a new data object of class
U . |
static class |
DXDataObject.Describe
Contains metadata for a data object (fields common to all data objects).
|
static class |
DXDataObject.DescribeOptions
Configuration options for a describe call on a data object (e.g.
describe(DescribeOptions) ) to control what optional fields get returned
and what project to obtain project-specific metadata from. |
Modifier and Type | Field and Description |
---|---|
protected com.fasterxml.jackson.databind.JsonNode |
cachedDescribe |
Modifier | Constructor and Description |
---|---|
protected |
DXDataObject(String dxId,
String className,
DXContainer project,
DXEnvironment env,
com.fasterxml.jackson.databind.JsonNode cachedDescribe)
Initializes the
DXDataObject to point to the object with the specified ID in the
specified project. |
protected |
DXDataObject(String dxId,
String className,
DXEnvironment env,
com.fasterxml.jackson.databind.JsonNode cachedDescribe)
Initializes the
DXDataObject to point to the object with the specified ID in the
environment's workspace. |
Modifier and Type | Method and Description |
---|---|
void |
addTags(List<String> tags)
Adds the specified tags to the object.
|
void |
addTypes(List<String> types)
Adds the specified types to the object.
|
protected void |
checkCachedDescribeAvailable()
Verifies that this object carries cached describe data.
|
protected static void |
checkDXLinkFormat(Map<String,Object> value)
Verifies that the specified map has the format of a DNAnexus link.
|
DXDataObject |
close()
Closes the data object.
|
DXDataObject |
closeAndWait()
Closes the data object and waits until the close operation is complete.
|
DXDataObject.Describe |
describe()
Returns metadata about the data object.
|
DXDataObject.Describe |
describe(DXDataObject.DescribeOptions options)
Returns metadata about the data object, specifying which optional fields are to be returned
and what project to obtain project-specific metadata from.
|
boolean |
equals(Object obj) |
DXDataObject.Describe |
getCachedDescribe()
Returns metadata about the data object, like
describe() , but without
making an API call. |
static DXDataObject |
getInstance(String objectId)
Returns a
DXDataObject corresponding to an existing object with the specified ID. |
static DXDataObject |
getInstance(String objectId,
DXContainer project)
Returns a
DXDataObject corresponding to an existing object with the specified ID in
the specified project or container. |
static DXDataObject |
getInstanceWithEnvironment(String objectId,
DXContainer project,
DXEnvironment env)
Returns a
DXDataObject corresponding to an existing object with the specified ID in
the specified project or container, using the specified environment. |
static DXDataObject |
getInstanceWithEnvironment(String objectId,
DXEnvironment env)
Returns a
DXDataObject corresponding to an existing object with the specified ID,
using the specified environment. |
com.fasterxml.jackson.databind.JsonNode |
getLinkAsJson()
Returns a DNAnexus link for this object.
|
DXContainer |
getProject()
Returns the object's project or container, if it was explicitly supplied.
|
int |
hashCode() |
Map<DXContainer,AccessLevel> |
listProjects()
Returns the set of projects that contain this object, and which the requesting user has
permissions to access.
|
void |
putAllProperties(Map<String,String> properties)
Sets properties on the object.
|
void |
putAllProperties(Map<String,String> propertiesToSet,
List<String> propertiesToRemove)
Sets and removes properties on the object.
|
void |
putProperty(String key,
String value)
Sets a property on the object.
|
void |
removeProperty(String key)
Removes a property from the object.
|
void |
removeTags(List<String> tags)
Removes the specified tags from the object.
|
void |
removeTypes(List<String> types)
Removes the specified types from the object.
|
void |
rename(String newName)
Changes the name of the object in its project.
|
void |
setDetails(Object details)
Sets the details of the object.
|
void |
setVisibility(boolean visible)
Makes the object visible or hidden.
|
apiCallOnObject, apiCallOnObject, getId, toString
protected DXDataObject(String dxId, String className, DXContainer project, DXEnvironment env, com.fasterxml.jackson.databind.JsonNode cachedDescribe)
DXDataObject
to point to the object with the specified ID in the
specified project.dxId
- DNAnexus ID of the data objectclassName
- class name that should prefix the IDenv
- environment to use for subsequent API requests from this DXDataObject
, or
null to use the default environmentcachedDescribe
- JSON hash of the describe output for this object if available, or null
otherwiseprotected DXDataObject(String dxId, String className, DXEnvironment env, com.fasterxml.jackson.databind.JsonNode cachedDescribe)
DXDataObject
to point to the object with the specified ID in the
environment's workspace.
Operations that use or retrieve project-specific metadata will fail if the object does not
exist in the environment's workspace. When a project is available, you should prefer to set
it explicitly via DXDataObject(String, String, DXContainer, DXEnvironment, JsonNode)
.
dxId
- DNAnexus ID of the data objectclassName
- class name that should prefix the IDenv
- environment to use for subsequent API requests from this DXDataObject
, or
null to use the default environmentcachedDescribe
- JSON hash of the describe output for this object if available, or null
otherwiseprotected static void checkDXLinkFormat(Map<String,Object> value)
value
- putative DNAnexus linkpublic static DXDataObject getInstance(String objectId)
DXDataObject
corresponding to an existing object with the specified ID.objectId
- DNAnexus object idDXDataObject
handle to the specified objectpublic static DXDataObject getInstance(String objectId, DXContainer project)
DXDataObject
corresponding to an existing object with the specified ID in
the specified project or container.objectId
- DNAnexus object idproject
- project or container in which the object residesDXDataObject
handle to the specified objectpublic static DXDataObject getInstanceWithEnvironment(String objectId, DXContainer project, DXEnvironment env)
DXDataObject
corresponding to an existing object with the specified ID in
the specified project or container, using the specified environment.objectId
- DNAnexus object idproject
- project or container in which the object residesenv
- environment to use to make subsequent API requestsDXDataObject
handle to the specified objectpublic static DXDataObject getInstanceWithEnvironment(String objectId, DXEnvironment env)
DXDataObject
corresponding to an existing object with the specified ID,
using the specified environment.objectId
- DNAnexus object idenv
- environment to use to make subsequent API requestsDXDataObject
handle to the specified objectpublic void addTags(List<String> tags)
The tags are modified in the project or container associated with this DXDataObject
,
or the environment's workspace if no project or container was explicitly specified.
tags
- List of tags to add to the objectNullPointerException
- if this object has no associated project and no workspace is setpublic void addTypes(List<String> types)
types
- List of types to add to the objectprotected void checkCachedDescribeAvailable() throws IllegalStateException
IllegalStateException
- if cachedDescribe is not set.public DXDataObject close()
Returns the same object so you can chain calls.
DXDataObject
public DXDataObject closeAndWait()
Returns the same object so you can chain calls.
DXDataObject
public DXDataObject.Describe describe()
The properties and details fields will not be returned, and any project-specific metadata
fields will be selected from an arbitrary project in which the requesting user has access to
this object. To change either of these aspects of this behavior, use
describe(DescribeOptions)
instead.
Describe
containing the data object's metadata.public DXDataObject.Describe describe(DXDataObject.DescribeOptions options)
options
- DescribeOptions
object specifying how the describe
request is
to be made.Describe
containing the data object's metadata.public DXDataObject.Describe getCachedDescribe()
describe()
, but without
making an API call.
This cached describe info is only available if this object appears in the result of a
DXSearch.findDataObjects()
call that specified
DXSearch.FindDataObjectsRequestBuilder.includeDescribeOutput()
, and the describe info
that is returned reflects the state of the object at the time that the search was performed.
Describe
containing the data object's metadataIllegalStateException
- if no cached describe info is availablepublic com.fasterxml.jackson.databind.JsonNode getLinkAsJson()
public DXContainer getProject()
null
if none was specified at object creation timepublic Map<DXContainer,AccessLevel> listProjects()
public void putAllProperties(Map<String,String> properties)
The properties are modified in the project or container associated with this
DXDataObject
, or the environment's workspace if no project or container was
explicitly specified.
properties
- Map from key to value for each property to be setNullPointerException
- if this object has no associated project and no workspace is setpublic void putAllProperties(Map<String,String> propertiesToSet, List<String> propertiesToRemove)
The properties are modified in the project or container associated with this
DXDataObject
, or the environment's workspace if no project or container was
explicitly specified.
propertiesToSet
- Map from key to value for each property to be setpropertiesToRemove
- List of property keys to be removedNullPointerException
- if this object has no associated project and no workspace is setpublic void putProperty(String key, String value)
The properties are modified in the project or container associated with this
DXDataObject
, or the environment's workspace if no project or container was
explicitly specified.
key
- property key to setvalue
- property value to setNullPointerException
- if this object has no associated project and no workspace is setpublic void removeProperty(String key)
The properties are modified in the project or container associated with this
DXDataObject
, or the environment's workspace if no project or container was
explicitly specified.
key
- property key to be removedNullPointerException
- if this object has no associated project and no workspace is setpublic void removeTags(List<String> tags)
The tags are modified in the project or container associated with this DXDataObject
,
or the environment's workspace if no project or container was explicitly specified.
tags
- List of tags to removeNullPointerException
- if this object has no associated project and no workspace is setpublic void removeTypes(List<String> types)
types
- List of types to removepublic void rename(String newName)
The object is renamed in the project or container associated with this DXDataObject
,
or the environment's workspace if no project or container was explicitly specified.
newName
- The new name of the objectNullPointerException
- if this object has no associated project and no workspace is setpublic void setDetails(Object details)
details
- an object whose JSON serialized form will be set as the detailspublic void setVisibility(boolean visible)
visible
- Copyright © 2023. All Rights Reserved.