Package org.alfresco.repo.remote
Class RepoRemoteTransportService
java.lang.Object
org.alfresco.repo.remote.RepoRemoteTransportService
- All Implemented Interfaces:
Runnable,RepoRemoteTransport
The server side implementation of RepoRemoteTransport. It handles ticket validation, and expiration of idle streams.
- Author:
- britt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseInputHandle(String ticket, String handle) Close a remote InputStream.voidcloseOutputHandle(String ticket, String handle) Close a remote OutputStream.createDirectory(String ticket, NodeRef base, String path) Create a new directory.createFile(String ticket, NodeRef base, String path) Create a file relative to a base node.getListing(String ticket, NodeRef dir) Get a listing of a directory.Get the root node of the SpacesStore repo.voidinit()The init method.Lookup a node by path relative to a node.Read a file directly.Read a file from a relative path.byte[]Read a block of bytes over the wire.voidremoveNode(String ticket, NodeRef toRemove) Remove a node directly.voidremoveNode(String ticket, NodeRef base, String path) Remove a node via a relative path.voidRename a nodevoidrun()The body of this Runnable.voidSet the AuthenticationService instance.voidsetIdleTimeout(long timeout) Set the Idle Timeout value.voidsetRepoRemote(RepoRemote remote) Set the RepoRemote instance.voidshutDown()Shutdown the Runnable cleanly.Write to an already existing file.voidwriteOutput(String ticket, String handle, byte[] buff, int count) Write a portion of a block of bytes over the wire.
-
Constructor Details
-
RepoRemoteTransportService
public RepoRemoteTransportService()Default constructor.
-
-
Method Details
-
setIdleTimeout
public void setIdleTimeout(long timeout) Set the Idle Timeout value.- Parameters:
timeout- The value to set.
-
setRepoRemote
Set the RepoRemote instance. -
setAuthenticationService
Set the AuthenticationService instance. -
init
public void init()The init method. This fires up a thread to check for closable streams. -
run
public void run()The body of this Runnable. -
shutDown
public void shutDown()Shutdown the Runnable cleanly. -
closeInputHandle
Description copied from interface:RepoRemoteTransportClose a remote InputStream.- Specified by:
closeInputHandlein interfaceRepoRemoteTransport- Parameters:
ticket- The authentication ticket.handle- The handle.
-
closeOutputHandle
Description copied from interface:RepoRemoteTransportClose a remote OutputStream.- Specified by:
closeOutputHandlein interfaceRepoRemoteTransport- Parameters:
ticket- The authentication ticket.handle- The handle.
-
createDirectory
Description copied from interface:RepoRemoteTransportCreate a new directory.- Specified by:
createDirectoryin interfaceRepoRemoteTransportbase- The base node ref.path- The relative path.- Returns:
- The node ref to the newly created directory.
-
createFile
Description copied from interface:RepoRemoteTransportCreate a file relative to a base node.- Specified by:
createFilein interfaceRepoRemoteTransportbase- The base node ref.path- The relative path.- Returns:
- A handle.
-
getListing
Description copied from interface:RepoRemoteTransportGet a listing of a directory.- Specified by:
getListingin interfaceRepoRemoteTransportdir- The node ref of the directory.- Returns:
- A Map of names to node refs.
-
getRoot
Description copied from interface:RepoRemoteTransportGet the root node of the SpacesStore repo.- Specified by:
getRootin interfaceRepoRemoteTransport- Returns:
- The root node ref.
-
lookup
Description copied from interface:RepoRemoteTransportLookup a node by path relative to a node.- Specified by:
lookupin interfaceRepoRemoteTransportbase- The base node ref.path- The relative path.- Returns:
- The node ref or null.
-
readFile
Description copied from interface:RepoRemoteTransportRead a file from a relative path.- Specified by:
readFilein interfaceRepoRemoteTransportbase- The base node ref.path- The relative path to the file.- Returns:
- A handle.
-
readFile
Description copied from interface:RepoRemoteTransportRead a file directly.- Specified by:
readFilein interfaceRepoRemoteTransportfileRef- The node ref of the file.- Returns:
- A handle.
-
readInput
Description copied from interface:RepoRemoteTransportRead a block of bytes over the wire.- Specified by:
readInputin interfaceRepoRemoteTransport- Parameters:
ticket- The authentication ticket.handle- The remote handle.count- The number of bytes to try to read.- Returns:
- A buffer of the bytes read. Length is 0 at EOF.
-
removeNode
Description copied from interface:RepoRemoteTransportRemove a node via a relative path.- Specified by:
removeNodein interfaceRepoRemoteTransportbase- The base node ref.path- The relative path.
-
removeNode
Description copied from interface:RepoRemoteTransportRemove a node directly.- Specified by:
removeNodein interfaceRepoRemoteTransporttoRemove- The node ref to remove.
-
rename
Description copied from interface:RepoRemoteTransportRename a node- Specified by:
renamein interfaceRepoRemoteTransportbase- The base node ref.src- The relative source path.dst- The relative target path.
-
writeFile
Description copied from interface:RepoRemoteTransportWrite to an already existing file.- Specified by:
writeFilein interfaceRepoRemoteTransportbase- The base node ref.path- The relative path.- Returns:
- A handle.
-
writeOutput
Description copied from interface:RepoRemoteTransportWrite a portion of a block of bytes over the wire.- Specified by:
writeOutputin interfaceRepoRemoteTransport- Parameters:
ticket- The authentication ticket.handle- The remote handle.buff- The buffer with data.count- The number of bytes to write.
-