示例#1
0
 /**
  * Changes the name of the object in its project. The basename of the object is changed to the
  * specified name and it remains in the same folder.
  *
  * <p>The object is renamed in the project or container associated with this {@code DXDataObject},
  * or the environment's workspace if no project or container was explicitly specified.
  *
  * @param newName The new name of the object
  * @throws NullPointerException if this object has no associated project and no workspace is set
  */
 public void rename(String newName) {
   Preconditions.checkNotNull(
       this.container, "Container must be supplied for this metadata operation");
   apiCallOnObject(
       "removeTags",
       MAPPER.valueToTree(new RenameRequest(this.container.getId(), newName)),
       RetryStrategy.SAFE_TO_RETRY);
 }
示例#2
0
 /**
  * Removes the specified tags from the object.
  *
  * <p>The tags are modified in the project or container associated with this {@code DXDataObject},
  * or the environment's workspace if no project or container was explicitly specified.
  *
  * @param tags List of tags to remove
  * @throws NullPointerException if this object has no associated project and no workspace is set
  */
 public void removeTags(List<String> tags) {
   Preconditions.checkNotNull(
       this.container, "Container must be supplied for this metadata operation");
   apiCallOnObject(
       "removeTags",
       MAPPER.valueToTree(new AddOrRemoveTagsRequest(this.container.getId(), tags)),
       RetryStrategy.SAFE_TO_RETRY);
 }
示例#3
0
 /**
  * Sets and removes properties on the object.
  *
  * <p>The properties are modified in the project or container associated with this {@code
  * DXDataObject}, or the environment's workspace if no project or container was explicitly
  * specified.
  *
  * @param propertiesToSet Map from key to value for each property to be set
  * @param propertiesToRemove List of property keys to be removed
  * @throws NullPointerException if this object has no associated project and no workspace is set
  */
 public void putAllProperties(
     Map<String, String> propertiesToSet, List<String> propertiesToRemove) {
   Preconditions.checkNotNull(
       this.container, "Container must be supplied for this metadata operation");
   apiCallOnObject(
       "setProperties",
       MAPPER.valueToTree(
           new SetPropertiesRequest(this.container.getId(), propertiesToSet, propertiesToRemove)),
       RetryStrategy.SAFE_TO_RETRY);
 }
示例#4
0
 /**
  * Returns metadata about the data object, specifying which optional fields are to be returned and
  * what project to obtain project-specific metadata from.
  *
  * @param options {@code DescribeOptions} object specifying how the {@code describe} request is to
  *     be made.
  * @return a {@code Describe} containing the data object's metadata.
  */
 public Describe describe(DescribeOptions options) {
   return DXJSON.safeTreeToValue(
       apiCallOnObject("describe", MAPPER.valueToTree(options), RetryStrategy.SAFE_TO_RETRY),
       Describe.class);
 }
示例#5
0
 /**
  * Adds the specified types to the object.
  *
  * @param types List of types to add to the object
  */
 public void addTypes(List<String> types) {
   apiCallOnObject(
       "addTypes",
       MAPPER.valueToTree(new AddOrRemoveTypesRequest(types)),
       RetryStrategy.SAFE_TO_RETRY);
 }
示例#6
0
 /**
  * Adds the specified tags to the object.
  *
  * <p>The tags are modified in the project or container associated with this {@code DXDataObject},
  * or the environment's workspace if no project or container was explicitly specified.
  *
  * @param tags List of tags to add to the object
  * @throws NullPointerException if this object has no associated project and no workspace is set
  */
 public void addTags(List<String> tags) {
   apiCallOnObject(
       "addTags",
       MAPPER.valueToTree(new AddOrRemoveTagsRequest(this.container.getId(), tags)),
       RetryStrategy.SAFE_TO_RETRY);
 }
示例#7
0
 /**
  * Sets the details of the data object to be created.
  *
  * @param details an object whose JSON serialized form will be set as the details
  * @return the same {@code Builder} object
  */
 public T setDetails(Object details) {
   Preconditions.checkState(this.details == null, "Cannot call setDetails more than once");
   this.details =
       MAPPER.valueToTree(Preconditions.checkNotNull(details, "details may not be null"));
   return getThisInstance();
 }
示例#8
0
 /**
  * Makes the object visible or hidden.
  *
  * @param visible
  */
 public void setVisibility(boolean visible) {
   apiCallOnObject(
       "setVisibility",
       MAPPER.valueToTree(new SetVisibilityRequest(!visible)),
       RetryStrategy.SAFE_TO_RETRY);
 }
示例#9
0
 /**
  * Sets the details of the object.
  *
  * @param details an object whose JSON serialized form will be set as the details
  */
 public void setDetails(Object details) {
   apiCallOnObject("setDetails", MAPPER.valueToTree(details), RetryStrategy.SAFE_TO_RETRY);
 }