Merge WCM_WDR_MER TO HEAD

MOB-399 Implementation of Deploymemnt Engine
     MOB-669
     MOB-630
     Revisions 14181 - 14539 merged,,

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14543 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2009-06-04 20:57:18 +00:00
parent 5cd055bbd7
commit eeb22722a8
15 changed files with 759 additions and 337 deletions

View File

@@ -418,8 +418,18 @@ public class AVMDeployWebsiteAction extends ActionExecuterAbstractBase
logger.debug("Performing Alfresco deployment to " + host + ":" + port +
" using deploymentserver: " + serverProps);
this.deployService.deployDifference(version, path, host, port,
remoteUsername, remotePassword, targetPath, regexMatcher, true, false, false, callbacks);
this.deployService.deployDifference(version,
path,
host,
port,
remoteUsername,
remotePassword,
targetPath,
regexMatcher,
true,
false,
false,
callbacks);
}
}
catch (Throwable err)

View File

@@ -126,7 +126,7 @@ public class BulkLoader
catch (IOException e)
{
e.printStackTrace(System.err);
throw new AVMException("I/O Error");
throw new AVMException("I/O Error", e);
}
}
}

View File

@@ -119,10 +119,10 @@ public class ASRDeploymentTest extends AVMServiceTestBase
String buffyText = "This is test data: Buffy the Vampire Slayer is an Emmy Award-winning and Golden Globe-nominated American cult television series that aired from March 10, 1997 until May 20, 2003. The series was created in 1997 by writer-director Joss Whedon under his production tag, Mutant Enemy Productions with later co-executive producers being Jane Espenson, David Fury, and Marti Noxon. The series narrative follows Buffy Summers (played by Sarah Michelle Gellar), the latest in a line of young women chosen by fate to battle against vampires, demons, and the forces of darkness as the Slayer. Like previous Slayers, Buffy is aided by a Watcher, who guides and trains her. Unlike her predecessors, Buffy surrounds herself with a circle of loyal friends who become known as the Scooby Gang.";
fService.createFile("main:/a/b", "buffy").close();
writer = fService.getContentWriter("main:/a/b/buffy");
// Force a conversion
writer.setEncoding("UTF-16");
writer.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
writer.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
writer.putContent(buffyText);
fService.createFile("main:/a/b", "fudge.bak").close();
@@ -144,14 +144,14 @@ public class ASRDeploymentTest extends AVMServiceTestBase
assertTrue("first deployment no start", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.START, null, destRef)));
assertTrue("first deployment no finish", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.END, null, destRef)));
assertTrue("first deployment wrong size", firstDeployment.size() == 11);
assertTrue("Update missing: /a", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, destRef + "/a")));
assertTrue("Update missing: /a/b", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, destRef + "/a/b")));
assertTrue("Update missing: /a/b/c", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, destRef + "/a/b/c")));
assertTrue("Update missing: /d/e", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, destRef + "/d/e")));
assertTrue("Update missing: /a/b/c/foo", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, destRef + "/a/b/c/foo")));
assertTrue("Update missing: /a/b/c/bar", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, destRef + "/a/b/c/bar")));
assertTrue("Update missing: /a/b/buffy", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, destRef + "/a/b/buffy")));
assertFalse("Fudge has not been excluded", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, destRef + "/a/b/fudge.bak")));
assertTrue("Update missing: /a", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, destRef + "/a")));
assertTrue("Update missing: /a/b", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, destRef + "/a/b")));
assertTrue("Update missing: /a/b/c", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, destRef + "/a/b/c")));
assertTrue("Update missing: /d/e", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, destRef + "/d/e")));
assertTrue("Update missing: /a/b/c/foo", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, destRef + "/a/b/c/foo")));
assertTrue("Update missing: /a/b/c/bar", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, destRef + "/a/b/c/bar")));
assertTrue("Update missing: /a/b/buffy", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, destRef + "/a/b/buffy")));
assertFalse("Fudge has not been excluded", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, destRef + "/a/b/fudge.bak")));
// Check that files exist in the destination AVM Store
{

View File

@@ -43,6 +43,8 @@ public class DeploymentClientOutputStream extends OutputStream
private String fOutputToken;
private boolean open = true;
/**
* Make one up.
* @param transport
@@ -75,7 +77,11 @@ public class DeploymentClientOutputStream extends OutputStream
@Override
public void close() throws IOException
{
// NO OP
if(open)
{
fTransport.finishSend(fTicket, fOutputToken);
}
open = false;
}
/* (non-Javadoc)

View File

@@ -27,9 +27,13 @@ package org.alfresco.repo.deploy;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.io.Serializable;
import org.alfresco.deployment.DeploymentReceiverService;
import org.alfresco.deployment.DeploymentReceiverTransport;
import org.alfresco.deployment.DeploymentToken;
import org.alfresco.deployment.FileDescriptor;
/**
@@ -68,9 +72,17 @@ public class DeploymentReceiverServiceClient implements
/* (non-Javadoc)
* @see org.alfresco.deployment.DeploymentReceiverService#begin(java.lang.String, java.lang.String, java.lang.String)
*/
public String begin(String target, String user, String password)
public DeploymentToken begin(String target, String storeName, int version, String user, String password)
{
return fTransport.begin(target, user, password);
return fTransport.begin(target, storeName, version, user, password);
}
/* (non-Javadoc)
* @see org.alfresco.deployment.DeploymentReceiverService#commit(java.lang.String)
*/
public void prepare(String ticket)
{
fTransport.prepare(ticket);
}
/* (non-Javadoc)
@@ -109,17 +121,17 @@ public class DeploymentReceiverServiceClient implements
/* (non-Javadoc)
* @see org.alfresco.deployment.DeploymentReceiverService#mkdir(java.lang.String, java.lang.String, java.lang.String)
*/
public void mkdir(String ticket, String path, String guid)
public void createDirectory(String ticket, String path, String guid, Set<String>aspects, Map<String, Serializable> properties)
{
fTransport.mkdir(ticket, path, guid);
fTransport.createDirectory(ticket, path, guid, aspects, properties);
}
/* (non-Javadoc)
* @see org.alfresco.deployment.DeploymentReceiverService#send(java.lang.String, java.lang.String, java.lang.String)
*/
public OutputStream send(String ticket, String path, String guid)
public OutputStream send(String ticket, String path, String guid, String encoding, String mimeType, Set<String>aspects, Map<String, Serializable> props)
{
String outputToken = fTransport.getSendToken(ticket, path, guid);
String outputToken = fTransport.getSendToken(ticket, path, guid, encoding, mimeType, aspects, props);
return new DeploymentClientOutputStream(fTransport, ticket, outputToken);
}
@@ -131,8 +143,8 @@ public class DeploymentReceiverServiceClient implements
fTransport.shutDown(user, password);
}
public void setGuid(String ticket, String path, String guid)
public void updateDirectory(String ticket, String path, String guid, Set<String>aspects, Map<String, Serializable> props)
{
fTransport.setGuid(ticket, path, guid);
fTransport.updateDirectory(ticket, path, guid, aspects, props);
}
}

