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 aroundClientResponsethat implementsCloseable.static final classThe Class ECaccessRESTApplication.static final classThe Class MonitorRequest.static final classThe Class PutRequest.static final classThe Class UpdateDataRequest. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(DataTransfer dataTransfer) Stop the transmission of the DataTransfer on the mover.voidDelete the physical file associated to the DataFile on the mover.getECauthToken(String user) Request a ecauth token to allow a connection to a ecauth compliant server.getHostReport(Host host) Gets the host report.Gets the mover report.static RESTClient.PutRequestgetPutRequest(DataTransfer transfer, String fileName, Long localPosn, Long remotePosn) Request for a transmission of a DataTransfer.Get the version of the remote ECaccess software (mover).booleanisValidDataFile(long dataFileId) Check if the DataFile exists and is not expired.longproxyHostIsAlive(String name) Send a live message from the ProxyHost to the Master server.voidpurge(List<ExistingStorageDirectory> directories) Purge.put(DataTransfer transfer, String fileName, long localPosn, long remotePosn) Request a transmission of the DataTransfer with the target name as specified in fileName.voidsendMessage(RESTClient.MonitorRequest request) Send a message using Monitor.voidupdateData(Host host) Request an update of the data part of the Host on the master (e.g. when the data is updated by the ectrans module).voidRequest 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) Request an update of the transfers on the master (e.g. status).voidupdateLocation(Host host) Update location.
-
Method Details
-
getVersion
Get the version of the remote ECaccess software (mover).- Specified by:
getVersionin interfaceRESTInterface- Returns:
- the version
- Throws:
org.apache.wink.common.RestException- the rest exception
-
del
Delete the physical file associated to the DataFile on the mover.- Specified by:
delin interfaceRESTInterface- Parameters:
dataFile- the data file- Throws:
org.apache.wink.common.RestException- the rest exception
-
close
Stop the transmission of the DataTransfer on the mover.- Specified by:
closein interfaceRESTInterface- Parameters:
dataTransfer- the data transfer- Throws:
org.apache.wink.common.RestException- the rest exception
-
purge
public void purge(List<ExistingStorageDirectory> directories) throws org.apache.wink.common.RestException Purge. Request 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:
org.apache.wink.common.RestException- the rest exception
-
getHostReport
Gets the host report. Request a report for the specified Host (e.g. traceroute, paping, mtr).- Specified by:
getHostReportin interfaceRESTInterface- Parameters:
host- the host- Returns:
- the host report
- Throws:
org.apache.wink.common.RestException- the rest exception
-
getMoverReport
Gets the mover report. Request a report from the Data Mover (e.g. df, sar).- Specified by:
getMoverReportin interfaceRESTInterface- Returns:
- the mover report
- Throws:
org.apache.wink.common.RestException- the rest exception
-
put
public String put(DataTransfer transfer, String fileName, long localPosn, long remotePosn) throws org.apache.wink.common.RestException Request a transmission of the DataTransfer with the target name as specified in fileName.- Specified by:
putin interfaceRESTInterface- Parameters:
transfer- the transferfileName- the file namelocalPosn- the local posnremotePosn- the remote posn- Returns:
- the string
- Throws:
org.apache.wink.common.RestException- the rest exception
-
getECauthToken
Request 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:
org.apache.wink.common.RestException- the rest exception
-
isValidDataFile
Check 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:
Exception- the exception
-
proxyHostIsAlive
Send a live message from the ProxyHost to the Master server.- Specified by:
proxyHostIsAlivein interfaceRESTInterface- Parameters:
name- the name- Returns:
- the long
- Throws:
org.apache.wink.common.RestException- the rest exception
-
updateDataRequest
public void updateDataRequest(RESTClient.UpdateDataRequest request) throws org.apache.wink.common.RestException 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:
updateDataRequestin interfaceRESTInterface- Parameters:
request- the request- Throws:
org.apache.wink.common.RestException- the rest exception
-
updateData
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:
updateDatain interfaceRESTInterface- Parameters:
host- the host- Throws:
org.apache.wink.common.RestException- the rest exception
-
updateLocation
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:
updateLocationin interfaceRESTInterface- Parameters:
host- the host- Throws:
org.apache.wink.common.RestException- the rest exception
-
updateDataTransfers
public void updateDataTransfers(List<DataTransfer> transfers) throws org.apache.wink.common.RestException Request an update of the transfers on the master (e.g. status).- Specified by:
updateDataTransfersin interfaceRESTInterface- Parameters:
transfers- the transfers- Throws:
org.apache.wink.common.RestException- the rest exception
-
sendMessage
public void sendMessage(RESTClient.MonitorRequest request) throws org.apache.wink.common.RestException Send a message using Monitor.- Specified by:
sendMessagein interfaceRESTInterface- Parameters:
request- the request- Throws:
org.apache.wink.common.RestException- the rest exception
-
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
-