org.alfresco.repo.transfer
Class HttpClientTransmitterImpl

java.lang.Object
  extended by org.alfresco.repo.transfer.HttpClientTransmitterImpl
All Implemented Interfaces:
TransferTransmitter

public class HttpClientTransmitterImpl
extends java.lang.Object
implements TransferTransmitter

HTTP implementation of TransferTransmitter. Sends data via HTTP to the server.


Constructor Summary
HttpClientTransmitterImpl()
           
 
Method Summary
 void abort(Transfer transfer)
          Abort the transfer
 Transfer begin(TransferTarget target)
          Begin a transfer, the transfer object returned will be used by subsequent calls to the transfer service.
 void commit(Transfer transfer)
           
 ContentService getContentService()
           
 TransferProgress getStatus(Transfer transfer)
          Get the status of an in process transfer
 void init()
           
 void prepare(Transfer transfer)
           
 void sendContent(Transfer transfer, java.util.Set data)
          Send the content of the specified urls
 DeltaList sendManifest(Transfer transfer, java.io.File manifest)
           
 void setContentService(ContentService contentService)
           
 void setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)
          By default, this class uses a plain HttpClient instance with the only non-default option being the multi-threaded connection manager.
 void setHttpsSocketFactory(org.apache.commons.httpclient.protocol.ProtocolSocketFactory socketFactory)
          By default this class uses the standard SSLProtocolSocketFactory, but this method allows this to be overridden.
 void verifyTarget(TransferTarget target)
          Verify that the target is available
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClientTransmitterImpl

public HttpClientTransmitterImpl()
Method Detail

init

public void init()

setHttpsSocketFactory

public void setHttpsSocketFactory(org.apache.commons.httpclient.protocol.ProtocolSocketFactory socketFactory)
By default this class uses the standard SSLProtocolSocketFactory, but this method allows this to be overridden. Useful if, for example, one wishes to permit support of self-signed certificates on the target.

Parameters:
socketFactory -

setHttpClient

public void setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)
By default, this class uses a plain HttpClient instance with the only non-default option being the multi-threaded connection manager. Use this method to replace this with your own HttpClient instance configured how you wish

Parameters:
httpClient -

verifyTarget

public void verifyTarget(TransferTarget target)
                  throws TransferException
Description copied from interface: TransferTransmitter
Verify that the target is available

Specified by:
verifyTarget in interface TransferTransmitter
Throws:
TransferException

begin

public Transfer begin(TransferTarget target)
               throws TransferException
Description copied from interface: TransferTransmitter
Begin a transfer, the transfer object returned will be used by subsequent calls to the transfer service.

Specified by:
begin in interface TransferTransmitter
Parameters:
target - definition of where to transfer to.
Returns:
the transfer object or null if the target cannot be locked.
Throws:
TransferException

sendManifest

public DeltaList sendManifest(Transfer transfer,
                              java.io.File manifest)
                       throws TransferException
Specified by:
sendManifest in interface TransferTransmitter
Parameters:
transfer - the transfer object returned by an earlier call to begin
Returns:
the delta list.
Throws:
TransferException

abort

public void abort(Transfer transfer)
           throws TransferException
Description copied from interface: TransferTransmitter
Abort the transfer

Specified by:
abort in interface TransferTransmitter
Parameters:
transfer - the transfer object returned by an earlier call to begin
Throws:
TransferException

commit

public void commit(Transfer transfer)
            throws TransferException
Specified by:
commit in interface TransferTransmitter
Parameters:
transfer - the transfer object returned by an earlier call to begin
Throws:
TransferException

prepare

public void prepare(Transfer transfer)
             throws TransferException
Specified by:
prepare in interface TransferTransmitter
Parameters:
transfer - the transfer object returned by an earlier call to begin
Throws:
TransferException

sendContent

public void sendContent(Transfer transfer,
                        java.util.Set data)
                 throws TransferException
Description copied from interface: TransferTransmitter
Send the content of the specified urls

Specified by:
sendContent in interface TransferTransmitter
Parameters:
transfer - the transfer object returned by an earlier call to begin
data - the content to send
Throws:
TransferException

getStatus

public TransferProgress getStatus(Transfer transfer)
                           throws TransferException
Description copied from interface: TransferTransmitter
Get the status of an in process transfer

Specified by:
getStatus in interface TransferTransmitter
Throws:
TransferException

setContentService

public void setContentService(ContentService contentService)

getContentService

public ContentService getContentService()


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.