public class HttpClientTransmitterImpl extends Object implements TransferTransmitter
Constructor and Description |
---|
HttpClientTransmitterImpl() |
Modifier and Type | Method and Description |
---|---|
void |
abort(Transfer transfer)
Abort the transfer
|
Transfer |
begin(TransferTarget target,
String fromRepositoryId,
TransferVersion fromVersion)
Begin a transfer, the transfer object returned will be used by subsequent
calls to the transfer service.
|
void |
commit(Transfer transfer) |
ContentService |
getContentService() |
protected org.apache.commons.httpclient.methods.PostMethod |
getPostMethod() |
TransferProgress |
getStatus(Transfer transfer)
Get the status of an in process transfer
|
void |
getTransferReport(Transfer transfer,
OutputStream result)
Get the destination side transfer report from the destination and write it to the specified output stream.
|
void |
init() |
void |
prepare(Transfer transfer) |
void |
sendContent(Transfer transfer,
Set<org.alfresco.service.cmr.repository.ContentData> data)
Send the content of the specified urls
|
void |
sendManifest(Transfer transfer,
File manifest,
OutputStream result) |
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 |
setHttpMethodFactory(HttpMethodFactory httpMethodFactory) |
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 |
setIsAuthenticationPreemptive(boolean isAuthenticationPreemptive)
Whether httpClient will use preemptive authentication or not.
|
void |
setJsonErrorSerializer(JsonSerializer<Throwable,org.json.JSONObject> jsonErrorSerializer) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
verifyTarget(TransferTarget target)
Verify that the target is available
|
public void init()
public void setHttpsSocketFactory(org.apache.commons.httpclient.protocol.ProtocolSocketFactory socketFactory)
socketFactory
- ProtocolSocketFactorypublic void setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)
httpClient
- HttpClientpublic void setIsAuthenticationPreemptive(boolean isAuthenticationPreemptive)
isAuthenticationPreemptive
- booleanpublic void verifyTarget(TransferTarget target) throws TransferException
TransferTransmitter
verifyTarget
in interface TransferTransmitter
target
- TransferTargetTransferException
public Transfer begin(TransferTarget target, String fromRepositoryId, TransferVersion fromVersion) throws TransferException
TransferTransmitter
begin
in interface TransferTransmitter
target
- definition of where to transfer to.fromRepositoryId
- the repositoryID of the sending systemfromVersion
- the version of the repository sendingTransferException
public void sendManifest(Transfer transfer, File manifest, OutputStream result) throws TransferException
sendManifest
in interface TransferTransmitter
transfer
- the transfer object returned by an earlier call to beginmanifest
- the transfer manifest fileresult
- - where to write the results, probably a temporary file the output steam should be
open and will be closed before the method returns.TransferException
public void abort(Transfer transfer) throws TransferException
TransferTransmitter
abort
in interface TransferTransmitter
transfer
- the transfer object returned by an earlier call to beginTransferException
public void commit(Transfer transfer) throws TransferException
commit
in interface TransferTransmitter
transfer
- the transfer object returned by an earlier call to beginTransferException
public void prepare(Transfer transfer) throws TransferException
prepare
in interface TransferTransmitter
transfer
- the transfer object returned by an earlier call to beginTransferException
public void sendContent(Transfer transfer, Set<org.alfresco.service.cmr.repository.ContentData> data) throws TransferException
TransferTransmitter
sendContent
in interface TransferTransmitter
transfer
- the transfer object returned by an earlier call to begindata
- the content to sendTransferException
public TransferProgress getStatus(Transfer transfer) throws TransferException
TransferTransmitter
getStatus
in interface TransferTransmitter
TransferException
public void getTransferReport(Transfer transfer, OutputStream result)
TransferTransmitter
The result stream will be closed.
getTransferReport
in interface TransferTransmitter
transfer
- the transfer object returned by an earlier call to beginresult
- - where to write the contents of the transfer report.protected org.apache.commons.httpclient.methods.PostMethod getPostMethod()
public void setContentService(ContentService contentService)
public ContentService getContentService()
public void setHttpMethodFactory(HttpMethodFactory httpMethodFactory)
public void setJsonErrorSerializer(JsonSerializer<Throwable,org.json.JSONObject> jsonErrorSerializer)
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Copyright © 2005–2017 Alfresco Software. All rights reserved.