Class AzureModule

java.lang.Object
ecmwf.common.ectrans.TransferModule
ecmwf.common.ectrans.module.AzureModule
All Implemented Interfaces:
Closeable, AutoCloseable

public final class AzureModule extends TransferModule
The Class AzureModule.
  • Constructor Details

    • AzureModule

      public AzureModule()
  • Method Details

    • getStatus

      public String getStatus()
      Gets the current status of the transfer module. Gets the status.
      Overrides:
      getStatus in class TransferModule
      Returns:
      the status
    • getPort

      public int getPort(ECtransSetup setup)
      Gets the port from the setup. Gets the port.
      Overrides:
      getPort in class TransferModule
      Parameters:
      setup - the setup
      Returns:
      the port
    • connect

      public void connect(String location, ECtransSetup setup) throws IOException, URISyntaxException
      Connect. Connect.
      Specified by:
      connect in class TransferModule
      Parameters:
      location - the location
      setup - the setup
      Throws:
      IOException
      URISyntaxException
    • del

      public void del(String name) throws IOException
      Delete by name. Del.
      Specified by:
      del in class TransferModule
      Parameters:
      name - the name
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • put

      public boolean put(InputStream in, String name, long posn, long size) throws IOException
      Write the content of the file given by its name, starting at position posn and writing to the provided input stream. By default, doing nothing and returning false. Put.
      Overrides:
      put in class TransferModule
      Parameters:
      in - the in
      name - the name
      posn - the posn
      size - the size
      Returns:
      true, if successful
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • put

      public OutputStream put(String name, long posn, long size) throws IOException
      Provide an output stream to write the content of the file given by its name starting at position posn. Put.
      Specified by:
      put in class TransferModule
      Parameters:
      name - the name
      posn - the posn
      size - the size
      Returns:
      the output stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • get

      public InputStream get(String name, long posn) throws IOException
      Gets the input stream to read the file given by name starting at posn. Gets the.
      Specified by:
      get in class TransferModule
      Parameters:
      name - the name
      posn - the posn
      Returns:
      the input stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • check

      public void check(long sent, String checksum) throws IOException
      Check if the last put was successful comparing the number of bytes sent and the checksum provided to the one calculated. By default, doing nothing. Check.
      Overrides:
      check in class TransferModule
      Parameters:
      sent - the sent
      checksum - the checksum
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getValue

      public String getValue(byte[] digest)
      Gets the value.
      Parameters:
      digest - the digest
      Returns:
      the value
    • size

      public long size(String name) throws IOException
      Give the size of the file given by its name. Size.
      Specified by:
      size in class TransferModule
      Parameters:
      name - the name
      Returns:
      the long
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • mkdir

      public void mkdir(String directory) throws IOException
      Make directory by name. Mkdir.
      Overrides:
      mkdir in class TransferModule
      Parameters:
      directory - the dir
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • rmdir

      public void rmdir(String directory) throws IOException
      Remove directory by name. Rmdir.
      Overrides:
      rmdir in class TransferModule
      Parameters:
      directory - the dir
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • listAsStringArray

      public String[] listAsStringArray(String directory, String pattern) throws IOException
      List as a string array. List as string array.
      Overrides:
      listAsStringArray in class TransferModule
      Parameters:
      directory - the directory
      pattern - the pattern
      Returns:
      the string[]
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • listAsByteArray

      public byte[] listAsByteArray(String directory, String pattern) throws IOException
      Default implementation to provide the list as a GZIPed byte array. The implementation should give a better implementation as this one is relying on the non optimal listAsStringArray method by default. List as byte array.
      Overrides:
      listAsByteArray in class TransferModule
      Parameters:
      directory - the directory
      pattern - the pattern
      Returns:
      the bytes
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • close

      public void close() throws IOException
      Close.
      Throws:
      IOException