ALF-2397 - Deployment protocol add create/update flag to "send" method.

API Changeto DeploymentTarget (Add a boolean parameter)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@20862 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2010-06-29 11:59:40 +00:00
parent c6e059b23a
commit 1b9e0d9837
2 changed files with 6 additions and 5 deletions

View File

@@ -123,9 +123,9 @@ public class DeploymentReceiverServiceClient implements
/* (non-Javadoc) /* (non-Javadoc)
* @see org.alfresco.deployment.DeploymentReceiverService#send(java.lang.String, java.lang.String, java.lang.String) * @see org.alfresco.deployment.DeploymentReceiverService#send(java.lang.String, java.lang.String, java.lang.String)
*/ */
public OutputStream send(String ticket, String path, String guid, String encoding, String mimeType, Set<String>aspects, Map<String, Serializable> props) public OutputStream send(String ticket, boolean create, String path, String guid, String encoding, String mimeType, Set<String>aspects, Map<String, Serializable> props)
{ {
String outputToken = fTransport.getSendToken(ticket, path, guid, encoding, mimeType, aspects, props); String outputToken = fTransport.getSendToken(ticket, create, path, guid, encoding, mimeType, aspects, props);
return new DeploymentClientOutputStream(fTransport, ticket, outputToken); return new DeploymentClientOutputStream(fTransport, ticket, outputToken);
} }

View File

@@ -1847,7 +1847,7 @@ public class DeploymentServiceImpl implements DeploymentService
AVMNodeDescriptor src = work.getSrc(); AVMNodeDescriptor src = work.getSrc();
if(src.isFile()) if(src.isFile())
{ {
copyFileToFSR(src, work.getVersion(), event.getDestination(), ticket); copyFileToFSR(src, true, work.getVersion(), event.getDestination(), ticket);
} }
else else
{ {
@@ -1857,7 +1857,7 @@ public class DeploymentServiceImpl implements DeploymentService
} }
else if (event.getType().equals(DeploymentEvent.Type.UPDATED)) else if (event.getType().equals(DeploymentEvent.Type.UPDATED))
{ {
copyFileToFSR(work.getSrc(), work.getVersion(), event.getDestination(), ticket); copyFileToFSR(work.getSrc(), false, work.getVersion(), event.getDestination(), ticket);
} }
// success, now put the event onto the event queue // success, now put the event onto the event queue
eventQueue.add(event); eventQueue.add(event);
@@ -1885,6 +1885,7 @@ public class DeploymentServiceImpl implements DeploymentService
*/ */
private void copyFileToFSR( private void copyFileToFSR(
final AVMNodeDescriptor src, final AVMNodeDescriptor src,
final boolean create,
final int version, final int version,
final String dstPath, final String dstPath,
final String ticket) final String ticket)
@@ -1905,7 +1906,7 @@ public class DeploymentServiceImpl implements DeploymentService
Set<String>stringAspects = getAspects(avmService, src); Set<String>stringAspects = getAspects(avmService, src);
Map<String, Serializable> stringProperties = getProperties(src, version); Map<String, Serializable> stringProperties = getProperties(src, version);
OutputStream out = service.send(ticket, dstPath, src.getGuid(), encoding, mimeType, stringAspects, stringProperties); OutputStream out = service.send(ticket, create, dstPath, src.getGuid(), encoding, mimeType, stringAspects, stringProperties);
try try
{ {