Package com.iizix.server.run.remote
Class RemoteBuilderEndPoint
- java.lang.Object
- com.iizix.server.AbstractEndPoint
- com.iizix.server.run.remote.RemoteBuilderEndPoint
- All Implemented Interfaces:
IServerWebSocketCommListener
,ITransactionCreator
,IWSUploaderAcceptor
,WebSocketCommListener
,IEndPoint
,IRootPropTransactionSender
public class RemoteBuilderEndPoint extends AbstractEndPoint implements IWSUploaderAcceptor
End point for the Remote Customized iiziRun Builder that transports a proxy of a RuntimeBuilderProps to build the app.- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from interface com.iizix.server.IEndPoint
IEndPoint.Type
Field Summary
Fields inherited from class com.iizix.server.AbstractEndPoint
DEBUG, endPointPropertyManager, endPointType, name, propTransSender, root, server, serverSessionID, sessionInfo, threadGroup, worker
Fields inherited from interface com.iizix.server.IEndPoint
DEFAULT_HEARTBEAT_INTERVAL, STORAGE_NAME
Fields inherited from interface com.iizix.nio.WebSocketCommListener
CC_ABNORMAL_CLOSURE, CC_GOING_AWAY, CC_INTERNAL_ERROR, CC_INVALID_PAYLOAD_DATA, CC_MANDATORY_EXT, CC_MESSAGE_TOO_BIG, CC_NO_STATUS_RECEIVED, CC_NORMAL, CC_POLICY_VIOLATION, CC_PROTOCOL_ERROR, CC_SERVICE_RESTART, CC_TLS_HANDSHAKE, CC_TRY_AGAIN_LATER, CC_UNSUPPORTED_DATA
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IWSUploaderAcceptor
getAlternateAcceptor(HttpServletRequest request)
Checks if the service wishes to return an alternate uploader.java.io.File
getUploadDirectory(java.io.File defaultDir, java.util.List<WSUploadPart> parts)
Gets the directory where to store the files.boolean
isAccepted(HttpServletRequest request)
Checks if the uploader service would accept this upload request or not.protected void
onClientPropsCreated(PropCnr root)
Called when the root is created from a transaction from the client.boolean
onUploaded(java.util.List<WSUploadPart> parts)
Called when the upload has completed.protected boolean
processQueuedTransaction(int code, ReadTransaction trans)
This method must be implemented in all extending classes.Methods inherited from class com.iizix.server.AbstractEndPoint
createTransaction, dispose, getClientContextMenuReference, getEndPoint, getEndPointName, getEndPointType, getHeartBeatInterval, getProperties, getPropertyManager, getServer, getServerSessionID, getSessionInfo, getWebSocketCommListener, isConnected, onCommClosed, onCommClosing, onCommConnected, onCommData, onCommData, onCommError, onCommHeartBeat, onCommOpen, onCommTimeout, onSendHeartHeat, onSessionConnected, paramString, sendTransaction, toString
Method Detail
processQueuedTransaction
protected boolean processQueuedTransaction(int code, ReadTransaction trans)
This method must be implemented in all extending classes.- Specified by:
processQueuedTransaction
in classAbstractEndPoint
- Parameters:
code
- The transaction code.trans
- The transaction.- Returns:
- true if the transaction has been processed, false otherwise.
onClientPropsCreated
protected void onClientPropsCreated(PropCnr root)
Called when the root is created from a transaction from the client. Override to perform some additional processing such as adding server environment, etc.- Overrides:
onClientPropsCreated
in classAbstractEndPoint
isAccepted
public boolean isAccepted(HttpServletRequest request)
Checks if the uploader service would accept this upload request or not.- Specified by:
isAccepted
in interfaceIWSUploaderAcceptor
- Parameters:
request
- The request.- Returns:
- true if accepted, false otherwise.
getAlternateAcceptor
public IWSUploaderAcceptor getAlternateAcceptor(HttpServletRequest request)
Checks if the service wishes to return an alternate uploader. This can only be done once and the new instance's "getAlternateAcceptor(request)" will not be called.- Specified by:
getAlternateAcceptor
in interfaceIWSUploaderAcceptor
- Returns:
- The IWSUploaderAcceptor instance registered for the target URL, or null for default.
getUploadDirectory
public java.io.File getUploadDirectory(java.io.File defaultDir, java.util.List<WSUploadPart> parts)
Gets the directory where to store the files.- Specified by:
getUploadDirectory
in interfaceIWSUploaderAcceptor
- Parameters:
defaultDir
- The default directory where to place the files.parts
- The parts that would be saved to disk.- Returns:
- The directory where to store the files, or null to reject the request.
onUploaded
public boolean onUploaded(java.util.List<WSUploadPart> parts) throws java.io.IOException
Called when the upload has completed.- Specified by:
onUploaded
in interfaceIWSUploaderAcceptor
- Parameters:
parts
- The parts that have been written to disk.- Returns:
- true To delete the files, false to keep them. If an IOException is thrown, the default is to delete the files!
- Throws:
java.io.IOException
- If there are error e.g. reading the files.