Class RESTClient
java.lang.Object
ecmwf.ecpds.mover.service.RESTClient
- All Implemented Interfaces:
RESTInterface
The Class RESTClient.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA wrapper aroundHttpResponsethat implementsCloseable.static final classThe Class MonitorRequest.static final classThe Class PutRequest.static classReplacement for the legacy RestException.static final classThe Class UpdateDataRequest. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(DataTransfer dataTransfer) Stops the transmission of the DataTransfer on the mover.voidDeletes 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.PutRequestgetPutRequest(DataTransfer transfer, String fileName, Long localPosn, Long remotePosn) Request for a transmission of a DataTransfer.Gets the version of the remote ECaccess software (mover).booleanisValidDataFile(long dataFileId) Checks if the DataFile exists and is not expired.longproxyHostIsAlive(String name) Live message sent from the ProxyHost to the Master server.voidpurge(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.voidsendMessage(RESTClient.MonitorRequest request) Sends a message to Monitor.voidupdateData(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).voidRequests an update of the data part of the Host on the master (e.g. when the data is updated by the ectrans module).voidupdateDataTransfers(List<DataTransfer> transfers) Requests an update of the transfers on the master (e.g. status).voidupdateLocation(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
Description copied from interface:RESTInterfaceGets the version of the remote ECaccess software (mover).- Specified by:
getVersionin interfaceRESTInterface- Returns:
- the version
- Throws:
RESTClient.RestException
-
del
Description copied from interface:RESTInterfaceDeletes the physical file associated to the DataFile on the mover.- Specified by:
delin interfaceRESTInterface- Parameters:
dataFile- the data file- Throws:
RESTClient.RestException
-
close
Description copied from interface:RESTInterfaceStops the transmission of the DataTransfer on the mover.- Specified by:
closein interfaceRESTInterface- Parameters:
dataTransfer- the data transfer- Throws:
RESTClient.RestException
-
purge
Description copied from interface:RESTInterfaceRequests an asynchronous purge of the DataFiles on the data mover which are more than the specified date.- Specified by:
purgein interfaceRESTInterface- Parameters:
directories- the directories- Throws:
RESTClient.RestException
-
getHostReport
Description copied from interface:RESTInterfaceRequests a report for the specified Host (e.g. traceroute, paping).- Specified by:
getHostReportin interfaceRESTInterface- Parameters:
host- the host- Returns:
- the host report
- Throws:
RESTClient.RestException
-
getMoverReport
Description copied from interface:RESTInterfaceRequests a report from the Data Mover (e.g. df, sar).- Specified by:
getMoverReportin interfaceRESTInterface- Returns:
- the mover report
- Throws:
RESTClient.RestException
-
put
public String put(DataTransfer transfer, String fileName, long localPosn, long remotePosn) throws RESTClient.RestException Description copied from interface:RESTInterfaceRequests a transmission of the DataTransfer with the target name as specified in fileName. Return the name of the DataMover used for the transmission.- Specified by:
putin interfaceRESTInterface- Parameters:
transfer- the transferfileName- the file namelocalPosn- the local posnremotePosn- the remote posn- Returns:
- the string
- Throws:
RESTClient.RestException
-
getECauthToken
Description copied from interface:RESTInterfaceRequests a ecauth token to allow a connection to a ecauth compliant server.- Specified by:
getECauthTokenin interfaceRESTInterface- Parameters:
user- the user- Returns:
- the ecauth token
- Throws:
RESTClient.RestException
-
isValidDataFile
Description copied from interface:RESTInterfaceChecks if the DataFile exists and is not expired.- Specified by:
isValidDataFilein interfaceRESTInterface- Parameters:
dataFileId- the data file id- Returns:
- true, if is valid data file
- Throws:
RESTClient.RestException
-
proxyHostIsAlive
Description copied from interface:RESTInterfaceLive message sent from the ProxyHost to the Master server.- Specified by:
proxyHostIsAlivein interfaceRESTInterface- Parameters:
name- the name- Returns:
- the long
- Throws:
RESTClient.RestException
-
updateDataRequest
Description copied from interface:RESTInterfaceRequests 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:
updateDataRequestin interfaceRESTInterface- Parameters:
request- the request- Throws:
RESTClient.RestException
-
updateData
Description copied from interface:RESTInterfaceRequests 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:
updateDatain interfaceRESTInterface- Parameters:
host- the host- Throws:
RESTClient.RestException
-
updateLocation
Description copied from interface:RESTInterfaceRequests 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:
updateLocationin interfaceRESTInterface- Parameters:
host- the host- Throws:
RESTClient.RestException
-
updateDataTransfers
Description copied from interface:RESTInterfaceRequests an update of the transfers on the master (e.g. status).- Specified by:
updateDataTransfersin interfaceRESTInterface- Parameters:
transfers- the transfers- Throws:
RESTClient.RestException
-
sendMessage
Description copied from interface:RESTInterfaceSends a message to Monitor.- Specified by:
sendMessagein interfaceRESTInterface- Parameters:
request- the request- Throws:
RESTClient.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
-