Package com.dnanexus

Class DXObject

  • Direct Known Subclasses:
    DXContainer, DXDataObject, DXExecution

    public abstract class DXObject
    extends Object
    Base class for all objects in the DNAnexus Platform.

    Two DXObjects are considered to be equal if they have the same DNAnexus object ID. The environment is not considered when testing for equality.

    • Field Detail

      • MAPPER

        protected static final com.fasterxml.jackson.databind.ObjectMapper MAPPER
      • dxId

        protected final String dxId
        The ID of this object (this is the base for URLs used in API calls, /object-id/verb).
      • env

        protected final DXEnvironment env
        Environment object to use for API calls. This should also be propagated to any new object handlers created by this object.
    • Constructor Detail

      • DXObject

        protected DXObject​(String dxId,
                           String className,
                           DXEnvironment env)
        Creates a new object with the specified ID and environment.
        Parameters:
        dxId - DNAnexus object ID, e.g. "file-xxxx"
        className - desired class name that should be a prefix of the object ID, or null to perform no prefix check
        env - Environment to use for API queries, or null to use the default environment.
    • Method Detail

      • getId

        public String getId()
        Returns the ID of the object.
        Returns:
        the DNAnexus object ID
      • apiCallOnObject

        protected com.fasterxml.jackson.databind.JsonNode apiCallOnObject​(String method,
                                                                          com.fasterxml.jackson.databind.JsonNode input,
                                                                          DXHTTPRequest.RetryStrategy retryStrategy)
        Calls the specified API method on this object (with the specified input hash) and returns its result. Subclasses can use this method to call API methods with the correct object ID and environment settings.
        Parameters:
        method - Name of method, e.g. "describe"
        input - Request payload (to be converted to JSON)
        retryStrategy - Indicates whether the request is idempotent and can be retried
      • apiCallOnObject

        protected com.fasterxml.jackson.databind.JsonNode apiCallOnObject​(String method,
                                                                          DXHTTPRequest.RetryStrategy retryStrategy)
        Calls the specified API method on this object (with an empty input hash) and returns its result. Subclasses can use this method to call API methods with the correct object ID and environment settings.
        Parameters:
        method - Name of method, e.g. "describe"
        retryStrategy - Indicates whether the request is idempotent and can be retried
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object