Class UIUploadEvent
- All Implemented Interfaces:
IMessageBox
The UI Upload Event is fired for a file upload component: when the client asks to upload files, which the receiver may deny, and for what becomes of the reservation and of each of its files.
The UIUploadEvent.Type.REQUEST event is fired on the client session's worker while the client waits for its answer; every other type is fired on the application session's worker.
- Author:
- Christopher Mindus
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface IMessageBox
IMessageBox.IconField Summary
Fields inherited from interface IMessageBox
ICON_ERROR, ICON_INFORMATION, ICON_MAP, ICON_NONE, ICON_QUESTION, ICON_WARNINGConstructor Summary
ConstructorsConstructorDescriptionUIUploadEvent(UIFileUpload source, UIUploadEvent.Type type, IUploadReservation reservation, IUploadFile file, String reason, long plainBytes, long plainTotal) Constructs the event of a reservation or of one of its files.UIUploadEvent(UIFileUpload source, UploadRequest request) Constructs the event of a request.Method Summary
Modifier and TypeMethodDescriptionvoidDenies the request: the client is told it is refused, with the reason, and nothing is reserved.Gets the reason the request is denied for.getFile()Gets the file the event is about.longGets the uncompressed bytes acknowledged so far.longGets the declared uncompressed size.Gets the reason of a pause, failure or cancellation.Gets the client's request.Gets the reservation.Gets the UI component that is the source of the event.getType()Gets the type of the event.Gets the completed file: take it (IUploadedFile.take()) or delete it (IUploadedFile.delete()); a file left alone is removed with its reservation at the next sweep.booleanisDenied()Returns if the request has been denied through this event.protected StringGets the parameter string.Methods inherited from class UIBaseEvent
getAppSessionGyro, getClientSessionGyro, getContainerFirstUIComponent, getContainerFirstUIComponentNull, getFirstUIComponent, getFirstUIComponentNull, getPanelUIComponent, getPanelUIComponentNull, getUIPanel, getVirtualSpaceMethods inherited from class BaseEvent
getAction, getAction2, getActionNull, getActionNull2, getField, getField2, getFieldNull, getFieldNull2, getGroup, getGroup2, getGroupNull, getGroupNull2, getTable, getTable2, getTableNull, getTableNull2, getTime, getVirtualizedVirtualSpace, getVSComponent, getVSComponent2, getVSComponentNull, getVSComponentNull2, messageBox, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface IMessageBox
messageBox, messageBox, messageBox
Constructor Details
UIUploadEvent
Constructs the event of a request.- Parameters:
source- The source.request- The client's request.- Throws:
NullPointerException- If the source is null.
UIUploadEvent
public UIUploadEvent(UIFileUpload source, UIUploadEvent.Type type, IUploadReservation reservation, IUploadFile file, String reason, long plainBytes, long plainTotal) Constructs the event of a reservation or of one of its files.- Parameters:
source- The source.type- The type, notUIUploadEvent.Type.REQUEST.reservation- The reservation.file- The file, or null forUIUploadEvent.Type.RESERVEDandUIUploadEvent.Type.FINISHED.reason- The reason of a pause, failure or cancellation, or null.plainBytes- The uncompressed bytes acknowledged so far.plainTotal- The declared uncompressed size.- Throws:
NullPointerException- If the source is null.
Method Details
getSource
Gets the UI component that is the source of the event.- Overrides:
getSourcein classBaseEvent<UIFileUpload>- Returns:
- The file upload component.
getType
getRequest
Gets the client's request.- Returns:
- The request for
UIUploadEvent.Type.REQUEST,nullotherwise.
deny
Denies the request: the client is told it is refused, with the reason, and nothing is reserved. A deny by a listener of the component or by this event wins.- Parameters:
reason- The reason the client is told, a short code such asdenied;nullor empty fordenied.- Throws:
IllegalStateException- If the event is not aUIUploadEvent.Type.REQUEST.
isDenied
public boolean isDenied()Returns if the request has been denied through this event.- Returns:
trueifdeny(String)has been called.
getDenyReason
Gets the reason the request is denied for.- Returns:
- The reason, or
nullif the request is not denied through this event.
getReservation
Gets the reservation.- Returns:
- The reservation,
nullforUIUploadEvent.Type.REQUEST.
getFile
Gets the file the event is about.- Returns:
- The file,
nullforUIUploadEvent.Type.REQUEST,UIUploadEvent.Type.RESERVEDandUIUploadEvent.Type.FINISHED.
getUploadedFile
Gets the completed file: take it (IUploadedFile.take()) or delete it (IUploadedFile.delete()); a file left alone is removed with its reservation at the next sweep.- Returns:
- The verified file for
UIUploadEvent.Type.FILE_COMPLETED,nullotherwise.
getReason
Gets the reason of a pause, failure or cancellation.- Returns:
- The reason, or
nullfor none.
getPlainBytes
public long getPlainBytes()Gets the uncompressed bytes acknowledged so far.- Returns:
- The bytes for
UIUploadEvent.Type.FILE_PROGRESS, zero otherwise.
getPlainTotal
public long getPlainTotal()Gets the declared uncompressed size.- Returns:
- The size for
UIUploadEvent.Type.FILE_PROGRESS, zero otherwise.
paramString
Gets the parameter string.- Overrides:
paramStringin classBaseEvent<UIFileUpload>