Class IRODSMetadata

java.lang.Object
org.irods.irods4j.high_level.metadata.IRODSMetadata

public class IRODSMetadata extends Object
A high-level class providing functions for modifying metadata on various iRODS entities.
Since:
0.1.0
  • Field Details

    • asAdmin

      public static final AdminTag asAdmin
      Instructs the server to execute operations using rodsadmin level privileges.
      Since:
      0.1.0
  • Constructor Details

    • IRODSMetadata

      public IRODSMetadata()
  • Method Details

    • addMetadataToCollection

      public static void addMetadataToCollection(IRODSApi.RcComm comm, String logicalPath, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Adds a single metadata triple to a collection.
      Parameters:
      comm - The connection to an iRODS server.
      logicalPath - The absolute logical path to a collection.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • addMetadataToCollection

      public static void addMetadataToCollection(AdminTag adminTag, IRODSApi.RcComm comm, String logicalPath, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Adds a single metadata triple to a collection using rodsadmin privileges.
      Parameters:
      comm - The connection to an iRODS server.
      logicalPath - The absolute logical path to a collection.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • removeMetadataFromCollection

      public static void removeMetadataFromCollection(IRODSApi.RcComm comm, String logicalPath, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Removes a single metadata triple from a collection.
      Parameters:
      comm - The connection to an iRODS server.
      logicalPath - The absolute logical path to a collection.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • removeMetadataFromCollection

      public static void removeMetadataFromCollection(AdminTag adminTag, IRODSApi.RcComm comm, String logicalPath, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Removes a single metadata triple from a collection using rodsadmin privileges.
      Parameters:
      comm - The connection to an iRODS server.
      logicalPath - The absolute logical path to a collection.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • setMetadataOnCollection

      public static void setMetadataOnCollection(IRODSApi.RcComm comm, String logicalPath, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Sets a single metadata triple on a collection.
      Parameters:
      comm - The connection to an iRODS server.
      logicalPath - The absolute logical path to a collection.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • setMetadataOnCollection

      public static void setMetadataOnCollection(AdminTag adminTag, IRODSApi.RcComm comm, String logicalPath, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Sets a single metadata triple on a collection using rodsadmin privileges.
      Parameters:
      comm - The connection to an iRODS server.
      logicalPath - The absolute logical path to a collection.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • addMetadataToDataObject

      public static void addMetadataToDataObject(IRODSApi.RcComm comm, String logicalPath, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Adds a single metadata triple to a data object.
      Parameters:
      comm - The connection to an iRODS server.
      logicalPath - The absolute logical path to a data object.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • addMetadataToDataObject

      public static void addMetadataToDataObject(AdminTag adminTag, IRODSApi.RcComm comm, String logicalPath, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Adds a single metadata triple to a data object using rodsadmin privileges.
      Parameters:
      comm - The connection to an iRODS server.
      logicalPath - The absolute logical path to a data object.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • removeMetadataFromDataObject

      public static void removeMetadataFromDataObject(IRODSApi.RcComm comm, String logicalPath, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Removes a single metadata triple from a data object.
      Parameters:
      comm - The connection to an iRODS server.
      logicalPath - The absolute logical path to a data object.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • removeMetadataFromDataObject

      public static void removeMetadataFromDataObject(AdminTag adminTag, IRODSApi.RcComm comm, String logicalPath, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Removes a single metadata triple from a data object using rodsadmin privileges.
      Parameters:
      comm - The connection to an iRODS server.
      logicalPath - The absolute logical path to a data object.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • setMetadataOnDataObject

      public static void setMetadataOnDataObject(IRODSApi.RcComm comm, String logicalPath, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Sets a single metadata triple on a data object.
      Parameters:
      comm - The connection to an iRODS server.
      logicalPath - The absolute logical path to a data object.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • setMetadataOnDataObject

      public static void setMetadataOnDataObject(AdminTag adminTag, IRODSApi.RcComm comm, String logicalPath, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Sets a single metadata triple on a data object using rodsadmin privileges.
      Parameters:
      comm - The connection to an iRODS server.
      logicalPath - The absolute logical path to a data object.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • addMetadataToResource

      public static void addMetadataToResource(IRODSApi.RcComm comm, String resourceName, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Adds a single metadata triple to a resource.

      This operation requires rodsadmin level privileges.

      Parameters:
      comm - The connection to an iRODS server.
      resourceName - The name of a resource.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • removeMetadataFromResource

      public static void removeMetadataFromResource(IRODSApi.RcComm comm, String resourceName, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Removes a single metadata triple from a resource.

      This operation requires rodsadmin level privileges.

      Parameters:
      comm - The connection to an iRODS server.
      resourceName - The name of a resource.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • setMetadataOnResource

      public static void setMetadataOnResource(IRODSApi.RcComm comm, String resourceName, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Sets a single metadata triple on a resource.

      This operation requires rodsadmin level privileges.

      Parameters:
      comm - The connection to an iRODS server.
      resourceName - The name of a resource.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • addMetadataToUserOrGroup

      public static void addMetadataToUserOrGroup(IRODSApi.RcComm comm, String userOrGroup, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Adds a single metadata triple to a user or group.

      This operation requires rodsadmin level privileges.

      Parameters:
      comm - The connection to an iRODS server.
      userOrGroup - The name of a user or group.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • removeMetadataFromUserOrGroup

      public static void removeMetadataFromUserOrGroup(IRODSApi.RcComm comm, String userOrGroup, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Removes a single metadata triple from a user or group.

      This operation requires rodsadmin level privileges.

      Parameters:
      comm - The connection to an iRODS server.
      userOrGroup - The name of a user or group.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • setMetadataOnUserOrGroup

      public static void setMetadataOnUserOrGroup(IRODSApi.RcComm comm, String userOrGroup, String attrName, String attrValue, Optional<String> attrUnits) throws IOException, IRODSException
      Sets a single metadata triple on a user or group.

      This operation requires rodsadmin level privileges.

      Parameters:
      comm - The connection to an iRODS server.
      userOrGroup - The name of a user or group.
      attrName - The metadata attribute name.
      attrValue - The metadata attribute value.
      attrUnits - The metadata attribute units.
      Throws:
      IOException
      IRODSException
      Since:
      0.1.0
    • atomicApplyMetadataOperationsToCollection

      public static IRODSMetadata.AtomicMetadataOperationsResult atomicApplyMetadataOperationsToCollection(AdminTag adminTag, IRODSApi.RcComm comm, String logicalPath, List<IRODSMetadata.AtomicMetadataOperation> operations) throws IOException
      Sequentially executes all metadata operations on a collection atomically using rodsadmin privileges.
      Parameters:
      adminTag - Instructs the server to execute the operation using rodsadmin privileges.
      comm - The connection to the iRODS server.
      logicalPath - The absolute logical path to a collection.
      operations - The list of metadata operations.
      Returns:
      An object containing error information.
      Throws:
      IOException
      Since:
      0.1.0
    • atomicApplyMetadataOperationsToCollection

      public static IRODSMetadata.AtomicMetadataOperationsResult atomicApplyMetadataOperationsToCollection(IRODSApi.RcComm comm, String logicalPath, List<IRODSMetadata.AtomicMetadataOperation> operations) throws IOException
      Sequentially executes all metadata operations on a collection atomically.
      Parameters:
      comm - The connection to the iRODS server.
      logicalPath - The absolute logical path to a collection.
      operations - The list of metadata operations.
      Returns:
      An object containing error information.
      Throws:
      IOException
      Since:
      0.1.0
    • atomicApplyMetadataOperationsToDataObject

      public static IRODSMetadata.AtomicMetadataOperationsResult atomicApplyMetadataOperationsToDataObject(AdminTag adminTag, IRODSApi.RcComm comm, String logicalPath, List<IRODSMetadata.AtomicMetadataOperation> operations) throws IOException
      Sequentially executes all metadata operations on a data object atomically using rodsadmin privileges.
      Parameters:
      adminTag - Instructs the server to execute the operation using rodsadmin privileges.
      comm - The connection to the iRODS server.
      logicalPath - The absolute logical path to a data object.
      operations - The list of metadata operations.
      Returns:
      An object containing error information.
      Throws:
      IOException
      Since:
      0.1.0
    • atomicApplyMetadataOperationsToDataObject

      public static IRODSMetadata.AtomicMetadataOperationsResult atomicApplyMetadataOperationsToDataObject(IRODSApi.RcComm comm, String logicalPath, List<IRODSMetadata.AtomicMetadataOperation> operations) throws IOException
      Sequentially executes all metadata operations on a data object atomically.
      Parameters:
      comm - The connection to the iRODS server.
      logicalPath - The absolute logical path to a data object.
      operations - The list of metadata operations.
      Returns:
      An object containing error information.
      Throws:
      IOException
      Since:
      0.1.0
    • atomicApplyMetadataOperationsToResource

      public static IRODSMetadata.AtomicMetadataOperationsResult atomicApplyMetadataOperationsToResource(IRODSApi.RcComm comm, String resourceName, List<IRODSMetadata.AtomicMetadataOperation> operations) throws IOException
      Sequentially executes all metadata operations on a resource atomically.

      This operation requires rodsadmin level privileges.

      Parameters:
      comm - The connection to the iRODS server.
      resourceName - The name of a resource.
      operations - The list of metadata operations.
      Returns:
      An object containing error information.
      Throws:
      IOException
      Since:
      0.1.0
    • atomicApplyMetadataOperationsToUserOrGroup

      public static IRODSMetadata.AtomicMetadataOperationsResult atomicApplyMetadataOperationsToUserOrGroup(IRODSApi.RcComm comm, String userOrGroup, List<IRODSMetadata.AtomicMetadataOperation> operations) throws IOException
      Sequentially executes all metadata operations on a user or group atomically.

      This operation requires rodsadmin level privileges.

      Parameters:
      comm - The connection to the iRODS server.
      userOrGroup - The name of a user or group.
      operations - The list of metadata operations.
      Returns:
      An object containing error information.
      Throws:
      IOException
      Since:
      0.1.0