Package org.marketcetera.strategy
Class StrategyRpcClient.FileUploadObserver
- java.lang.Object
-
- org.marketcetera.strategy.StrategyRpcClient.FileUploadObserver
-
- All Implemented Interfaces:
io.grpc.stub.StreamObserver<StrategyRpc.FileUploadResponse>
- Enclosing class:
- StrategyRpcClient
private static class StrategyRpcClient.FileUploadObserver extends Object implements io.grpc.stub.StreamObserver<StrategyRpc.FileUploadResponse>
Observes the file upload process.- Since:
- $Release$
- Version:
- $Id$
- Author:
- Colin DuPlantis
-
-
Field Summary
Fields Modifier and Type Field Description private doublebytesUploadedindicates the total number of bytes uploaded so farprivate booleancompletedindicates if the file upload has completed or notprivate StrategyTypesRpc.FileUploadStatuscurrentStatusholds the current status of the uploadprivate doublefileSizeindicates the total size of the file to be uploadedprivate FileUploadRequestrequestholds the file upload requestprivate ThrowableuploadErrorholds the error that occurred during upload, if any
-
Constructor Summary
Constructors Constructor Description FileUploadObserver(FileUploadRequest inRequest)Create a new FileUploadObserver instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidincrementBytesUploaded(int inSize)Increment the bytes uploaded value.voidonCompleted()voidonError(Throwable inError)voidonNext(StrategyRpc.FileUploadResponse inFileUploadResponse)private voidsetFileSize(long inFileSize)Sets the size of the file to be uploaded.
-
-
-
Field Detail
-
bytesUploaded
private double bytesUploaded
indicates the total number of bytes uploaded so far
-
fileSize
private double fileSize
indicates the total size of the file to be uploaded
-
request
private final FileUploadRequest request
holds the file upload request
-
completed
private boolean completed
indicates if the file upload has completed or not
-
uploadError
private Throwable uploadError
holds the error that occurred during upload, if any
-
currentStatus
private StrategyTypesRpc.FileUploadStatus currentStatus
holds the current status of the upload
-
-
Constructor Detail
-
FileUploadObserver
public FileUploadObserver(FileUploadRequest inRequest)
Create a new FileUploadObserver instance.- Parameters:
inRequest- aFileUploadRequestvalue
-
-
Method Detail
-
incrementBytesUploaded
public void incrementBytesUploaded(int inSize)
Increment the bytes uploaded value.- Parameters:
inSize- anintvalue
-
setFileSize
private void setFileSize(long inFileSize)
Sets the size of the file to be uploaded.- Parameters:
inFileSize- alongvalue
-
onNext
public void onNext(StrategyRpc.FileUploadResponse inFileUploadResponse)
- Specified by:
onNextin interfaceio.grpc.stub.StreamObserver<StrategyRpc.FileUploadResponse>
-
onError
public void onError(Throwable inError)
- Specified by:
onErrorin interfaceio.grpc.stub.StreamObserver<StrategyRpc.FileUploadResponse>
-
onCompleted
public void onCompleted()
- Specified by:
onCompletedin interfaceio.grpc.stub.StreamObserver<StrategyRpc.FileUploadResponse>
-
-