Class MultiClientManager
- java.lang.Object
-
- unlimited.fc.client.api.multiclient.MultiClientManager
-
- All Implemented Interfaces:
java.lang.AutoCloseable,FileListDataItemSource,RemoteFileSystemSource,FileTransferData,FileTransferMechanism
public class MultiClientManager extends java.lang.Object implements FileTransferMechanism
The MultiClientManager is a pooled client solution to transfers. It allows for an easy way to launch and monitor multiple transfers, auto archive small files. This MultiClientManager can be used like the FCClient, initializing it the same way, using the TransferHook to monitor the transfer It also supports a new state machine driven infrastructure allowing it to automate much of the work while allowing you to "plug in" with an event dispatch system Here is an example of a simple upload all files in the working directory with all of the skeleton code that shows different methods of handling different system events such as jobs complete, changes of state, jobs failed, in transit etc ... The code shows the old way of doing things with the TransferHook and a while() loop, but also shows how a MultiClientListenerAdapter can be added to the MultiClientManager and things can be handled that way. All that would be needed in this code to upload a vector of files however would be to call initializeManager() and simpleUpload(Vectorfiles), there is no longer a need to call initialize(), connect() and login() first, they are handled by the internal state machine. MultiClientManager m; public void initializeManager(){ //only call this method once m = new MultiClientManager("localhost",21,20); m.setUserName("user"); m.setPassword("pwd"); m.addMultiClientListener(getMultiClientListener()); } public void simpleUpload(Vector<Path> files){ TransferHook hook; try{ hook = m.upload(files); while (!hook.isTransferCancelled() && !hook.isTransferComplete() && !hook.isTransferError()) { Thread.sleep(200); } } catch (MultiClientState.StateMachineException e){ MultiClientState illegalState = e.cause(); //handle the illegal state preferably with a StateHandler.Adapter //StateHandler stateHandler = getStateMachineExceptionStateHandler(); //illegalState.getHandledBy(stateHandler); } } public MultiClientListenerAdapter getMultiClientListener(){ MultiClientListenerAdapter listener = new MultiClientListenerAdapter(){ public void handleStateMachineEvent(MultiClientEvent.StateMachineEvent evt) { //handle the state machine event, preferably with a StateHandler.Adapter //StateHandler stateHandler = getStateHandler(); //evt.getNewValue().getHandledBy(stateHandler); } public void handleJobAddedToQueueEvent(TransferJobAddedToJobQueueEvent evt) { //handle the Job event preferably with a TransferJob.JobHandler //TransferJob.JobHandler handler = getJobAddedHandler(); //evt.getNewValue().getHandledBy(handler); } public void handleJobTransferringEvent(TransferJobTransferringEvent evt) { //handle the Job event preferably with a TransferJob.JobHandler //TransferJob.JobHandler handler = getJobTransferringHandler(); //evt.getNewValue().getHandledBy(handler); } public void handleJobTransferSuccessEvent(TransferJobTransferSuccessEvent evt) { //handle the Job event preferably with a TransferJob.JobHandler //TransferJob.JobHandler handler = getJobSuccessHandler(); //evt.getNewValue().getHandledBy(handler); } public void handleFileTransferFailureEvent(TransferJobTransferFailureEvent evt) { //handle the Job event preferably with a TransferJob.JobHandler //TransferJob.JobHandler handler = getJobFailureHandler(); //evt.getNewValue().getHandledBy(handler); } public void handleJobTransferRejectionEvent(TransferJobTransferRejectionEvent evt) { //handle the Job event preferably with a TransferJob.JobHandler //TransferJob.JobHandler handler = getJobRejectedHandler(); //evt.getNewValue().getHandledBy(handler); } }; }
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface unlimited.fc.client.api.FileTransferMechanism
FileTransferMechanism.ConnectionModeType
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.function.Supplier<java.lang.Integer>AGGREGATECAPprotected CompressionDataautoArchivingSpecificCompressionDataintclientPoolSizeprotected com.google.common.collect.HashBiMap<java.lang.Integer,FileTransferMechanism>clientsprotected TransferMechanismDatadataprotected MultiClientListenerAdapter.LoggerListenerlogListenerprotected ProcessManagerprocessManagerjava.lang.StringsessionIDprotected StateSignal.StateListenerstateListenerprotected java.lang.ObjectstreamingLockprotected java.lang.ObjecttransitionalClientLock-
Fields inherited from interface unlimited.fc.client.api.FileTransferMechanism
WORKER_CLIENT_ID
-
-
Constructor Summary
Constructors Modifier Constructor Description MultiClientManager(java.lang.String remoteServer, int poolsize)Constructs an un-initialized, un-connected MultiClientManager object.MultiClientManager(java.lang.String remoteServer, int port, int poolsize)Constructs an un-initialized, un-connected MultiClientManager object.protectedMultiClientManager(java.lang.String remoteServer, int port, ClientFactory fact)Constructs an un-initialized, un-connected MultiClientManager object.protectedMultiClientManager(java.lang.String remoteServer, ClientFactory fact)Constructs an un-initialized, un-connected FCClient object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCustomLogHandler(java.util.logging.Handler handler)Adds a custom log handler to which API logs will be published.voidaddFocusedDelta(unlimited.core.util.common.tuples.Quintet<java.lang.String,java.lang.Long,java.lang.Long,java.lang.Long,java.util.concurrent.TimeUnit> focusedDelta)Adds a focused delta to the Multi-Client's post process.voidaddMultiClientListener(MultiClientListenerAdapter listener)Adds the property change listener.voidaddPostprocess(PostProcessor<?> processor)Adds a PostProcess to the client's current processor listvoidaddPreprocess(PreProcessor processor)Adds a PreProcessor to the clien's current processor listvoidaddProcessEventListener(ProcessEventDispatch.ProcessEventListener listener)Adds an event listener that is triggered when PreProcessor and PostProcessor triggersvoidaddRetransferDelta(unlimited.core.util.common.tuples.Triplet<java.lang.String,java.lang.Long,java.util.concurrent.TimeUnit> retransferDelta)Adds a re-transfer delta PostProcessor that re-transfers deltas after a file succeeds<T> java.util.stream.Stream<T>addStream(java.util.stream.Stream<T> stream)Adds a stream into the current stream listvoidaddWaitForGrowth(unlimited.core.util.common.tuples.Triplet<java.lang.String,java.lang.Long,java.util.concurrent.TimeUnit> waitForGrowth)Adds a wait for file growth PreProcessor that waits for a file to stop growing before it's transferredvoidapplyRemoteFileAttributesToLocalFile(java.nio.file.Path localFile, java.lang.String remoteFile)Applies the remote file attributes to the local file instance.voidautoDetectConectionMode()Tests what type of connection mode should be used for the transfer.voidautoDetectConectionModeDownload()This method will attempt to detect the optimal connection method based on the provided server information, HTTP servlet location, and ports.voidautoDetectConectionModeDownload(boolean testUDP, boolean portFallback)This method will attempt to detect the optimal connection method based on the provided server information, HTTP servlet location, and ports.voidautoDetectConectionModeUpload()This method will attempt to detect the optimal connection method based on the provided server information, HTTP servlet location, and ports.voidautoDetectConectionModeUpload(boolean testUDP, boolean portFallback)This method will attempt to detect the optimal connection method based on the provided server information, HTTP servlet location, and ports.voidautoDetectConectionModeUploadAndDownload()This method will attempt to detect the optimal connection method based on the provided server information, HTTP servlet location, and ports.voidautoDetectConectionModeUploadAndDownload(boolean portFallback)This method will attempt to detect the optimal connection method based on the provided server information, HTTP servlet location, and ports.booleanbumpPriority(java.lang.String path)Bump the priority of a given pending file to the head of the pending listbooleancanAcceptWork()Returns whether or not the Multi-Manager has room in the work queueuprotected voidcancelJobs()Takes the pending jobs and adds them to the unattempted job listvoidcd(java.lang.String path)Sets the current remote working directory to the specified path.voidcdup()Move up one directory on the remote directory structure.voidcheckTimeout()Deprecated.protected voidcleanupClient(FileTransferMechanism client)Cleans up the client if it is neededbooleanclientsCanStillTransfer()Returns whether or not the client can still transfervoidclose()Closes the Manager, and finishes the connection.protected voidcloseAllStreams()protected voidcloseResources()Shuts and cancels the Multi-Manager's current resourcesvoidcompleteClientFailure(TransferJob job, TransferHook hook)Method that handles marks failed transfers, and fires the corresponding TransferJobFailureEvents.voidconnect()Connect to the FileCatalyst server.booleanconnected()Returns true if connectedWeblinkResultcreateWeblink(java.util.List<java.lang.String> to, java.lang.String subject, java.lang.String message, java.util.Set<java.lang.String> files)Deprecated.WeblinkResultcreateWeblink(java.util.List<java.lang.String> to, java.lang.String subject, java.lang.String message, FileListData files)Deprecated.WeblinkResultcreateWeblink(WeblinkDataContainer data)Creates a weblink on the FileCatalyst Server with the parameters provided by the client.protected booleancreateWorkerThreads()Creates the worker threads to be used by this Multi-Client instancevoiddelete(java.lang.String file)Deletes the specified file from the remote file system.java.util.stream.Stream<unlimited.core.util.common.tuples.Pair<FileListDataItem,java.lang.Boolean>>delete(java.util.stream.Stream<FileListDataItem> toDelete)Deletes a stream of files on the Server.voiddeleteAll(java.util.List files)Delete all specified files in a single efficient command.voiddeleteAll(java.util.List<java.lang.String> files, boolean ftpDelete)Delete all specified files in a single efficient command.voiddeleteAll(FileListData files)Delete all specified files in a single efficient command.voiddeleteAll(FileListDataItem[] files)Delete all specified files in a single efficient command.voiddeRegisterStateSignal(StateSignal signal)De-registers the specified state signal and makes it so it is no longer called system when the state is enteredvoiddisconnect()Disconnect from the server.protected voiddoDisconnect()Method that contains the functionality to disconnect the clients from the systemprotected voiddoJob(TransferRunner runner)Calls the current state to execute the supplied runner.protected intdoTestAproximateDownloadSpeed()Tests the approximate download speed by using the tester clientprotected intdoTestAproximateUploadSpeed()Tests the approximate upload speed by using the tester clientprotected intdoTestMaxDownloadSpeed()Performs a series of tests to determine the maximum download speed from the connected server.protected intdoTestMaxUploadSpeed()Performs a series of tests to determine the maximum upload speed from the connected server.protected intdoTestWriteSpeed()Perform a write to current directory with recommended values for determining storage rate.protected intdoTestWriteSpeed(java.nio.file.Path file, int size, int timeout)Perform a write to specified file with specified size and timeout for determining storage rate.TransferHookdownload(java.lang.String remoteFile)Download a the specified file to the current local working directory.TransferHookdownload(java.lang.String remoteFile, java.lang.String localPath)Download the specified file to the specified local path.TransferHookdownload(java.util.List<java.lang.String> files)Downloads the files as specified by the paths (in String format) contained in the specified vector to the current working directory.TransferHookdownload(java.util.List<java.lang.String> files, java.lang.String localPath)Downloads the files as specified by the paths (in String format) contained in the specified vector to the current working directory.TransferHookdownload(java.util.List<java.lang.String> files, java.lang.String localPath, java.lang.String transferUniqueID)Downloads the files as specified by the paths (in String format) contained in the specified vector to the current working directory.TransferHookdownload(java.util.List<java.lang.String> files, java.lang.String localPath, java.lang.String transferUniqueID, boolean needsRecurse)TransferHookdownload(FileListData files)Downloads the files specified in the FileListData object to the current local working directory.TransferHookdownload(FileListData files, java.lang.String localPath)Downloads the files specified in the FileListData object to the specified path.TransferHookdownload(FileListData files, java.lang.String localPath, java.lang.String transferUniqueID)Downloads the files specified in the FileListData object to the specified path.TransferHookdownload(FileListData files, java.lang.String localPath, java.lang.String transferUniqueID, boolean needsRecurse)Downloads the files specified in the FileListData object to the specified path.TransferHookdownloadAs(java.lang.String remoteFile, java.lang.String localFile)Download the specified file to the specified local file.TransferHookdownloadAs(java.lang.String remoteFile, java.nio.file.Path localFile, java.lang.String transferUniqueID)Download the specified file to the specified local file.TransferHookdownloadAs(FileListDataItem remoteFile, java.nio.file.Path localFile, java.lang.String transferUniqueID)Download the specified file to the specified local file.voiddownloadRange(java.nio.file.Path localFile, java.lang.String remoteFile, long offset, long length)Downloads a range of information from the remote file.voiddownloadStream(java.util.stream.Stream<FileListDataItem> stream)Downloads the provided stream from the currently connected Server.protected voidendJob(FileTransferMechanism client, TransferJob job, TransferHook hook)Method that performs the necessary logic for processing TransferJob that has completed.booleanexists(java.lang.String remoteFile)Test if the remote file, denoted by the given remote path, exists on the server and returns true if it exists, false otherwise.unlimited.core.util.common.AutoClose<unlimited.core.util.common.stream.PairStream<java.lang.String,java.lang.Boolean>>exists(java.util.stream.Stream<java.lang.String> nameStream)Queries the Server for existence of all files in the provided stream.voidexportFile(java.nio.file.Path aFile)Export all settings to a properties filejava.util.PropertiesexportProperties()Export all settings to a properties objectbooleanfilesMatch(java.nio.file.Path file, java.lang.String rFile)Verifies whether a local file matches a remote file using MD5 checksumbooleanfilesMatch(java.nio.file.Path file, java.lang.String rFile, int md5RateLimit)Verifies whether a local file matches a remote file using MD5 checksumbooleanfilesMatch(java.nio.file.Path file, java.lang.String rFile, int md5RateLimit, unlimited.core.util.common.CancelHandler cancelHandler)Verifies whether a local file matches a remote file using MD5 checksumbooleanfilesMatch(java.nio.file.Path file, java.lang.String rFile, unlimited.core.util.common.CancelHandler cancelHandler)Verifies whether a local file matches a remote file using MD5 checksumjava.util.List<FileSystemEvent>fileSystemEvents(long timeout)Collects the list of file system events from the Server.voidfinish()Cleans up memory allocated by the native libraries component of FileCatalyst.protected voidfirePropertyChange(java.beans.PropertyChangeEvent evt)Fires a PropertyChange event for all objects listening for themvoidflushAllInternals()voidflushCaches()Deletes underlying caches for file sizes and date/time stampsvoidflushDispatch()the event listening is handled asynchronously inside the multi client manager.voidflushInternalTaskDispatch()Flushes the internal task dispatching system and causes the calling resource to wait until the resource has been flushed also change this commentvoidfsEvents()Prints out a list of the current file system events that are set on the server.voidget(java.lang.String localPath, java.lang.String remoteFile, int inRate, long offset, long size, int numDFEncoders, int blockSize, int unitSize, int mode)Downloads a file from the FC Server, and places it on the file system.java.util.List<java.lang.Integer>getActiveClientIDs()Gets the active client ID's each client in the pool is assigned an ID 0-n where n is the number of clients.java.util.HashSet<FileTransferMechanism>getActiveClientsCopy()Gets a list that contains an independent copy of a client objects that are currently performing work.java.util.Vector<TransferJob>getActiveJobs()Gets the currently active jobs that are being executed by this MultiClientManager.java.util.HashMap<java.lang.String,? extends HandlerData>getActivePreProcessorInfo()Returns the active preprocessor info.ServerConfigsgetAllAvailableServerConfigs()Returns all Server side configurations that the Client may be interested in.java.util.List<TransferJob>getAllWork()Returns ALL work that this MultiClient Manager has.MultiClientTransferringBandwidthManagergetBandwidthManager()intgetBlastRate()Deprecated.Method deprecated.intgetBlockSize()Return the current block size.FileCatalystClientCallbackHandlergetCallbackHandler()Returns the currently set callback handler that will be used to confirm resume, overwrite and to do post processingjava.lang.StringgetClientConnectKey()Returns the client connect key, used to connect to non-FileCatalyst serversjava.util.function.Supplier<ClientCredentials>getClientCredentials()Returns the credentials supplier that is set for this client.intgetClientIdentifier()Returns the identifier for this transfer mechanism.java.lang.StringgetClientName()Used for HotFolder Reporting, And CSV Reportsprotected com.google.common.collect.HashBiMap<java.lang.Integer,FileTransferMechanism>getClients()Returns the current clients being used by the managerprotected intgetClientSubIdentifier()Returns the current sub identifier that identifies this client as a sub component of a broader group of client apps.protected FileTransferMechanismgetClientUnderTest()Returns the client that is used for test operations.java.lang.StringgetCompFileFilter()Sets the compression FileFilter that is to be used by the implementation.intgetCompLevel()Returns the current compression level (0 - 9).intgetCompMethod()Returns the current compression method to be used during transfers.intgetCompStrategy()Returns the current compression deflater strategy that will be used in the current compression method to minimize the data and compress into smaller byte values.intgetCongCtrlStrategy()Returns the current congestion control strategy.intgetCongestionControlAggression()Returns an aggression factor between 1 (passive) and 10 (aggressive) used by the congestion control mechanism to determine how passive or aggressive it should be in the face of network congestion.ConnectivityTestResultContainergetConnectivityTestResults()Returns a data container object that contains information about whether or not uploads, downloads or overall transfers will work for all available transfer modes.intgetConnectTimeout()Return the connect timeout value (in milliseconds)MultiClientStategetCurrentState()Gets the current state.TransferMechanismDatagetData()Returns the DataObject that contains all of the transfer settings for this MultiClientManagerintgetExtendedReadTimeout()This is the length of time in milliseconds the client will wait for a reply after sending a long running command (such as MD5, MKDLT, MKSIG, ZIP, UNZIP) to the FileCatalyst server.FileCatalystFileFiltergetFileFilter()Returns the current file filter that is used to filter out information for a transfer.longgetFileSizeThreshHold()Gets the file size thresh hold.intgetFileTransferPriority()Returns the task file transfer priorityjava.lang.StringgetForceFileOwnershipGroup()Returns the groupname / groupID to be used when attempting to force group level ownership for files downloaded by the client.java.lang.StringgetForceFileOwnershipUser()Returns the username to be used when attempting to force file ownership for files downloaded by the clientHandlerDatagetHandlerData(java.lang.Integer id)java.util.HashMap<java.lang.String,HandlerData>getHandlerMap()protected java.lang.IntegergetIDForClient(FileTransferMechanism client)java.util.List<java.lang.Integer>getIdleClientIDs()Gets the idle client ID's.protected java.util.HashSet<FileTransferMechanism>getIdleClientsCopy()Creates and returns a mutable copy of the idle client listprotected intgetIdleRateSlice()intgetIncomingDataPort()Returns the port used for incoming UDP packets on downloads Only the first port will be returned in the case of v3.0 where multi-receive sockets have been enabled.int[]getIncomingDataPorts()Returns the list of ports used for incoming UDP packets on downloadsintgetIncrementalMode()Returns the current incremental mode.java.nio.file.PathgetLocalWorkingDirectoryPath()unlimited.core.util.common.logs.LogUtilsgetLogger()Returns the logger that is usedjava.lang.StringgetLogLocation()Returns the current location for the log files.intgetMaxRetries()Returns the number of times to retry a broken or interrupted transfer.intgetMaxWorkQueueRePush()java.lang.StringgetMD5(java.lang.String remote)Returns the MD5 checksum for the specified remote file if it existsjava.lang.StringgetMD5Checksum(java.lang.String rFile)Returns the MD5 checksum for the given remote fileintgetMd5RateLimit()Returns the current MD5 that is set.intgetMode()The current transfer mode of this client.ThreadSafeMultiHookgetMultiHook()Gets an updated representation of the MultiClientTransferHook getTransferHook().protected TransferJobgetNextJob()Returns the next job to be attempted by this objectintgetNumBlockReaders()Returns the number of block reader threads.intgetNumBlockWriters()Returns the number of block writer threads.intgetNumFTPStreams()Returns the number of concurrent streams that will be used for FTP transfersintgetNumPacketProcessors()Return the current number of packet processor threads.intgetNumReceiveSockets()Returns the current number of receive sockets.intgetNumSenderSockets()Return the number of Sender sockets to useintgetNumSenderThreads()Returns the number of threads that will be used at most for each FC transmission.intgetNumThreads()Returns the number of threads that will be used at most for each FC transmission.intgetNumUDPSockets()Return the number of Sender sockets to usejava.util.ObservergetObserver()Returns the Observer that is currently set.intgetPacketQueueDepth()Return the current packet queue depth.intgetPacketSize()Returns the current packet size in bytes.java.util.Vector<TransferJob>getPendingJobs()Gets the pending jobs.intgetPendingWorkCount()Gets the pending work count.intgetPoolSize()Returns the number of clients this MultiClient manager has access tojava.util.Collection<PostProcessor<?>>getPostProcessors()PostTaskSentDatagetPostTaskSentData()Returns the current post task sent datajava.lang.StringgetPostURL()Returns the current post URL to usejava.util.Collection<PreProcessor>getPreProcessors()intgetProgressiveTimeout()Returns the current progressive timeout value.java.lang.StringgetProgressiveTimeoutFilter()Returns the current progressive timeout filter.RateDistributergetRateDistributer()protected java.lang.RunnablegetRateUpdater()intgetReadBufferSizeKB()Return the current read buffer size, in KB Value zero (0) indicates read buffer is dictated by the network block size.FileTransferMechanismgetReadOnlyClient(java.lang.Integer id)Gets the read only client.FileTransferMechanismgetReadOnlyFromMasterClient()Returns a read-only client that provides read access.intgetReadTimeout()This is the length of time in milliseconds the client will wait for a reply after sending a command to the FileCatalyst server.protected java.lang.StringgetRealPwd()Returns the current working directory for the remote connection.intgetRemotePort()Gets the remote port to which this client will be connected.java.lang.StringgetRemoteServer()This method returns the remote server / hostname to which this client is connected.booleangetRenameExtension()Returns whether or not the rename extension will be used.unlimited.fc.reporting.MultiClientDataReportgetReport()this returns the report that was filled by the FCClientEngine.unlimited.fc.reporting.MultiClientReportWritergetReportWriter()For Testing Purposes OnlyRollingStartRategetRollingStartRate()java.lang.StringgetServerAgentID()Returns the server's current agent ID.java.lang.StringgetServerConfigurationValue(java.lang.String value)Gets an individual Server configuration value from the Server.intgetServerLinkExpiryDayValue()Returns the number of days that the server has configured for links to be stored.intgetServerOverrideBandwidth()Returns the override bandwidth value that has been specified by server.java.lang.StringgetServletLocation()FileCatalyst has the ability to upload using the HTTP/S protocol as long as the FileCatalyst Servlet application is installed and properly configured.intgetServletMultiplier()When uploading in HTTP mode using FileCatalyst Servlet, this option allows the upload buffer size to be tuned.intgetSessionCount()Returns the current number of active sessions that the implementation hasjava.lang.StringgetSessionID()Returns the current session ID of the implementationSessionManageModegetSessionManageMode()Returns the current session management mode that is used for this Manager instanceunlimited.core.util.common.net.ssl.FCSSLSocketProducerImplgetSSLSocketProducer()Retrieves the implementation that will be used to generate SSL socketsintgetStartRate()Returns the current start rate for FC transfers.java.util.function.Supplier<java.lang.String>getStickySessionID()Returns the current supplier that is used to generate the unique sticky session identifier that the FileCatalyst Client use when the connect to the FileCatalyst LoadBalancerFileTransferMechanismgetSynchedClient()Gets the synched client.intgetTargetRate()Returns the current target rate for this client.protected intgetTargetRateSlice()java.lang.StringgetTaskID()Returns the current task IDintgetTempMode()Returns the temporary mode for the implementationTransferMechanismDatagetTransferData()Returns a clone of the data object that contains all of the transfer settings for this MultiClientManagerbooleangetTransferEmptyDirectories()Returns whether not the implementation is set to transfer empty directories.PostURLTransfer.TransferHoldergetTransferHolder()MultiClientTransferHookgetTransferHook()Gets the Master Transfer hook.intgetTransferRate()Returns the implementation's current transfer rateprotected intgetTransferringRateSlice()intgetUnitSize()Use getPacketSizejava.lang.StringgetUserEmailAddresss()Gets the connected user's email address when calledjava.lang.StringgetUserFullName()Get The User's Full Name When CalledUserPermissionsContainergetUserPermissions()Gather's the current user's permissions that are enabled on the server.intgetUserRelativePriority()This priority hint is to help the server distribute bandwidth within its own set parameters.intgetVerifyMode()Returns the current integrity verification mode.longgetWaitRetry()Returns the amount of milliseconds to wait between retries for failed transfers.intgetWriteBufferSizeKB()Return the current write buffer size.java.lang.StringgetWriteFileMode()Gets the file write mode set Client application will use these values for downloads only.longgetZipFileSizeLimit()Returns the zip file size limit in bytes.voidhandleCurrentState(StateHandler handler)Calls the state handler to handle the current state.protected voidhandleFailedTransfer(TransferHook hook, FileTransferMechanism client, TransferJob job)Handles a failed transfer event when called.protected voidhandleSuccessfulTransfer(TransferHook hook, FileTransferMechanism client, TransferJob job)Handles a successful transfer event when called.protected voidhandleTransferStart(TransferHook hook, TransferRunner runner)Method that performs the operations relating to transfer start.protected voidhandleTransferStop(TransferHook hook, TransferRunner runner)Method that performs the operations relating to transfer stop.booleanhasSignalRegistered(StateSignal signal)Returns whether or not the state signal has been successfully registered to this MultiClient Manager instancebooleanhasWork()Returns whether or not the Manager has active or pending workvoidimportFile(java.nio.file.Path aFile)This will overwrite all settings within this object, if the values are not present within this file, the values within this object are reset to defaults.voidimportProperties(java.util.Properties props)This will overwrite all settings within this object, if the values are not present within the properties object, the values within this object are reset to defaults.voidinformTransferFinished()Sends a message to the server letting them know that transfer has finishedvoidinformTransferStart()Sends a message to the server letting them know that transfer has started<T> voidinitDeleteAfterTransfer(unlimited.core.util.common.tuples.Pair<java.util.LinkedList<T>,java.util.HashSet<T>> dirsToBeDeleted)Initializes the delete after transfer if it is needed.voidinitialize(boolean generateUserLogs)Initialize FCClient object.protected voidinitializeManager()Initializes the Multi-Client Manager for workvoidinitializeNoUserLogs()Initializes the TransferMechanism with no user logsprotected voidinitReportWriter()Initializes the report writer it hasn't already been initalized by the systemprotected voidinitThreadSafeHook()Initializes the ThreadSafeMultiHook that is used to provide transfer information in Thread safe mannerbooleanisAutoMode()Returns whether or not the transfer mode has been set toTransferMode.AUTObooleanisAutoResume()Returns true if auto-resume is enabled.booleanisAutoUnzip()Returns true if auto unzip is enabled, false otherwise.booleanisAutoZip()Returns true if auto zip is enabled, false otherwise.booleanisBadState()Returns whether or not the current state is a bad state.booleanisCancelled()Returns whether or not the MultiClientManager has been cancelledbooleanisCancelledDueToError()Returns whether or not the Manager was cancelledbooleanisCancelledOrCancelling()Returns whether or not the Manager is currently canceling it's current transfers, or if it has completely cancelled it's workbooleanisCancelling()Returns whether or not the manager is currently in a cancelling statebooleanisCompressionEnabled()Returns true if compression is enabled, false otherwise.booleanisCongestionControlEnabled()Returns true if congestion control is currently enabled.booleanisCurrentStateConnected()Returns whether or not the FileTransferMechanism currently has a connection.booleanisCurrentStateInstanceof(java.lang.Class<? extends MultiClientState>... states)booleanisDebug()Returns true if debug is set to true.booleanisDeleteAfterTransfer()Returns true if the delete after transfer option is enabled, false otherwise.booleanisDowngradeModeOnReConnect()Returns true if the downgrade on reconnect option is enabled, false otherwise.booleanisFileCatalystServer()Returns true if connected to a FileCatalyst server.booleanisForceFileOwnershipEnabled()Returns true if the force file ownership feature is currently enabled.booleanisForceTCPmodeACKs()Returns true if TCP mode ACKs are enabled.booleanisIdle()Returns whether or not the Client is currently idlebooleanisIncrementalSizeCheckOnly()Returns whether or not incremental has been set to use the size only optionbooleanisInitialized()Returns true if the last auto-detect that was performed identified that at least one mode of transfer was possible for the given type (upload, download, or both directions).booleanisMaintainLastModified()Returns true if Maintain last modified is enabled.booleanisMaintainPermissions()Returns true if maintain permissions is enabled.booleanisMoveToSent()booleanisOptimizeBlockSize()Returns true if optimize block size feature is enabled.booleanisProcessing()Returns whether or not the MultiClientManager is currently pre/post processing files.booleanisProgressiveTransfers()Return true if the progressive option is enabled, false otherwise.booleanisServerOverridebandwidth()Returns whether or not the server has specified that the bandwidth should be overridden.booleanisShowConsoleLog()Returns true if console log is enabled.booleanisTransferComplete()Returns whether or not the MultiClientManager has completed it's current transfer.booleanisTransferEmptyDirectories()Returns whether or not the implementation should be transferring empty directoriesbooleanisTransferWithTempName()Returns true if transferring with temporary names is enabledbooleanisUDPSupported()Returns true if connected to a FileCatalyst server that supports UDP.booleanisUseCompression()Returns true if compression is enabled, false otherwise.booleanisUseCongestionControl()Returns true if congestion control is currently enabled.booleanisUseIncremental()Returns true if incremental feature is enabledbooleanisUseSSL()Returns true if SSL mode is enabled, false otherwise.booleanisUsingDeleteAfterPostProcessor()Returns true if we are using the delete after post processorbooleanisVerifyIntegrity()Returns true if integrity check is enabled.booleanisWeblinkEnabledOnServer()Request if link is enabled on the server that you are connected toovoidjobSuccess(FileTransferMechanism client, TransferJob job, TransferHook hook)Method that handles marks successful transfers, and fires the corresponding TransferJobTransferSuccessEvent.intlastServerRestrictedRate()Returns the last rate (kbps) that the Server had replied with.FileListDatalist()Returns meta data for files in the current remote directory.FileListDatalist(java.lang.String wildcard)Returns meta data for files in the current remote directory.FileListDatalist(java.lang.String wildcard, java.lang.String remoteDirectory)Returns meta data for files that match the wildcard in the supplied directory.FileListDatalistNoParse(java.lang.String directory)Returns a remote file listing with no parsingFileListDatalistRecursiveFTPCompatible(java.lang.String directory)Method recursive lists files in an ftp compatible manner similar toFileTransferMechanism.listWithInlineParse()FileListDatalistWithInlineParse()Returns meta data for files in the current remote directory.FileListDatalistWithInlineParse(java.lang.String directory)Returns meta data for files in the given remote directory.booleanloggedIn()Returns whether or not the TransferMechanism is currently logged into the servervoidlogin()Logs the Multi-Manager with the currently stored username and passwordvoidlogin(java.util.function.Supplier<ClientCredentials> creds)Login to the server with the specified credentials.voidmkdir(java.lang.String dir)Creates the specified directory on the remote file system.voidmodtime(FileListDataItem item)This will update the modtime of the file existing on the server to whatever the incoming FileListDataItem is set toprotected voidmoveClientToActive(FileTransferMechanism client)Moves the client to the current active list.protected voidmoveClientToIdle(FileTransferMechanism client)Moves the client to idle list.voidnoop()Sends a small command to the server to see if it still can be reached.protected voidnullClients()Resets all information by clearing all internal clients (idle, worker, and transferring), and the main transferhook.java.lang.String[]prms(java.lang.String filename)Return the file permission of the file/directory listed in the argument from the remote server.MultiClientTransferHookpushJob(TransferJob job)Queries the internal state machine to add a TransferJob into the current queue of pending work.MultiClientTransferHookpushJobNoProcessing(TransferJob job)Pushes a new TransferJob into the current TransferJobQueue.protected MultiClientTransferHookpushJobOntoWorkQueue(TransferJob job)Pushes a new TransferJob into the current queue.java.lang.Stringpwd()Returns the current remote working directory.java.lang.Stringquote(java.lang.String command)Issue arbitrary FileCatalyst commands to the FileCatalyst server.voidrefreshMaster()Refreshes the master client by disconnecting and reconnecting into the present working directoryvoidregisterStateSignal(StateSignal signal)This state signal being registered will be signaled when the multi client manager enters an instance of that signal typejava.util.stream.Stream<FileListDataItem>remoteSynchFile(java.util.stream.Stream<FileListDataItem> fileStream)Syncs a stream of FileListDataItem objects with it's current remote information.voidremoteSynchFile(FileListDataItem aFile)Syncs a FileListDataItem object with it's current remote information.TransferHookremoteUpload(FCClient destServer, java.lang.String sourceFile, java.lang.String destFile)This method will initiate an upload from the server to which this FCClient object (Server A) is connected to the server specified by the destServer parameter passed in (Server B).TransferHookremoteUpload(FCClient destServer, java.util.List<java.lang.String> sourceFiles, java.util.List<java.lang.String> destFiles)This method will initiate an upload from the server to which this FCClient object (Server A) is connected to the server specified by the destServer parameter passed in (Server B).voidremoveActiveJob(TransferJob job)Removes the active job from pending jobs list and the main filtervoidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)Removes the property change listener.voidremoveStream(java.util.stream.Stream<?> stream)Removes the stream from current stream listvoidrename(java.lang.String oldName, java.lang.String newName)Renames the specified file to the new name.voidrequestCancel()Requests the Multi-Client Manager to cancel the current transfer.voidrequestUpdateServerOverrides()Queries the currently connected Server to provide it's currently overridden bandwidths.voidresetAutoDetectInfo()Resets all Auto-detect information.protected voidresetPooledClientIfNeeded(FileTransferMechanism client)Resets the provided FileTransferMechanism by clearing it's information and throwing it back into the WorkerPool of clients responsible for grabbing work for the currently pending queue.voidresetSession()Resets the session when called.voidresetStickySessionProducer()protected voidreturnJob(TransferJob job)Returns the supplied the TransferJob to the queueprotected voidreturnJob(TransferJob job, TransferHook hook)Returns the supplied the TransferJob to the queuevoidrmdir(java.lang.String dir)Deletes the specified directory from the remote file system.voidrmdirRecursive(FileListDataItem fileListDataItem)Deletes a directory on the server in a recursive manner.protected voidrunWorkerClient(FileTransferMechanismHandler handler)This allows you to use the worker client to perform operations that don't interfere with the transferring clientsprotected booleansafeSynchClient(FileTransferMechanism client)Safely syncs the client to the system.protected voidscheduleHookUpdate()Schedules an asynchronous update for the MultiClientManager's TransferHook information.java.util.List<unlimited.core.util.common.tuples.Pair<java.lang.String,TransferJobPriority>>searchPending(java.lang.String filter, int limit)Searches the pending work list and returns all results that match the supplied filtervoidsendEmail(java.lang.String emailAddress, int emailConst, java.lang.String emailText)Sends an email with the specified information.booleanserverSupportsFSEvents()This returns true if the server supports file system events.java.lang.StringserverVersion()Returns the FileCatalyst server version.voidsetAutoArchivingSpecificCompressionData(CompressionData autoArchivingSpecificCompressionData)Sets the auto archiving specific compression data.voidsetAutoConnectClientFactory(java.util.function.Supplier<FileTransferMechanism> fact)voidsetAutoResume(boolean autoResume)Enables/disables auto resume feature.voidsetAutoUnzip(boolean autoUnzip)Enables/disables auto unzip feature.voidsetAutoZip(boolean autoZip)Enables/disables auto zip feature.voidsetBandwidthManager(MultiClientTransferringBandwidthManager bandwidthManager)voidsetBlockSize(int blockSize)Set the block size.voidsetCallbackHandler(FileCatalystClientCallbackHandler callbackHandler)Sets a callback handler that will be used to confirm resume, overwrite and to do post processingprotected voidsetCancelled()Calls the Manager to asynchrously cancel it's current transactions and close all available resources.voidsetClientAgentID(java.lang.String clientAgentID)Sets the current client agent ID to the new specified value.voidsetClientConnectKey(java.lang.String clientConnectKey)This key must be set in order to connect to non-FileCatalyst servers.voidsetClientCredentials(java.util.function.Supplier<ClientCredentials> creds)Sets the credentials supplier for this connection.voidsetClientIdentifier(int clientIdentifier)An ID value that identifies this client to the FileCatalyst Server.voidsetClientName(java.lang.String clientName)Sets the current client name to the value that is specifiedvoidsetClientString(java.lang.String clientString)Set a text string that will be displayed on the server UI to identify this client.voidsetClientSubIdentifier(int id)Sets an ID that further identifies this clientvoidsetClientWorkingPath(java.nio.file.Path clientWorkingPath)Sets the client's current working path to the value specifiedvoidsetCompFileFilter(java.lang.String compFileFilter)Sets the compression FileFilter that is to be used by the implementationvoidsetCompLevel(int compLevel)Sets the compression level (0 - 9 with default of 4).voidsetCompMethod(int compMethod)Sets the current compression method to be used during transfers.voidsetCompressionEnabled(boolean enable)Enables/disables on the fly compression.voidsetCompStrategy(int compStrategy)Sets the compression deflater strategy that will be used within the compression method to minimize the data and compress into smaller byte values.voidsetCongCtrlStrategy(int congCtrlStrategy)Sets the congestion control strategy.voidsetCongestionControlAggression(int congestionControlAggression)Specifies an aggression factor between 1 (passive) and 10 (aggressive) used by the congestion control mechanism to determine how passive or aggressive it should be in the face of network congestion.voidsetCongestionControlEnabled(boolean enabled)Enables/disables congestion control for this client.voidsetConnectTimeout(int millisec)Sets the connect timeout value (in milliseconds).protected voidsetCurrentState(MultiClientState newState)Sets the manager's current state to the new provided statevoidsetDataReportWriter(unlimited.fc.reporting.CSVReportWriter reportWriter)Sets the CSVReportWriter that is used to write transfer reports to diskvoidsetDebug(boolean debug)Turns on debug mode.voidsetDeleteAfterTransfer(boolean deleteAfterTransfer)With this option enabled, source files will be deleted after the transfer is complete.static voidsetDisableForceFlush(boolean dff)Calling this method will set the system property that specifies if a transfer should force the file metadata to update on each write (disabled = true) or should wait until the file is complete (disabled = false).voidsetDowngradeModeOnReConnect(boolean downgradeModeOnReConnect)If set to true, if a disconnect occurs during a UDP transfer, upon reconnect and resume, the transfer mode is downgraded to multi-stream TCP, then single stream TCP, and finally HTTP (if available).voidsetExtendedReadTimeout(int millisecs)This is the length of time the client will wait for a reply after sending a long running command (such as MD5, MKDLT, MKSIG, ZIP, UNZIP) to the FileCatalyst server.voidsetFileCache(CachedFileIndexInterface fileCache)Sets the file cache.voidsetFileFilter(FileCatalystFileFilter filter)Sets the FileFilter that is to be used by the implementation.voidsetFileSizeThreshHold(long fileSizeThreshHold)Sets the file size thresh hold.voidsetFileTransferPriority(int fileTransferPriority)Sets the FileTransferPrioriry to new new value.voidsetForceFileOwnershipEnabled(boolean isForceFileOwnershipEnabled)Sets whether or not the force file ownership feature is enabled.voidsetForceFileOwnershipGroup(java.lang.String forceFileOwnershipGroup)Sets the groupname / groupID to be used when attempting to force group level ownership for files downloaded by the client.voidsetForceFileOwnershipUser(java.lang.String forceFileOwnershipUser)Sets the username to be used when attempting to force file ownership for files downloaded by the clientvoidsetForceTCPmodeACKs(boolean forceTCPmodeACKs)By default, FileCatalyst uses UDP to acknowledge data received.voidsetIncomingDataPort(int inDataPort)Sets the port used for incoming UDP packets on downloads.voidsetIncomingDataPorts(int[] inDataPorts)Sets the port used for incoming UDP packets on downloads.voidsetIncrementalMode(int incrementalMode)When incremental is enabled, this method allows you to choose the incremental mode.voidsetIncrementalSizeCheckOnly(boolean incrementalSizeCheckOnly)Setting this value will cause the MD5 checks to be skipped and the files compared using size only.voidsetLocalWorkingDirectory(java.nio.file.Path localWorkingDirectory)Sets the Local Working directory.voidsetLogger(unlimited.core.util.common.logs.LogUtils logger)overriding the logUtils object.voidsetLogLocation(java.lang.String logLocation)Specifies a directory on the local system where the log file should be stored.voidsetLogPrefix(java.lang.String logPrefix)Sets the prefix for the log file name.voidsetMaintainLastModified(boolean isMaintainLastModified)Sets the maintain last modified feature to the value specified.voidsetMaintainPermissions(boolean maintainPermissions)If set to true, upon each successful transfer, the destination file permissions will be set to match those of the source file.voidsetMaxRetries(int maxRetries)Specify the number of times to retry a broken or interrupted transfer.voidsetMaxWorkQueueuRePush(int maxPush)Sets the max amount of times a failed transfer job will be returned to the work queue after a failurevoidsetMd5RateLimit(int md5RateLimit)Sets the rate limit to use when calculating MD5s of filesvoidsetMode(int mode)Set the transfer mode of this client.voidsetNumBlockReaders(int numBlockReaders)Sets the number of block reader threads.voidsetNumBlockWriters(int numBlockWriters)Sets the number of block writer threads to use when receiving a file.voidsetNumFTPStreams(int numFTPStreams)When transferring in FTP mode, it is possible to send with several concurrent streams.voidsetNumPacketProcessors(int numPacketProcessors)Sets the number of threads used to process incoming UDP packets when downloading.voidsetNumReceiveSockets(int numReceiveSockets)Set the number of UDP sockets to use to receive packets during a UDP download.voidsetNumSenderSockets(int numSenderSockets)Sets the number of UDP sockets to use when uploading a file in UDP mode.voidsetNumSenderThreads(int numThreads)This value determines how many blocks will be sent into the pipe before redundant data will be sent.voidsetNumThreads(int numThreads)This value determines how many blocks will be sent into the pipe before redundant data will be sent.voidsetNumUDPSockets(int numUDPSockets)Sets the number of UDP sockets to use when uploading a file in UDP mode.voidsetObserver(java.util.Observer observer)FCClient is not directly observable, however TransferHook is.voidsetOptimizeBlockSize(boolean optimizeBlockSize)If set to true, FileCatalyst will attempt to optimize the current block size to be an exact multiple of the data size that is being transmitted.voidsetPacketQueueDepth(int packetQueueDepth)Sets the depth of the application level packet queue.voidsetPacketSize(int packetSize)Set the unit size.voidsetPostTaskSentData(PostTaskSentData data)Sets the current post task sent data to the specified valuevoidsetPostURL(java.lang.String postURL)Sets the current post URL to the value that is definedvoidsetProgressiveTimeout(int progressiveTimeout)Sets the current progressive timeout to the value suppliedvoidsetProgressiveTimeoutFilter(java.lang.String progressiveTimeoutFilter)Sets the current progressive timeout filter to the value that is set tovoidsetProgressiveTransfers(boolean progressiveTransfers)With this option enabled, upon completion of an upload or download, FileCatalyst will compare the size of the source file to the size when it began the transfer.voidsetRateDistributer(RateDistributer rateDistributer)voidsetReadBufferSizeKB(int bufferSizeKB)Sets the read buffer size used when reading data from disk.voidsetReadTimeout(int millisecs)This is the length of time the client will wait for a reply after sending a command to the FileCatalyst server.protected java.lang.StringsetRealPwd()Sets the working directory of the clientvoidsetRemoteFileFilter(FileCatalystFileFilter<?> filter)Sets the file filter to be used when listing or interacting with remote files on the FCServer.voidsetRemotePort(int remotePort)Sets the remote port to which this client will be connected.voidsetRemoteServer(java.lang.String remoteServer)Set the remote server to which this client should connect.voidsetRenameExtension(boolean renameExtension)Sets whether or not the rename extension should be usedvoidsetReport(unlimited.fc.reporting.ClientDataReport reporter)Sets the report object.voidsetRollingStartRate(RollingStartRate rollingStartRate)voidsetRunningIntegrationTest(boolean isRunning)Internal use only: Sets whether or not this MultiClientManager is running in an integration testvoidsetServerAgentID(java.lang.String serverAgentID)Sets the server agent ID to the new valuevoidsetServletLocation(java.lang.String servletLocation)FileCatalyst has the ability to upload using the HTTP/S protocol as long as the FileCatalyst Servlet application is installed and properly configured.voidsetServletLocation(java.lang.String servletLocation, java.lang.String servletSessionID, java.lang.String welcomeMessage)FileCatalyst has the ability to upload using the HTTP/S protocol as long as the FileCatalyst Servlet application is installed and properly configured.voidsetServletMultiplier(int servletMultiplier)When uploading in HTTP mode using FileCatalyst Servlet, this option allows the upload buffer size to be tuned.voidsetSessionID(java.lang.String sessionID)Sets the session ID to the specified value.voidsetSessionManageMode(SessionManageMode sessionManageMode)Sets the session management mode to the supplied valuevoidsetShowConsoleLog(boolean showConsoleLog)If set to true, all logging information is also sent to standard out.voidsetSSLSocketProducer(unlimited.core.util.common.net.ssl.FCSSLSocketProducerImpl producerImpl)Sets the implementation that will be used to generate SSL socketsvoidsetStartRate(int incomingSlowStartRate)Sets the start rate for FC transfers in Kilobits per second.voidsetStickySessionID(java.util.function.Supplier<java.lang.String> stickyIDProvider)Sets the current supplier that is used to generate the unique sticky session identifier that the FileCatalyst Client use when the connect to the FileCatalyst LoadBalancervoidsetTargetRate(int targetRate)Sets the target rate (kbps) for this client.voidsetTaskID(java.lang.String taskID)Sets the current task ID to the new value suppliedvoidsetTransactionID(java.lang.String uniqueID)Sets a unique transaction number for the transfer (instance variable).voidsetTransferEmptyDirectories(boolean transferEmptyDirectories)Sets whether or not the implementation should transfer empty directoriesvoidsetTransferHolder(PostURLTransfer.TransferHolder h)voidsetTransferToServerOverride(int serverOverrideBW)Sets bandwidth value that the Server is attempting to override this client to.voidsetTransferWithTempName(boolean transferWithTempName)With this option enabled, files will be uploaded with a temporary filename and renamed back to their original name when the transfer is complete.voidsetTransferWithTempName(boolean transferWithTempName, int tempMode)With this option enabled, files will be uploaded with a temporary filename and renamed back to their original name when the transfer is complete.voidsetUnitSize(int unitSize)Use setPacketSize()protected TransferJobQueuesetUpQueue()Sets up the pending work queue when called.voidsetUseCompression(boolean useCompression)Enables/disables on the fly compression.voidsetUseCongestionControl(boolean useCongestionControl)Enables/disables congestion control for this client.voidsetUseIncremental(boolean useIncremental)If set to true, before each source file is transferred, it will be compared with the destination file if it exists to ensure the file has changed.voidsetUserEmailAddress(java.lang.String newEmailAddress)Sets the connected user's email address when calledvoidsetUserFullName(java.lang.String newUserName)Set's The User's Name When CalledvoidsetUserRelativePriority(int priority)This priority hint is to help the server distribute bandwidth within its own set parameters.voidsetUseSSL(boolean useSSL)If set to true, control connection will be made using an implicit SSL connection.voidsetVerifyIntegrity(boolean verifyIntegrity)If set to true, after each file is transferred an MD5 sum will be performed on the destination file and the result will be compared to that of the source file to ensure the files are identical.voidsetVerifyMode(int verifyMode)Sets the integrity verification modevoidsetWaitRetry(long waitRetry)Sets the amount of time in milliseconds to wait before the client attempts to retry a failed transfervoidsetWriteBufferSizeKB(int bufferSizeKB)Sets the write buffer size used when saving data to disk.voidsetWriteFileMode(java.lang.String mode)Set JAVA file write mode when saving data to disk.voidsetZipFileSizeLimit(long zipFileSizeLimit)Sets the zip file size limit to the value specified.protected voidshutdown()Shuts down the MultiClient Manager when calledprotected voidshutdownInternalTaskScheduler()protected voidshutDownWork()Shuts down the manager's current workbooleansiteMatch(java.lang.String host, int port, ClientCredentials creds)Returns whether or not the supplied information matches the information currently set in the Manager.longsize(java.lang.String remoteFile)Return the size of a remote filelongsize(java.lang.String remoteFile, boolean bypassCache)Get the size of the named file from the remote server.voidstart()This will start the MultiClientManager by attempting to initialize, connect, login then spawn the client pool threads.protected voidstartReporting()protected voidstartUpdatingTargetRate()protected voidstopReporting()voidstopSpeedTesting()Stops the current speed testing methods that this TransferMechanism may be executingjava.util.stream.Stream<FileListDataItem>streamWithInlineParse()Returns streaming meta data for files in the current remote directory.java.util.stream.Stream<FileListDataItem>streamWithInlineParse(java.lang.String directory)Returns streaming meta data for files in the given remote directory.java.util.stream.Stream<FileListDataItem>streamWithInlineParse(java.lang.String directory, java.util.function.BooleanSupplier isCancelled)Returns streaming meta data for files in the given remote directory.java.util.stream.Stream<FileListDataItem>streamWithInlineParse(java.util.function.BooleanSupplier isCancelled)Returns streaming meta data for files in the current remote directory.protected booleansynchClient(FileTransferMechanism client)Syncs the supplied FileTransferMechanism's current settings to the settings within the MultiClient.inttestApproximateDownloadSpeed()Performs a quick test to determine the approximate download speed to the connected server.inttestApproximateUploadSpeed()Performs a quick test to determine the approximate upload speed to the connected server.inttestMaximumDownloadSpeed()Performs a series of tests to determine the maximum download speed from the connected server.inttestMaximumUploadSpeed()Performs a series of tests to determine the maximum upload speed to the connected server.voidtestUDPACKs()Tests if UDP ACK mode is possible an configures internal variables.inttestWriteSpeed()Perform a write to current directory with recommended values for determining storage rate.inttestWriteSpeed(java.nio.file.Path file, int size, int timeout)Perform a write to specified file with specified size and timeout for determining storage rate.java.lang.StringtoString()<FileType> voidtransferJobStream(java.util.stream.Stream<TransferJob.FileTypeJob<FileType>> stream)TransferHookupload(java.lang.String localFile)Upload the specified file to the current remote working directory.TransferHookupload(java.nio.file.Path localFile)Upload the specified file to the current remote working directory.TransferHookupload(java.nio.file.Path localFile, java.lang.String remotePath)Upload the specified file to the specified remote directory.TransferHookupload(java.nio.file.Path localFile, java.lang.String remotePath, java.lang.String transferUniqueID)Upload the specified file to the specified remote directory and specifies a unique transaction id.TransferHookupload(java.util.List<java.nio.file.Path> files)Uploads all File objects in the Vector provided to the current remote working directory.TransferHookupload(java.util.List<java.nio.file.Path> files, java.lang.String remotePath)Uploads all File objects in the Vector provided to the specified remote directory.TransferHookupload(java.util.List<java.nio.file.Path> files, java.lang.String remotePath, java.lang.String transferUniqueID)Uploads all File objects in the Vector provided to the specified remote directory.TransferHookuploadAs(java.nio.file.Path localFile, java.lang.String remoteFilename)Upload the specified file to the specified remote filename.TransferHookuploadAs(java.nio.file.Path localFile, java.lang.String remoteFilename, java.lang.String transferUniqueID)Upload the specified file to the specified remote filename.TransferHookuploadList(java.util.List<java.nio.file.Path> files, java.lang.String remotePath, java.lang.String transferUniqueID)Uploads a list of files to the connected ServerTransferHookuploadList(java.util.List<java.nio.file.Path> files, java.lang.String remotePath, java.lang.String transferUniqueID, boolean needsRecurse)Uploads a list of files to the connected Server.voiduploadRange(java.nio.file.Path localFile, java.lang.String remoteFile, long offset, long length)Uploads a range of rate for the given file.voiduploadStream(java.util.stream.Stream<java.nio.file.Path> stream)Uploads the provided stream to the currently connected Server.booleanwillTransferWork()Returns whether or not transfers will work under the current settingsbooleanworkInProgress()Returns whether or not the MultiClientManager has any work that is currently in progressbooleanworkRemaining()Returns whether or not the MultiClientManager has any work remaining within it's queue.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface unlimited.fc.client.api.filelist.FileListDataItemSource
listAsList
-
Methods inherited from interface unlimited.fc.client.api.FileTransferData
getAutoConnectClientFactory, getLocalWorkingDirectory, setLocalWorkingDirectory
-
Methods inherited from interface unlimited.fc.client.api.FileTransferMechanism
connectAndlogin, downloadAs, downloadAs, equals, hashCode, initialize, isTransferringCheck, waitForComplete
-
-
-
-
Field Detail
-
sessionID
public java.lang.String sessionID
-
AGGREGATECAP
public static final java.util.function.Supplier<java.lang.Integer> AGGREGATECAP
-
data
protected TransferMechanismData data
-
clientPoolSize
public final int clientPoolSize
-
clients
protected com.google.common.collect.HashBiMap<java.lang.Integer,FileTransferMechanism> clients
-
logListener
protected MultiClientListenerAdapter.LoggerListener logListener
-
stateListener
protected StateSignal.StateListener stateListener
-
processManager
protected ProcessManager processManager
-
transitionalClientLock
protected java.lang.Object transitionalClientLock
-
autoArchivingSpecificCompressionData
protected CompressionData autoArchivingSpecificCompressionData
-
streamingLock
protected java.lang.Object streamingLock
-
-
Constructor Detail
-
MultiClientManager
public MultiClientManager(java.lang.String remoteServer, int poolsize)Constructs an un-initialized, un-connected MultiClientManager object. This will also set the default remote port 21. The MultiClientManager object must be initialized prior to use.- Parameters:
remoteServer- the remote serverpoolsize- the poolsize
-
MultiClientManager
public MultiClientManager(java.lang.String remoteServer, int port, int poolsize)Constructs an un-initialized, un-connected MultiClientManager object.- Parameters:
remoteServer- the remote serverport- the portpoolsize- the poolsize
-
MultiClientManager
protected MultiClientManager(java.lang.String remoteServer, ClientFactory fact)Constructs an un-initialized, un-connected FCClient object. This will also set the default remote port 21. The FCClient object must be initialized prior to use.- Parameters:
remoteServer- The remote server to which to connect.
-
MultiClientManager
protected MultiClientManager(java.lang.String remoteServer, int port, ClientFactory fact)Constructs an un-initialized, un-connected MultiClientManager object. The MultiClientManager object must be initialized prior to use.- Parameters:
remoteServer- The remote server to which to connect.port- The remote port to which to connect.
-
-
Method Detail
-
getRollingStartRate
public RollingStartRate getRollingStartRate()
-
setRollingStartRate
public void setRollingStartRate(RollingStartRate rollingStartRate)
-
getRateDistributer
public RateDistributer getRateDistributer()
-
setRateDistributer
public void setRateDistributer(RateDistributer rateDistributer)
-
getBandwidthManager
public MultiClientTransferringBandwidthManager getBandwidthManager()
-
setBandwidthManager
public void setBandwidthManager(MultiClientTransferringBandwidthManager bandwidthManager)
-
setAutoConnectClientFactory
public void setAutoConnectClientFactory(java.util.function.Supplier<FileTransferMechanism> fact)
-
registerStateSignal
public void registerStateSignal(StateSignal signal)
This state signal being registered will be signaled when the multi client manager enters an instance of that signal type- Parameters:
signal- - signal that can be waited on
-
hasSignalRegistered
public boolean hasSignalRegistered(StateSignal signal)
Returns whether or not the state signal has been successfully registered to this MultiClient Manager instance- Parameters:
signal- Signal to check for- Returns:
- True if signal already registered, false if not
-
deRegisterStateSignal
public void deRegisterStateSignal(StateSignal signal)
De-registers the specified state signal and makes it so it is no longer called system when the state is entered- Parameters:
signal- - signal to be removed
-
getData
public TransferMechanismData getData()
Returns the DataObject that contains all of the transfer settings for this MultiClientManager- Returns:
-
setUpQueue
protected TransferJobQueue setUpQueue()
Sets up the pending work queue when called. Called when the MultiClientManager initializes it's information- Returns:
- New transfer job queue to be used for the pendingJob queue
-
initThreadSafeHook
protected void initThreadSafeHook()
Initializes the ThreadSafeMultiHook that is used to provide transfer information in Thread safe manner
-
setAutoArchivingSpecificCompressionData
public void setAutoArchivingSpecificCompressionData(CompressionData autoArchivingSpecificCompressionData)
Sets the auto archiving specific compression data.- Parameters:
autoArchivingSpecificCompressionData- the new auto archiving specific compression data
-
shutdown
protected void shutdown()
Shuts down the MultiClient Manager when called
-
shutdownInternalTaskScheduler
protected void shutdownInternalTaskScheduler()
-
addMultiClientListener
public void addMultiClientListener(MultiClientListenerAdapter listener)
Adds the property change listener. This listener will be notified of allMultiClientStateandTransferJobrelated events SeeMultiClientListenerAdapterfor more details- Parameters:
listener- the listener, a subclass ofMultiClientListenerAdapterstrongly recommended.
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the property change listener.- Parameters:
listener- the listener
-
firePropertyChange
protected void firePropertyChange(java.beans.PropertyChangeEvent evt)
Fires a PropertyChange event for all objects listening for them- Parameters:
evt-
-
initializeManager
protected void initializeManager()
Initializes the Multi-Client Manager for work
-
getCurrentState
public MultiClientState getCurrentState()
Gets the current state.- Returns:
- the current state
-
isCurrentStateConnected
public boolean isCurrentStateConnected()
Description copied from interface:FileTransferMechanismReturns whether or not the FileTransferMechanism currently has a connection.- Specified by:
isCurrentStateConnectedin interfaceFileTransferMechanism- Returns:
- Whether or not mechanism is connected
-
setCurrentState
protected void setCurrentState(MultiClientState newState)
Sets the manager's current state to the new provided state- Parameters:
newState- State to set
-
initialize
public void initialize(boolean generateUserLogs)
Description copied from interface:FileTransferMechanismInitialize FCClient object. This will initialize the logs for this session. The log location can be configured with the setLogLocation() method, but must be done before the initialize(boolean generateUserLogs) method is called.- Specified by:
initializein interfaceFileTransferMechanism- Parameters:
generateUserLogs- generate default FCAPI logs in your log location
-
initializeNoUserLogs
public void initializeNoUserLogs()
Description copied from interface:FileTransferMechanismInitializes the TransferMechanism with no user logs- Specified by:
initializeNoUserLogsin interfaceFileTransferMechanism
-
getActiveClientIDs
public java.util.List<java.lang.Integer> getActiveClientIDs()
Gets the active client ID's each client in the pool is assigned an ID 0-n where n is the number of clients. This will give a snapshot list of all the active client ID's These ID's are useful when trying to get individual hook information see {@link MultiClientTransferHook.getHook(Integer id)}- Returns:
- the active client i ds
-
getIdleClientIDs
public java.util.List<java.lang.Integer> getIdleClientIDs()
Gets the idle client ID's. each client in the pool is assigned an ID 0-n where n is the number of clients. This will give a snapshot list of all the idle client ID's These ID's are useful when trying to get individual hook information see {@link MultiClientTransferHook.getHook(Integer id)}- Returns:
- the idle client ID's
-
getIdleClientsCopy
protected java.util.HashSet<FileTransferMechanism> getIdleClientsCopy()
Creates and returns a mutable copy of the idle client list- Returns:
- The Idle Clients
-
connect
public void connect() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismConnect to the FileCatalyst server. Once connected, the client can execute commands and transfer files on the Server- Specified by:
connectin interfaceFileTransferMechanism- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
start
public void start() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionThis will start the MultiClientManager by attempting to initialize, connect, login then spawn the client pool threads. This should not be called until all the initialization values are set.- Throws:
unlimited.core.util.common.exception.FCException- the fC exceptionjava.io.IOException- Signals that an I/O exception has occurred.
-
initReportWriter
protected void initReportWriter()
Initializes the report writer it hasn't already been initalized by the system
-
isDowngradeModeOnReConnect
public boolean isDowngradeModeOnReConnect()
Description copied from interface:FileTransferDataReturns true if the downgrade on reconnect option is enabled, false otherwise.- Specified by:
isDowngradeModeOnReConnectin interfaceFileTransferData- Returns:
- boolean true if the downgrade on reconnect option is enabled, false otherwise.
-
setDowngradeModeOnReConnect
public void setDowngradeModeOnReConnect(boolean downgradeModeOnReConnect)
Description copied from interface:FileTransferDataIf set to true, if a disconnect occurs during a UDP transfer, upon reconnect and resume, the transfer mode is downgraded to multi-stream TCP, then single stream TCP, and finally HTTP (if available).- Specified by:
setDowngradeModeOnReConnectin interfaceFileTransferData- Parameters:
downgradeModeOnReConnect- the downgradeModeOnReConnect to set
-
setClientSubIdentifier
public void setClientSubIdentifier(int id)
Description copied from interface:FileTransferDataSets an ID that further identifies this client- Specified by:
setClientSubIdentifierin interfaceFileTransferData- Parameters:
id- the clientSubIdentifier to set
-
setClientString
public void setClientString(java.lang.String clientString)
Description copied from interface:FileTransferDataSet a text string that will be displayed on the server UI to identify this client. USeful when developing 3rd party applications that are not identified properly by FileCatalyst internal IDs.- Specified by:
setClientStringin interfaceFileTransferData- Parameters:
clientString- the clientString to set
-
getObserver
public java.util.Observer getObserver()
Description copied from interface:FileTransferDataReturns the Observer that is currently set.- Specified by:
getObserverin interfaceFileTransferData- Returns:
- the observer
-
setObserver
public void setObserver(java.util.Observer observer)
Description copied from interface:FileTransferDataFCClient is not directly observable, however TransferHook is. Setting an Observer using this method ensures that the given Observer will be set on the TransferHook object returned from upload and download method calls prior to the actual transfer being initiated.- Specified by:
setObserverin interfaceFileTransferData- Parameters:
observer- the observer to set
-
getCallbackHandler
public FileCatalystClientCallbackHandler getCallbackHandler()
Description copied from interface:FileTransferDataReturns the currently set callback handler that will be used to confirm resume, overwrite and to do post processing- Specified by:
getCallbackHandlerin interfaceFileTransferData- Returns:
- the callbackHandler
-
setCallbackHandler
public void setCallbackHandler(FileCatalystClientCallbackHandler callbackHandler)
Sets a callback handler that will be used to confirm resume, overwrite and to do post processingNote when implementing the confirmOverwrite and confirmResume methods, keep in mind not to synchronize on this MultiClientManager or its MultiClientTransferHook as you run the risk of deadlock. Also note, your callback handler will be wrapped as a delegate to a ManagedMultiCallback to keep track of YES_TO_ALL and NO_TO_ALL options across multiple clients.
- Specified by:
setCallbackHandlerin interfaceFileTransferData- Parameters:
callbackHandler- the callbackHandler to set
-
getWriteFileMode
public java.lang.String getWriteFileMode()
Description copied from interface:FileTransferDataGets the file write mode set Client application will use these values for downloads only. Server has these values defined remotely for uploads.- Specified by:
getWriteFileModein interfaceFileTransferData- Returns:
- returns either rw, rws, rwd, or ""
-
setWriteFileMode
public void setWriteFileMode(java.lang.String mode)
Description copied from interface:FileTransferDataSet JAVA file write mode when saving data to disk. Client application will use these values for downloads only. Server has these values defined remotely for uploads.- Specified by:
setWriteFileModein interfaceFileTransferData- Parameters:
mode- Default "" uses "rws" for Windows/Linux, and "rw" for Solaris/MacOSX. Possible values are "", rw, rws, rwd
-
getWriteBufferSizeKB
public int getWriteBufferSizeKB()
Description copied from interface:FileTransferDataReturn the current write buffer size. Value is in KB. Value zero (0) indicates read buffer is dictated by the network block size. Client application will use these values for downloads only. Server has these values defined remotely for uploads.- Specified by:
getWriteBufferSizeKBin interfaceFileTransferData- Returns:
- the writeBufferSize
-
setWriteBufferSizeKB
public void setWriteBufferSizeKB(int bufferSizeKB)
Description copied from interface:FileTransferDataSets the write buffer size used when saving data to disk. Default (0) sets value to network buffer size. Client application will use these values for downloads only. Server has these values defined remotely for uploads.- Specified by:
setWriteBufferSizeKBin interfaceFileTransferData- Parameters:
bufferSizeKB- default value will utilize network block size for writes. Value in KB.
-
getReadBufferSizeKB
public int getReadBufferSizeKB()
Description copied from interface:FileTransferDataReturn the current read buffer size, in KB Value zero (0) indicates read buffer is dictated by the network block size. Client application will use these values for uploads only. Server has these values defined remotely for downloads.- Specified by:
getReadBufferSizeKBin interfaceFileTransferData- Returns:
- readBufferSize
-
setReadBufferSizeKB
public void setReadBufferSizeKB(int bufferSizeKB)
Description copied from interface:FileTransferDataSets the read buffer size used when reading data from disk. Default (0) sets value to network buffer size. Client application will use these values for uploads only. Server has these values defined remotely for downloads.- Specified by:
setReadBufferSizeKBin interfaceFileTransferData- Parameters:
bufferSizeKB- default value will utilize network block size for reads.
-
getNumBlockReaders
public int getNumBlockReaders()
Description copied from interface:FileTransferDataReturns the number of block reader threads. Client application will use these values for uploads only. Server has these values defined remotely for downloads.- Specified by:
getNumBlockReadersin interfaceFileTransferData- Returns:
- the numBlockReaders
-
setNumBlockReaders
public void setNumBlockReaders(int numBlockReaders)
Description copied from interface:FileTransferDataSets the number of block reader threads. Increasing the number of blocker reader threads may increase read speed performance and help boost performance. Client application will use these values for uploads only. Server has these values defined remotely for downloads.- Specified by:
setNumBlockReadersin interfaceFileTransferData- Parameters:
numBlockReaders- the numBlockReaders to set
-
getNumBlockWriters
public int getNumBlockWriters()
Description copied from interface:FileTransferDataReturns the number of block writer threads. Client application will use these values for downloads only. Server has these values defined remotely for uploads.- Specified by:
getNumBlockWritersin interfaceFileTransferData- Returns:
- the numBlockWriters
-
setNumBlockWriters
public void setNumBlockWriters(int numBlockWriters)
Description copied from interface:FileTransferDataSets the number of block writer threads to use when receiving a file. Writing to the file with multiple threads may improve performance. Client application will use these values for downloads only. Server has these values defined remotely for uploads.- Specified by:
setNumBlockWritersin interfaceFileTransferData- Parameters:
numBlockWriters- the numBlockWriters to set
-
getNumSenderThreads
public int getNumSenderThreads()
Description copied from interface:FileTransferDataReturns the number of threads that will be used at most for each FC transmission.- Specified by:
getNumSenderThreadsin interfaceFileTransferData- Returns:
- the number of threads that will be used at most for each FC transmission.
-
setNumSenderThreads
public void setNumSenderThreads(int numThreads)
Description copied from interface:FileTransferDataThis value determines how many blocks will be sent into the pipe before redundant data will be sent. In high RTT environments, this value multiplied by the block size should be higher than the product of the RTT and the target rate. Depending on the speed and spec of the disk, it may be advantageous to have more threads with a higher block size or vise versa. Number of threads is set to 5 by default.- Specified by:
setNumSenderThreadsin interfaceFileTransferData- Parameters:
numThreads- Number of block sender threads to start for each transmission.
-
getNumReceiveSockets
public int getNumReceiveSockets()
Description copied from interface:FileTransferDataReturns the current number of receive sockets. Required for > 2gbps transfers. Default for this value is 1.- Specified by:
getNumReceiveSocketsin interfaceFileTransferData- Returns:
- the numReceiveSockets
-
setNumReceiveSockets
public void setNumReceiveSockets(int numReceiveSockets)
Description copied from interface:FileTransferDataSet the number of UDP sockets to use to receive packets during a UDP download. When individual UDP sockets receive packets there is latency between when packets are received and when they are processed. This means processing packets form a single socket may limit reception because only a single CPU core may be used. Increasing the number of sockets will allow multiple threads to receive data, and process data in parallel, hence taking advantage of more CPU cores. Required for > 2gbps transfers. Default for this value is 1.- Specified by:
setNumReceiveSocketsin interfaceFileTransferData- Parameters:
numReceiveSockets- the numReceiveSockets to set
-
getNumSenderSockets
public int getNumSenderSockets()
Description copied from interface:FileTransferDataReturn the number of Sender sockets to use- Specified by:
getNumSenderSocketsin interfaceFileTransferData- Returns:
- the Number of UDP Sockets currently set
-
setNumSenderSockets
public void setNumSenderSockets(int numSenderSockets)
Description copied from interface:FileTransferDataSets the number of UDP sockets to use when uploading a file in UDP mode. Increasing the number of sockets used may boost performance at high speeds (i.e. greater than 500 Mbps)- Specified by:
setNumSenderSocketsin interfaceFileTransferData
-
getPacketQueueDepth
public int getPacketQueueDepth()
Description copied from interface:FileTransferDataReturn the current packet queue depth. Client application will use these values for downloads only. Server has these values defined remotely for uploads.- Specified by:
getPacketQueueDepthin interfaceFileTransferData- Returns:
- the packetQueueDepth
-
setPacketQueueDepth
public void setPacketQueueDepth(int packetQueueDepth)
Description copied from interface:FileTransferDataSets the depth of the application level packet queue. As packets are received, the are inserted into this queue to await processing. This queue is an extra level of protection against packet loss due to CPU and I/O bottlenecks, and may help performance when using more than 1 packet processor threads, or in virtual environments where CPU and I/O performance is not predictable. Client application will use these values for downloads only. Server has these values defined remotely for uploads.- Specified by:
setPacketQueueDepthin interfaceFileTransferData- Parameters:
packetQueueDepth- the packetQueueDepth to set
-
getNumPacketProcessors
public int getNumPacketProcessors()
Description copied from interface:FileTransferDataReturn the current number of packet processor threads. Client application will use these values for downloads only. Server has these values defined remotely for uploads.- Specified by:
getNumPacketProcessorsin interfaceFileTransferData- Returns:
- the numPacketProcessors
-
setNumPacketProcessors
public void setNumPacketProcessors(int numPacketProcessors)
Description copied from interface:FileTransferDataSets the number of threads used to process incoming UDP packets when downloading. When packets arrive they are inserted into a queue for processing. The packet processor threads process the packets and sort them into the proper data blocks. The number of threads used to process the packets becomes very important when AES encryption is enabled as it distributes the decryption between the CPU cores. Client application will use these values for downloads only. Server has these values defined remotely for uploads.- Specified by:
setNumPacketProcessorsin interfaceFileTransferData- Parameters:
numPacketProcessors- the numPacketProcessors to set
-
isCongestionControlEnabled
public boolean isCongestionControlEnabled()
Description copied from interface:FileTransferDataReturns true if congestion control is currently enabled.- Specified by:
isCongestionControlEnabledin interfaceFileTransferData- Returns:
- true if congestion control is currently enabled.
-
getCongestionControlAggression
public int getCongestionControlAggression()
Description copied from interface:FileTransferDataReturns an aggression factor between 1 (passive) and 10 (aggressive) used by the congestion control mechanism to determine how passive or aggressive it should be in the face of network congestion. Default value is 5.- Specified by:
getCongestionControlAggressionin interfaceFileTransferData- Returns:
- int Aggression factor between 1 (passive) and 10 (aggressive)
-
setCongestionControlEnabled
public void setCongestionControlEnabled(boolean enabled)
Description copied from interface:FileTransferDataEnables/disables congestion control for this client. When enabled, the client will automatically decrease its transmission or reception rate when congestion is detected. Future versions will allow finer grain control over the reaction algorithm. Congestion control is set to true by default.- Specified by:
setCongestionControlEnabledin interfaceFileTransferData
-
getCongCtrlStrategy
public int getCongCtrlStrategy()
Description copied from interface:FileTransferDataReturns the current congestion control strategy.The possible options are:
- RTT based (
CongestionControlType.RTT) - LOSS based (
CongestionControlType.LOSS) - Rate based (
CongestionControlType.BSS)
- Specified by:
getCongCtrlStrategyin interfaceFileTransferData- Returns:
- the congCtrlStrategy
- RTT based (
-
setCongCtrlStrategy
public void setCongCtrlStrategy(int congCtrlStrategy)
Description copied from interface:FileTransferDataSets the congestion control strategy.The possible options are:
- RTT based (
CongestionControlType.RTT) - LOSS based (
CongestionControlType.LOSS) - Rate based (
CongestionControlType.BSS)
- Specified by:
setCongCtrlStrategyin interfaceFileTransferData- Parameters:
congCtrlStrategy- the congCtrlStrategy to set
- RTT based (
-
willTransferWork
public boolean willTransferWork()
Description copied from interface:FileTransferMechanismReturns whether or not transfers will work under the current settings- Specified by:
willTransferWorkin interfaceFileTransferMechanism- Returns:
-
resetAutoDetectInfo
public void resetAutoDetectInfo()
Description copied from interface:FileTransferMechanismResets all Auto-detect information. Should be called before running the autoDetectConnectionMode() methods- Specified by:
resetAutoDetectInfoin interfaceFileTransferMechanism
-
autoDetectConectionModeDownload
public void autoDetectConectionModeDownload()
Description copied from interface:FileTransferMechanismThis method will attempt to detect the optimal connection method based on the provided server information, HTTP servlet location, and ports. It will also detect which mode to use for downloading files.- Specified by:
autoDetectConectionModeDownloadin interfaceFileTransferMechanism
-
autoDetectConectionModeUpload
public void autoDetectConectionModeUpload()
Description copied from interface:FileTransferMechanismThis method will attempt to detect the optimal connection method based on the provided server information, HTTP servlet location, and ports. It will also detect which mode to use for uploading files.- Specified by:
autoDetectConectionModeUploadin interfaceFileTransferMechanism
-
autoDetectConectionModeDownload
public void autoDetectConectionModeDownload(boolean testUDP, boolean portFallback)Description copied from interface:FileTransferMechanismThis method will attempt to detect the optimal connection method based on the provided server information, HTTP servlet location, and ports. It will also detect which mode to use for downloading files.- Specified by:
autoDetectConectionModeDownloadin interfaceFileTransferMechanism- Parameters:
testUDP- true/false whether or not UDP test should be performedportFallback- true/false whether TCP data connection test should fallback to PORT if PASV fails.
-
autoDetectConectionModeUpload
public void autoDetectConectionModeUpload(boolean testUDP, boolean portFallback)Description copied from interface:FileTransferMechanismThis method will attempt to detect the optimal connection method based on the provided server information, HTTP servlet location, and ports. It will also detect which mode to use for uploading files.- Specified by:
autoDetectConectionModeUploadin interfaceFileTransferMechanism- Parameters:
testUDP- true/false whether or not UDP test should be performedportFallback- true/false whether TCP data connection test should fallback to PORT if PASV fails.
-
autoDetectConectionModeUploadAndDownload
public void autoDetectConectionModeUploadAndDownload()
Description copied from interface:FileTransferMechanismThis method will attempt to detect the optimal connection method based on the provided server information, HTTP servlet location, and ports. It will also detect which mode to use for uploading AND downloading files. If UDP fails for EITHER upload OR download, the mode will be reverted to FTP or HTTP- Specified by:
autoDetectConectionModeUploadAndDownloadin interfaceFileTransferMechanism
-
autoDetectConectionModeUploadAndDownload
public void autoDetectConectionModeUploadAndDownload(boolean portFallback)
Description copied from interface:FileTransferMechanismThis method will attempt to detect the optimal connection method based on the provided server information, HTTP servlet location, and ports. It will also detect which mode to use for uploading AND downloading files. If UDP fails for EITHER upload OR download, the mode will be reverted to FTP or HTTP- Specified by:
autoDetectConectionModeUploadAndDownloadin interfaceFileTransferMechanism- Parameters:
portFallback- true/false whether TCP data connection test should fallback to PORT if PASV fails.
-
login
public void login(java.util.function.Supplier<ClientCredentials> creds) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismLogin to the server with the specified credentials.- Specified by:
loginin interfaceFileTransferMechanism- Parameters:
creds- The ClientCredentials with which to authenticate- Throws:
unlimited.core.util.common.exception.FCException- If authentication failsjava.io.IOException- If a timeout, or other I/O error occurs
-
disconnect
public void disconnect() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismDisconnect from the server. TransferMechanism stays initialized and can be reconnected into the Server by calling the connect() method. Method should be used when you want to disconnect the client, but may want to reconnect it back later in your implementations.- Specified by:
disconnectin interfaceFileTransferMechanism- Specified by:
disconnectin interfaceRemoteFileSystemSource- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
doDisconnect
protected void doDisconnect()
Method that contains the functionality to disconnect the clients from the system
-
finish
public void finish()
Description copied from interface:FileTransferMechanismCleans up memory allocated by the native libraries component of FileCatalyst. This should be called when all transfers are completed, the TransferMechanism has disconnected, and the TransferMechanism is no longer needed.
Note: Finish() completely disconnects and terminates the FileTransferMechanism in it's entirety. To perform future- Specified by:
finishin interfaceFileTransferMechanism
-
exists
public boolean exists(java.lang.String remoteFile) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismTest if the remote file, denoted by the given remote path, exists on the server and returns true if it exists, false otherwise.- Specified by:
existsin interfaceFileTransferMechanism- Parameters:
remoteFile- String The path to the remote file- Returns:
- boolean True if the file exists, false otherwise
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
size
public long size(java.lang.String remoteFile) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileListDataItemSourceReturn the size of a remote file- Specified by:
sizein interfaceFileListDataItemSource- Parameters:
remoteFile- String The path to the remote file- Returns:
- long the size of the remote file or -1 if it doesn't exist
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
size
public long size(java.lang.String remoteFile, boolean bypassCache) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismGet the size of the named file from the remote server.- Specified by:
sizein interfaceFileTransferMechanism- Parameters:
remoteFile- name of the file- Returns:
- the size of the file
- Throws:
unlimited.core.util.common.exception.FCException- if a FileCatalyst protocol error occurs.java.io.IOException- if an error occurs either connecting to the destination server, or if a transfer I/O error occurs.
-
download
public TransferHook download(java.lang.String remoteFile) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismDownload a the specified file to the current local working directory.- Specified by:
downloadin interfaceFileTransferMechanism- Parameters:
remoteFile- The remote file to be downloaded. Can be a relative or absolute path to the file.- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
download
public TransferHook download(java.lang.String remoteFile, java.lang.String localPath) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismDownload the specified file to the specified local path.- Specified by:
downloadin interfaceFileTransferMechanism- Parameters:
remoteFile- The remote file to be downloaded. Can be a relative or absolute path to the file.localPath- The local path to which the file will be stored- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
download
public TransferHook download(java.util.List<java.lang.String> files) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismDownloads the files as specified by the paths (in String format) contained in the specified vector to the current working directory.- Specified by:
downloadin interfaceFileTransferMechanism- Parameters:
files- A Vector containing paths (as String) of files to be downloaded- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
download
public TransferHook download(FileListData files) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismDownloads the files specified in the FileListData object to the current local working directory.- Specified by:
downloadin interfaceFileTransferMechanism- Parameters:
files- List of files to be downloaded- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
java.io.IOException- If a timeout, or other IO error occursunlimited.core.util.common.exception.FCException- If an error in the FC protocol occurs
-
download
public TransferHook download(FileListData files, java.lang.String localPath) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismDownloads the files specified in the FileListData object to the specified path.- Specified by:
downloadin interfaceFileTransferMechanism- Parameters:
files- FileListDatalocalPath- String- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
java.io.IOException- If a timeout, or other IO error occursunlimited.core.util.common.exception.FCException- If an error in the FC protocol occurs
-
download
public TransferHook download(FileListData files, java.lang.String localPath, java.lang.String transferUniqueID) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismDownloads the files specified in the FileListData object to the specified path.- Specified by:
downloadin interfaceFileTransferMechanism- Parameters:
files- FileListDatalocalPath- StringtransferUniqueID- Assigns a unique transaction ID for the duration of this transfer. Overrides global setUniqueID() variable.- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
java.io.IOException- If a timeout, or other IO error occursunlimited.core.util.common.exception.FCException- If an error in the FC protocol occurs
-
download
public TransferHook download(FileListData files, java.lang.String localPath, java.lang.String transferUniqueID, boolean needsRecurse) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismDownloads the files specified in the FileListData object to the specified path.- Specified by:
downloadin interfaceFileTransferMechanism- Parameters:
files- FileListDatalocalPath- StringtransferUniqueID- Assigns a unique transaction ID for the duration of this transfer. Overrides global setUniqueID() variable.needsRecurse- flag to recurse in any directories passed into the client object for transfer- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
java.io.IOException- If a timeout, or other IO error occursunlimited.core.util.common.exception.FCException- If an error in the FC protocol occurs
-
download
public TransferHook download(java.util.List<java.lang.String> files, java.lang.String localPath) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismDownloads the files as specified by the paths (in String format) contained in the specified vector to the current working directory.- Specified by:
downloadin interfaceFileTransferMechanism- Parameters:
files- A Vector containing paths (as String) of files to be downloadedlocalPath- The local path to which the files will be stored- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
download
public TransferHook download(java.util.List<java.lang.String> files, java.lang.String localPath, java.lang.String transferUniqueID) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismDownloads the files as specified by the paths (in String format) contained in the specified vector to the current working directory.- Specified by:
downloadin interfaceFileTransferMechanism- Parameters:
files- A Vector containing paths (as String) of files to be downloadedlocalPath- The local path to which the files will be storedtransferUniqueID- Assigns a unique transaction ID for the duration of this transfer. Overrides global setUniqueID() variable.- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
download
public TransferHook download(java.util.List<java.lang.String> files, java.lang.String localPath, java.lang.String transferUniqueID, boolean needsRecurse) throws java.io.IOException, unlimited.core.util.common.exception.FCException
- Specified by:
downloadin interfaceFileTransferMechanism- Returns:
- Throws:
unlimited.core.util.common.exception.FCException- if a FileCatalyst protocol error occurs.java.io.IOException- if an error occurs either connecting to the destination server, or if a transfer I/O error occurs.
-
downloadAs
public TransferHook downloadAs(java.lang.String remoteFile, java.lang.String localFile) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismDownload the specified file to the specified local file.- Specified by:
downloadAsin interfaceFileTransferMechanism- Parameters:
remoteFile- The remote file to be downloaded. Can be a relative or absolute path to the file.localFile- The local path to which the file will be stored. Can be a different path entirely- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
downloadAs
public TransferHook downloadAs(java.lang.String remoteFile, java.nio.file.Path localFile, java.lang.String transferUniqueID) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismDownload the specified file to the specified local file.- Specified by:
downloadAsin interfaceFileTransferMechanism- Parameters:
remoteFile- The remote file to be downloaded. Can be a relative or absolute path to the file.localFile- The local path to which the file will be stored. Can be a different path entirelytransferUniqueID- Unique ID for the transfer- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
downloadAs
public TransferHook downloadAs(FileListDataItem remoteFile, java.nio.file.Path localFile, java.lang.String transferUniqueID) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismDownload the specified file to the specified local file.- Specified by:
downloadAsin interfaceFileTransferMechanism- Parameters:
remoteFile- The remote file to be downloaded.localFile- The local path to which the file will be stored. Can be a different path entirelytransferUniqueID- Unique ID for the transfer- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
upload
public TransferHook upload(java.lang.String localFile) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismUpload the specified file to the current remote working directory.- Specified by:
uploadin interfaceFileTransferMechanism- Parameters:
localFile- The local file to be uploaded, can be a directory as well- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
upload
public TransferHook upload(java.nio.file.Path localFile) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismUpload the specified file to the current remote working directory.- Specified by:
uploadin interfaceFileTransferMechanism- Parameters:
localFile- The local file to be uploaded, can be a directory as well- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
uploadStream
public void uploadStream(java.util.stream.Stream<java.nio.file.Path> stream) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionUploads the provided stream to the currently connected Server. Use this method if you expect large collections of files to be transferred- Parameters:
stream- Stream of files to be transferred- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
downloadStream
public void downloadStream(java.util.stream.Stream<FileListDataItem> stream) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Downloads the provided stream from the currently connected Server. Use this method if you expect large collections of files to be transferred- Parameters:
stream-- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
transferJobStream
public <FileType> void transferJobStream(java.util.stream.Stream<TransferJob.FileTypeJob<FileType>> stream) throws unlimited.core.util.common.exception.FCException, java.io.IOException
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
upload
public TransferHook upload(java.nio.file.Path localFile, java.lang.String remotePath) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismUpload the specified file to the specified remote directory.- Specified by:
uploadin interfaceFileTransferMechanism- Parameters:
localFile- The local file to be uploaded, can be a directory as wellremotePath- The remote path where files should be uploaded- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
upload
public TransferHook upload(java.nio.file.Path localFile, java.lang.String remotePath, java.lang.String transferUniqueID) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismUpload the specified file to the specified remote directory and specifies a unique transaction id.- Specified by:
uploadin interfaceFileTransferMechanism- Parameters:
localFile- The local file to be uploaded, can be a directory as wellremotePath- The remote path where files should be uploadedtransferUniqueID- Assigns a unique transaction ID for the duration of this transfer. Overrides global setUniqueID() variable.- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
uploadAs
public TransferHook uploadAs(java.nio.file.Path localFile, java.lang.String remoteFilename) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismUpload the specified file to the specified remote filename. The remoteFilename filename parameter can be a plain filename, in which case it will be uploaded to the current remote directory. It can also be a relative or absolute path on the remote server. i.e. /path/to/stor/file.zip- Specified by:
uploadAsin interfaceFileTransferMechanism- Parameters:
localFile- The local file to be uploaded, can be a directory as wellremoteFilename- The filename to which this file will be stored- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
uploadAs
public TransferHook uploadAs(java.nio.file.Path localFile, java.lang.String remoteFilename, java.lang.String transferUniqueID) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismUpload the specified file to the specified remote filename. The remoteFilename filename parameter can be a plain filename, in which case it will be uploaded to the current remote directory. It can also be a relative or absolute path on the remote server. i.e. /path/to/stor/file.zip- Specified by:
uploadAsin interfaceFileTransferMechanism- Parameters:
localFile- The local file to be uploaded, can be a directory as wellremoteFilename- The filename to which this file will be storedtransferUniqueID- Assigns a unique transaction ID for the duration of this transfer. Overrides global setUniqueID() variable.- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
upload
public TransferHook upload(java.util.List<java.nio.file.Path> files) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismUploads all File objects in the Vector provided to the current remote working directory.- Specified by:
uploadin interfaceFileTransferMechanism- Parameters:
files- A Vector of File objects to be uploaded- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
upload
public TransferHook upload(java.util.List<java.nio.file.Path> files, java.lang.String remotePath) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismUploads all File objects in the Vector provided to the specified remote directory.- Specified by:
uploadin interfaceFileTransferMechanism- Parameters:
files- A Vector of File objects to be uploadedremotePath- The remote path where files should be uploaded- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
upload
public TransferHook upload(java.util.List<java.nio.file.Path> files, java.lang.String remotePath, java.lang.String transferUniqueID) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismUploads all File objects in the Vector provided to the specified remote directory.- Specified by:
uploadin interfaceFileTransferMechanism- Parameters:
files- A Vector of File objects to be uploadedremotePath- The remote path where files should be uploadedtransferUniqueID- Assigns a unique transaction ID for the duration of this transfer. Overrides global setUniqueID() variable.- Returns:
- A handler object that can be monitored for progress and status information.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
uploadList
public TransferHook uploadList(java.util.List<java.nio.file.Path> files, java.lang.String remotePath, java.lang.String transferUniqueID) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismUploads a list of files to the connected Server- Specified by:
uploadListin interfaceFileTransferMechanism- Parameters:
files- List of Paths to be uploadedremotePath- Remote path of where the files should land on the ServertransferUniqueID- Unique ID that you wish to have for the transfer- Returns:
- Throws:
java.io.IOExceptionunlimited.core.util.common.exception.FCException
-
uploadList
public TransferHook uploadList(java.util.List<java.nio.file.Path> files, java.lang.String remotePath, java.lang.String transferUniqueID, boolean needsRecurse) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismUploads a list of files to the connected Server.- Specified by:
uploadListin interfaceFileTransferMechanism- Parameters:
files- List of Paths to be uploadedremotePath- Remote path of where the files should land on the ServertransferUniqueID- Unique ID that you wish to have for the transferneedsRecurse- Whether or not the code should recurse into the file to transfer it (defaults to true)- Returns:
- Throws:
unlimited.core.util.common.exception.FCException- if a FileCatalyst protocol error occurs.java.io.IOException- if an error occurs either connecting to the destination server, or if a transfer I/O error occurs.
-
addCustomLogHandler
public void addCustomLogHandler(java.util.logging.Handler handler)
Description copied from interface:FileTransferMechanismAdds a custom log handler to which API logs will be published. This should be called prior to calling initialize() to have an affect.- Specified by:
addCustomLogHandlerin interfaceFileTransferMechanism- Parameters:
handler- The log handler to add.
-
quote
public java.lang.String quote(java.lang.String command) throws java.io.IOException, unlimited.core.util.common.exception.FCExceptionDescription copied from interface:FileTransferMechanismIssue arbitrary FileCatalyst commands to the FileCatalyst server. example: MD5 commands can be called from here- Specified by:
quotein interfaceFileTransferMechanism- Parameters:
command- command to be sent to server- Returns:
- sends back the server response to the command.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
noop
public void noop() throws java.io.IOException, unlimited.core.util.common.exception.FCExceptionSends a small command to the server to see if it still can be reached.- Throws:
java.io.IOExceptionunlimited.core.util.common.exception.FCException
-
pwd
public java.lang.String pwd() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferDataReturns the current remote working directory.- Specified by:
pwdin interfaceFileTransferData- Specified by:
pwdin interfaceRemoteFileSystemSource- Returns:
- the current remote working directory.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
cd
public void cd(java.lang.String path) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferDataSets the current remote working directory to the specified path. This can be relative or absolute.- Specified by:
cdin interfaceFileTransferData- Specified by:
cdin interfaceRemoteFileSystemSource- Parameters:
path- The desired remote path to change to.- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occurs, permission denied, etc...java.io.IOException- If a timeout, or other IO error occurs
-
cdup
public void cdup() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismMove up one directory on the remote directory structure.- Specified by:
cdupin interfaceFileTransferMechanism- Specified by:
cdupin interfaceRemoteFileSystemSource- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
fsEvents
public void fsEvents() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismPrints out a list of the current file system events that are set on the server. Uses a default timeout value of 1000.- Specified by:
fsEventsin interfaceFileTransferMechanism- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
delete
public void delete(java.lang.String file) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileListDataItemSourceDeletes the specified file from the remote file system.- Specified by:
deletein interfaceFileListDataItemSource- Parameters:
file- The file to be deleted- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
deleteAll
public void deleteAll(java.util.List files) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismDelete all specified files in a single efficient command. Files and directories may be passed, and are deleted recursively.- Specified by:
deleteAllin interfaceFileTransferMechanism- Parameters:
files- List of files to delete- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
deleteAll
public void deleteAll(java.util.List<java.lang.String> files, boolean ftpDelete) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismDelete all specified files in a single efficient command. Files and directories may be passed, and are deleted recursively.- Specified by:
deleteAllin interfaceFileTransferMechanism- Parameters:
files- List of String file names to deleteftpDelete- - if true will not delete non empty directories- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
deleteAll
public void deleteAll(FileListData files) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismDelete all specified files in a single efficient command. Files and directories may be passed, and are deleted recursively.- Specified by:
deleteAllin interfaceFileTransferMechanism- Parameters:
files- List of files to delete- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
deleteAll
public void deleteAll(FileListDataItem[] files) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismDelete all specified files in a single efficient command. Files and directories may be passed, and are deleted recursively.- Specified by:
deleteAllin interfaceFileTransferMechanism- Parameters:
files- List of files to delete- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
flushCaches
public void flushCaches()
Description copied from interface:FileTransferMechanismDeletes underlying caches for file sizes and date/time stamps- Specified by:
flushCachesin interfaceFileTransferMechanism
-
mkdir
public void mkdir(java.lang.String dir) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismCreates the specified directory on the remote file system.- Specified by:
mkdirin interfaceFileTransferMechanism- Parameters:
dir- The directory to be created- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occurs, i.e. permissions deniedjava.io.IOException- If a timeout, or other IO error occurs
-
rmdir
public void rmdir(java.lang.String dir) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismDeletes the specified directory from the remote file system.- Specified by:
rmdirin interfaceFileTransferMechanism- Parameters:
dir- The directory to be deleted- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
rename
public void rename(java.lang.String oldName, java.lang.String newName) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismRenames the specified file to the new name.- Specified by:
renamein interfaceFileTransferMechanism- Parameters:
oldName- File to be renamednewName- New name for the file- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
list
public FileListData list() throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileListDataItemSourceReturns meta data for files in the current remote directory. Use to see what files exist and can be downloaded from the connected Server- Specified by:
listin interfaceFileListDataItemSource- Specified by:
listin interfaceRemoteFileSystemSource- Returns:
- meta data for files in the current remote directory.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
listWithInlineParse
public FileListData listWithInlineParse() throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismReturns meta data for files in the current remote directory.- Specified by:
listWithInlineParsein interfaceFileTransferMechanism- Returns:
- meta data for files in the current remote directory.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
listWithInlineParse
public FileListData listWithInlineParse(java.lang.String directory) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismReturns meta data for files in the given remote directory.- Specified by:
listWithInlineParsein interfaceFileTransferMechanism- Specified by:
listWithInlineParsein interfaceRemoteFileSystemSource- Parameters:
directory- to get data from- Returns:
- meta data for files in the given remote directory.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
listRecursiveFTPCompatible
public FileListData listRecursiveFTPCompatible(java.lang.String directory) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismMethod recursive lists files in an ftp compatible manner similar toFileTransferMechanism.listWithInlineParse()- Specified by:
listRecursiveFTPCompatiblein interfaceFileTransferMechanism- Parameters:
directory- Remote directory to list contents from- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
list
public FileListData list(java.lang.String wildcard) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismReturns meta data for files in the current remote directory.- Specified by:
listin interfaceFileTransferMechanism- Parameters:
wildcard- only return items that match this pattern- Returns:
- meta data for files in the current remote directory.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
list
public FileListData list(java.lang.String wildcard, java.lang.String remoteDirectory) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismReturns meta data for files that match the wildcard in the supplied directory.- Specified by:
listin interfaceFileTransferMechanismremoteDirectory- Remote directory to retrieve a listing for- Returns:
- meta data for files in the current remote directory.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
getRemoteServer
public java.lang.String getRemoteServer()
Description copied from interface:FileTransferDataThis method returns the remote server / hostname to which this client is connected.- Specified by:
getRemoteServerin interfaceFileTransferData- Returns:
- the remote server to which this client is connected.
-
setRemoteServer
public void setRemoteServer(java.lang.String remoteServer)
Description copied from interface:FileTransferDataSet the remote server to which this client should connect. This should be called prior to calling the connect() method.- Specified by:
setRemoteServerin interfaceFileTransferData- Parameters:
remoteServer- String value to specify the server to connect to
-
getRemotePort
public int getRemotePort()
Description copied from interface:FileTransferDataGets the remote port to which this client will be connected.- Specified by:
getRemotePortin interfaceFileTransferData- Returns:
- the remote port to which this client will be connected.
-
setRemotePort
public void setRemotePort(int remotePort)
Description copied from interface:FileTransferDataSets the remote port to which this client will be connected. This should be called prior to calling the connect() method.- Specified by:
setRemotePortin interfaceFileTransferData- Parameters:
remotePort- int value to specify the remort post to be used
-
getMode
public int getMode()
Description copied from interface:FileListDataItemSourceThe current transfer mode of this client.The possible returns values can be found at the following locations:
- UDP:
TransferMode.UDP - FTP:
TransferMode.FTP - HTTP:
TransferMode.HTTP - AUTO:
TransferMode.AUTO
- Specified by:
getModein interfaceFileListDataItemSource- Returns:
- current transfer mode (UDP, FTP, AUTO) of this client
- UDP:
-
setMode
public void setMode(int mode)
Description copied from interface:FileTransferDataSet the transfer mode of this client.The possible values can be found at the following locations:
- UDP:
TransferMode.UDP - FTP:
TransferMode.FTP - HTTP:
TransferMode.HTTP - AUTO:
TransferMode.AUTO
- Specified by:
setModein interfaceFileTransferData- Parameters:
mode- int value used to specify which transfer mode to use (ie: TransferMode.UDP)
- UDP:
-
getTargetRate
public int getTargetRate()
Description copied from interface:FileTransferDataReturns the current target rate for this client. The client will attempt to transfer files no faster than the specified rate. If a transfer is already in progress, an attempt will be made to adjust it's target rate to the specified value.- Specified by:
getTargetRatein interfaceFileTransferData- Returns:
- the current target rate for this client.
-
setTargetRate
public void setTargetRate(int targetRate)
Description copied from interface:FileTransferDataSets the target rate (kbps) for this client. The client will attempt to transfer files no faster than the specified rate. If a transfer is already in progress, an attempt will be made to adjust it's target rate to the specified value.- Specified by:
setTargetRatein interfaceFileTransferData- Parameters:
targetRate- int value to specify the maximum transfer rate
-
getBlockSize
public int getBlockSize()
Description copied from interface:FileTransferDataReturn the current block size. The block size determines how much data each thread will encode and send through the pipe. In higher RTT environments, it might be advantageous to increase this value as it will ensure the pipe is full of data. This however will cause the client side to consume more memory (number of threads * the block size)- Specified by:
getBlockSizein interfaceFileTransferData- Returns:
- the current block size.
-
setBlockSize
public void setBlockSize(int blockSize)
Description copied from interface:FileTransferDataSet the block size. The block size determines how much data each thread will encode and send through the pipe. In higher RTT environments, it might be advantageous to increase this value as it will ensure the pipe is full of data. This however will cause the client side to consume more memory (number of threads * the block size) Block size is set to 2048000 by default.- Specified by:
setBlockSizein interfaceFileTransferData- Parameters:
blockSize- An int value used to set the Block Size
-
getPacketSize
public int getPacketSize()
Description copied from interface:FileTransferDataReturns the current packet size in bytes. This is the encoded unit size, and determines the eventual UDP packet size. If the unit size is greater than the MTU of the network with will create fragmented UDP packets. This can lead to higher performance in low loss environments, but may decrease performance in environments with very low MTU (ATM) or high packet loss environments.- Specified by:
getPacketSizein interfaceFileTransferData- Returns:
- The current packet size. In Bytes.
-
setPacketSize
public void setPacketSize(int packetSize)
Description copied from interface:FileTransferDataSet the unit size. This is the encoded unit size, and determines the eventual UDP packet size. If the unit size is greater than the MTU of the network with will create fragmented UDP packets. This can lead to higher performance in low loss environments, but may decrease performance in environments with very low MTU (ATM) or high packet loss environments. Unit size is set to 1024 Bytes by default.- Specified by:
setPacketSizein interfaceFileTransferData- Parameters:
packetSize- int value used to set the Unit Size
-
setTransactionID
public void setTransactionID(java.lang.String uniqueID)
Description copied from interface:FileTransferDataSets a unique transaction number for the transfer (instance variable). Transaction number will be used as part of working/temporary filenames when transferring a file.Applies to temporary file name, zip file name, signature/delta filename.
By default, a random unique ID is created per machine by the API. This ensures that on the server, two separate client connections into the same user account should not encounter a filename collision. However, if two concurrent transfers are being launched using the same fileset (ie: upload using auto-zip) from the client API to separate servers, this value must be set for each transfer in order to ensure that temporary & working file name is not reused for two distinct transfers.
Value may be overridden if you explicitly specify a transaction ID during upload(Vector, String, String) or download(Vector, String, String) calls.
- Specified by:
setTransactionIDin interfaceFileTransferData- Parameters:
uniqueID- String value, should be alpha-numeric (Long.toString(System.currentTimeMillis()))
-
isAutoResume
public boolean isAutoResume()
Description copied from interface:FileTransferDataReturns true if auto-resume is enabled. When enabled, if the destination file is smaller than the source file, the client will compare the relevant portions of the files to see if a transfer can be resumed. This is done using an MD5 checksum.- Specified by:
isAutoResumein interfaceFileTransferData- Returns:
- true if auto-resume is enabled. false otherwise.
-
setAutoResume
public void setAutoResume(boolean autoResume)
Description copied from interface:FileTransferDataEnables/disables auto resume feature. When enabled, if the destination file is smaller than the source file, the client will compare the relevant portions of the files to see if a transfer can be resumed. This is done using an MD5 checksum. Auto resume is false by default.- Specified by:
setAutoResumein interfaceFileTransferData- Parameters:
autoResume- true/false to enabled or disable this feature.
-
isVerifyIntegrity
public boolean isVerifyIntegrity()
Description copied from interface:FileTransferDataReturns true if integrity check is enabled. If true, after each file is transferred an MD5 sum will be performed on the destination file and the result will be compared to that of the source file to ensure the files are identical.- Specified by:
isVerifyIntegrityin interfaceFileTransferData- Returns:
- true if integrity check is enabled.
-
setVerifyIntegrity
public void setVerifyIntegrity(boolean verifyIntegrity)
Description copied from interface:FileTransferDataIf set to true, after each file is transferred an MD5 sum will be performed on the destination file and the result will be compared to that of the source file to ensure the files are identical. Verify integrity is false by default.- Specified by:
setVerifyIntegrityin interfaceFileTransferData- Parameters:
verifyIntegrity- true/false to enable or disable this feature.
-
isMaintainPermissions
public boolean isMaintainPermissions()
Description copied from interface:FileTransferDataReturns true if maintain permissions is enabled. If value returns true, upon each successful transfer, the destination file permissions will be set to match those of the source file. This features only functions when both the source and destination are running a Linux/Unix based OS.- Specified by:
isMaintainPermissionsin interfaceFileTransferData- Returns:
- true if Maintain permissions is enabled
-
setMaintainPermissions
public void setMaintainPermissions(boolean maintainPermissions)
Description copied from interface:FileTransferDataIf set to true, upon each successful transfer, the destination file permissions will be set to match those of the source file. This features only functions when both the source and destination are running a Linux/Unix based OS. This feature is off by default.- Specified by:
setMaintainPermissionsin interfaceFileTransferData- Parameters:
maintainPermissions- true/false to enabled and disable this feature.
-
isMaintainLastModified
public boolean isMaintainLastModified()
Description copied from interface:FileTransferDataReturns true if Maintain last modified is enabled. If set to true, upon each successful transfer, the destination files modification date will be set to match that of the source file.- Specified by:
isMaintainLastModifiedin interfaceFileTransferData- Returns:
- true if Maintain last modified is enabled
-
setMaintainLastModified
public void setMaintainLastModified(boolean isMaintainLastModified)
Description copied from interface:FileTransferDataSets the maintain last modified feature to the value specified. If set to true, upon each successful transfer, the destination files modification date will be set to match that of the source file. This feature is off by default.- Specified by:
setMaintainLastModifiedin interfaceFileTransferData- Parameters:
isMaintainLastModified- true/false to enabled and disable this feature.
-
isUseIncremental
public boolean isUseIncremental()
Description copied from interface:FileTransferDataReturns true if incremental feature is enabled- Specified by:
isUseIncrementalin interfaceFileTransferData- Returns:
- true if incremental feature is enabled
-
setUseIncremental
public void setUseIncremental(boolean useIncremental)
Description copied from interface:FileTransferDataIf set to true, before each source file is transferred, it will be compared with the destination file if it exists to ensure the file has changed. If the file has not changed, the file will not be transmitted. This feature is off by default.- Specified by:
setUseIncrementalin interfaceFileTransferData- Parameters:
useIncremental- boolean value to turn incremental on/off
-
isOptimizeBlockSize
public boolean isOptimizeBlockSize()
Description copied from interface:FileTransferDataReturns true if optimize block size feature is enabled.- Specified by:
isOptimizeBlockSizein interfaceFileTransferData- Returns:
- true/false if this feature is enabled/disabled
-
setOptimizeBlockSize
public void setOptimizeBlockSize(boolean optimizeBlockSize)
Description copied from interface:FileTransferDataIf set to true, FileCatalyst will attempt to optimize the current block size to be an exact multiple of the data size that is being transmitted. This feature is on by default.- Specified by:
setOptimizeBlockSizein interfaceFileTransferData- Parameters:
optimizeBlockSize- true/false to enabled and disable this feature.
-
getClientCredentials
public java.util.function.Supplier<ClientCredentials> getClientCredentials()
Description copied from interface:FileTransferDataReturns the credentials supplier that is set for this client.- Specified by:
getClientCredentialsin interfaceFileTransferData- Returns:
- the credentials supplier that is set for this client.
-
setClientCredentials
public void setClientCredentials(java.util.function.Supplier<ClientCredentials> creds)
Description copied from interface:FileTransferDataSets the credentials supplier for this connection. Value is used to determine which user this transfer mechanism attempts to connect to a FC Server- Specified by:
setClientCredentialsin interfaceFileTransferData
-
isUseSSL
public boolean isUseSSL()
Description copied from interface:FileTransferDataReturns true if SSL mode is enabled, false otherwise.- Specified by:
isUseSSLin interfaceFileTransferData- Returns:
- true if SSL mode is enabled, false otherwise.
-
setUseSSL
public void setUseSSL(boolean useSSL)
Description copied from interface:FileTransferDataIf set to true, control connection will be made using an implicit SSL connection. This must be set prior to calling the connect method.- Specified by:
setUseSSLin interfaceFileTransferData- Parameters:
useSSL- Boolean value to turn SSL on/off
-
getSSLSocketProducer
public unlimited.core.util.common.net.ssl.FCSSLSocketProducerImpl getSSLSocketProducer()
Description copied from interface:FileTransferDataRetrieves the implementation that will be used to generate SSL sockets- Specified by:
getSSLSocketProducerin interfaceFileTransferData
-
setSSLSocketProducer
public void setSSLSocketProducer(unlimited.core.util.common.net.ssl.FCSSLSocketProducerImpl producerImpl)
Description copied from interface:FileTransferDataSets the implementation that will be used to generate SSL sockets- Specified by:
setSSLSocketProducerin interfaceFileTransferData- Parameters:
producerImpl- Concrete instance that provides logic for generating SSL sockets
-
getLogLocation
public java.lang.String getLogLocation()
Description copied from interface:FileTransferDataReturns the current location for the log files.- Specified by:
getLogLocationin interfaceFileTransferData- Returns:
- The current location for the log files.
-
setLogLocation
public void setLogLocation(java.lang.String logLocation)
Description copied from interface:FileTransferDataSpecifies a directory on the local system where the log file should be stored. If this value is not set, the log will be stored in the current working directory. This should be called prior to calling initialize() to have an affect.- Specified by:
setLogLocationin interfaceFileTransferData- Parameters:
logLocation- String value specifying where to store the logs
-
setLogPrefix
public void setLogPrefix(java.lang.String logPrefix)
Sets the prefix for the log file name.- Specified by:
setLogPrefixin interfaceFileTransferMechanism- Parameters:
logPrefix- the logPrefix to set
-
getLogger
public unlimited.core.util.common.logs.LogUtils getLogger()
Description copied from interface:FileTransferDataReturns the logger that is used- Specified by:
getLoggerin interfaceFileTransferData- Returns:
- the logger
-
setLogger
public void setLogger(unlimited.core.util.common.logs.LogUtils logger)
Description copied from interface:FileTransferDataoverriding the logUtils object.- Specified by:
setLoggerin interfaceFileTransferData- Parameters:
logger- the logger to set
-
getStartRate
public int getStartRate()
Description copied from interface:FileListDataItemSourceReturns the current start rate for FC transfers. All FC transfer will begin at this rate and ramp up to the specified target rate if no congestion is encounters.Note: Congestion control must be enabled for this value to have an effect.
- Specified by:
getStartRatein interfaceFileListDataItemSource- Returns:
- The current start rate for FC transfers in Kilobits per second
-
setStartRate
public void setStartRate(int incomingSlowStartRate)
Description copied from interface:FileTransferDataSets the start rate for FC transfers in Kilobits per second. All FC transfer will begin at this rate and ramp up to the specified target rate if no congestion is encounters. Congestion control must be enabled for this value to have an effect. Start rate is set to 1000 Kbps by default.- Specified by:
setStartRatein interfaceFileTransferData- Parameters:
incomingSlowStartRate- int value used to set the rate in which the transfer should start at
-
getConnectTimeout
public int getConnectTimeout()
Description copied from interface:FileTransferDataReturn the connect timeout value (in milliseconds)- Specified by:
getConnectTimeoutin interfaceFileTransferData- Returns:
- The connect timeout value (in milliseconds)
-
setConnectTimeout
public void setConnectTimeout(int millisec)
Description copied from interface:FileTransferDataSets the connect timeout value (in milliseconds). Default is 20000 milliseconds.- Specified by:
setConnectTimeoutin interfaceFileTransferData- Parameters:
millisec- int value used to set the connect timeout
-
isShowConsoleLog
public boolean isShowConsoleLog()
Description copied from interface:FileTransferDataReturns true if console log is enabled.- Specified by:
isShowConsoleLogin interfaceFileTransferData- Returns:
- true if console log is enabled.
-
setShowConsoleLog
public void setShowConsoleLog(boolean showConsoleLog)
Description copied from interface:FileTransferDataIf set to true, all logging information is also sent to standard out. This must be enabled prior to calling the initialize method.- Specified by:
setShowConsoleLogin interfaceFileTransferData- Parameters:
showConsoleLog- boolean value set to show the console Log or not
-
isDebug
public boolean isDebug()
Description copied from interface:FileTransferDataReturns true if debug is set to true.- Specified by:
isDebugin interfaceFileTransferData- Returns:
- True if debug is set to true
-
setDebug
public void setDebug(boolean debug)
Description copied from interface:FileTransferDataTurns on debug mode.- Specified by:
setDebugin interfaceFileTransferData- Parameters:
debug- boolean value to turn the debug mode on or of
-
getNumFTPStreams
public int getNumFTPStreams()
Description copied from interface:FileTransferDataReturns the number of concurrent streams that will be used for FTP transfers- Specified by:
getNumFTPStreamsin interfaceFileTransferData- Returns:
- Number of concurrent streams that will be used for FTP transfers
-
getCompMethod
public int getCompMethod()
Description copied from interface:FileTransferDataReturns the current compression method to be used during transfers. The method dictates what type of algorithm to use when compressing the data into smaller amounts.The available compression strategies that can be used are as follows:
- 0: Default Zip deflator (Lower CPU and memory usage with less efficient compression)
- 1: LMZA (Higher CPU and memory usage with more efficient data compression)
- Specified by:
getCompMethodin interfaceFileTransferData- Returns:
- int The current compression Method.
-
getCompLevel
public int getCompLevel()
Description copied from interface:FileTransferDataReturns the current compression level (0 - 9). This compression level is used determine the amount of compression to be used when attempting to compress the data in a given transfer. In some networks (such as high bandwidth connections), it may be helpful to lower the amount of compression to a smaller number. In other networks (low bandwidth, satellite networks), it may be helpful t maximize the compression (comp level = 9).- Specified by:
getCompLevelin interfaceFileTransferData- Returns:
- int The current compression level
-
getCompStrategy
public int getCompStrategy()
Description copied from interface:FileTransferDataReturns the current compression deflater strategy that will be used in the current compression method to minimize the data and compress into smaller byte values.Valid return values are:
- java.util.zip.Deflater.DEFAULT_STRATEGY
- java.util.zip.Deflater.FILTERED (Strategy that is most beneficial when compressing filtered, sorted data)
- java.util.zip.Deflater.HUFFMAN_ONLY (Strategy that compresses and decompresses data by encoding and decoding data into different information)
- Specified by:
getCompStrategyin interfaceFileTransferData- Returns:
- int The current compression strategy
-
isCompressionEnabled
public boolean isCompressionEnabled()
Description copied from interface:FileTransferDataReturns true if compression is enabled, false otherwise.- Specified by:
isCompressionEnabledin interfaceFileTransferData- Returns:
- boolean True if compression is enabled, false otherwise.
-
getIncrementalMode
public int getIncrementalMode()
Description copied from interface:FileTransferDataReturns the current incremental mode.- Specified by:
getIncrementalModein interfaceFileTransferData- Returns:
- int The current incremental mode.
-
isIncrementalSizeCheckOnly
public boolean isIncrementalSizeCheckOnly()
Description copied from interface:FileTransferDataReturns whether or not incremental has been set to use the size only option- Specified by:
isIncrementalSizeCheckOnlyin interfaceFileTransferData- Returns:
-
isAutoZip
public boolean isAutoZip()
Description copied from interface:FileTransferDataReturns true if auto zip is enabled, false otherwise.- Specified by:
isAutoZipin interfaceFileTransferData- Returns:
- boolean True if auto zip is enabled, false otherwise.
-
isAutoUnzip
public boolean isAutoUnzip()
Description copied from interface:FileTransferDataReturns true if auto unzip is enabled, false otherwise.- Specified by:
isAutoUnzipin interfaceFileTransferData- Returns:
- boolean True if auto zip is enabled, false otherwise.
-
isTransferWithTempName
public boolean isTransferWithTempName()
Description copied from interface:FileTransferDataReturns true if transferring with temporary names is enabled- Specified by:
isTransferWithTempNamein interfaceFileTransferData- Returns:
- boolean True if transferring with temporary names is enabled
-
getReadTimeout
public int getReadTimeout()
Description copied from interface:FileTransferDataThis is the length of time in milliseconds the client will wait for a reply after sending a command to the FileCatalyst server.- Specified by:
getReadTimeoutin interfaceFileTransferData- Returns:
- int The current read timeout value, in millisecods..
-
getExtendedReadTimeout
public int getExtendedReadTimeout()
Description copied from interface:FileTransferDataThis is the length of time in milliseconds the client will wait for a reply after sending a long running command (such as MD5, MKDLT, MKSIG, ZIP, UNZIP) to the FileCatalyst server.- Specified by:
getExtendedReadTimeoutin interfaceFileTransferData- Returns:
- int The current extended read timeout value, in millisecods.
-
getVerifyMode
public int getVerifyMode()
Description copied from interface:FileTransferDataReturns the current integrity verification mode.The modes that can be returned are as follows:
- Specified by:
getVerifyModein interfaceFileTransferData- Returns:
- int The current verify mode, either TransferMode.VERIFY_AFTER or TransferMode.VERIFY_ON_THE_FLY.
-
getServletLocation
public java.lang.String getServletLocation()
Description copied from interface:FileTransferDataFileCatalyst has the ability to upload using the HTTP/S protocol as long as the FileCatalyst Servlet application is installed and properly configured. This method allows you to retrieve the current URL of the FileCatalyst Servlet if it has been set.- Specified by:
getServletLocationin interfaceFileTransferData- Returns:
- String the URL of FileCatalyst Servlet, or null if it has not been set.
-
getLocalWorkingDirectoryPath
public java.nio.file.Path getLocalWorkingDirectoryPath()
- Specified by:
getLocalWorkingDirectoryPathin interfaceFileTransferData
-
isDeleteAfterTransfer
public boolean isDeleteAfterTransfer()
Description copied from interface:FileTransferDataReturns true if the delete after transfer option is enabled, false otherwise. With this option enabled, source files will be deleted after the transfer is complete. If the transfer is an upload, the local files will be deleted. If the transfer is a download, the remote files will be deleted.- Specified by:
isDeleteAfterTransferin interfaceFileTransferData- Returns:
- boolean true if the delete after transfer option is enabled, false otherwise.
-
isProgressiveTransfers
public boolean isProgressiveTransfers()
Description copied from interface:FileTransferDataReturn true if the progressive option is enabled, false otherwise.- Specified by:
isProgressiveTransfersin interfaceFileTransferData- Returns:
- boolean true if the progressive option is enabled, false otherwise.
-
getProgressiveTimeout
public int getProgressiveTimeout()
Description copied from interface:FileTransferDataReturns the current progressive timeout value. The value determines how many seconds we will wait for files to stop growing- Specified by:
getProgressiveTimeoutin interfaceFileTransferData- Returns:
-
getProgressiveTimeoutFilter
public java.lang.String getProgressiveTimeoutFilter()
Description copied from interface:FileTransferDataReturns the current progressive timeout filter. Value determines the file that will be included in progressive file growth checks- Specified by:
getProgressiveTimeoutFilterin interfaceFileTransferData- Returns:
-
getIncomingDataPort
public int getIncomingDataPort()
Description copied from interface:FileTransferDataReturns the port used for incoming UDP packets on downloads Only the first port will be returned in the case of v3.0 where multi-receive sockets have been enabled.- Specified by:
getIncomingDataPortin interfaceFileTransferData- Returns:
- int The port used for incoming UDP packets on downloads (Only the first port will be returned in the case of v3.0 where multi-receive sockets have been enabled.)
-
getIncomingDataPorts
public int[] getIncomingDataPorts()
Description copied from interface:FileTransferDataReturns the list of ports used for incoming UDP packets on downloads- Specified by:
getIncomingDataPortsin interfaceFileTransferData- Returns:
- int The list of port used for incoming UDP packets on downloads
-
getServletMultiplier
public int getServletMultiplier()
Description copied from interface:FileTransferDataWhen uploading in HTTP mode using FileCatalyst Servlet, this option allows the upload buffer size to be tuned. This method returns the current value.- Specified by:
getServletMultiplierin interfaceFileTransferData- Returns:
- int multiplier value used to tune upload buffer
-
getClientConnectKey
public java.lang.String getClientConnectKey()
Description copied from interface:FileTransferDataReturns the client connect key, used to connect to non-FileCatalyst servers- Specified by:
getClientConnectKeyin interfaceFileTransferData- Returns:
- String Client Connect Key
-
setNumFTPStreams
public void setNumFTPStreams(int numFTPStreams)
Description copied from interface:FileTransferDataWhen transferring in FTP mode, it is possible to send with several concurrent streams. This may increase performance on connections with low packet loss, but high latency. Speed gains are linear, that is, if you get 2 Mbps with 1 stream, you should get 4 Mbps with 2 streams.- Specified by:
setNumFTPStreamsin interfaceFileTransferData- Parameters:
numFTPStreams- Number of concurrent streams to use.
-
setCompStrategy
public void setCompStrategy(int compStrategy) throws java.lang.ExceptionDescription copied from interface:FileTransferDataSets the compression deflater strategy that will be used within the compression method to minimize the data and compress into smaller byte values.
Valid values are:
- java.util.zip.Deflater.DEFAULT_STRATEGY
- java.util.zip.Deflater.FILTERED (Strategy that is most beneficial when compressing filtered, sorted data)
- java.util.zip.Deflater.HUFFMAN_ONLY (Strategy that compresses and decompresses data by encoding and decoding data into different information)
- Specified by:
setCompStrategyin interfaceFileTransferData- Parameters:
compStrategy- int The new compression strategy- Throws:
java.lang.Exception
-
setCompMethod
public void setCompMethod(int compMethod) throws java.lang.ExceptionDescription copied from interface:FileTransferDataSets the current compression method to be used during transfers. The method dictates what type of algorithm to use alongside the deflater when compressing the data into smaller amounts.The available compression strategies that can be used are as follows:
- 0: Default Zip deflator (Lower CPU and memory usage for less efficient compression)
- 1: LMZA (Higher CPU and Memory usage for more efficient data compression)
- Specified by:
setCompMethodin interfaceFileTransferData- Parameters:
compMethod- int The desired compression Method- Throws:
java.lang.Exception
-
setCompLevel
public void setCompLevel(int compLevel) throws java.lang.ExceptionDescription copied from interface:FileTransferDataSets the compression level (0 - 9 with default of 4). This compression level is used determine the amount of compression to be used when attempting to compress the data in a given transfer. In some networks (such as high bandwidth connections), it may be helpful to lower the amount of compression to a smaller number. In other networks (low bandwidth, satellite networks), it may be helpful to maximize the compression (comp level = 9).- Specified by:
setCompLevelin interfaceFileTransferData- Parameters:
compLevel- int The desired compression level- Throws:
java.lang.Exception
-
setCompressionEnabled
public void setCompressionEnabled(boolean enable)
Description copied from interface:FileTransferDataEnables/disables on the fly compression. When enabled, each block of data will be compressed on the fly before it is sent over the network.- Specified by:
setCompressionEnabledin interfaceFileTransferData
-
setIncrementalMode
public void setIncrementalMode(int incrementalMode)
Description copied from interface:FileTransferDataWhen incremental is enabled, this method allows you to choose the incremental mode.Valid modes are
TransferMode.TRANSFER_FILE: Will transfer the entire file when it has been modified.TransferMode.TRANSFER_FILE_DELTAS: Will only transfer sections of the file that have been modifiedTransferMode.TRANSFER_FILE_UNIQUE_NAME: Will transfer the entire file, but under a unique nameTransferMode.TRANSFER_FILE_DELTAS_UNIQUE_NAME: Will only transfer sections of the file that have been modified but store the new file with a unique name
- Specified by:
setIncrementalModein interfaceFileTransferData- Parameters:
incrementalMode- int The desired incremental mode.
-
setIncrementalSizeCheckOnly
public void setIncrementalSizeCheckOnly(boolean incrementalSizeCheckOnly)
Description copied from interface:FileTransferDataSetting this value will cause the MD5 checks to be skipped and the files compared using size only.- Specified by:
setIncrementalSizeCheckOnlyin interfaceFileTransferData
-
setAutoZip
public void setAutoZip(boolean autoZip)
Description copied from interface:FileTransferDataEnables/disables auto zip feature. If this feature is enabled, prior to transferring, all files will be compressed into a single archive, transferred as one archive, and decompressed at the destination. Path structure will be maintained, as will file modification times. When using this feature in combination with setProgressive(true), FileCatalyst will beging to transfer the zip file before it is completely generated. This currently only works during uploads.- Specified by:
setAutoZipin interfaceFileTransferData- Parameters:
autoZip- boolean
-
setAutoUnzip
public void setAutoUnzip(boolean autoUnzip)
Description copied from interface:FileTransferDataEnables/disables auto unzip feature. When using this feature in combination with setAutoZip(true), if this feature is enabled, all files will be decompressed at the destination, otherwise if this feature is disable, all files won't be extracted and not deleted either.- Specified by:
setAutoUnzipin interfaceFileTransferData- Parameters:
autoUnzip- boolean
-
setTransferWithTempName
public void setTransferWithTempName(boolean transferWithTempName)
Description copied from interface:FileTransferDataWith this option enabled, files will be uploaded with a temporary filename and renamed back to their original name when the transfer is complete. This allows other applications to identify files that are not complete.- Specified by:
setTransferWithTempNamein interfaceFileTransferData- Parameters:
transferWithTempName- boolean true/false to enable or disable this feature
-
setReadTimeout
public void setReadTimeout(int millisecs)
Description copied from interface:FileTransferDataThis is the length of time the client will wait for a reply after sending a command to the FileCatalyst server.- Specified by:
setReadTimeoutin interfaceFileTransferData- Parameters:
millisecs- int New timeout value (in millisecs)
-
setExtendedReadTimeout
public void setExtendedReadTimeout(int millisecs)
Description copied from interface:FileTransferDataThis is the length of time the client will wait for a reply after sending a long running command (such as MD5, MKDLT, MKSIG, ZIP, UNZIP) to the FileCatalyst server. Minimum value is 600000 (10 minutes). Any attempt to set a value lower than this will automatically be increased to 600000.- Specified by:
setExtendedReadTimeoutin interfaceFileTransferData- Parameters:
millisecs- int New timeout value (in millisecs).
-
setVerifyMode
public void setVerifyMode(int verifyMode)
Description copied from interface:FileTransferDataSets the integrity verification mode- Specified by:
setVerifyModein interfaceFileTransferData- Parameters:
verifyMode- int Sets the desired mode, TransferMode.VERIFY_AFTER or TransferMode.VERIFY_ON_THE_FLY.- See Also:
TransferMode
-
setServletLocation
public void setServletLocation(java.lang.String servletLocation)
Description copied from interface:FileTransferDataFileCatalyst has the ability to upload using the HTTP/S protocol as long as the FileCatalyst Servlet application is installed and properly configured. This method allows you to set the URL of the FileCatalyst Servlet. Note that you must set the servlet location prior to calling connect(). You must also set the transfer mode to HTTP.- Specified by:
setServletLocationin interfaceFileTransferData- Parameters:
servletLocation- String The URL of the FileCatalyst Servlet
-
setServletLocation
public void setServletLocation(java.lang.String servletLocation, java.lang.String servletSessionID, java.lang.String welcomeMessage)Description copied from interface:FileTransferDataFileCatalyst has the ability to upload using the HTTP/S protocol as long as the FileCatalyst Servlet application is installed and properly configured. This method allows you to set the URL of the FileCatalyst Servlet. Note that you must set the servlet location prior to calling connect(). You must also set the transfer mode to HTTP.- Specified by:
setServletLocationin interfaceFileTransferData- Parameters:
servletLocation- String The URL of the FileCatalyst ServletservletSessionID- If s session was already established that should be re-used, this session id should be setwelcomeMessage- When connecting with pre-connected Servlet session, you may pass the welcome message to the FCClient as well so it can detect whether this is a FileCatalyst server or not as well as extract the version string.
-
setLocalWorkingDirectory
public void setLocalWorkingDirectory(java.nio.file.Path localWorkingDirectory)
Description copied from interface:FileTransferDataSets the Local Working directory. This directory is used as a base path during uploads or downloads. For example, if you specify an upload of the folder "/path1/path2" and you have set the working directory to "/path1" then the file will appear on the destination server as "/path2". If you had a local working directory of "/" then the entire path would be created on the destination server. Note: Call will attempt to create the directory if it doesn't currently exist- Specified by:
setLocalWorkingDirectoryin interfaceFileTransferData
-
setDeleteAfterTransfer
public void setDeleteAfterTransfer(boolean deleteAfterTransfer)
Description copied from interface:FileTransferDataWith this option enabled, source files will be deleted after the transfer is complete. If the transfer is an upload, the local files will be deleted. If the transfer is a download, the remote files will be deleted.- Specified by:
setDeleteAfterTransferin interfaceFileTransferData- Parameters:
deleteAfterTransfer- boolean Enables/disables the delete after transfer option
-
setProgressiveTransfers
public void setProgressiveTransfers(boolean progressiveTransfers)
Description copied from interface:FileTransferDataWith this option enabled, upon completion of an upload or download, FileCatalyst will compare the size of the source file to the size when it began the transfer. If the file has grown, it will continue to transfer the new data until the file is no longer growing. In this way, it is able to download or upload files that are curently being copied, or are currently being encoded.- Specified by:
setProgressiveTransfersin interfaceFileTransferData- Parameters:
progressiveTransfers- boolean boolean Enables/disables the progressive transfer option
-
setProgressiveTimeout
public void setProgressiveTimeout(int progressiveTimeout)
Description copied from interface:FileTransferDataSets the current progressive timeout to the value supplied- Specified by:
setProgressiveTimeoutin interfaceFileTransferData- Parameters:
progressiveTimeout- New timeout to set
-
setProgressiveTimeoutFilter
public void setProgressiveTimeoutFilter(java.lang.String progressiveTimeoutFilter)
Description copied from interface:FileTransferDataSets the current progressive timeout filter to the value that is set to- Specified by:
setProgressiveTimeoutFilterin interfaceFileTransferData- Parameters:
progressiveTimeoutFilter- Filter to set
-
setIncomingDataPort
public void setIncomingDataPort(int inDataPort)
Description copied from interface:FileTransferDataSets the port used for incoming UDP packets on downloads. If not set the default port is 9000.- Specified by:
setIncomingDataPortin interfaceFileTransferData
-
setIncomingDataPorts
public void setIncomingDataPorts(int[] inDataPorts)
Description copied from interface:FileTransferDataSets the port used for incoming UDP packets on downloads. Allows for multiple data ports to be selected to have more than one receiver socket open for incoming streams.- Specified by:
setIncomingDataPortsin interfaceFileTransferData
-
setServletMultiplier
public void setServletMultiplier(int servletMultiplier)
Description copied from interface:FileTransferDataWhen uploading in HTTP mode using FileCatalyst Servlet, this option allows the upload buffer size to be tuned.- Specified by:
setServletMultiplierin interfaceFileTransferData- Parameters:
servletMultiplier- int multiplier value used to tune upload buffer
-
setClientConnectKey
public void setClientConnectKey(java.lang.String clientConnectKey)
Description copied from interface:FileTransferDataThis key must be set in order to connect to non-FileCatalyst servers. This method must be called prior to called connect() or the key will not have any effect.- Specified by:
setClientConnectKeyin interfaceFileTransferData- Parameters:
clientConnectKey- String Client connect key
-
setClientIdentifier
public void setClientIdentifier(int clientIdentifier)
Description copied from interface:FileTransferDataAn ID value that identifies this client to the FileCatalyst Server.- Specified by:
setClientIdentifierin interfaceFileTransferData- Parameters:
clientIdentifier- int
-
setCongestionControlAggression
public void setCongestionControlAggression(int congestionControlAggression)
Description copied from interface:FileTransferDataSpecifies an aggression factor between 1 (passive) and 10 (aggressive) used by the congestion control mechanism to determine how passive or aggressive it should be in the face of network congestion.- Specified by:
setCongestionControlAggressionin interfaceFileTransferData- Parameters:
congestionControlAggression- int Aggression factor between 1 and 10.
-
setTransferWithTempName
public void setTransferWithTempName(boolean transferWithTempName, int tempMode)Description copied from interface:FileTransferDataWith this option enabled, files will be uploaded with a temporary filename and renamed back to their original name when the transfer is complete. This allows other applications to identify files that are not complete.- Specified by:
setTransferWithTempNamein interfaceFileTransferData- Parameters:
transferWithTempName- boolean true/false to enable or disable this featuretempMode- int Sets the desired mode, TransferMode.PREFIX or TransferMode.SUFFIX.- See Also:
TransferMode
-
testWriteSpeed
public int testWriteSpeed() throws java.io.FileNotFoundException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismPerform a write to current directory with recommended values for determining storage rate.- Specified by:
testWriteSpeedin interfaceFileTransferMechanism- Returns:
- write speed in kilobits per second
- Throws:
java.io.FileNotFoundExceptionjava.io.IOException
-
testWriteSpeed
public int testWriteSpeed(java.nio.file.Path file, int size, int timeout) throws java.io.FileNotFoundException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismPerform a write to specified file with specified size and timeout for determining storage rate.- Specified by:
testWriteSpeedin interfaceFileTransferMechanism- Parameters:
file- file to writesize- size of file in bytestimeout- timeout of write in milliseconds- Returns:
- write speed in kilobits per second
- Throws:
java.io.FileNotFoundExceptionjava.io.IOException
-
testMaximumUploadSpeed
public int testMaximumUploadSpeed() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismPerforms a series of tests to determine the maximum upload speed to the connected server.- Specified by:
testMaximumUploadSpeedin interfaceFileTransferMechanism- Returns:
- int the rate detected in Kbps
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
testMaximumDownloadSpeed
public int testMaximumDownloadSpeed() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismPerforms a series of tests to determine the maximum download speed from the connected server.- Specified by:
testMaximumDownloadSpeedin interfaceFileTransferMechanism- Returns:
- int the rate detected in Kbps
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
doTestWriteSpeed
protected int doTestWriteSpeed() throws unlimited.core.util.common.exception.FCException, java.io.FileNotFoundException, java.io.IOExceptionPerform a write to current directory with recommended values for determining storage rate.- Returns:
- write speed in kilobits per second
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.FileNotFoundExceptionjava.io.IOException
-
doTestAproximateUploadSpeed
protected int doTestAproximateUploadSpeed() throws java.io.IOExceptionTests the approximate upload speed by using the tester client- Returns:
- Rate detected in Kbps
- Throws:
java.io.IOException
-
doTestAproximateDownloadSpeed
protected int doTestAproximateDownloadSpeed() throws java.io.IOExceptionTests the approximate download speed by using the tester client- Returns:
- Rate detected in Kbps
- Throws:
java.io.IOException
-
doTestWriteSpeed
protected int doTestWriteSpeed(java.nio.file.Path file, int size, int timeout) throws unlimited.core.util.common.exception.FCException, java.io.FileNotFoundException, java.io.IOExceptionPerform a write to specified file with specified size and timeout for determining storage rate.- Parameters:
file- file to writesize- size of file in bytestimeout- timeout of write in milliseconds- Returns:
- write speed in kilobits per second
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.FileNotFoundExceptionjava.io.IOException
-
getClientUnderTest
protected final FileTransferMechanism getClientUnderTest()
Returns the client that is used for test operations.- Returns:
- FileTransferMechanism
-
doTestMaxUploadSpeed
protected int doTestMaxUploadSpeed() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionPerforms a series of tests to determine the maximum upload speed from the connected server.- Returns:
- int the rate detected in Kbps
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
doTestMaxDownloadSpeed
protected int doTestMaxDownloadSpeed() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionPerforms a series of tests to determine the maximum download speed from the connected server.- Returns:
- int the rate detected in Kbps
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
stopSpeedTesting
public void stopSpeedTesting()
Description copied from interface:FileTransferMechanismStops the current speed testing methods that this TransferMechanism may be executing- Specified by:
stopSpeedTestingin interfaceFileTransferMechanism
-
filesMatch
public boolean filesMatch(java.nio.file.Path file, java.lang.String rFile, unlimited.core.util.common.CancelHandler cancelHandler) throws unlimited.core.util.common.exception.FCException, java.io.IOException, java.lang.ExceptionDescription copied from interface:FileTransferMechanismVerifies whether a local file matches a remote file using MD5 checksum- Specified by:
filesMatchin interfaceFileTransferMechanism- Parameters:
file- Local filerFile- Remote filecancelHandler- Cancel Handler- Returns:
- true if the local file matches the remote file, false if they don't match
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOExceptionjava.lang.Exception
-
filesMatch
public boolean filesMatch(java.nio.file.Path file, java.lang.String rFile) throws unlimited.core.util.common.exception.FCException, java.io.IOException, java.lang.ExceptionDescription copied from interface:FileTransferMechanismVerifies whether a local file matches a remote file using MD5 checksum- Specified by:
filesMatchin interfaceFileTransferMechanism- Parameters:
file- Local filerFile- Remote file- Returns:
- true if the local file matches the remote file, false if they don't match
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOExceptionjava.lang.Exception
-
filesMatch
public boolean filesMatch(java.nio.file.Path file, java.lang.String rFile, int md5RateLimit) throws unlimited.core.util.common.exception.FCException, java.io.IOException, java.lang.ExceptionDescription copied from interface:FileTransferMechanismVerifies whether a local file matches a remote file using MD5 checksum- Specified by:
filesMatchin interfaceFileTransferMechanism- Parameters:
file- Local filerFile- Remote filemd5RateLimit- limits the rate of MD5 checksum on local file. This will stop MD5 from consuming too much I/O- Returns:
- true if the local file matches the remote file, false if they don't match
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOExceptionjava.lang.Exception
-
filesMatch
public boolean filesMatch(java.nio.file.Path file, java.lang.String rFile, int md5RateLimit, unlimited.core.util.common.CancelHandler cancelHandler) throws unlimited.core.util.common.exception.FCException, java.io.IOException, java.lang.ExceptionDescription copied from interface:FileTransferMechanismVerifies whether a local file matches a remote file using MD5 checksum- Specified by:
filesMatchin interfaceFileTransferMechanism- Parameters:
file- Local filerFile- Remote filemd5RateLimit- limits the rate of MD5 checksum on local file. This will stop MD5 from consuming too much I/OcancelHandler- Cancel Handler- Returns:
- true if the local file matches the remote file, false if they don't match
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOExceptionjava.lang.Exception
-
getMD5Checksum
public java.lang.String getMD5Checksum(java.lang.String rFile) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismReturns the MD5 checksum for the given remote file- Specified by:
getMD5Checksumin interfaceFileTransferMechanism- Returns:
- the MD5 checksum for the given remote file
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
getMD5
public java.lang.String getMD5(java.lang.String remote) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismReturns the MD5 checksum for the specified remote file if it exists- Specified by:
getMD5in interfaceFileTransferMechanism- Parameters:
remote- file to checksum- Returns:
- String representation of the remote file's MD5 checksum
- Throws:
unlimited.core.util.common.exception.FCException- if not connectedjava.io.IOException
-
connected
public boolean connected()
Description copied from interface:FileTransferMechanismReturns true if connected- Specified by:
connectedin interfaceFileTransferMechanism- Specified by:
connectedin interfaceRemoteFileSystemSource- Returns:
- true if connected
-
serverVersion
public java.lang.String serverVersion() throws unlimited.core.util.common.exception.FCExceptionDescription copied from interface:FileTransferMechanismReturns the FileCatalyst server version.- Specified by:
serverVersionin interfaceFileTransferMechanism- Returns:
- FileCatalyst Server version
- Throws:
unlimited.core.util.common.exception.FCException- Exception thrown if not connected.
-
isFileCatalystServer
public boolean isFileCatalystServer() throws java.io.IOException, unlimited.core.util.common.exception.FCExceptionDescription copied from interface:FileListDataItemSourceReturns true if connected to a FileCatalyst server. Returns false if connected to a standard FTP server.- Specified by:
isFileCatalystServerin interfaceFileListDataItemSource- Returns:
- true if connected to a FileCatalyst server.
- Throws:
java.io.IOExceptionunlimited.core.util.common.exception.FCException
-
isUDPSupported
public boolean isUDPSupported() throws java.io.IOException, unlimited.core.util.common.exception.FCExceptionDescription copied from interface:FileTransferMechanismReturns true if connected to a FileCatalyst server that supports UDP.- Specified by:
isUDPSupportedin interfaceFileTransferMechanism- Returns:
- Returns false if you are not FileCatalyst or if UDP is not supported by license.
- Throws:
java.io.IOExceptionunlimited.core.util.common.exception.FCException
-
getMaxRetries
public int getMaxRetries()
Description copied from interface:FileTransferDataReturns the number of times to retry a broken or interrupted transfer. Transfers will be reattempted upto the max number of retries before ultimately failing the transfer
Default value for max retries is 10- Specified by:
getMaxRetriesin interfaceFileTransferData- Returns:
- the maxRetries
-
setMaxRetries
public void setMaxRetries(int maxRetries)
Description copied from interface:FileTransferDataSpecify the number of times to retry a broken or interrupted transfer. Transfers will be reattempted upto the max number of retries before ultimately failing the transfer
Default value for max retries is 10- Specified by:
setMaxRetriesin interfaceFileTransferData- Parameters:
maxRetries- the maxRetries to set
-
getWaitRetry
public long getWaitRetry()
Description copied from interface:FileTransferDataReturns the amount of milliseconds to wait between retries for failed transfers.- Specified by:
getWaitRetryin interfaceFileTransferData- Returns:
- the waitRetry
-
isForceTCPmodeACKs
public boolean isForceTCPmodeACKs()
Description copied from interface:FileTransferDataReturns true if TCP mode ACKs are enabled. If option is enabled, transfers will instead use TCP acknowledgement messages (ACKs) to confirm that data is received during the transfer. If the option is disabled, then transfer will use the default UDP ACK messages to ensure data is transferred.Note: In some cases UDP notifications may be blocked. If this is the case you may force the client to use TCP mode ACKs.
- Specified by:
isForceTCPmodeACKsin interfaceFileTransferData- Returns:
- true if TCP mode ACKs are enabled
-
setForceTCPmodeACKs
public void setForceTCPmodeACKs(boolean forceTCPmodeACKs)
Description copied from interface:FileTransferDataBy default, FileCatalyst uses UDP to acknowledge data received. If option is enabled, transfers will instead use TCP acknowledgement messages (ACKs) to confirm that data is received during the transfer. If the option is disabled, then transfer will use the default UDP ACK messages to ensure data is transferred.Note: In some cases UDP notifications may be blocked. If this is the case you may force the client to use TCP mode ACKs.
- Specified by:
setForceTCPmodeACKsin interfaceFileTransferData- Parameters:
forceTCPmodeACKs- true if TCP mode ACKs should be used
-
setWaitRetry
public void setWaitRetry(long waitRetry)
Description copied from interface:FileTransferDataSets the amount of time in milliseconds to wait before the client attempts to retry a failed transfer- Specified by:
setWaitRetryin interfaceFileTransferData- Parameters:
waitRetry- the waitRetry to set
-
testUDPACKs
public void testUDPACKs() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismTests if UDP ACK mode is possible an configures internal variables. This method only needs to be called if the FCClient object was created using an existing authenticated Socket object.- Specified by:
testUDPACKsin interfaceFileTransferMechanism- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
getZipFileSizeLimit
public long getZipFileSizeLimit()
Description copied from interface:FileTransferDataReturns the zip file size limit in bytes. This zip file size limit is the maximum size that a zip file can be once it is created. If a zip file exceeds this value it will be split into multiple zips, and transferred in pieces- Specified by:
getZipFileSizeLimitin interfaceFileTransferData- Returns:
- the zipFileSizeLimit in bytes
-
setZipFileSizeLimit
public void setZipFileSizeLimit(long zipFileSizeLimit)
Description copied from interface:FileTransferDataSets the zip file size limit to the value specified. This zip file size limit is the maximum size that a zip file can be once it is created. If a zip file exceeds this value it will be split into multiple zips, and transferred in pieces- Specified by:
setZipFileSizeLimitin interfaceFileTransferData- Parameters:
zipFileSizeLimit- the zipFileSizeLimit (in bytes) to set
-
isUseCongestionControl
public boolean isUseCongestionControl()
Description copied from interface:FileTransferDataReturns true if congestion control is currently enabled.- Specified by:
isUseCongestionControlin interfaceFileTransferData- Returns:
- true if congestion control is currently enabled.
-
setUseCongestionControl
public void setUseCongestionControl(boolean useCongestionControl)
Description copied from interface:FileTransferDataEnables/disables congestion control for this client. When enabled, the client will automatically decrease its transmission or reception rate when congestion is detected. Future versions will allow finer grain control over the reaction algorithm. Congestion control is set to true by default.- Specified by:
setUseCongestionControlin interfaceFileTransferData- Parameters:
useCongestionControl- boolean value used to turn congestion control on/off
-
getUnitSize
public int getUnitSize()
Description copied from interface:FileListDataItemSourceUse getPacketSize- Specified by:
getUnitSizein interfaceFileListDataItemSource- Returns:
- The current unit size. In Bytes.
-
setUnitSize
public void setUnitSize(int unitSize)
Description copied from interface:FileTransferDataUse setPacketSize()- Specified by:
setUnitSizein interfaceFileTransferData- Parameters:
unitSize- int value used to set the Unit Size. In Bytes.
-
isUseCompression
public boolean isUseCompression()
Description copied from interface:FileTransferDataReturns true if compression is enabled, false otherwise.- Specified by:
isUseCompressionin interfaceFileTransferData- Returns:
- boolean True if compression is enabled, false otherwise.
-
getNumUDPSockets
public int getNumUDPSockets()
Description copied from interface:FileTransferDataReturn the number of Sender sockets to use- Specified by:
getNumUDPSocketsin interfaceFileTransferData- Returns:
- the Number of UDP Sockets currently set
-
setNumUDPSockets
public void setNumUDPSockets(int numUDPSockets)
Description copied from interface:FileTransferDataSets the number of UDP sockets to use when uploading a file in UDP mode. Increasing the number of sockets used may boost performance at high speeds (i.e. greater than 500 Mbps)- Specified by:
setNumUDPSocketsin interfaceFileTransferData- Parameters:
numUDPSockets- the Number of UDP Sockets to set
-
autoDetectConectionMode
public void autoDetectConectionMode()
Description copied from interface:FileTransferMechanismTests what type of connection mode should be used for the transfer. First tests UDP, then FTP, then finally HTTP. If a valid connection mode is found, the internal connection mode will be set to that value, and this method will return.- Specified by:
autoDetectConectionModein interfaceFileTransferMechanism
-
getNumThreads
public int getNumThreads()
Description copied from interface:FileTransferDataReturns the number of threads that will be used at most for each FC transmission.- Specified by:
getNumThreadsin interfaceFileTransferData- Returns:
- the number of threads that will be used at most for each FC transmission.
-
setNumThreads
public void setNumThreads(int numThreads)
Description copied from interface:FileTransferDataThis value determines how many blocks will be sent into the pipe before redundant data will be sent. In high RTT environments, this value multiplied by the block size should be higher than the product of the RTT and the target rate. Depending on the speed and spec of the disk, it may be advantageous to have more threads with a higher block size or vise versa. Number of threads is set to 5 by default.- Specified by:
setNumThreadsin interfaceFileTransferData- Parameters:
numThreads- Number of block sender threads to start for each transmission.
-
setUseCompression
public void setUseCompression(boolean useCompression)
Description copied from interface:FileTransferDataEnables/disables on the fly compression. When enabled, each block of data will be compressed on the fly before it is sent over the network.- Specified by:
setUseCompressionin interfaceFileTransferData- Parameters:
useCompression- boolean true/false to enable/disable compression.
-
setFileFilter
public void setFileFilter(FileCatalystFileFilter filter)
Description copied from interface:FileListDataItemSourceSets the FileFilter that is to be used by the implementation.- Specified by:
setFileFilterin interfaceFileListDataItemSource- Parameters:
filter- Filter to set
-
remoteUpload
public TransferHook remoteUpload(FCClient destServer, java.lang.String sourceFile, java.lang.String destFile) throws unlimited.core.util.common.exception.FCException, java.io.IOException, java.lang.Exception
Description copied from interface:FileTransferMechanismThis method will initiate an upload from the server to which this FCClient object (Server A) is connected to the server specified by the destServer parameter passed in (Server B). The sourceFile is the path to a file on Server A and the desFile is the path on Server B where the file will be uploaded. This method returns a TransferHook which may be monitored for status information, and which allows the transfer to be canceled. All transfer parameters, transfer mode, etc... are specified through the regular API methods, such as setBlocksize(), setMode(), etc...- Specified by:
remoteUploadin interfaceFileTransferMechanism- Parameters:
destServer- an FCClient object from which remote connection information will be taken. It doesn't have to be connected.sourceFile- the absolute or relative path to the source filedestFile- the absolute or relative path to the destination file- Returns:
- a TransferHook which may be monitored for status information
- Throws:
unlimited.core.util.common.exception.FCException- if a FileCatalyst protocol error occurs.java.io.IOException- if an error occurs either connecting to the destination server, or if a transfer I/O error occurs.java.lang.Exception
-
remoteUpload
public TransferHook remoteUpload(FCClient destServer, java.util.List<java.lang.String> sourceFiles, java.util.List<java.lang.String> destFiles) throws unlimited.core.util.common.exception.FCException, java.io.IOException, java.lang.Exception
Description copied from interface:FileTransferMechanismThis method will initiate an upload from the server to which this FCClient object (Server A) is connected to the server specified by the destServer parameter passed in (Server B). The sourceFile is the path to a file on Server A and the desFile is the path on Server B where the file will be uploaded. This method returns a TransferHook which may be monitored for status information, and which allows the transfer to be canceled. All transfer parameters, transfer mode, etc... are specified through the regular API methods, such as setBlocksize(), setMode(), etc...- Specified by:
remoteUploadin interfaceFileTransferMechanism- Parameters:
destServer- an FCClient object from which remote connection information will be taken. It doesn't have to be connected.sourceFiles- a list of absolute or relative paths to the source files to be transferreddestFiles- a list of absolute or relative paths to the destination files. Size must match sourceFiles List.- Returns:
- a TransferHook which may be monitored for status information
- Throws:
unlimited.core.util.common.exception.FCException- if a FileCatalyst protocol error occurs.java.io.IOException- if an error occurs either connecting to the destination server, or if a transfer I/O error occurs.java.lang.Exception
-
testApproximateUploadSpeed
public int testApproximateUploadSpeed() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismPerforms a quick test to determine the approximate upload speed to the connected server.- Specified by:
testApproximateUploadSpeedin interfaceFileTransferMechanism- Returns:
- int the rate detected in Kbps
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
testApproximateDownloadSpeed
public int testApproximateDownloadSpeed() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismPerforms a quick test to determine the approximate download speed to the connected server.- Specified by:
testApproximateDownloadSpeedin interfaceFileTransferMechanism- Returns:
- int the rate detected in Kbps
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
getClients
protected com.google.common.collect.HashBiMap<java.lang.Integer,FileTransferMechanism> getClients()
Returns the current clients being used by the manager- Returns:
-
createWorkerThreads
protected boolean createWorkerThreads()
Creates the worker threads to be used by this Multi-Client instance- Returns:
- Whether or not the operation succeeded
-
shutDownWork
protected void shutDownWork()
Shuts down the manager's current work
-
pushJob
public MultiClientTransferHook pushJob(TransferJob job) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Queries the internal state machine to add a TransferJob into the current queue of pending work. Once the job submitted, it is scanned and remove of all duplicate work. If the TransferJob has work remaining within it, it is then added to the list of pending work, it will attempted once the next available client asynchronously pulls it out of the queue and begins to transfer it.Note: If the Manager is in a
CancelTypeState, then job will be ignored. No new work may placed into the MultiClientManager if it is in the middle of it's cancel operations- Parameters:
job- TransferJob to be attempted in the future- Returns:
- A TransferHook that gives qualitative and quantitative data for the transfer job
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
pushJobNoProcessing
public MultiClientTransferHook pushJobNoProcessing(TransferJob job) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Pushes a new TransferJob into the current TransferJobQueue. Does not PreProcess the data before submission- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
pushJobOntoWorkQueue
protected MultiClientTransferHook pushJobOntoWorkQueue(TransferJob job)
Pushes a new TransferJob into the current queue. Fires a TransferJobTransferRejectionEvent if it fails- Parameters:
job- TransferJob to push- Returns:
- Main transferhook
-
getNextJob
protected TransferJob getNextJob() throws java.lang.InterruptedException
Returns the next job to be attempted by this object- Returns:
- TransferJob to be attempted
- Throws:
java.lang.InterruptedException
-
doJob
protected void doJob(TransferRunner runner) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Calls the current state to execute the supplied runner. If the system isn't currently in a transferring state, it will placed in one- Parameters:
runner- Runnable wrapper of a transfer job that is to be executed- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
handleTransferStart
protected void handleTransferStart(TransferHook hook, TransferRunner runner)
Method that performs the operations relating to transfer start. IE moving clients to the active list, and adding the respective TransferHook to the MultiClient's current TransferHook. Also fires a property change eventof type TransferJobTransferringEvent- Parameters:
hook- Transfer that has startedrunner- Runner that has started to transfer
-
moveClientToActive
protected void moveClientToActive(FileTransferMechanism client)
Moves the client to the current active list. Removes the client from the idle list if it exists- Parameters:
client-
-
getRateUpdater
protected java.lang.Runnable getRateUpdater()
-
moveClientToIdle
protected void moveClientToIdle(FileTransferMechanism client)
Moves the client to idle list. Removes client from the active list if it is present there- Parameters:
client-
-
handleTransferStop
protected void handleTransferStop(TransferHook hook, TransferRunner runner)
Method that performs the operations relating to transfer stop. IE moving clients to the idle list, and removing the respective TransferHook from the Multi-Client's current transfer hook. Also attempts to retry the TransferJob if it fails in a non-fatal manner- Parameters:
hook- Transfer that has startedrunner- Runner that has started to transfer
-
handleFailedTransfer
protected void handleFailedTransfer(TransferHook hook, FileTransferMechanism client, TransferJob job)
Handles a failed transfer event when called. Executed when an individual client transfer fails- Parameters:
hook- Transfer data object containing the data for the transferclient- TransferMechanism that was failed the transferjob- Transfer job that was failed
-
handleSuccessfulTransfer
protected void handleSuccessfulTransfer(TransferHook hook, FileTransferMechanism client, TransferJob job)
Handles a successful transfer event when called. Executed when an individual client completes it's transfer- Parameters:
hook- Transfer data object containing the data for the transferclient- TransferMechanism that completed the transferjob- Transfer job that was completed
-
endJob
protected void endJob(FileTransferMechanism client, TransferJob job, TransferHook hook)
Method that performs the necessary logic for processing TransferJob that has completed. Also publishes reports and cleans up after the transfer- Parameters:
client- Client that transferred the jobjob- Job that has been completedhook- TransferHook that contains the information for the job itself
-
completeClientFailure
public void completeClientFailure(TransferJob job, TransferHook hook)
Method that handles marks failed transfers, and fires the corresponding TransferJobFailureEvents. Should only be implicitly called by internal mechanisms- Parameters:
job- Transfer Job that failed to transferhook- TransferHook that contains information about the failed transfer
-
jobSuccess
public void jobSuccess(FileTransferMechanism client, TransferJob job, TransferHook hook)
Method that handles marks successful transfers, and fires the corresponding TransferJobTransferSuccessEvent. Should only be implicitly called by internal mechanisms- Parameters:
job- Transfer Job that succeeded in transferringhook- TransferHook that contains information about the successful transfer transfer
-
setRunningIntegrationTest
public void setRunningIntegrationTest(boolean isRunning)
Internal use only: Sets whether or not this MultiClientManager is running in an integration test- Parameters:
isRunning- Boolean to set
-
getMaxWorkQueueRePush
public int getMaxWorkQueueRePush()
- Returns:
- maximum times a failed transfer job will be returned to the work queue before being deemed complete failure
-
setMaxWorkQueueuRePush
public void setMaxWorkQueueuRePush(int maxPush)
Sets the max amount of times a failed transfer job will be returned to the work queue after a failure- Parameters:
maxPush- - maximum times a failed transfer job will be returned to the work queue before being deemed complete failure
-
returnJob
protected void returnJob(TransferJob job)
Returns the supplied the TransferJob to the queue- Parameters:
job-
-
returnJob
protected void returnJob(TransferJob job, TransferHook hook)
Returns the supplied the TransferJob to the queue- Parameters:
job-
-
cleanupClient
protected void cleanupClient(FileTransferMechanism client) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Cleans up the client if it is needed- Parameters:
client-- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
workRemaining
public boolean workRemaining()
Returns whether or not the MultiClientManager has any work remaining within it's queue.- Returns:
- true, if successful
-
getPendingWorkCount
public int getPendingWorkCount()
Gets the pending work count.- Returns:
- the pending work count
-
synchClient
protected boolean synchClient(FileTransferMechanism client) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Syncs the supplied FileTransferMechanism's current settings to the settings within the MultiClient.- Parameters:
client- TransferMechanism to sync to the system- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
safeSynchClient
protected boolean safeSynchClient(FileTransferMechanism client)
Safely syncs the client to the system. If exception is thrown, the Manager will dump the stack trace and return false- Parameters:
client- TransferMechanism to sync to the system- Returns:
- True if successful, false if not
-
setCompFileFilter
public void setCompFileFilter(java.lang.String compFileFilter)
Description copied from interface:FileTransferDataSets the compression FileFilter that is to be used by the implementation- Specified by:
setCompFileFilterin interfaceFileTransferData- Parameters:
compFileFilter- Filter to set
-
setTransferEmptyDirectories
public void setTransferEmptyDirectories(boolean transferEmptyDirectories)
Description copied from interface:FileTransferDataSets whether or not the implementation should transfer empty directories- Specified by:
setTransferEmptyDirectoriesin interfaceFileTransferData- Parameters:
transferEmptyDirectories- Boolean value to set
-
setPostURL
public void setPostURL(java.lang.String postURL)
Description copied from interface:FileTransferDataSets the current post URL to the value that is defined- Specified by:
setPostURLin interfaceFileTransferData- Parameters:
postURL- New postURL to use
-
setMd5RateLimit
public void setMd5RateLimit(int md5RateLimit)
Description copied from interface:FileTransferDataSets the rate limit to use when calculating MD5s of files- Specified by:
setMd5RateLimitin interfaceFileTransferData- Parameters:
md5RateLimit- Limit to use
-
setRenameExtension
public void setRenameExtension(boolean renameExtension)
Description copied from interface:FileTransferDataSets whether or not the rename extension should be used- Specified by:
setRenameExtensionin interfaceFileTransferData- Parameters:
renameExtension- Enabled boolean
-
serverSupportsFSEvents
public boolean serverSupportsFSEvents() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismThis returns true if the server supports file system events. In general this means that the server is a FileCatalyst server and also is post 2.8.1.- Specified by:
serverSupportsFSEventsin interfaceFileTransferMechanism- Throws:
unlimited.core.util.common.exception.FCException- if a FileCatalyst protocol error occurs.java.io.IOException- if an error occurs either connecting to the destination server, or if a transfer I/O error occurs.
-
fileSystemEvents
public java.util.List<FileSystemEvent> fileSystemEvents(long timeout) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismCollects the list of file system events from the Server.File system events are local events that are triggered on the Server whenever a monitored local file system changes in some manner. Example file system invents include: creating new files, deleting files, modifying existing files, and renaming files to other paths
- Specified by:
fileSystemEventsin interfaceFileTransferMechanism- Parameters:
timeout- Amount of time that you wish to wait for file system events to appear on the FC Server- Throws:
java.io.IOExceptionunlimited.core.util.common.exception.FCException
-
setCancelled
protected void setCancelled()
Calls the Manager to asynchrously cancel it's current transactions and close all available resources. Do note that the Manager may not be fully cancelled once this method returns. To properly wait for cancellation completion, register a CancelledState signal then wait for that signal to fire.
-
cancelJobs
protected void cancelJobs()
Takes the pending jobs and adds them to the unattempted job list
-
closeResources
protected void closeResources()
Shuts and cancels the Multi-Manager's current resources
-
closeAllStreams
protected void closeAllStreams()
-
prms
public java.lang.String[] prms(java.lang.String filename) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileListDataItemSourceReturn the file permission of the file/directory listed in the argument from the remote server.- Specified by:
prmsin interfaceFileListDataItemSource- Returns:
- permissions
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
getPendingJobs
public java.util.Vector<TransferJob> getPendingJobs()
Gets the pending jobs.- Returns:
- the pending jobs
-
getActiveJobs
public java.util.Vector<TransferJob> getActiveJobs()
Gets the currently active jobs that are being executed by this MultiClientManager.- Returns:
- the active jobs
-
getTransferRate
public int getTransferRate()
Description copied from interface:FileTransferDataReturns the implementation's current transfer rate- Specified by:
getTransferRatein interfaceFileTransferData- Returns:
- The current rate
-
getReadOnlyClient
public FileTransferMechanism getReadOnlyClient(java.lang.Integer id)
Gets the read only client.- Parameters:
id- the id- Returns:
- the read only client
-
getBlastRate
@Deprecated public int getBlastRate()
Deprecated.Method deprecated. UsegetTransferRate()insteadReturns the implementation's current blast rate- Specified by:
getBlastRatein interfaceFileTransferData- Returns:
- Current transfer rate
-
getServerAgentID
public java.lang.String getServerAgentID()
Description copied from interface:FileTransferDataReturns the server's current agent ID. Used with Central monitoring and management- Specified by:
getServerAgentIDin interfaceFileTransferData- Returns:
- Server agent ID
-
getSessionID
public java.lang.String getSessionID()
Description copied from interface:FileTransferDataReturns the current session ID of the implementation- Specified by:
getSessionIDin interfaceFileTransferData- Returns:
- The session ID
-
getSessionCount
public int getSessionCount()
Description copied from interface:FileTransferDataReturns the current number of active sessions that the implementation has- Specified by:
getSessionCountin interfaceFileTransferData- Returns:
- Current number of sessions
-
getCompFileFilter
public java.lang.String getCompFileFilter()
Description copied from interface:FileTransferDataSets the compression FileFilter that is to be used by the implementation. If a file is queued for compression and sucessfully passes this filter, it will be compressed prior to transferring. If the file is doesn't pass the filter, then it is not compressed, but is still transferred- Specified by:
getCompFileFilterin interfaceFileTransferData- Returns:
- Current compression file filter
-
getTransferEmptyDirectories
public boolean getTransferEmptyDirectories()
Description copied from interface:FileTransferDataReturns whether not the implementation is set to transfer empty directories.- Specified by:
getTransferEmptyDirectoriesin interfaceFileTransferData- Returns:
- True if implementation will transfer empty directories, false if not
-
getPostURL
public java.lang.String getPostURL()
Description copied from interface:FileTransferDataReturns the current post URL to use- Specified by:
getPostURLin interfaceFileTransferData- Returns:
-
getMd5RateLimit
public int getMd5RateLimit()
Description copied from interface:FileTransferDataReturns the current MD5 that is set. Limit is used to limit the amount of CPU usage and speed that for MD5s- Specified by:
getMd5RateLimitin interfaceFileTransferData- Returns:
- Current MD5 rate that is set
-
getRenameExtension
public boolean getRenameExtension()
Description copied from interface:FileTransferDataReturns whether or not the rename extension will be used. If true, transfers of files with the extension .RDY will rename both the source and destination files to have the extension .PKD- Specified by:
getRenameExtensionin interfaceFileTransferData- Returns:
- Boolean dictating the use of the rename extension
-
get
public void get(java.lang.String localPath, java.lang.String remoteFile, int inRate, long offset, long size, int numDFEncoders, int blockSize, int unitSize, int mode) throws java.io.IOException, unlimited.core.util.common.exception.FCException, java.security.NoSuchAlgorithmException, unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileListDataItemSourceDownloads a file from the FC Server, and places it on the file system.- Specified by:
getin interfaceFileListDataItemSource- Parameters:
localPath- Location of where to store the file after it has been downloadedremoteFile- Remote file to be downloaded from the ServerinRate- Rate to use for the download transferoffset- Location in the local file to start placing downloaded data into (0 = start of file)size- Amount of date to retrieve from the FC Server. (Typically this is (remote file size - (offset))numDFEncoders- Number of encoders to use for theblockSize- Size of blocks to be used in the download transferunitSize- Size of the individual units in the download transfer. Value with compared with the Server's max unit size. Minimum of the two values will be usedmode- Transfer mode to be used for the download. Available modes can be atTransferMode- Throws:
java.io.IOExceptionunlimited.core.util.common.exception.FCExceptionjava.security.NoSuchAlgorithmException
-
workInProgress
public boolean workInProgress()
Returns whether or not the MultiClientManager has any work that is currently in progress- Returns:
- true, if successful
-
isCancelled
public boolean isCancelled()
Returns whether or not the MultiClientManager has been cancelled- Returns:
- True if in a CancelledState, false otherwisze
-
isBadState
public boolean isBadState()
Returns whether or not the current state is a bad state.- Returns:
- true, if is bad state
-
applyRemoteFileAttributesToLocalFile
public void applyRemoteFileAttributesToLocalFile(java.nio.file.Path localFile, java.lang.String remoteFile) throws java.io.IOExceptionDescription copied from interface:FileTransferMechanismApplies the remote file attributes to the local file instance. Method performs this functionality by attempting to fetch the remote ACLs, and file permissions from the remote Server then apply them to the local file.- Specified by:
applyRemoteFileAttributesToLocalFilein interfaceFileTransferMechanism- Parameters:
localFile- Path of the local file that you wish to changeremoteFile- Path of the remote tile that you would like the attributes from- Throws:
java.io.IOException
-
sendEmail
public void sendEmail(java.lang.String emailAddress, int emailConst, java.lang.String emailText) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismSends an email with the specified information.Note: Email constant can value can be any of the following
- 0: Upload completed successfully
- 1: Download completed successfully
- 2: Upload failed
- 3: Download failed
- 4: Client email test
- 5: Transfer Cancelled
- 6: Upload completed with exceptions
- 7: Download completed with exceptions
- 8: HotFolder shutdown notification/li>
- Specified by:
sendEmailin interfaceFileTransferMechanism- Parameters:
emailAddress- Email address to send the email toemailConst- Value that the Email should have within it. Can be 0 - 8 (0 == Successful_Upload, 1 == Successful Download, etc)emailText- Text that will be contained within the email itself- Throws:
unlimited.core.util.common.exception.FCException- if a FileCatalyst protocol error occurs.java.io.IOException- if an error occurs either connecting to the destination server, or if a transfer I/O error occurs.
-
getTransferHook
public MultiClientTransferHook getTransferHook()
Gets the Master Transfer hook. This hook is *NOT THREAD SAFE* call getMultiHook() to get a thread safe representation of this hook.- Returns:
- the transfer hook
-
getMultiHook
public ThreadSafeMultiHook getMultiHook()
Gets an updated representation of the MultiClientTransferHook getTransferHook(). This hook is thread safe but only updated on 500 ms broadcasts. calling getTransferHook() is more accurate but due to the fact that it is managing core engine classes can cause unexpected results in a multi threaded environment.- Returns:
- the transfer hook
-
getSynchedClient
public FileTransferMechanism getSynchedClient() throws unlimited.core.util.common.exception.FCException
Gets the synched client.- Returns:
- the synched client
- Throws:
unlimited.core.util.common.exception.FCException
-
rmdirRecursive
public void rmdirRecursive(FileListDataItem fileListDataItem) throws java.lang.Exception
Description copied from interface:FileTransferMechanismDeletes a directory on the server in a recursive manner.- Specified by:
rmdirRecursivein interfaceFileTransferMechanism- Parameters:
fileListDataItem- Directory that should be deleted- Throws:
java.lang.Exception- IOException or FCException depending on the issue encountered
-
getFileFilter
public FileCatalystFileFilter getFileFilter()
Description copied from interface:FileTransferDataReturns the current file filter that is used to filter out information for a transfer. If a file is queued for transfer and passes the filter's current settings, then it will transferred. Otherwise it will be ignored.- Specified by:
getFileFilterin interfaceFileTransferData- Returns:
- Current file filter
-
isTransferEmptyDirectories
public boolean isTransferEmptyDirectories()
Description copied from interface:FileTransferDataReturns whether or not the implementation should be transferring empty directories- Specified by:
isTransferEmptyDirectoriesin interfaceFileTransferData- Returns:
- true or false
-
getIDForClient
protected java.lang.Integer getIDForClient(FileTransferMechanism client)
-
getPoolSize
public int getPoolSize()
Returns the number of clients this MultiClient manager has access to- Returns:
-
nullClients
protected void nullClients()
Resets all information by clearing all internal clients (idle, worker, and transferring), and the main transferhook.Note: Method should only be called by the resources responsible for finishing the MultiClientManager
-
loggedIn
public boolean loggedIn()
Description copied from interface:FileTransferMechanismReturns whether or not the TransferMechanism is currently logged into the server- Specified by:
loggedInin interfaceFileTransferMechanism- Returns:
-
isInitialized
public boolean isInitialized()
Description copied from interface:FileTransferMechanismReturns true if the last auto-detect that was performed identified that at least one mode of transfer was possible for the given type (upload, download, or both directions). Returns false if no transfer modes are working- Specified by:
isInitializedin interfaceFileTransferMechanism- Returns:
-
getActiveClientsCopy
public java.util.HashSet<FileTransferMechanism> getActiveClientsCopy()
Gets a list that contains an independent copy of a client objects that are currently performing work.- Returns:
- the active clients copy
-
startUpdatingTargetRate
protected void startUpdatingTargetRate()
-
getTransferringRateSlice
protected int getTransferringRateSlice()
-
getIdleRateSlice
protected int getIdleRateSlice()
-
getTargetRateSlice
protected int getTargetRateSlice()
-
remoteSynchFile
public void remoteSynchFile(FileListDataItem aFile) throws unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismSyncs a FileListDataItem object with it's current remote information. This is useful for progressive downloads when the updated value of the FileListData is required.
Note: The FileListDataItem file type will only be synced if the value isFileListDataItem.UNKNOWN- Specified by:
remoteSynchFilein interfaceFileTransferMechanism- Parameters:
aFile- a FileListDataItem with a valid name that the size and modified time will be updated.- Throws:
unlimited.core.util.common.exception.FCException
-
remoteSynchFile
public java.util.stream.Stream<FileListDataItem> remoteSynchFile(java.util.stream.Stream<FileListDataItem> fileStream) throws unlimited.core.util.common.exception.FCException
Description copied from interface:FileTransferMechanismSyncs a stream of FileListDataItem objects with it's current remote information. This is useful when there is a large amount of files that need to be synced at a given time. If stream encounters an exception when processing an item, it will throw a RuntimeException that should be caught.- Note 1: The FileListDataItem file type will only be synced if the value is
FileListDataItem.UNKNOWN - Note 2: Make sure to close this stream before attempting to perform any other commands against the Server. If you don't close the stream, the Server will be stuck processing the command, and will be unable to process other commands that come in.
- Specified by:
remoteSynchFilein interfaceFileTransferMechanism- Parameters:
fileStream- Stream of FileListData items that you wish to sync with the FileCatalyst Server- Returns:
- Throws:
unlimited.core.util.common.exception.FCException
- Note 1: The FileListDataItem file type will only be synced if the value is
-
removeActiveJob
public void removeActiveJob(TransferJob job)
Removes the active job from pending jobs list and the main filter- Parameters:
job- Job to remove
-
setFileCache
public void setFileCache(CachedFileIndexInterface fileCache)
Sets the file cache.- Parameters:
fileCache- the new file cache
-
getFileSizeThreshHold
public long getFileSizeThreshHold()
Gets the file size thresh hold.- Returns:
- the file size thresh hold
-
setFileSizeThreshHold
public void setFileSizeThreshHold(long fileSizeThreshHold)
Sets the file size thresh hold.- Parameters:
fileSizeThreshHold- the new file size thresh hold
-
setPostTaskSentData
public void setPostTaskSentData(PostTaskSentData data)
Description copied from interface:FileTransferDataSets the current post task sent data to the specified value- Specified by:
setPostTaskSentDatain interfaceFileTransferData
-
getPostTaskSentData
public PostTaskSentData getPostTaskSentData()
Description copied from interface:FileTransferDataReturns the current post task sent data- Specified by:
getPostTaskSentDatain interfaceFileTransferData
-
setClientName
public void setClientName(java.lang.String clientName)
Description copied from interface:FileTransferDataSets the current client name to the value that is specified- Specified by:
setClientNamein interfaceFileTransferData- Parameters:
clientName- Name to set
-
setClientWorkingPath
public void setClientWorkingPath(java.nio.file.Path clientWorkingPath)
Description copied from interface:FileTransferDataSets the client's current working path to the value specified- Specified by:
setClientWorkingPathin interfaceFileTransferData- Parameters:
clientWorkingPath- Working path to set
-
getClientName
public java.lang.String getClientName()
Description copied from interface:FileTransferDataUsed for HotFolder Reporting, And CSV Reports- Specified by:
getClientNamein interfaceFileTransferData
-
setClientAgentID
public void setClientAgentID(java.lang.String clientAgentID)
Description copied from interface:FileTransferDataSets the current client agent ID to the new specified value. Do note that this ID value is used to distinguish this client and it's transfers from other clients in the reports- Specified by:
setClientAgentIDin interfaceFileTransferData- Parameters:
clientAgentID- New ID to set
-
getReport
public unlimited.fc.reporting.MultiClientDataReport getReport()
Description copied from interface:FileTransferMechanismthis returns the report that was filled by the FCClientEngine. If there is no report, this returns null.- Specified by:
getReportin interfaceFileTransferMechanism- Returns:
- AbstractDataReport
-
setReport
public void setReport(unlimited.fc.reporting.ClientDataReport reporter)
Description copied from interface:FileTransferMechanismSets the report object.- Specified by:
setReportin interfaceFileTransferMechanism
-
resetStickySessionProducer
public void resetStickySessionProducer()
-
setSessionID
public void setSessionID(java.lang.String sessionID)
Description copied from interface:FileTransferDataSets the session ID to the specified value.- Specified by:
setSessionIDin interfaceFileTransferData
-
resetPooledClientIfNeeded
protected void resetPooledClientIfNeeded(FileTransferMechanism client)
Resets the provided FileTransferMechanism by clearing it's information and throwing it back into the WorkerPool of clients responsible for grabbing work for the currently pending queue. Do note that if the pool has been already shutdown, this method will do nothing- Parameters:
client- Client to reset after a transfer completes
-
getClientIdentifier
public int getClientIdentifier()
Returns the identifier for this transfer mechanism. List of valid identifiers can be found atLicenseIdentifiers- Specified by:
getClientIdentifierin interfaceFileTransferData- Returns:
- Number value representing the type of client this TransferMechanismData comes from.
-
getClientSubIdentifier
protected int getClientSubIdentifier()
Returns the current sub identifier that identifies this client as a sub component of a broader group of client apps. For example, client id 9 means FC Web, but doesn't indicate which applet is connecting. Or CLI identifier doesn't let you know if its Java or C++ CLI.- Returns:
- Integer representing the sub identifier
-
getAllWork
public java.util.List<TransferJob> getAllWork()
Returns ALL work that this MultiClient Manager has. Combines the the pending, active, and processing job lists into one consolidated list- Returns:
- List containing all of the transfer jobs the Manager has in memory
-
getTempMode
public int getTempMode()
Description copied from interface:FileTransferDataReturns the temporary mode for the implementation- Specified by:
getTempModein interfaceFileTransferData- Returns:
-
getActivePreProcessorInfo
public java.util.HashMap<java.lang.String,? extends HandlerData> getActivePreProcessorInfo()
Returns the active preprocessor info.- Returns:
-
setRealPwd
protected java.lang.String setRealPwd() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionSets the working directory of the client- Returns:
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
getRealPwd
protected java.lang.String getRealPwd() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionReturns the current working directory for the remote connection. If the directory isn't currently initialized, then the system will initialize the value, then return that information- Returns:
- Current working directory of the remote Server connection
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
isIdle
public boolean isIdle()
Description copied from interface:FileTransferMechanismReturns whether or not the Client is currently idle- Specified by:
isIdlein interfaceFileTransferMechanism- Returns:
-
refreshMaster
public void refreshMaster()
Refreshes the master client by disconnecting and reconnecting into the present working directory
-
addStream
public <T> java.util.stream.Stream<T> addStream(java.util.stream.Stream<T> stream)
Adds a stream into the current stream list- Parameters:
stream- Stream to add
-
removeStream
public void removeStream(java.util.stream.Stream<?> stream)
Removes the stream from current stream list- Parameters:
stream- Stream to remove
-
checkTimeout
@Deprecated public void checkTimeout() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDeprecated.This literally does nothing it is empty code. The concept of checking for timeout does not work with pooled clients that are connected on demand.- Specified by:
checkTimeoutin interfaceFileTransferMechanism- Specified by:
checkTimeoutin interfaceRemoteFileSystemSource- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
setDataReportWriter
public void setDataReportWriter(unlimited.fc.reporting.CSVReportWriter reportWriter)
Sets the CSVReportWriter that is used to write transfer reports to disk- Parameters:
reportWriter- Writer to use
-
login
public void login() throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionLogs the Multi-Manager with the currently stored username and password- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
getTransferData
public TransferMechanismData getTransferData()
Returns a clone of the data object that contains all of the transfer settings for this MultiClientManager- Returns:
- Data object containing the transfer settings
-
initDeleteAfterTransfer
public <T> void initDeleteAfterTransfer(unlimited.core.util.common.tuples.Pair<java.util.LinkedList<T>,java.util.HashSet<T>> dirsToBeDeleted)
Initializes the delete after transfer if it is needed. If delete after transfer is enabled, this method will add a DeleteAfterTransferListener to the Manager's current listener list. This listener will be responsible for deleting all files after they have been successfully transferred- Parameters:
dirsToBeDeleted-
-
clientsCanStillTransfer
public boolean clientsCanStillTransfer()
Returns whether or not the client can still transfer- Returns:
- True or false
-
close
public void close() throws java.lang.ExceptionCloses the Manager, and finishes the connection. Once the connection is finished, the Manager is becomes unuseable, and a new one must be constructed- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
stopReporting
protected void stopReporting()
-
startReporting
protected void startReporting()
-
getReportWriter
public unlimited.fc.reporting.MultiClientReportWriter getReportWriter()
For Testing Purposes Only
-
requestCancel
public void requestCancel()
Requests the Multi-Client Manager to cancel the current transfer. Cancellation is an asynchronous process that is best checked with StateListeners and listening for the CancelledState events.
-
isTransferComplete
public boolean isTransferComplete()
Returns whether or not the MultiClientManager has completed it's current transfer.- Returns:
- True if transfer complete, false if nto
-
handleCurrentState
public void handleCurrentState(StateHandler handler)
Calls the state handler to handle the current state. Uses a double dispatching system to invoke particular functionality for particular states- Parameters:
handler- State that is to be handled
-
setDisableForceFlush
public static void setDisableForceFlush(boolean dff)
Calling this method will set the system property that specifies if a transfer should force the file metadata to update on each write (disabled = true) or should wait until the file is complete (disabled = false).- Parameters:
dff-
-
getHandlerMap
public java.util.HashMap<java.lang.String,HandlerData> getHandlerMap()
-
getHandlerData
public HandlerData getHandlerData(java.lang.Integer id)
-
addPostprocess
public void addPostprocess(PostProcessor<?> processor)
Adds a PostProcess to the client's current processor list- Parameters:
processor- - processors are executed in the order they are added unless added with an index
-
addPreprocess
public void addPreprocess(PreProcessor processor)
Adds a PreProcessor to the clien's current processor list- Parameters:
processor- - processors are executed in the order they are added unless added with an index
-
addProcessEventListener
public void addProcessEventListener(ProcessEventDispatch.ProcessEventListener listener)
Adds an event listener that is triggered when PreProcessor and PostProcessor triggers- Parameters:
listener- used to monitor the status of all processors
-
isProcessing
public boolean isProcessing()
Returns whether or not the MultiClientManager is currently pre/post processing files.- Returns:
- true if the manager is currently processing
-
importFile
public void importFile(java.nio.file.Path aFile) throws java.io.IOExceptionDescription copied from interface:FileTransferMechanismThis will overwrite all settings within this object, if the values are not present within this file, the values within this object are reset to defaults. There are no partial imports. If valid keys are paired with invalid values, defaults are used.- Specified by:
importFilein interfaceFileTransferMechanism- Parameters:
aFile- - any valid file- Throws:
java.io.IOException- - if there are problems reading from the file or importing the data read
-
importProperties
public void importProperties(java.util.Properties props) throws java.io.IOExceptionDescription copied from interface:FileTransferMechanismThis will overwrite all settings within this object, if the values are not present within the properties object, the values within this object are reset to defaults. There are no partial imports. If valid keys are paired with invalid values, defaults are used.- Specified by:
importPropertiesin interfaceFileTransferMechanism- Parameters:
props- - any valid properties object- Throws:
java.io.IOException- - if there are problems importing the data read from the properties and writing to this object
-
exportFile
public void exportFile(java.nio.file.Path aFile) throws java.io.IOExceptionDescription copied from interface:FileTransferMechanismExport all settings to a properties file- Specified by:
exportFilein interfaceFileTransferMechanism- Parameters:
aFile- - any valid file, if it does not exist it will be created, the export will overwrite any data within this file- Throws:
java.io.IOException- - if there are any issues
-
exportProperties
public java.util.Properties exportProperties() throws java.io.IOExceptionDescription copied from interface:FileTransferMechanismExport all settings to a properties object- Specified by:
exportPropertiesin interfaceFileTransferMechanism- Returns:
- a properties object with all the values within this object saved to the properties object.
- Throws:
java.io.IOException- - if there are issues reading the values from this object or writing them to the properties object.
-
getReadOnlyFromMasterClient
public FileTransferMechanism getReadOnlyFromMasterClient() throws unlimited.core.util.common.exception.FCException, java.io.IOException
Returns a read-only client that provides read access.- Returns:
- A connected ReadOnlyClient
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
isAutoMode
public boolean isAutoMode()
Returns whether or not the transfer mode has been set toTransferMode.AUTO- Returns:
- True if the mode is AUTO, false if other mode
-
listNoParse
public FileListData listNoParse(java.lang.String directory) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Returns a remote file listing with no parsing- Parameters:
directory- Directory to list from- Returns:
- FileListData that contains all files in the specified directory
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
setServerAgentID
public void setServerAgentID(java.lang.String serverAgentID)
Description copied from interface:FileTransferDataSets the server agent ID to the new value- Specified by:
setServerAgentIDin interfaceFileTransferData- Parameters:
serverAgentID- New value to set
-
setRemoteFileFilter
public void setRemoteFileFilter(FileCatalystFileFilter<?> filter) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:RemoteFileSystemSourceSets the file filter to be used when listing or interacting with remote files on the FCServer.- Specified by:
setRemoteFileFilterin interfaceRemoteFileSystemSource- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
getUserFullName
public java.lang.String getUserFullName() throws java.io.IOExceptionDescription copied from interface:FileTransferMechanismGet The User's Full Name When Called- Specified by:
getUserFullNamein interfaceFileTransferMechanism- Throws:
java.io.IOException
-
getUserEmailAddresss
public java.lang.String getUserEmailAddresss() throws java.io.IOExceptionDescription copied from interface:FileTransferMechanismGets the connected user's email address when called- Specified by:
getUserEmailAddresssin interfaceFileTransferMechanism- Returns:
- A string containing the user's email address
- Throws:
java.io.IOException- If there are issues an exception will be thrown
-
setUserEmailAddress
public void setUserEmailAddress(java.lang.String newEmailAddress) throws java.io.IOExceptionDescription copied from interface:FileTransferMechanismSets the connected user's email address when called- Specified by:
setUserEmailAddressin interfaceFileTransferMechanism- Parameters:
newEmailAddress- The New Email To Be Set- Throws:
java.io.IOException
-
setUserFullName
public void setUserFullName(java.lang.String newUserName) throws java.io.IOExceptionDescription copied from interface:FileTransferMechanismSet's The User's Name When Called- Specified by:
setUserFullNamein interfaceFileTransferMechanism- Parameters:
newUserName- - The New User Name To Be Set- Throws:
java.io.IOException
-
createWeblink
@Deprecated public WeblinkResult createWeblink(java.util.List<java.lang.String> to, java.lang.String subject, java.lang.String message, FileListData files) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Deprecated.Description copied from interface:FileTransferMechanismCreates a weblink with the parameters provided by the client.- Specified by:
createWeblinkin interfaceFileTransferMechanism- Parameters:
to- A ";" delimited list of to addressessubject- The subject for the emailmessage- The message the user would like the email to have. Do note that this is not the email's body contentfiles- The list of files that the user wishes to have in this weblink- Returns:
- Returns the result of executing the command. Exceptions are thrown if the any of the parameters are null
- Throws:
unlimited.core.util.common.exception.FCException- if a FileCatalyst protocol error occurs.java.io.IOException- if an error occurs either connecting to the destination server, or if a transfer I/O error occurs.
-
createWeblink
@Deprecated public WeblinkResult createWeblink(java.util.List<java.lang.String> to, java.lang.String subject, java.lang.String message, java.util.Set<java.lang.String> files) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Deprecated.Description copied from interface:FileTransferMechanismMethod for creating a Weblink on FC Servers.- Specified by:
createWeblinkin interfaceFileTransferMechanism- Parameters:
to- List of to email addresses that you would like to send the link tosubject- Subject of the email that will be sent outmessage- Message contained in the email that is sent outfiles- File listing that you wish to include the link. All files are relative to connected user home- Returns:
- Data object containing the results of the weblink creation
- Throws:
unlimited.core.util.common.exception.FCException- if a FileCatalyst protocol error occurs.java.io.IOException- if an error occurs either connecting to the destination server, or if a transfer I/O error occurs.
-
createWeblink
public WeblinkResult createWeblink(WeblinkDataContainer data) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismCreates a weblink on the FileCatalyst Server with the parameters provided by the client. Currently supported method for data creation- Specified by:
createWeblinkin interfaceFileTransferMechanism- Parameters:
data- Data object representing the data to be used for the link itself- Returns:
- Throws:
unlimited.core.util.common.exception.FCException- if a FileCatalyst protocol error occurs.java.io.IOException- if an error occurs either connecting to the destination server, or if a transfer I/O error occurs.
-
getUserPermissions
public UserPermissionsContainer getUserPermissions() throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileTransferMechanismGather's the current user's permissions that are enabled on the server.- Specified by:
getUserPermissionsin interfaceFileTransferMechanism- Returns:
- Throws:
unlimited.core.util.common.exception.FCException- if a FileCatalyst protocol error occurs.java.io.IOException- if an error occurs either connecting to the destination server, or if a transfer I/O error occurs.
-
informTransferStart
public void informTransferStart()
Description copied from interface:FileTransferMechanismSends a message to the server letting them know that transfer has started- Specified by:
informTransferStartin interfaceFileTransferMechanism
-
informTransferFinished
public void informTransferFinished()
Description copied from interface:FileTransferMechanismSends a message to the server letting them know that transfer has finished- Specified by:
informTransferFinishedin interfaceFileTransferMechanism
-
uploadRange
public void uploadRange(java.nio.file.Path localFile, java.lang.String remoteFile, long offset, long length) throws java.io.IOExceptionDescription copied from interface:FileTransferMechanismUploads a range of rate for the given file. Used for patching remote files with particular ranges of data that exist on the local file instance- Specified by:
uploadRangein interfaceFileTransferMechanism- Parameters:
localFile- The file the patch will be drawn fromremoteFile- The file to be patchedoffset- Starting byte for the patchlength- Length of the patch- Throws:
java.io.IOException- Problems with the transfer
-
downloadRange
public void downloadRange(java.nio.file.Path localFile, java.lang.String remoteFile, long offset, long length) throws java.io.IOExceptionDescription copied from interface:FileTransferMechanismDownloads a range of information from the remote file. Used for patching local files with particular ranges of data that exist on the remote file instance.- Specified by:
downloadRangein interfaceFileTransferMechanism- Parameters:
localFile- - file to be patchedremoteFile- - the file the patch will be drawn fromoffset- - starting byte for the patchlength- - length of the patch- Throws:
java.io.IOException- - problems with the transfer
-
streamWithInlineParse
public java.util.stream.Stream<FileListDataItem> streamWithInlineParse(java.lang.String directory) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:RemoteFileSystemSourceReturns streaming meta data for files in the given remote directory. Use if you expect a large collection of files to be returned from the Server- Specified by:
streamWithInlineParsein interfaceRemoteFileSystemSource- Parameters:
directory- to get data from- Returns:
- stream of FileListDataItems
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
streamWithInlineParse
public java.util.stream.Stream<FileListDataItem> streamWithInlineParse() throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileListDataItemSourceReturns streaming meta data for files in the current remote directory. Use if you expect a large collection of files to be returned from the Server- Specified by:
streamWithInlineParsein interfaceFileListDataItemSource- Returns:
- stream of FileListDataItems
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
canAcceptWork
public boolean canAcceptWork()
Returns whether or not the Multi-Manager has room in the work queueu- Returns:
- true if it can accept more transfer jobs
-
addFocusedDelta
public void addFocusedDelta(unlimited.core.util.common.tuples.Quintet<java.lang.String,java.lang.Long,java.lang.Long,java.lang.Long,java.util.concurrent.TimeUnit> focusedDelta)
Adds a focused delta to the Multi-Client's post process. The Quartet parameter contains the folling data First Item (String) - Filter to be used for the delta Second Item (Integer) - Timeout value to be used for the delta Third Item (Long) - Header byte amount Fourth Item (Long) - Footer byte amount- Parameters:
focusedDelta-
-
addRetransferDelta
public void addRetransferDelta(unlimited.core.util.common.tuples.Triplet<java.lang.String,java.lang.Long,java.util.concurrent.TimeUnit> retransferDelta)
Adds a re-transfer delta PostProcessor that re-transfers deltas after a file succeeds- Parameters:
retransferDelta- Pair object containing the filter (string), and filter delay (integer) amount
-
addWaitForGrowth
public void addWaitForGrowth(unlimited.core.util.common.tuples.Triplet<java.lang.String,java.lang.Long,java.util.concurrent.TimeUnit> waitForGrowth)
Adds a wait for file growth PreProcessor that waits for a file to stop growing before it's transferred- Parameters:
waitForGrowth- Triplet object containing the filter, timeout, and time unit
-
isWeblinkEnabledOnServer
public boolean isWeblinkEnabledOnServer() throws java.io.IOExceptionDescription copied from interface:FileTransferMechanismRequest if link is enabled on the server that you are connected too- Specified by:
isWeblinkEnabledOnServerin interfaceFileTransferMechanism- Returns:
- True if link is enabled, false otherwise
- Throws:
java.io.IOException- if an error occurs either connecting to the destination server, or if a transfer I/O error occurs.
-
getServerLinkExpiryDayValue
public int getServerLinkExpiryDayValue() throws java.io.IOExceptionDescription copied from interface:FileTransferMechanismReturns the number of days that the server has configured for links to be stored. Method returns error if the functionality isn't supported on the server- Specified by:
getServerLinkExpiryDayValuein interfaceFileTransferMechanism- Returns:
- Throws:
java.io.IOException- if an error occurs either connecting to the destination server, or if a transfer I/O error occurs.
-
getServerConfigurationValue
public java.lang.String getServerConfigurationValue(java.lang.String value) throws java.io.IOExceptionDescription copied from interface:FileTransferMechanismGets an individual Server configuration value from the Server. The list of available requests can be found in the ServerConfigs call that is returned fromFileTransferMechanism.getAllAvailableServerConfigs()- Specified by:
getServerConfigurationValuein interfaceFileTransferMechanism- Throws:
java.io.IOException- if an error occurs either connecting to the destination server, or if a transfer I/O error occurs.
-
getAllAvailableServerConfigs
public ServerConfigs getAllAvailableServerConfigs() throws java.io.IOException
Description copied from interface:FileTransferMechanismReturns all Server side configurations that the Client may be interested in.- Specified by:
getAllAvailableServerConfigsin interfaceFileTransferMechanism- Returns:
- Data object containing the current Client-based Server configurations
- Throws:
java.io.IOException- if an error occurs either connecting to the destination server, or if a transfer I/O error occurs.
-
modtime
public void modtime(FileListDataItem item) throws java.io.IOException
Description copied from interface:FileTransferMechanismThis will update the modtime of the file existing on the server to whatever the incoming FileListDataItem is set to- Specified by:
modtimein interfaceFileTransferMechanism- Parameters:
item- - item with a modification time to be sent to the server;- Throws:
java.io.IOException
-
runWorkerClient
protected void runWorkerClient(FileTransferMechanismHandler handler) throws java.lang.Exception
This allows you to use the worker client to perform operations that don't interfere with the transferring clients- Parameters:
handler- - user defined handler that accepts a synched FileTransferMechanism object- Throws:
java.lang.Exception
-
isCancelling
public boolean isCancelling()
Returns whether or not the manager is currently in a cancelling state- Returns:
- True if in a cancelling state
-
isUsingDeleteAfterPostProcessor
public boolean isUsingDeleteAfterPostProcessor()
Returns true if we are using the delete after post processor- Returns:
-
lastServerRestrictedRate
public int lastServerRestrictedRate()
Description copied from interface:FileTransferDataReturns the last rate (kbps) that the Server had replied with. This rate takes into account what the server is imposing during a transfer bandwidth speed.- Specified by:
lastServerRestrictedRatein interfaceFileTransferData
-
getServerOverrideBandwidth
public int getServerOverrideBandwidth()
Description copied from interface:FileTransferDataReturns the override bandwidth value that has been specified by server. If isServerOverrideBandwith() == false, then 0 is returned- Specified by:
getServerOverrideBandwidthin interfaceFileTransferData- Returns:
- if isServerOverridebandwidth() is true returns the serverOverrideBandwidth otherwise returns 0;
-
isServerOverridebandwidth
public boolean isServerOverridebandwidth()
Description copied from interface:FileTransferDataReturns whether or not the server has specified that the bandwidth should be overridden. If true, then the bandwidth allocated to the client will be the value specified by the current server override bandwidth. If false, then the client will attempt to transfer at the rate specified by the target rate.- Specified by:
isServerOverridebandwidthin interfaceFileTransferData- Returns:
- true if the server is overriding the bandwidth during a transfer, always false if no transfer is happening.
-
setTransferToServerOverride
public void setTransferToServerOverride(int serverOverrideBW)
Description copied from interface:FileTransferDataSets bandwidth value that the Server is attempting to override this client to. If the isServerOverrideBandwidth() returns true, then the client will attempt to transfer at the specified by the server override. Otherwise, it will attempt to transfer at the defined target rate.- Specified by:
setTransferToServerOverridein interfaceFileTransferData- Parameters:
serverOverrideBW- Kbps bandwidth value
-
setUserRelativePriority
public void setUserRelativePriority(int priority)
Description copied from interface:FileTransferDataThis priority hint is to help the server distribute bandwidth within its own set parameters. The scope of the hint is for all sessions with this client's agent ID connecting to this client's user.- Specified by:
setUserRelativePriorityin interfaceFileTransferData- Parameters:
priority- hint for server to distribute bandwidth when it would normally split it evenly.
-
getUserRelativePriority
public int getUserRelativePriority()
Description copied from interface:FileTransferDataThis priority hint is to help the server distribute bandwidth within its own set parameters. The scope of the hint is for all sessions with this client's agent ID connecting to this client's user.- Specified by:
getUserRelativePriorityin interfaceFileTransferData- Returns:
- priority hint for server to distribute bandwidth when it would normally split it evenly.
-
isCurrentStateInstanceof
@SafeVarargs public final boolean isCurrentStateInstanceof(java.lang.Class<? extends MultiClientState>... states)
-
delete
public java.util.stream.Stream<unlimited.core.util.common.tuples.Pair<FileListDataItem,java.lang.Boolean>> delete(java.util.stream.Stream<FileListDataItem> toDelete)
Description copied from interface:FileTransferMechanismDeletes a stream of files on the Server. Returns a stream containing the file and the result of the delete operation- Specified by:
deletein interfaceFileTransferMechanism- Returns:
-
exists
public unlimited.core.util.common.AutoClose<unlimited.core.util.common.stream.PairStream<java.lang.String,java.lang.Boolean>> exists(java.util.stream.Stream<java.lang.String> nameStream) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDescription copied from interface:FileTransferMechanismQueries the Server for existence of all files in the provided stream.
Note: Make sure to close this stream before attempting to perform any other commands against the Server. If you don't close the stream, the Server will be stuck processing the command, and will be unable to process other commands that come in.- Specified by:
existsin interfaceFileTransferMechanism- Returns:
- A Stream containing pairs of file name and existence (boolean)
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
requestUpdateServerOverrides
public void requestUpdateServerOverrides()
Queries the currently connected Server to provide it's currently overridden bandwidths. Method is used implicitly to balance the bandwidth distribution for individual clients contained within the MultiClientManager.
Note: This method will only give a new value every 1000 milliseconds. If a called before that interval, the system will simply return
-
bumpPriority
public boolean bumpPriority(java.lang.String path)
Bump the priority of a given pending file to the head of the pending list- Parameters:
path- File path to bump- Returns:
- Whether or not the operation was successful
-
searchPending
public java.util.List<unlimited.core.util.common.tuples.Pair<java.lang.String,TransferJobPriority>> searchPending(java.lang.String filter, int limit)
Searches the pending work list and returns all results that match the supplied filter- Parameters:
filter- Filter to use for checkinglimit- Hard limit on the number of results to return- Returns:
- List containing all files that matches the filter
-
hasWork
public boolean hasWork()
Returns whether or not the Manager has active or pending work- Returns:
-
setTaskID
public void setTaskID(java.lang.String taskID)
Description copied from interface:FileTransferDataSets the current task ID to the new value supplied- Specified by:
setTaskIDin interfaceFileTransferData
-
getTaskID
public java.lang.String getTaskID()
Description copied from interface:FileTransferDataReturns the current task ID- Specified by:
getTaskIDin interfaceFileTransferData- Returns:
-
getConnectivityTestResults
public ConnectivityTestResultContainer getConnectivityTestResults()
Description copied from interface:FileTransferMechanismReturns a data container object that contains information about whether or not uploads, downloads or overall transfers will work for all available transfer modes.- Specified by:
getConnectivityTestResultsin interfaceFileTransferMechanism- Returns:
- A data container that contains the connectivity test results
-
resetSession
public void resetSession()
Resets the session when called. If currently transferring, this call will do nothing. If not currently transferring, then this call will query the state machine, and generate a brand new session with brand new IDs that keep it separate from other sessions.
-
getSessionManageMode
public SessionManageMode getSessionManageMode()
Returns the current session management mode that is used for this Manager instance- Returns:
- The current session mode
-
setSessionManageMode
public void setSessionManageMode(SessionManageMode sessionManageMode)
Sets the session management mode to the supplied value- Parameters:
sessionManageMode- Management mode to use
-
isCancelledOrCancelling
public boolean isCancelledOrCancelling()
Returns whether or not the Manager is currently canceling it's current transfers, or if it has completely cancelled it's work- Returns:
-
isCancelledDueToError
public boolean isCancelledDueToError()
Returns whether or not the Manager was cancelled- Returns:
-
getFileTransferPriority
public int getFileTransferPriority()
Description copied from interface:FileTransferDataReturns the task file transfer priority- Specified by:
getFileTransferPriorityin interfaceFileTransferData- Returns:
-
setFileTransferPriority
public void setFileTransferPriority(int fileTransferPriority)
Description copied from interface:FileTransferDataSets the FileTransferPrioriry to new new value. .Valid values are as follows:
- 0 = Oldest files are transferred first
- 1 = Newest files are transferred first
- 2 = Smallest files are transferred first
- 3 = Largest files are transferred first
- 4 = No Priority for files
- Specified by:
setFileTransferPriorityin interfaceFileTransferData
-
isForceFileOwnershipEnabled
public boolean isForceFileOwnershipEnabled()
Description copied from interface:FileListDataItemSourceReturns true if the force file ownership feature is currently enabled. If it is, then all files downloaded this client will have their ownership changed to current values for the ForceFileOwnershipUsername, and ForceFileOwnershipGroupname- Specified by:
isForceFileOwnershipEnabledin interfaceFileListDataItemSource- Returns:
- the isForceFileOwnershipEnabled
-
setForceFileOwnershipEnabled
public void setForceFileOwnershipEnabled(boolean isForceFileOwnershipEnabled)
Description copied from interface:FileListDataItemSourceSets whether or not the force file ownership feature is enabled. If it is, then all files downloaded this client will have their ownership changed to current values for the ForceFileOwnershipUsername, and ForceFileOwnershipGroupname- Specified by:
setForceFileOwnershipEnabledin interfaceFileListDataItemSource- Parameters:
isForceFileOwnershipEnabled- the isForceFileOwnershipEnabled to set
-
getForceFileOwnershipUser
public java.lang.String getForceFileOwnershipUser()
Description copied from interface:FileTransferDataReturns the username to be used when attempting to force file ownership for files downloaded by the client- Specified by:
getForceFileOwnershipUserin interfaceFileTransferData- Returns:
- the forceFileOwnershipUser
-
setForceFileOwnershipUser
public void setForceFileOwnershipUser(java.lang.String forceFileOwnershipUser)
Description copied from interface:FileTransferDataSets the username to be used when attempting to force file ownership for files downloaded by the client- Specified by:
setForceFileOwnershipUserin interfaceFileTransferData- Parameters:
forceFileOwnershipUser- the forceFileOwnershipUser to set
-
getForceFileOwnershipGroup
public java.lang.String getForceFileOwnershipGroup()
Description copied from interface:FileTransferDataReturns the groupname / groupID to be used when attempting to force group level ownership for files downloaded by the client.
Note: Value is ignored if on a Windows platform- Specified by:
getForceFileOwnershipGroupin interfaceFileTransferData- Returns:
- the forceFileOwnershipGroup
-
setForceFileOwnershipGroup
public void setForceFileOwnershipGroup(java.lang.String forceFileOwnershipGroup)
Description copied from interface:FileTransferDataSets the groupname / groupID to be used when attempting to force group level ownership for files downloaded by the client.
Note: Value is ignored if on a Windows platform- Specified by:
setForceFileOwnershipGroupin interfaceFileTransferData
-
siteMatch
public boolean siteMatch(java.lang.String host, int port, ClientCredentials creds)Returns whether or not the supplied information matches the information currently set in the Manager.- Parameters:
host- Host to check against the current hostport- Port to check against the current portcreds- Credentials to verify the client.- Returns:
- True if all information matches, false otherwise
-
flushDispatch
public void flushDispatch()
the event listening is handled asynchronously inside the multi client manager. If you want to wait for all queued events to be cleared, use this method, it pushes an empty runnable onto the executor service responsible for dispatching all multi client manager events.
-
flushAllInternals
public void flushAllInternals()
-
scheduleHookUpdate
protected void scheduleHookUpdate()
Schedules an asynchronous update for the MultiClientManager's TransferHook information. Once the operation has completed, the currentgetMultiHook()will be updated with the most recent information
-
flushInternalTaskDispatch
public void flushInternalTaskDispatch()
Flushes the internal task dispatching system and causes the calling resource to wait until the resource has been flushed also change this comment
-
isMoveToSent
public boolean isMoveToSent()
- Specified by:
isMoveToSentin interfaceFileTransferData
-
getTransferHolder
public PostURLTransfer.TransferHolder getTransferHolder()
-
setTransferHolder
public void setTransferHolder(PostURLTransfer.TransferHolder h)
-
streamWithInlineParse
public java.util.stream.Stream<FileListDataItem> streamWithInlineParse(java.lang.String directory, java.util.function.BooleanSupplier isCancelled) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:RemoteFileSystemSourceReturns streaming meta data for files in the given remote directory. Use if you expect a large collection of files to be returned from the Server- Specified by:
streamWithInlineParsein interfaceRemoteFileSystemSource- Parameters:
directory- to get data fromisCancelled- cancelhandler to stop streaming- Returns:
- stream of FileListDataItems
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
streamWithInlineParse
public java.util.stream.Stream<FileListDataItem> streamWithInlineParse(java.util.function.BooleanSupplier isCancelled) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Description copied from interface:FileListDataItemSourceReturns streaming meta data for files in the current remote directory. Use if you expect a large collection of files to be returned from the Server- Specified by:
streamWithInlineParsein interfaceFileListDataItemSource- Parameters:
isCancelled- cancel handler to stop stream on cancel- Returns:
- stream of FileListDataItems
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
getPreProcessors
public java.util.Collection<PreProcessor> getPreProcessors()
-
getPostProcessors
public java.util.Collection<PostProcessor<?>> getPostProcessors()
-
getStickySessionID
public java.util.function.Supplier<java.lang.String> getStickySessionID()
Description copied from interface:FileTransferMechanismReturns the current supplier that is used to generate the unique sticky session identifier that the FileCatalyst Client use when the connect to the FileCatalyst LoadBalancer- Specified by:
getStickySessionIDin interfaceFileTransferMechanism- Returns:
- Supplier that produces a unique ID
-
setStickySessionID
public void setStickySessionID(java.util.function.Supplier<java.lang.String> stickyIDProvider)
Description copied from interface:FileTransferMechanismSets the current supplier that is used to generate the unique sticky session identifier that the FileCatalyst Client use when the connect to the FileCatalyst LoadBalancer- Specified by:
setStickySessionIDin interfaceFileTransferMechanism
-
-