Class RepoRemoteTransportService

    • Constructor Detail

      • RepoRemoteTransportService

        public RepoRemoteTransportService()
        Default constructor.
    • Method Detail

      • setIdleTimeout

        public void setIdleTimeout​(long timeout)
        Set the Idle Timeout value.
        Parameters:
        timeout - The value to set.
      • setRepoRemote

        public void setRepoRemote​(RepoRemote remote)
        Set the RepoRemote instance.
      • setAuthenticationService

        public void setAuthenticationService​(AuthenticationService service)
        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.
        Specified by:
        run in interface Runnable
      • shutDown

        public void shutDown()
        Shutdown the Runnable cleanly.
      • createDirectory

        public org.alfresco.service.cmr.repository.NodeRef createDirectory​(String ticket,
                                                                           org.alfresco.service.cmr.repository.NodeRef base,
                                                                           String path)
        Description copied from interface: RepoRemoteTransport
        Create a new directory.
        Specified by:
        createDirectory in interface RepoRemoteTransport
        base - The base node ref.
        path - The relative path.
        Returns:
        The node ref to the newly created directory.
      • createFile

        public String createFile​(String ticket,
                                 org.alfresco.service.cmr.repository.NodeRef base,
                                 String path)
        Description copied from interface: RepoRemoteTransport
        Create a file relative to a base node.
        Specified by:
        createFile in interface RepoRemoteTransport
        base - The base node ref.
        path - The relative path.
        Returns:
        A handle.
      • getListing

        public Map<String,​org.alfresco.util.Pair<org.alfresco.service.cmr.repository.NodeRef,​Boolean>> getListing​(String ticket,
                                                                                                                              org.alfresco.service.cmr.repository.NodeRef dir)
        Description copied from interface: RepoRemoteTransport
        Get a listing of a directory.
        Specified by:
        getListing in interface RepoRemoteTransport
        dir - The node ref of the directory.
        Returns:
        A Map of names to node refs.
      • getRoot

        public org.alfresco.service.cmr.repository.NodeRef getRoot​(String ticket)
        Description copied from interface: RepoRemoteTransport
        Get the root node of the SpacesStore repo.
        Specified by:
        getRoot in interface RepoRemoteTransport
        Returns:
        The root node ref.
      • lookup

        public org.alfresco.util.Pair<org.alfresco.service.cmr.repository.NodeRef,​Boolean> lookup​(String ticket,
                                                                                                        org.alfresco.service.cmr.repository.NodeRef base,
                                                                                                        String path)
        Description copied from interface: RepoRemoteTransport
        Lookup a node by path relative to a node.
        Specified by:
        lookup in interface RepoRemoteTransport
        base - The base node ref.
        path - The relative path.
        Returns:
        The node ref or null.
      • readFile

        public String readFile​(String ticket,
                               org.alfresco.service.cmr.repository.NodeRef base,
                               String path)
        Description copied from interface: RepoRemoteTransport
        Read a file from a relative path.
        Specified by:
        readFile in interface RepoRemoteTransport
        base - The base node ref.
        path - The relative path to the file.
        Returns:
        A handle.
      • readFile

        public String readFile​(String ticket,
                               org.alfresco.service.cmr.repository.NodeRef fileRef)
        Description copied from interface: RepoRemoteTransport
        Read a file directly.
        Specified by:
        readFile in interface RepoRemoteTransport
        fileRef - The node ref of the file.
        Returns:
        A handle.
      • readInput

        public byte[] readInput​(String ticket,
                                String handle,
                                int count)
        Description copied from interface: RepoRemoteTransport
        Read a block of bytes over the wire.
        Specified by:
        readInput in interface RepoRemoteTransport
        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

        public void removeNode​(String ticket,
                               org.alfresco.service.cmr.repository.NodeRef base,
                               String path)
        Description copied from interface: RepoRemoteTransport
        Remove a node via a relative path.
        Specified by:
        removeNode in interface RepoRemoteTransport
        base - The base node ref.
        path - The relative path.
      • removeNode

        public void removeNode​(String ticket,
                               org.alfresco.service.cmr.repository.NodeRef toRemove)
        Description copied from interface: RepoRemoteTransport
        Remove a node directly.
        Specified by:
        removeNode in interface RepoRemoteTransport
        toRemove - The node ref to remove.
      • rename

        public void rename​(String ticket,
                           org.alfresco.service.cmr.repository.NodeRef base,
                           String src,
                           String dst)
        Description copied from interface: RepoRemoteTransport
        Rename a node
        Specified by:
        rename in interface RepoRemoteTransport
        base - The base node ref.
        src - The relative source path.
        dst - The relative target path.
      • writeFile

        public String writeFile​(String ticket,
                                org.alfresco.service.cmr.repository.NodeRef base,
                                String path)
        Description copied from interface: RepoRemoteTransport
        Write to an already existing file.
        Specified by:
        writeFile in interface RepoRemoteTransport
        base - The base node ref.
        path - The relative path.
        Returns:
        A handle.
      • writeOutput

        public void writeOutput​(String ticket,
                                String handle,
                                byte[] buff,
                                int count)
        Description copied from interface: RepoRemoteTransport
        Write a portion of a block of bytes over the wire.
        Specified by:
        writeOutput in interface RepoRemoteTransport
        Parameters:
        ticket - The authentication ticket.
        handle - The remote handle.
        buff - The buffer with data.
        count - The number of bytes to write.