The abstract base class for all data object remote handlers. More...
#include <bindings.h>
Public Member Functions | |
DXDataObject (const DXDataObject &to_copy) | |
DXDataObject (const std::string &dxid) | |
DXDataObject (const std::string &dxid, const std::string &proj) | |
std::string | getID () const |
operator std::string () | |
std::string | getProjectID () const |
virtual void | setIDs (const std::string &dxid, const std::string &proj="default") |
virtual void | setIDs (const char *dxid, const char *proj=NULL) |
virtual void | setIDs (const JSON &dxlink) |
JSON | describe (bool incl_properties=false, bool incl_details=false) const |
void | addTypes (const JSON &types) const |
void | removeTypes (const JSON &types) const |
JSON | getDetails () const |
void | setDetails (const JSON &details) const |
void | hide () const |
void | unhide () const |
void | rename (const std::string &name) const |
void | setProperties (const JSON &properties) const |
JSON | getProperties () const |
void | addTags (const JSON &tags) const |
void | removeTags (const JSON &tags) const |
virtual void | close () const |
JSON | listProjects () const |
void | move (const std::string &dest_folder) const |
void | remove () |
Protected Member Functions | |
void | waitOnState (const std::string &state="closed", const int timeout=std::numeric_limits< int >::max()) const |
virtual JSON | describe_ (const std::string &input_params) const =0 |
virtual void | addTypes_ (const std::string &input_params) const =0 |
virtual void | removeTypes_ (const std::string &input_params) const =0 |
virtual JSON | getDetails_ (const std::string &input_params) const =0 |
virtual void | setDetails_ (const std::string &input_params) const =0 |
virtual void | setVisibility_ (const std::string &input_params) const =0 |
virtual void | rename_ (const std::string &input_params) const =0 |
virtual void | setProperties_ (const std::string &input_params) const =0 |
virtual void | addTags_ (const std::string &input_params) const =0 |
virtual void | removeTags_ (const std::string &input_params) const =0 |
virtual void | close_ (const std::string &input_params) const =0 |
virtual JSON | listProjects_ (const std::string &input_params) const =0 |
void | clone_ (const std::string &dest_proj_id, const std::string &dest_folder) const |
Protected Attributes | |
std::string | dxid_ |
std::string | proj_ |
The abstract base class for all data object remote handlers.
DXDataObject contains the common methods to all handlers, such as creation, describing, setting of properties, tags, types, visibility, details, etc.
Each DXDataObject instance has two IDs associated with it: the ID of the data object ID it is associated with, and a project ID to indicate which project's copy of the data the handler will use. Note that it is possible to have two handlers with the same data object ID but different project IDs. Both will access the same underlying data, but the name, properties, and tags are local to the project and can be modified independently.
|
inline |
Copy constructor.
|
inline |
Creates a handler for the specified remote data object.
dxid | Data object ID. |
|
inline |
Creates a handler for the specified remote data object.
dxid | Data object ID. |
proj | ID of of the project in which to access the object. |
void dx::DXDataObject::addTags | ( | const JSON & | tags | ) | const |
Adds the specified tags to the object.
See the /class-xxxx/addTags API method for more info.
tags | JSON array of strings to add as tags. |
void dx::DXDataObject::addTypes | ( | const JSON & | types | ) | const |
Adds the specified types to the object.
See the /class-xxxx/addTypes API method for more info.
types | JSON array of strings to add as types |
|
protected |
Clones the object into the specified project and folder.
See the /class-xxxx/clone API method for more info.
dest_proj_id | ID of the project into which the object should be cloned |
dest_folder | Folder route in which to put it in the destination project. |
|
virtual |
Closes the object.
JSON dx::DXDataObject::describe | ( | bool | incl_properties = false , |
bool | incl_details = false |
||
) | const |
Returns a JSON object with, at minimum, the keys "id", "class", "types", and "createdAt". Other fields may also be included, depending on the class.
incl_properties | If true, properties are included in the output. |
incl_details | If true, details are included in the output. |
JSON dx::DXDataObject::getDetails | ( | ) | const |
Retrieves the details stored in the object.
See the /class-xxxx/getDetails API method for more info.
|
inline |
|
inline |
dx::JSON dx::DXDataObject::getProperties | ( | ) | const |
Retrieves all properties of the object.
void dx::DXDataObject::hide | ( | ) | const |
Ensures that the remote object is hidden.
See the /class-xxxx/setVisibility API method for more info.
JSON dx::DXDataObject::listProjects | ( | ) | const |
Lists all projects that contain a copy of the object.
void dx::DXDataObject::move | ( | const std::string & | dest_folder | ) | const |
Moves the object into the specified folder in the same project.
dest_folder | Folder route in which to put the object |
|
inline |
This default conversion to string returns the object ID so a handler can always be passed in place of a string argument that expects an object ID.
void dx::DXDataObject::remove | ( | ) |
Removes the copy of the object from the associated project (see getProjectID()). Copies of the object in other projects are not affected.
void dx::DXDataObject::removeTags | ( | const JSON & | tags | ) | const |
Removes the specified tags from the object.
See the /class-xxxx/removeTags API method for more info.
tags | JSON array of strings to remove as tags. |
void dx::DXDataObject::removeTypes | ( | const JSON & | types | ) | const |
Removes the specified types from the object.
See the /class-xxxx/removeTypes API method for more info.
types | JSON array of strings to remove as types |
void dx::DXDataObject::rename | ( | const std::string & | name | ) | const |
Renames the object.
See the /class-xxxx/rename API method for more info.
name | New name for the object. |
void dx::DXDataObject::setDetails | ( | const JSON & | details | ) | const |
Stores the given JSON in the details of the remote object.
See the /class-xxxx/setDetails API method for more info.
details | Arbitrary JSON hash or array to store as details |
|
virtual |
Sets the object and project IDs as specified. If not specified, the project ID will be set to the default workspace.
See setWorkspaceID() and loadFromEnvironment() for more information.
dxid | ID of the associated object. |
proj | ID of the project whose copy of the data object should be accessed. If a value "default" is provided, then default workspace will be used. |
Reimplemented in dx::DXFile.
|
virtual |
Sets the object and project IDs as specified. If not specified, the project ID will be set to the default workspace.
See setWorkspaceID() and loadFromEnvironment() for more information.
dxid | ID of the associated object. |
proj | ID of the project whose copy of the data object should be accessed. (if NULL, then default workspace will be used) |
Reimplemented in dx::DXFile.
|
virtual |
Sets the object and project IDs as specified by dxlink. If project is not specified in dxlink, the project ID will be set to the default workspace.
See setWorkspaceID() and loadFromEnvironment() for more information.
dxlink | A JSON representing a DNAnexus link. You may also use the extended form: {"$dnanexus_link": {"project": proj-id, "id": obj-id}}. |
void dx::DXDataObject::setProperties | ( | const JSON & | properties | ) | const |
Sets the specified properties.
See the /class-xxxx/setProperties API method for more info.
properties | JSON hash mapping strings to strings, containing names and values of properties to set. |
void dx::DXDataObject::unhide | ( | ) | const |
Ensures that the remote object is visible.
See the /class-xxxx/setVisibility API method for more info.