Class RESTClient

java.lang.Object
ecmwf.ecpds.mover.service.RESTClient
All Implemented Interfaces:
RESTInterface

public final class RESTClient extends Object implements RESTInterface
The Class RESTClient.
  • Method Details

    • getVersion

      public String getVersion() throws org.apache.wink.common.RestException
      Gets the version of the remote ECaccess software (mover). Get the version of the remote ECaccess software (mover).
      Specified by:
      getVersion in interface RESTInterface
      Returns:
      the version
      Throws:
      org.apache.wink.common.RestException
    • del

      public void del(DataFile dataFile) throws org.apache.wink.common.RestException
      Deletes the physical file associated to the DataFile on the mover. Delete the physical file associated to the DataFile on the mover.
      Specified by:
      del in interface RESTInterface
      Parameters:
      dataFile - the data file
      Throws:
      org.apache.wink.common.RestException
    • close

      public void close(DataTransfer dataTransfer) throws org.apache.wink.common.RestException
      Stops the transmission of the DataTransfer on the mover. Stop the transmission of the DataTransfer on the mover.
      Specified by:
      close in interface RESTInterface
      Parameters:
      dataTransfer - the data transfer
      Throws:
      org.apache.wink.common.RestException
    • purge

      public void purge(List<ExistingStorageDirectory> directories) throws org.apache.wink.common.RestException
      Requests an asynchronous purge of the DataFiles on the data mover which are more than the specified date. Purge. Request an asynchronous purge of the DataFiles on the data mover which are more than the specified date.
      Specified by:
      purge in interface RESTInterface
      Parameters:
      directories - the directories
      Throws:
      org.apache.wink.common.RestException
    • getHostReport

      public String getHostReport(Host host) throws org.apache.wink.common.RestException
      Requests a report for the specified Host (e.g. traceroute, paping). Gets the host report. Request a report for the specified Host (e.g. traceroute, paping, mtr).
      Specified by:
      getHostReport in interface RESTInterface
      Parameters:
      host - the host
      Returns:
      the host report
      Throws:
      org.apache.wink.common.RestException
    • getMoverReport

      public String getMoverReport() throws org.apache.wink.common.RestException
      Requests a report from the Data Mover (e.g. df, sar). Gets the mover report. Request a report from the Data Mover (e.g. df, sar).
      Specified by:
      getMoverReport in interface RESTInterface
      Returns:
      the mover report
      Throws:
      org.apache.wink.common.RestException
    • put

      public String put(DataTransfer transfer, String fileName, long localPosn, long remotePosn) throws org.apache.wink.common.RestException
      Requests a transmission of the DataTransfer with the target name as specified in fileName. Return the name of the DataMover used for the transmission. Request a transmission of the DataTransfer with the target name as specified in fileName.
      Specified by:
      put in interface RESTInterface
      Parameters:
      transfer - the transfer
      fileName - the file name
      localPosn - the local posn
      remotePosn - the remote posn
      Returns:
      the string
      Throws:
      org.apache.wink.common.RestException
    • getECauthToken

      public ECauthToken getECauthToken(String user) throws org.apache.wink.common.RestException
      Requests a ecauth token to allow a connection to a ecauth compliant server. Request a ecauth token to allow a connection to a ecauth compliant server.
      Specified by:
      getECauthToken in interface RESTInterface
      Parameters:
      user - the user
      Returns:
      the ecauth token
      Throws:
      org.apache.wink.common.RestException
    • isValidDataFile

      public boolean isValidDataFile(long dataFileId) throws Exception
      Checks if the DataFile exists and is not expired. Check if the DataFile exists and is not expired.
      Specified by:
      isValidDataFile in interface RESTInterface
      Parameters:
      dataFileId - the data file id
      Returns:
      true, if is valid data file
      Throws:
      Exception - the exception
    • proxyHostIsAlive

      public long proxyHostIsAlive(String name) throws org.apache.wink.common.RestException
      Live message sent from the ProxyHost to the Master server. Send a live message from the ProxyHost to the Master server.
      Specified by:
      proxyHostIsAlive in interface RESTInterface
      Parameters:
      name - the name
      Returns:
      the long
      Throws:
      org.apache.wink.common.RestException
    • updateDataRequest

      public void updateDataRequest(RESTClient.UpdateDataRequest request) throws org.apache.wink.common.RestException
      Requests an update of the data part of the Host on the master (e.g. when the data is updated by the ectrans module). Request an update of the data part of the Host on the master (e.g. when the data is updated by the ectrans module).
      Specified by:
      updateDataRequest in interface RESTInterface
      Parameters:
      request - the request
      Throws:
      org.apache.wink.common.RestException
    • updateData

      public void updateData(Host host) throws org.apache.wink.common.RestException
      Requests an update of the data part of the Host on the master (e.g. when the data is updated by the ectrans module). Request an update of the data part of the Host on the master (e.g. when the data is updated by the ectrans module).
      Specified by:
      updateData in interface RESTInterface
      Parameters:
      host - the host
      Throws:
      org.apache.wink.common.RestException
    • updateLocation

      public void updateLocation(Host host) throws org.apache.wink.common.RestException
      Requests an update of the location part of the Host on the master (e.g. when the IP is updated by the ectrans module). Update location. Request an update of the location part of the Host on the master (e.g. when the IP is updated by the ectrans module).
      Specified by:
      updateLocation in interface RESTInterface
      Parameters:
      host - the host
      Throws:
      org.apache.wink.common.RestException
    • updateDataTransfers

      public void updateDataTransfers(List<DataTransfer> transfers) throws org.apache.wink.common.RestException
      Requests an update of the transfers on the master (e.g. status). Request an update of the transfers on the master (e.g. status).
      Specified by:
      updateDataTransfers in interface RESTInterface
      Parameters:
      transfers - the transfers
      Throws:
      org.apache.wink.common.RestException
    • sendMessage

      public void sendMessage(RESTClient.MonitorRequest request) throws org.apache.wink.common.RestException
      Sends a message to Monitor. Send a message using Monitor.
      Specified by:
      sendMessage in interface RESTInterface
      Parameters:
      request - the request
      Throws:
      org.apache.wink.common.RestException
    • getPutRequest

      public static RESTClient.PutRequest getPutRequest(DataTransfer transfer, String fileName, Long localPosn, Long remotePosn)
      Request for a transmission of a DataTransfer.
      Parameters:
      transfer - the transfer
      fileName - the file name
      localPosn - the local posn
      remotePosn - the remote posn
      Returns:
      the puts the request