View File

@@ -180,14 +180,14 @@ public class FSDeploymentTest extends AVMServiceTestBase
assertTrue("first deployment no start", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.START, null, TEST_TARGET)));
assertTrue("first deployment no finish", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.END, null, TEST_TARGET)));
assertTrue("first deployment wrong size", firstDeployment.size() == 11);
assertTrue("Update missing: /a", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, "/a")));
assertTrue("Update missing: /a/b", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, "/a/b")));
assertTrue("Update missing: /a/b/c", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, "/a/b/c")));
assertTrue("Update missing: /d/e", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, "/d/e")));
assertTrue("Update missing: /a/b/c/foo", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, "/a/b/c/foo")));
assertTrue("Update missing: /a/b/c/bar", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, "/a/b/c/bar")));
assertTrue("Update missing: /a/b/buffy", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, "/a/b/buffy")));
assertFalse("Fudge has not been excluded", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, "/a/b/fudge.bak")));
assertTrue("Update missing: /a", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, "/a")));
assertTrue("Update missing: /a/b", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, "/a/b")));
assertTrue("Update missing: /a/b/c", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, "/a/b/c")));
assertTrue("Update missing: /d/e", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, "/d/e")));
assertTrue("Update missing: /a/b/c/foo", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, "/a/b/c/foo")));
assertTrue("Update missing: /a/b/c/bar", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, "/a/b/c/bar")));
assertTrue("Update missing: /a/b/buffy", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, "/a/b/buffy")));
assertFalse("Fudge has not been excluded", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, "/a/b/fudge.bak")));
// Check that files exist on target
File target = new File("target");
@@ -342,7 +342,7 @@ public class FSDeploymentTest extends AVMServiceTestBase
Set<DeploymentEvent> firstDeployment = new HashSet<DeploymentEvent>();
firstDeployment.addAll(report.getEvents());
assertTrue("Update missing: /a/test02.html", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, "/a/test02.html")));
assertTrue("Update missing: /a/test02.html", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, "/a/test02.html")));
assertTrue("delete missing: /a/test03.html", firstDeployment.contains(new DeploymentEvent(DeploymentEvent.Type.DELETED, null, "/a/test03.html")));
@@ -409,7 +409,7 @@ public class FSDeploymentTest extends AVMServiceTestBase
{
System.out.println(event);
}
assertTrue("Update missing", smallUpdate.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, "/a/b/fudge.bak")));
assertTrue("Update missing", smallUpdate.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, "/a/b/fudge.bak")));
assertEquals(5, smallUpdate.size());
}
@@ -455,7 +455,7 @@ public class FSDeploymentTest extends AVMServiceTestBase
{
System.out.println(event);
}
assertTrue("Update missing", smallUpdate.contains(new DeploymentEvent(DeploymentEvent.Type.COPIED, null, "/a/b/Zander")));
assertTrue("Update missing", smallUpdate.contains(new DeploymentEvent(DeploymentEvent.Type.CREATED, null, "/a/b/Zander")));
assertTrue("Update missing", smallUpdate.contains(new DeploymentEvent(DeploymentEvent.Type.DELETED, null, "/a/b/Drusilla")));
assertTrue("Update missing", smallUpdate.contains(new DeploymentEvent(DeploymentEvent.Type.DELETED, null, "/a/b/Master")));
assertEquals(5, smallUpdate.size());

View File

@@ -78,6 +78,7 @@ public interface JobLockService
* make use of retrying; the lock is actually being refreshed and will therefore never
* become valid if it doesn't refresh directly.
*
* @param timeToLive the time (in milliseconds) for the lock to remain valid
* @param retryWait the time (in milliseconds) to wait before trying again
* @param retryCount the maximum number of times to attempt the lock acquisition
* @throws LockAcquisitionException if the lock could not be acquired

View File

@@ -43,7 +43,7 @@ public class DeploymentEvent implements Serializable
*/
public static enum Type implements Serializable
{
COPIED, // Copied a source node that did not exist on the destination.
CREATED, // Copied a source node that did not exist on the destination.
UPDATED, // Overwrote the destination.
DELETED, // Deleted the destination node.
START, // A Deployment has begun.