Class RESTClient
java.lang.Object
ecmwf.ecpds.mover.service.RESTClient
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
The Class ECaccessRESTApplication.static final class
The Class MonitorRequest.static final class
The Class PutRequest.static final class
The Class UpdateDataRequest. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close
(DataTransfer dataTransfer) Stops the transmission of the DataTransfer on the mover.void
Deletes the physical file associated to the DataFile on the mover.getECauthToken
(String user) Requests a ecauth token to allow a connection to a ecauth compliant server.getHostReport
(Host host) Requests a report for the specified Host (e.g. traceroute, paping).Requests a report from the Data Mover (e.g. df, sar).static RESTClient.PutRequest
getPutRequest
(DataTransfer transfer, String fileName, Long localPosn, Long remotePosn) Request for a transmission of a DataTransfer.Gets the version of the remote ECaccess software (mover).boolean
isValidDataFile
(long dataFileId) Checks if the DataFile exists and is not expired.long
proxyHostIsAlive
(String name) Live message sent from the ProxyHost to the Master server.void
purge
(List<ExistingStorageDirectory> directories) Requests an asynchronous purge of the DataFiles on the data mover which are more than the specified date.put
(DataTransfer transfer, String fileName, long localPosn, long remotePosn) Requests a transmission of the DataTransfer with the target name as specified in fileName.void
sendMessage
(RESTClient.MonitorRequest request) Sends a message to Monitor.void
updateData
(Host host) Requests an update of the data part of the Host on the master (e.g. when the data is updated by the ectrans module).void
Requests an update of the data part of the Host on the master (e.g. when the data is updated by the ectrans module).void
updateDataTransfers
(List<DataTransfer> transfers) Requests an update of the transfers on the master (e.g. status).void
updateLocation
(Host host) Requests an update of the location part of the Host on the master (e.g. when the IP is updated by the ectrans module).
-
Method Details
-
getVersion
Gets the version of the remote ECaccess software (mover). Get the version of the remote ECaccess software (mover).- Specified by:
getVersion
in interfaceRESTInterface
- Returns:
- the version
- Throws:
org.apache.wink.common.RestException
-
del
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 interfaceRESTInterface
- Parameters:
dataFile
- the data file- Throws:
org.apache.wink.common.RestException
-
close
Stops the transmission of the DataTransfer on the mover. Stop the transmission of the DataTransfer on the mover.- Specified by:
close
in interfaceRESTInterface
- 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 interfaceRESTInterface
- Parameters:
directories
- the directories- Throws:
org.apache.wink.common.RestException
-
getHostReport
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 interfaceRESTInterface
- Parameters:
host
- the host- Returns:
- the host report
- Throws:
org.apache.wink.common.RestException
-
getMoverReport
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 interfaceRESTInterface
- 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 interfaceRESTInterface
- Parameters:
transfer
- the transferfileName
- the file namelocalPosn
- the local posnremotePosn
- the remote posn- Returns:
- the string
- Throws:
org.apache.wink.common.RestException
-
getECauthToken
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 interfaceRESTInterface
- Parameters:
user
- the user- Returns:
- the ecauth token
- Throws:
org.apache.wink.common.RestException
-
isValidDataFile
Checks if the DataFile exists and is not expired. Check if the DataFile exists and is not expired.- Specified by:
isValidDataFile
in interfaceRESTInterface
- Parameters:
dataFileId
- the data file id- Returns:
- true, if is valid data file
- Throws:
Exception
- the exception
-
proxyHostIsAlive
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 interfaceRESTInterface
- 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 interfaceRESTInterface
- Parameters:
request
- the request- Throws:
org.apache.wink.common.RestException
-
updateData
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 interfaceRESTInterface
- Parameters:
host
- the host- Throws:
org.apache.wink.common.RestException
-
updateLocation
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 interfaceRESTInterface
- 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 interfaceRESTInterface
- 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 interfaceRESTInterface
- 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 transferfileName
- the file namelocalPosn
- the local posnremotePosn
- the remote posn- Returns:
- the puts the request
-