Author: rhauch
Date: 2009-05-21 12:44:53 -0400 (Thu, 21 May 2009)
New Revision: 918
Modified:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/inmemory/InMemoryRequestProcessor.java
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/processor/RequestProcessor.java
trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/MockRepositoryRequestProcessor.java
trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
trunk/extensions/dna-connector-jbosscache/src/main/java/org/jboss/dna/connector/jbosscache/JBossCacheRequestProcessor.java
trunk/extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/basic/BasicRequestProcessor.java
Log:
DNA-252 Complete support for events to the connector framework
Changed the name of the method in RequestProcessor to record an event, hopefully making it
a little easier to understand what it is doing when reading the code.
Modified:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/inmemory/InMemoryRequestProcessor.java
===================================================================
---
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/inmemory/InMemoryRequestProcessor.java 2009-05-21
16:44:06 UTC (rev 917)
+++
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/inmemory/InMemoryRequestProcessor.java 2009-05-21
16:44:53 UTC (rev 918)
@@ -135,7 +135,7 @@
Location oldLocation = getActualLocation(request.from().getPath(), node);
Location newLocation = Location.create(newPath, newNode.getUuid());
request.setActualLocations(oldLocation, newLocation);
- record(request);
+ recordChange(request);
}
@Override
@@ -197,7 +197,7 @@
}
Location actualLocation = getActualLocation(path, node);
request.setActualLocationOfNode(actualLocation);
- record(request);
+ recordChange(request);
}
@Override
@@ -209,7 +209,7 @@
workspace.removeNode(getExecutionContext(), node);
Location actualLocation = getActualLocation(request.at().getPath(), node);
request.setActualLocationOfNode(actualLocation);
- record(request);
+ recordChange(request);
}
@Override
@@ -228,7 +228,7 @@
Location oldLocation = getActualLocation(request.from().getPath(), node);
Location newLocation = Location.create(newPath, newParent.getUuid());
request.setActualLocations(oldLocation, newLocation);
- record(request);
+ recordChange(request);
}
@Override
@@ -250,7 +250,7 @@
}
Location actualLocation = getActualLocation(request.on().getPath(), node);
request.setActualLocationOfNode(actualLocation);
- record(request);
+ recordChange(request);
}
/**
@@ -271,7 +271,7 @@
InMemoryNode root = workspace.getRoot();
request.setActualRootLocation(Location.create(pathFactory.createRootPath(),
root.getUuid()));
request.setActualWorkspaceName(workspace.getName());
- record(request);
+ recordChange(request);
}
}
@@ -286,7 +286,7 @@
if (workspace != null) {
InMemoryNode root = workspace.getRoot();
request.setActualRootLocation(Location.create(pathFactory.createRootPath(),
root.getUuid()));
- record(request);
+ recordChange(request);
} else {
String msg =
GraphI18n.workspaceDoesNotExistInRepository.text(request.workspaceName(),
repository.getSourceName());
request.setError(new InvalidWorkspaceException(msg));
@@ -367,7 +367,7 @@
InMemoryNode root = target.getRoot();
request.setActualRootLocation(Location.create(pathFactory.createRootPath(),
root.getUuid()));
request.setActualWorkspaceName(target.getName());
- record(request);
+ recordChange(request);
}
}
Modified:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/processor/RequestProcessor.java
===================================================================
---
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/processor/RequestProcessor.java 2009-05-21
16:44:06 UTC (rev 917)
+++
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/processor/RequestProcessor.java 2009-05-21
16:44:53 UTC (rev 918)
@@ -121,7 +121,7 @@
*
* @param request the completed change request; may not be null
*/
- protected void record( ChangeRequest request ) {
+ protected void recordChange( ChangeRequest request ) {
assert request != null;
assert !request.isCancelled();
assert !request.hasError();
Modified:
trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/MockRepositoryRequestProcessor.java
===================================================================
---
trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/MockRepositoryRequestProcessor.java 2009-05-21
16:44:06 UTC (rev 917)
+++
trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/MockRepositoryRequestProcessor.java 2009-05-21
16:44:53 UTC (rev 918)
@@ -100,7 +100,7 @@
*/
@Override
public void process( CreateWorkspaceRequest request ) {
- record(request);
+ recordChange(request);
}
/**
@@ -110,7 +110,7 @@
*/
@Override
public void process( CloneWorkspaceRequest request ) {
- record(request);
+ recordChange(request);
}
/**
@@ -120,7 +120,7 @@
*/
@Override
public void process( DestroyWorkspaceRequest request ) {
- record(request);
+ recordChange(request);
}
/**
@@ -130,7 +130,7 @@
*/
@Override
public void process( CopyBranchRequest request ) {
- record(request);
+ recordChange(request);
}
/**
@@ -140,7 +140,7 @@
*/
@Override
public void process( CreateNodeRequest request ) {
- record(request);
+ recordChange(request);
}
/**
@@ -150,7 +150,7 @@
*/
@Override
public void process( DeleteBranchRequest request ) {
- record(request);
+ recordChange(request);
}
/**
@@ -160,7 +160,7 @@
*/
@Override
public void process( MoveBranchRequest request ) {
- record(request);
+ recordChange(request);
}
/**
@@ -190,7 +190,7 @@
*/
@Override
public void process( UpdatePropertiesRequest request ) {
- record(request);
+ recordChange(request);
}
/**
@@ -250,7 +250,7 @@
*/
@Override
public void process( RemovePropertyRequest request ) {
- record(request);
+ recordChange(request);
}
/**
@@ -260,7 +260,7 @@
*/
@Override
public void process( RenameNodeRequest request ) {
- record(request);
+ recordChange(request);
}
/**
@@ -270,7 +270,7 @@
*/
@Override
public void process( SetPropertyRequest request ) {
- record(request);
+ recordChange(request);
}
/**
Modified:
trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java
===================================================================
---
trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java 2009-05-21
16:44:06 UTC (rev 917)
+++
trunk/extensions/dna-connector-filesystem/src/main/java/org/jboss/dna/connector/filesystem/FileSystemRequestProcessor.java 2009-05-21
16:44:53 UTC (rev 918)
@@ -414,7 +414,7 @@
request.setActualWorkspaceName(getCanonicalWorkspaceName(directory));
request.setActualRootLocation(Location.create(pathFactory().createRootPath()));
availableWorkspaceNames.add(workspaceName);
- record(request);
+ recordChange(request);
} else {
request.setError(new
InvalidWorkspaceException(FileSystemI18n.workspaceDoesNotExist.text(workspaceName)));
}
@@ -437,7 +437,7 @@
request.setError(new
InvalidWorkspaceException(FileSystemI18n.workspaceDoesNotExist.text(workspaceName)));
} else {
request.setActualRootLocation(Location.create(pathFactory().createRootPath()));
- record(request);
+ recordChange(request);
}
}
Modified:
trunk/extensions/dna-connector-jbosscache/src/main/java/org/jboss/dna/connector/jbosscache/JBossCacheRequestProcessor.java
===================================================================
---
trunk/extensions/dna-connector-jbosscache/src/main/java/org/jboss/dna/connector/jbosscache/JBossCacheRequestProcessor.java 2009-05-21
16:44:06 UTC (rev 917)
+++
trunk/extensions/dna-connector-jbosscache/src/main/java/org/jboss/dna/connector/jbosscache/JBossCacheRequestProcessor.java 2009-05-21
16:44:53 UTC (rev 918)
@@ -183,7 +183,7 @@
}
Path nodePath = pathFactory.create(parent, newSegment);
request.setActualLocationOfNode(Location.create(nodePath));
- record(request);
+ recordChange(request);
}
@Override
@@ -215,7 +215,7 @@
node.put(propName, value);
}
request.setActualLocationOfNode(Location.create(nodePath));
- record(request);
+ recordChange(request);
}
@Override
@@ -252,7 +252,7 @@
Path newPath = pathFactory.create(newParentPath, newSegment);
request.setActualLocations(Location.create(nodePath), Location.create(newPath));
- record(request);
+ recordChange(request);
}
@Override
@@ -269,7 +269,7 @@
if (cache.removeNode(node.getFqn())) {
removeFromChildList(cache, parent, nameOfRemovedNode,
getExecutionContext());
request.setActualLocationOfNode(Location.create(nodePath));
- record(request);
+ recordChange(request);
} else {
String msg =
JBossCacheConnectorI18n.unableToDeleteBranch.text(getSourceName(), request.inWorkspace(),
nodePath);
request.setError(new RepositorySourceException(msg));
@@ -303,7 +303,7 @@
Path newPath = pathFactory.create(newParentPath, newSegment);
request.setActualLocations(Location.create(nodePath), Location.create(newPath));
- record(request);
+ recordChange(request);
}
/**
@@ -371,7 +371,7 @@
}
request.setActualRootLocation(Location.create(pathFactory.createRootPath()));
request.setActualWorkspaceName(workspaceName);
- record(request);
+ recordChange(request);
}
/**
@@ -421,7 +421,7 @@
// Copy the list of child segments in the root (this maintains the order of the
children) ...
Path.Segment[] childNames =
(Path.Segment[])fromRoot.get(JBossCacheLexicon.CHILD_PATH_SEGMENT_LIST);
intoRoot.put(JBossCacheLexicon.CHILD_PATH_SEGMENT_LIST, childNames);
- record(request);
+ recordChange(request);
}
/**
@@ -438,7 +438,7 @@
return;
}
request.setActualRootLocation(Location.create(pathFactory.createRootPath()));
- record(request);
+ recordChange(request);
}
//
----------------------------------------------------------------------------------------------------------------
Modified:
trunk/extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/basic/BasicRequestProcessor.java
===================================================================
---
trunk/extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/basic/BasicRequestProcessor.java 2009-05-21
16:44:06 UTC (rev 917)
+++
trunk/extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/basic/BasicRequestProcessor.java 2009-05-21
16:44:53 UTC (rev 918)
@@ -952,7 +952,7 @@
return;
}
if (actualLocation != null) request.setActualLocationOfNode(actualLocation);
- record(request);
+ recordChange(request);
}
/**
@@ -1238,7 +1238,7 @@
return;
}
request.setActualLocations(actualFromLocation, actualToLocation);
- record(request);
+ recordChange(request);
}
/**
@@ -1252,7 +1252,7 @@
Location location = delete(request, request.at(), request.inWorkspace(), true);
if (location != null) {
request.setActualLocationOfNode(location);
- record(request);
+ recordChange(request);
}
}
@@ -1267,7 +1267,7 @@
Location location = delete(request, request.at(), request.inWorkspace(), false);
if (location != null) {
request.setActualLocationOfNode(location);
- record(request);
+ recordChange(request);
}
}
@@ -1484,7 +1484,7 @@
return;
}
request.setActualLocations(actualOldLocation, actualNewLocation);
- record(request);
+ recordChange(request);
}
/**
@@ -1557,7 +1557,7 @@
// Create the root node ...
Location root = Location.create(pathFactory.createRootPath());
request.setActualRootLocation(getActualLocation(entity.getId(), root).location);
- record(request);
+ recordChange(request);
}
/**
@@ -1657,7 +1657,7 @@
// Finish up the request ...
Location root = Location.create(pathFactory.createRootPath(), rootNodeUuid);
request.setActualRootLocation(getActualLocation(intoWorkspace.getId(),
root).location);
- record(request);
+ recordChange(request);
}
/**
@@ -1697,7 +1697,7 @@
// Finish the request ...
request.setActualRootLocation(actual.location);
- record(request);
+ recordChange(request);
}
/**