exo-jcr SVN: r818 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2009-11-24 03:57:13 -0500 (Tue, 24 Nov 2009)
New Revision: 818
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
Log:
EXOJCR-246: JBossCacheStorageConnection exception throwing updated
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-24 08:44:16 UTC (rev 817)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-24 08:57:13 UTC (rev 818)
@@ -309,10 +309,16 @@
Fqn<String> propUUID = makePropFqn(data.getIdentifier());
Node<Serializable, Object> prop = propsRoot.getChild(propUUID);
+ if (prop == null)
+ {
+ throw new InvalidItemStateException("Property doesn't exist or removed by another Session "
+ + data.getQPath().getAsString());
+ }
PropertyData prevData = (PropertyData)prop.get(ITEM_DATA);
if (prevData == null)
{
- throw new RepositoryException("FATAL PropertyData already empty " + data.getQPath().getAsString());
+ throw new InvalidItemStateException("FATAL. Property record exist but PropertyData already empty "
+ + data.getQPath().getAsString());
}
// REFERENCEs handling
@@ -851,7 +857,7 @@
Node<Serializable, Object> parent = nodesRoot.getChild(makeNodeFqn(data.getParentIdentifier()));
if (parent == null)
{
- throw new RepositoryException("FATAL Node's parent not found " + data.getQPath().getAsString());
+ throw new InvalidItemStateException("FATAL Node's parent not found " + data.getQPath().getAsString());
}
// update child on Parent
@@ -1163,7 +1169,7 @@
if (!refParent.removeChild(propId))
{
- throw new RepositoryException("FATAL Reference property was not removed from REFS table of node "
+ throw new InvalidItemStateException("Reference property was not removed from REFS table of node "
+ nodeId);
}
@@ -1171,7 +1177,7 @@
{
if (!refsRoot.removeChild(makeNodeFqn(nodeId)))
{
- throw new RepositoryException("FATAL Node record was node removed from REFS table " + nodeId);
+ throw new InvalidItemStateException("Node record was node removed from REFS table " + nodeId);
}
}
}
16 years, 8 months
exo-jcr SVN: r817 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2009-11-24 03:44:16 -0500 (Tue, 24 Nov 2009)
New Revision: 817
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
Log:
EXOJCR-246: JBossCacheStorageConnection references fixed
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-24 08:28:08 UTC (rev 816)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-24 08:44:16 UTC (rev 817)
@@ -214,37 +214,8 @@
// REFERENCEs hadnling
if (data.getType() == PropertyType.REFERENCE)
{
- Fqn propIdentifier = Fqn.fromElements(data.getIdentifier());
-
- for (ValueData value : data.getValues())
- {
-
- String refNodeUUID;
- try
- {
- refNodeUUID = ValueDataConvertor.readString(value);
- }
- catch (UnsupportedEncodingException e)
- {
- throw new RepositoryException(e);
- }
- catch (IOException e)
- {
- throw new RepositoryException(e);
- }
-
- Fqn<String> refNode = makeNodeFqn(refNodeUUID);
-
- // add to $REFS map
- Node<Serializable, Object> refParent = refsRoot.getChild(refNode);
- if (refParent == null)
- {
- refParent = refsRoot.addChild(refNode);
- }
-
- refParent.addChild(propIdentifier);
- }
- }
+ addReferences(data);
+ }
}
/**
@@ -344,6 +315,12 @@
throw new RepositoryException("FATAL PropertyData already empty " + data.getQPath().getAsString());
}
+ // REFERENCEs handling
+ if (prevData.getType() == PropertyType.REFERENCE)
+ {
+ removeReferences(prevData);
+ }
+
// remove from parent's properties attributes
// TODO validate does deleted
if (parent.remove(data.getQPath().getName().getAsString()) == null)
@@ -357,69 +334,7 @@
{
LOG.warn("Property want not deleted " + data.getQPath().getAsString());
}
-
- // REFERENCEs handling
- if (prevData.getType() == PropertyType.REFERENCE)
- {
- // get values from cahce
- Set<String> remNodes = new HashSet<String>();
-
- for (ValueData value : prevData.getValues())
- {
- try
- {
- remNodes.add(ValueDataConvertor.readString(value));
- }
- catch (UnsupportedEncodingException e)
- {
- throw new RepositoryException(e);
- }
- catch (IOException e)
- {
- throw new RepositoryException(e);
- }
- }
-
- for (String refNodeUUID : remNodes)
- {
- // remove property from referencedNode in $REFS map
- Node<Serializable, Object> refParent = refsRoot.getChild(makeNodeFqn(refNodeUUID));
-
- if (refParent != null)
- {
- if (refParent.hasChild(propUUID))
- {
- // do we need remove node record also
- boolean removeParent = (refParent.getChildrenNames().size() == 1);
-
- if (!refParent.removeChild(propUUID))
- {
- throw new RepositoryException("FATAL Reference property was not removed from REFS table of node "
- + refNodeUUID);
- }
-
- if (removeParent)
- {
- if (!refsRoot.removeChild(makeNodeFqn(refNodeUUID)))
- {
- throw new RepositoryException("FATAL Node record was node removed from REFS table "
- + refNodeUUID);
- }
- }
- }
- else
- {
- LOG.warn("Property reference " + data.getIdentifier() + " to node " + refNodeUUID
- + " was already removed.");
- }
- }
- else
- {
- LOG.warn("Reference record of node " + refNodeUUID + " was already removed.");
- }
- }
- }
}
/**
@@ -1010,96 +925,14 @@
throw new RepositoryException("FATAL Previous Property data is null. Parent " + data.getQPath().getAsString());
}
- // update data
- prop.put(ITEM_DATA, data);
-
// REFERENCEs handling
if (prevData.getType() == PropertyType.REFERENCE || data.getType() == PropertyType.REFERENCE)
{
- // get Set of old values
- Set<String> removeSet = new HashSet<String>();
- if (prevData.getType() == PropertyType.REFERENCE)
- {
- for (ValueData value : prevData.getValues())
- {
- try
- {
- removeSet.add(ValueDataConvertor.readString(value));
- }
- catch (UnsupportedEncodingException e)
- {
- throw new RepositoryException(e);
- }
- catch (IOException e)
- {
- throw new RepositoryException(e);
- }
- }
- }
+ updateReferences(prevData, data);
+ }
- // check new
- Set<String> addSet = new HashSet<String>();
- if (data.getType() == PropertyType.REFERENCE)
- {
- for (ValueData value : data.getValues())
- {
- try
- {
- addSet.add(ValueDataConvertor.readString(value));
- }
- catch (UnsupportedEncodingException e)
- {
- throw new RepositoryException(e);
- }
- catch (IOException e)
- {
- throw new RepositoryException(e);
- }
- }
- }
-
- String[] added = new String[addSet.size()];
- addSet.toArray(added);
-
- for (String id : added)
- {
- if (removeSet.contains(id))
- {
- removeSet.remove(id);
- addSet.remove(id);
- }
- }
-
- // remove references to nodes
- for (String id : removeSet)
- {
- Node<Serializable, Object> node = refsRoot.getChild(Fqn.fromElements(id));
- if (!node.removeChild(propFqn))
- {
- throw new RepositoryException("FATAL Reference property was not removed from REFS table of node " + id);
- }
-
- // check node
- if (node.getChildrenNames().size() == 0)
- {
- //TODO remove children
- refsRoot.removeChild(Fqn.fromElements(id));
- }
- }
-
- // add references to nodes
- for (String id : addSet)
- {
- Fqn nodeFqn = Fqn.fromElements(id);
- Node<Serializable, Object> node = refsRoot.getChild(nodeFqn);
-
- if (node == null)
- {
- node = refsRoot.addChild(nodeFqn);
- }
- node.addChild(propFqn);
- }
- }
+ // update data
+ prop.put(ITEM_DATA, data);
}
/**
@@ -1177,11 +1010,182 @@
}
}
- private void removePropertyReferenceToNode(String nodeId, Fqn propFqn)
+ private void removeReferences(PropertyData prevData) throws RepositoryException
{
+ // get values from cahce
+ Set<String> remNodes = new HashSet<String>();
+ for (ValueData value : prevData.getValues())
+ {
+ try
+ {
+ remNodes.add(ValueDataConvertor.readString(value));
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ throw new RepositoryException(e);
+ }
+ catch (IOException e)
+ {
+ throw new RepositoryException(e);
+ }
+ }
+ String propUUID = prevData.getIdentifier();
+ for (String refNodeUUID : remNodes)
+ {
+ removePropertyReferenceToNode(refNodeUUID, propUUID);
+ }
}
+ private void addReferences(PropertyData data) throws RepositoryException
+ {
+ Fqn propIdentifier = Fqn.fromElements(data.getIdentifier());
+
+ for (ValueData value : data.getValues())
+ {
+
+ String refNodeUUID;
+ try
+ {
+ refNodeUUID = ValueDataConvertor.readString(value);
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ throw new RepositoryException(e);
+ }
+ catch (IOException e)
+ {
+ throw new RepositoryException(e);
+ }
+
+ Fqn<String> refNode = makeNodeFqn(refNodeUUID);
+
+ // add to $REFS map
+ Node<Serializable, Object> refParent = refsRoot.getChild(refNode);
+ if (refParent == null)
+ {
+ refParent = refsRoot.addChild(refNode);
+ }
+
+ refParent.addChild(propIdentifier);
+ }
+ }
+
+ private void updateReferences(PropertyData prevData, PropertyData newData) throws RepositoryException
+ {
+ // get Set of old values
+ Set<String> removeSet = new HashSet<String>();
+ if (prevData.getType() == PropertyType.REFERENCE)
+ {
+ for (ValueData value : prevData.getValues())
+ {
+ try
+ {
+ removeSet.add(ValueDataConvertor.readString(value));
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ throw new RepositoryException(e);
+ }
+ catch (IOException e)
+ {
+ throw new RepositoryException(e);
+ }
+ }
+ }
+
+ // check new
+ Set<String> addSet = new HashSet<String>();
+ if (newData.getType() == PropertyType.REFERENCE)
+ {
+ for (ValueData value : newData.getValues())
+ {
+ try
+ {
+ addSet.add(ValueDataConvertor.readString(value));
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ throw new RepositoryException(e);
+ }
+ catch (IOException e)
+ {
+ throw new RepositoryException(e);
+ }
+ }
+ }
+
+ String[] added = new String[addSet.size()];
+ addSet.toArray(added);
+
+ for (String id : added)
+ {
+ if (removeSet.contains(id))
+ {
+ removeSet.remove(id);
+ addSet.remove(id);
+ }
+ }
+
+ // remove references to nodes
+ for (String id : removeSet)
+ {
+ removePropertyReferenceToNode(id, newData.getIdentifier());
+ }
+
+ Fqn propFqn = Fqn.fromElements(newData.getIdentifier());
+
+ // add references to nodes
+ for (String id : addSet)
+ {
+ Fqn nodeFqn = Fqn.fromElements(id);
+ Node<Serializable, Object> node = refsRoot.getChild(nodeFqn);
+
+ if (node == null)
+ {
+ node = refsRoot.addChild(nodeFqn);
+ }
+ node.addChild(propFqn);
+ }
+ }
+
+ private void removePropertyReferenceToNode(String nodeId, String propId) throws RepositoryException
+ {
+ // remove property from referencedNode in $REFS map
+ Node<Serializable, Object> refParent = refsRoot.getChild(makeNodeFqn(nodeId));
+
+ if (refParent != null)
+ {
+ if (refParent.hasChild(propId))
+ {
+ // do we need remove node record also
+ boolean removeParent = (refParent.getChildrenNames().size() == 1);
+
+ if (!refParent.removeChild(propId))
+ {
+ throw new RepositoryException("FATAL Reference property was not removed from REFS table of node "
+ + nodeId);
+ }
+
+ if (removeParent)
+ {
+ if (!refsRoot.removeChild(makeNodeFqn(nodeId)))
+ {
+ throw new RepositoryException("FATAL Node record was node removed from REFS table " + nodeId);
+ }
+ }
+ }
+ else
+ {
+ LOG.warn("Property reference " + propId + " to node " + nodeId + " was already removed.");
+ }
+ }
+ else
+ {
+ LOG.warn("Reference record of node " + nodeId + " was already removed.");
+ }
+ }
+
/**
* @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getLockData(java.lang.String)
*/
16 years, 8 months
exo-jcr SVN: r816 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/core.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2009-11-24 03:28:08 -0500 (Tue, 24 Nov 2009)
New Revision: 816
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/TestMoveNode.java
Log:
EXOJCR-199: added test on node move and then delete
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/TestMoveNode.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/TestMoveNode.java 2009-11-24 07:45:22 UTC (rev 815)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/TestMoveNode.java 2009-11-24 08:28:08 UTC (rev 816)
@@ -30,8 +30,11 @@
import java.util.Random;
import javax.jcr.Node;
+import javax.jcr.NodeIterator;
import javax.jcr.PathNotFoundException;
import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NodeDefinition;
/**
* @author <a href="mailto:Sergey.Kabashnyuk@gmail.com">Sergey Kabashnyuk</a>
@@ -114,6 +117,47 @@
assertTrue(node2.isModified());
}
+ public void testMoveAndDelete() throws Exception
+ {
+ // +TestRoot
+ // +node1
+ // +node11
+ // +node2
+
+ // after move:
+
+ // +TestRoot
+ // +node1
+ // +node2
+ // +node11
+
+ // create structure
+ Node testRoot = root.addNode("TestRoot");
+ session.save();
+ Node node1 = testRoot.addNode("node1");
+ Node node2 = node1.addNode("node11");
+ Node node3 = testRoot.addNode("node2");
+ session.save();
+
+ // move
+ String newPath = node3.getPath() + "/" + node2.getName();
+ session.move(node2.getPath(), newPath);
+ session.save();
+
+ // try to remove /TestRoot
+ for (NodeIterator children = testRoot.getNodes(); children.hasNext();)
+ {
+ Node child = children.nextNode();
+ NodeDefinition nodeDef = child.getDefinition();
+ if (!nodeDef.isMandatory() && !nodeDef.isProtected())
+ {
+ child.remove();
+ }
+ }
+ session.save();
+
+ }
+
public void _testMoveAndRefreshTrue() throws Exception
{
Node node1 = root.addNode("node1");
16 years, 8 months
exo-jcr SVN: r815 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-11-24 02:45:22 -0500 (Tue, 24 Nov 2009)
New Revision: 815
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
Log:
EXOJCR-246: References handling on the end ofoperations
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-23 17:09:12 UTC (rev 814)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-24 07:45:22 UTC (rev 815)
@@ -196,6 +196,22 @@
+ data.getQPath().getAsString());
}
+ // add to parent's properties attr
+ String propName = data.getQPath().getName().getAsString();
+ if (parent.get(propName) == null)
+ {
+ parent.put(propName, data.getIdentifier());
+ }
+ else
+ {
+ throw new ItemExistsException("Property already exists " + data.getQPath().getAsString());
+ }
+
+ // add in PROPERTIES
+ Node<Serializable, Object> prop = propsRoot.addChild(makePropFqn(data.getIdentifier()));
+ prop.put(ITEM_DATA, data);
+
+ // REFERENCEs hadnling
if (data.getType() == PropertyType.REFERENCE)
{
Fqn propIdentifier = Fqn.fromElements(data.getIdentifier());
@@ -210,16 +226,14 @@
}
catch (UnsupportedEncodingException e)
{
- // TODO Auto-generated catch block
- throw new RepositoryException(e.getMessage(), e);
+ throw new RepositoryException(e);
}
catch (IOException e)
{
- // TODO Auto-generated catch block
- throw new RepositoryException(e.getMessage(), e);
+ throw new RepositoryException(e);
}
- Fqn refNode = makeNodeFqn(refNodeUUID);
+ Fqn<String> refNode = makeNodeFqn(refNodeUUID);
// add to $REFS map
Node<Serializable, Object> refParent = refsRoot.getChild(refNode);
@@ -230,23 +244,7 @@
refParent.addChild(propIdentifier);
}
-
- }
-
- // add to parent's properties attr
- String propName = data.getQPath().getName().getAsString();
- if (parent.get(propName) == null)
- {
- parent.put(propName, data.getIdentifier());
- }
- else
- {
- throw new ItemExistsException("Property already exists " + data.getQPath().getAsString());
- }
-
- // add in PROPERTIES
- Node<Serializable, Object> prop = propsRoot.addChild(makePropFqn(data.getIdentifier()));
- prop.put(ITEM_DATA, data);
+ }
}
/**
@@ -337,37 +335,49 @@
+ data.getQPath().getAsString());
}
- Fqn propUUID = makePropFqn(data.getIdentifier());
+ Fqn<String> propUUID = makePropFqn(data.getIdentifier());
Node<Serializable, Object> prop = propsRoot.getChild(propUUID);
- PropertyData oldData = (PropertyData)prop.get(ITEM_DATA);
- if (oldData == null)
+ PropertyData prevData = (PropertyData)prop.get(ITEM_DATA);
+ if (prevData == null)
{
throw new RepositoryException("FATAL PropertyData already empty " + data.getQPath().getAsString());
}
- if (oldData.getType() == PropertyType.REFERENCE)
+ // remove from parent's properties attributes
+ // TODO validate does deleted
+ if (parent.remove(data.getQPath().getName().getAsString()) == null)
{
+ throw new InvalidItemStateException("Property doesn't exist or deleted by another Session "
+ + data.getQPath().getAsString());
+ }
+
+ // remove from PROPERTIES
+ if (!propsRoot.removeChild(makePropFqn(data.getIdentifier())))
+ {
+ LOG.warn("Property want not deleted " + data.getQPath().getAsString());
+ }
+
+ // REFERENCEs handling
+ if (prevData.getType() == PropertyType.REFERENCE)
+ {
// get values from cahce
Set<String> remNodes = new HashSet<String>();
- for (ValueData value : oldData.getValues())
+ for (ValueData value : prevData.getValues())
{
-
try
{
remNodes.add(ValueDataConvertor.readString(value));
}
catch (UnsupportedEncodingException e)
{
- // TODO Auto-generated catch block
- throw new RepositoryException(e.getMessage(), e);
+ throw new RepositoryException(e);
}
catch (IOException e)
{
- // TODO Auto-generated catch block
- throw new RepositoryException(e.getMessage(), e);
+ throw new RepositoryException(e);
}
}
@@ -409,21 +419,7 @@
LOG.warn("Reference record of node " + refNodeUUID + " was already removed.");
}
}
- }
-
- // remove from parent's properties attributes
- // TODO validate does deleted
- if (parent.remove(data.getQPath().getName().getAsString()) == null)
- {
- throw new InvalidItemStateException("Property doesn't exist or deleted by another Session "
- + data.getQPath().getAsString());
- }
-
- // remove from PROPERTIES
- if (!propsRoot.removeChild(makePropFqn(data.getIdentifier())))
- {
- LOG.warn("Property want not deleted " + data.getQPath().getAsString());
- }
+ }
}
/**
@@ -826,8 +822,7 @@
* @param node Node - cache node containing root of JCR subtree.
* @throws RepositoryException on error state detected
*/
- protected void updateTreePath(Node<Serializable, Object> node, QPath rootPath)
- throws RepositoryException
+ protected void updateTreePath(Node<Serializable, Object> node, QPath rootPath) throws RepositoryException
{
QPath nodePath = rootPath;
@@ -846,12 +841,12 @@
{
// recreate with new path for child Nodes only
nodePath =
- QPath.makeChildPath(rootPath, prevData.getQPath().getEntries()[prevData.getQPath()
- .getEntries().length - 1]);
+ QPath.makeChildPath(rootPath,
+ prevData.getQPath().getEntries()[prevData.getQPath().getEntries().length - 1]);
TransientNodeData newData =
- new TransientNodeData(nodePath, prevData.getIdentifier(), prevData.getPersistedVersion(),
- prevData.getPrimaryTypeName(), prevData.getMixinTypeNames(), prevData
- .getOrderNumber(), prevData.getParentIdentifier(), prevData.getACL());
+ new TransientNodeData(nodePath, prevData.getIdentifier(), prevData.getPersistedVersion(), prevData
+ .getPrimaryTypeName(), prevData.getMixinTypeNames(), prevData.getOrderNumber(), prevData
+ .getParentIdentifier(), prevData.getACL());
newData.addState(TransientPropertyData.TRANSITIVE_PATH_UPDATED);
node.put(ITEM_DATA, newData);
}
@@ -878,11 +873,11 @@
// recreate the property data with new path
QPath newPath =
- QPath.makeChildPath(rootPath, prevData.getQPath().getEntries()[prevData.getQPath()
- .getEntries().length - 1]);
+ QPath.makeChildPath(rootPath,
+ prevData.getQPath().getEntries()[prevData.getQPath().getEntries().length - 1]);
TransientPropertyData newData =
- new TransientPropertyData(newPath, prevData.getIdentifier(), prevData.getPersistedVersion(),
- prevData.getType(), prevData.getParentIdentifier(), prevData.isMultiValued());
+ new TransientPropertyData(newPath, prevData.getIdentifier(), prevData.getPersistedVersion(), prevData
+ .getType(), prevData.getParentIdentifier(), prevData.isMultiValued());
newData.addState(TransientPropertyData.TRANSITIVE_PATH_UPDATED);
newData.setValues(prevData.getValues());
prop.put(ITEM_DATA, newData);
@@ -918,22 +913,6 @@
}
updateTreePath(childNode, nodePath);
-
- // TODO cleanup
- // NodeData cacheNodeData = (NodeData)childNode.get(ITEM_DATA);
- // if (cacheNodeData == null)
- // {
- // throw new RepositoryException("Child node data is null. Parent " + rootPath);
- // }
- //
- // // recreate child Node with new path
- // QPath newPath = QPath.makeChildPath(rootPath, cacheNodeData.getQPath().getName());
- // TransientNodeData newNodeData =
- // new TransientNodeData(newPath, cacheNodeData.getIdentifier(), cacheNodeData.getPersistedVersion(),
- // cacheNodeData.getPrimaryTypeName(), cacheNodeData.getMixinTypeNames(), cacheNodeData.getOrderNumber(),
- // cacheNodeData.getParentIdentifier(), cacheNodeData.getACL());
- // newNodeData.addState(TransientPropertyData.TRANSITIVE_PATH_UPDATED);
- // childNode.put(ITEM_DATA, newNodeData);
}
}
@@ -1028,13 +1007,16 @@
PropertyData prevData = (PropertyData)prop.get(ITEM_DATA);
if (prevData == null)
{
- throw new RepositoryException("FATAL Old Property data is null. Parent " + data.getQPath().getAsString());
+ throw new RepositoryException("FATAL Previous Property data is null. Parent " + data.getQPath().getAsString());
}
+ // update data
+ prop.put(ITEM_DATA, data);
+
+ // REFERENCEs handling
if (prevData.getType() == PropertyType.REFERENCE || data.getType() == PropertyType.REFERENCE)
{
-
- //get Set of old values
+ // get Set of old values
Set<String> removeSet = new HashSet<String>();
if (prevData.getType() == PropertyType.REFERENCE)
{
@@ -1046,13 +1028,11 @@
}
catch (UnsupportedEncodingException e)
{
- // TODO Auto-generated catch block
- throw new RepositoryException(e.getMessage(), e);
+ throw new RepositoryException(e);
}
catch (IOException e)
{
- // TODO Auto-generated catch block
- throw new RepositoryException(e.getMessage(), e);
+ throw new RepositoryException(e);
}
}
}
@@ -1069,13 +1049,11 @@
}
catch (UnsupportedEncodingException e)
{
- // TODO Auto-generated catch block
- throw new RepositoryException(e.getMessage(), e);
+ throw new RepositoryException(e);
}
catch (IOException e)
{
- // TODO Auto-generated catch block
- throw new RepositoryException(e.getMessage(), e);
+ throw new RepositoryException(e);
}
}
}
@@ -1122,9 +1100,6 @@
node.addChild(propFqn);
}
}
-
- // remove
- prop.put(ITEM_DATA, data);
}
/**
@@ -1187,7 +1162,7 @@
*/
public void close() throws IllegalStateException, RepositoryException
{
- // TODO Auto-generated method stub
+ // not actual
}
/**
16 years, 8 months
exo-jcr SVN: r814 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl: dataflow and 2 other directories.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-11-23 12:09:12 -0500 (Mon, 23 Nov 2009)
New Revision: 814
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
Log:
EXOJCR-245: node move new impl.
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2009-11-23 17:05:27 UTC (rev 813)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2009-11-23 17:09:12 UTC (rev 814)
@@ -29,7 +29,6 @@
import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager;
import org.exoplatform.services.jcr.core.nodetype.PropertyDefinitionData;
import org.exoplatform.services.jcr.dataflow.ItemState;
-import org.exoplatform.services.jcr.dataflow.LockPlainChangesLogImpl;
import org.exoplatform.services.jcr.dataflow.PlainChangesLog;
import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl;
import org.exoplatform.services.jcr.datamodel.Identifier;
@@ -58,7 +57,6 @@
import org.exoplatform.services.jcr.impl.dataflow.session.SessionChangesLog;
import org.exoplatform.services.jcr.impl.dataflow.session.TransactionableDataManager;
import org.exoplatform.services.jcr.impl.util.EntityCollection;
-import org.exoplatform.services.jcr.observation.ExtendedEvent;
import org.exoplatform.services.jcr.util.IdGenerator;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java 2009-11-23 17:05:27 UTC (rev 813)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java 2009-11-23 17:09:12 UTC (rev 814)
@@ -41,6 +41,26 @@
public abstract class TransientItemData implements MutableItemData, Externalizable
{
+ /**
+ * Transitive state: is not set.
+ */
+ public static final int TRANSITIVE_NONE = 0;
+
+ /**
+ * Transitive state: Item path updated.
+ */
+ public static final int TRANSITIVE_PATH_UPDATED = 1;
+
+ /**
+ * Transitive state: Node mixin updated.
+ */
+ public static final int TRANSITIVE_MIXIN_UPDATED = 2;
+
+ /**
+ * Transitive state: Node ACL updated.
+ */
+ public static final int TRANSITIVE_ACL_UPDATED = 4;
+
protected static final Log LOG = ExoLogger.getLogger("jcr.TransientItemData");
protected String identifier;
@@ -49,18 +69,28 @@
protected int persistedVersion;
+ /**
+ * For transitive state storing. Used in JBossCache.
+ */
+ protected int state = TRANSITIVE_NONE;
+
protected QPath qpath;
private int NOT_NULL_VALUE = 1;
private int NULL_VALUE = -1;
- // serializable --------------
+ /**
+ * Serializable TransientItemData constructor.
+ *
+ */
TransientItemData()
{
}
/**
+ * TransientItemData contructor.
+ *
* @param path QPath
* @param identifier id
* @param version persisted version
@@ -74,10 +104,8 @@
this.persistedVersion = version;
}
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
+ /**
+ * {@inheritDoc}
*/
@Override
public boolean equals(Object obj)
@@ -97,30 +125,24 @@
return false;
}
- /*
- * (non-Javadoc)
- *
- * @see org.exoplatform.services.jcr.datamodel.ItemData#getIdentifier()
+ /**
+ * {@inheritDoc}
*/
public String getIdentifier()
{
return identifier;
}
- /*
- * (non-Javadoc)
- *
- * @see org.exoplatform.services.jcr.datamodel.ItemData#getParentUUID()
+ /**
+ * {@inheritDoc}
*/
public String getParentIdentifier()
{
return parentIdentifier;
}
- /*
- * (non-Javadoc)
- *
- * @see org.exoplatform.services.jcr.datamodel.ItemData#getPersistedVersion()
+ /**
+ * {@inheritDoc}
*/
public int getPersistedVersion()
{
@@ -135,26 +157,52 @@
return qpath.getName();
}
- /*
- * (non-Javadoc)
- *
- * @see org.exoplatform.services.jcr.datamodel.ItemData#getQPath()
+ /**
+ * {@inheritDoc}
*/
public QPath getQPath()
{
return qpath;
}
- /*
- * (non-Javadoc)
- *
- * @see org.exoplatform.services.jcr.datamodel.MutableItemData#increasePersistedVersion()
+ /**
+ * {@inheritDoc}
*/
public void increasePersistedVersion()
{
this.persistedVersion++;
}
+ /**
+ * Return transitive state. Used in JBossCache.
+ *
+ * @return the state
+ */
+ public int getState()
+ {
+ return state;
+ }
+
+ /**
+ * Set transitive state. Used in JBossCache.
+ *
+ * @param state the state to set
+ */
+ public void setState(int state)
+ {
+ this.state = state;
+ }
+
+ /**
+ * Add transitive state to existing one using OR operation. Used in JBossCache.
+ *
+ * @param state the state to add to existing
+ */
+ public void addState(int state)
+ {
+ this.state = this.state | state;
+ }
+
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
byte[] buf;
@@ -195,6 +243,8 @@
}
persistedVersion = in.readInt();
+
+ state = in.readInt();
}
public void writeExternal(ObjectOutput out) throws IOException
@@ -216,6 +266,8 @@
out.writeInt(NULL_VALUE);
out.writeInt(persistedVersion);
+
+ out.writeInt(state);
}
}
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 2009-11-23 17:05:27 UTC (rev 813)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 2009-11-23 17:09:12 UTC (rev 814)
@@ -72,7 +72,7 @@
if (readOnly && !(changesLog instanceof ReadOnlyThroughChanges))
throw new ReadOnlyWorkspaceException("Workspace container '" + dataContainer.getName() + "' is read-only.");
- final Set<QPath> addedNodes = new HashSet<QPath>();
+ final Set<QPath> addedNodes = new HashSet<QPath>(); //TODO LOG.info(changesLog.dump());
WorkspaceStorageConnection thisConnection = null;
WorkspaceStorageConnection systemConnection = null;
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-23 17:05:27 UTC (rev 813)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-23 17:09:12 UTC (rev 814)
@@ -21,9 +21,12 @@
import org.exoplatform.services.jcr.datamodel.ItemData;
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.PropertyData;
+import org.exoplatform.services.jcr.datamodel.QPath;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.core.lock.LockData;
+import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
+import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
import org.exoplatform.services.jcr.impl.dataflow.ValueDataConvertor;
import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
import org.exoplatform.services.log.ExoLogger;
@@ -91,7 +94,7 @@
// helpers
@Deprecated
- protected NodeData getNodeData(Node<Serializable, Object> node)
+ protected ItemData readItemData(Node<Serializable, Object> node)
{
Object data = node.get(ITEM_DATA);
if (data != null)
@@ -110,7 +113,7 @@
Object freshData = freshNode.get(ITEM_DATA);
if (freshData != null)
{
- return (NodeData)freshData;
+ return (ItemData)freshData;
}
else
{
@@ -126,7 +129,7 @@
}
else
{
- return (NodeData)data;
+ return (ItemData)data;
}
}
else
@@ -451,6 +454,7 @@
throw new RepositoryException("FATAL Node record not found(" + nodeId
+ "), but listed in child nodes of " + parent.getQPath().getAsString());
}
+
NodeData nodeData = (NodeData)node.get(ITEM_DATA);
if (nodeData == null)
{
@@ -474,6 +478,11 @@
return childs;
}
+ /**
+ * Print tree of given node. For dev purpose only (TODO).
+ *
+ * @param node Node
+ */
private void treePrint(Node<Serializable, Object> node)
{
for (Node<Serializable, Object> child : node.getChildren())
@@ -550,7 +559,7 @@
*/
public List<PropertyData> listChildPropertiesData(NodeData parent) throws RepositoryException, IllegalStateException
{
- // TODO it's same as getChild... now
+ // TODO it's same as getChild... now, but should be without ValueData
return getChildPropertiesData(parent);
}
@@ -571,10 +580,10 @@
Node<Serializable, Object> node = nodesRoot.getChild(makeNodeFqn(nodeId));
if (node != null)
{
- Object itemData = node.get(ITEM_DATA);
+ NodeData itemData = (NodeData)node.get(ITEM_DATA);
if (itemData != null)
{
- return (NodeData)itemData;
+ return itemData;
}
else
{
@@ -650,10 +659,10 @@
Node<Serializable, Object> node = nodesRoot.getChild(makeNodeFqn(identifier));
if (node != null)
{
- Object itemData = node.get(ITEM_DATA);
+ NodeData itemData = (NodeData)node.get(ITEM_DATA);
if (itemData != null)
{
- return (NodeData)itemData;
+ return itemData;
}
else
{
@@ -724,57 +733,60 @@
{
//TODO we expecting that on session.move() there will be only one rename() method call
- // startBatch();
- //
- // String nodeId = data.getIdentifier();
- //
- // //1. Update renamed node and also get old nodeData
- // Node<Serializable, Object> node = nodesRoot.getChild(makeNodeFqn(nodeId));
- // if (node == null)
- // {
- // throw new InvalidItemStateException("Renamed node is not exist" + data.getQPath().getAsString());
- // }
- //
- // NodeData prevData = (NodeData)node.put(ITEM_DATA, data);
- // if (prevData == null)
- // {
- // throw new RepositoryException("FATAL NodeData is empty " + data.getQPath().getAsString());
- // }
- //
- // // 2. remove renamed node from child list of previous parent node
- // // check if parent is cached
- // Node<Serializable, Object> prevParent = nodesRoot.getChild(makeNodeFqn(prevData.getParentIdentifier()));
- // if (prevParent == null)
- // {
- // throw new InvalidItemStateException("Node's previous parent doesn't exist "
- // + prevData.getQPath().getAsString() + ". Node " + data.getQPath().getAsString());
- // }
- //
- // // remove node form old parent child list
- // if (!prevParent
- // .removeChild(makeChildNodeFqn(prevData.getQPath().getEntries()[prevData.getQPath().getEntries().length - 1])))
- // {
- // throw new RepositoryException("FATAL Node doesn't listed in children nodes of previous parent "
- // + prevData.getQPath().getAsString() + ". Node " + data.getQPath().getAsString());
- // }
- //
- // // 3. add node to child list of new parent node
- // // check if parent is cached
- // Node<Serializable, Object> newParent = nodesRoot.getChild(makeNodeFqn(data.getParentIdentifier()));
- // if (newParent == null)
- // {
- // throw new InvalidItemStateException("Node's new parent doesn't exist " + data.getParentIdentifier()
- // + ". Node " + data.getQPath().getAsString());
- // }
- //
- // // add child to Parent
- // Node<Serializable, Object> childNode =
- // newParent.addChild(makeChildNodeFqn(data.getQPath().getEntries()[data.getQPath().getEntries().length - 1]));
- //
- // // set child id attr
- // childNode.put(ITEM_ID, data.getIdentifier());
- //
- // // 4. update all child nodes
+ startBatch();
+
+ String nodeId = data.getIdentifier();
+
+ //1. Update renamed node and also get old nodeData
+ Node<Serializable, Object> node = nodesRoot.getChild(makeNodeFqn(nodeId));
+ if (node == null)
+ {
+ throw new InvalidItemStateException("Renamed node is not exist" + data.getQPath().getAsString());
+ }
+
+ NodeData prevData = (NodeData)node.put(ITEM_DATA, data);
+ if (prevData == null)
+ {
+ throw new RepositoryException("FATAL NodeData is empty " + data.getQPath().getAsString());
+ }
+
+ // 2. remove renamed node from child list of previous parent node
+ // check if parent is cached
+ Node<Serializable, Object> prevParent = nodesRoot.getChild(makeNodeFqn(prevData.getParentIdentifier()));
+ if (prevParent == null)
+ {
+ throw new InvalidItemStateException("Node's previous parent doesn't exist "
+ + prevData.getQPath().getAsString() + ". Node " + data.getQPath().getAsString());
+ }
+
+ // remove node form old parent child list
+ if (!prevParent
+ .removeChild(makeChildNodeFqn(prevData.getQPath().getEntries()[prevData.getQPath().getEntries().length - 1])))
+ {
+ throw new RepositoryException("FATAL Node doesn't listed in children nodes of previous parent "
+ + prevData.getQPath().getAsString() + ". Node " + data.getQPath().getAsString());
+ }
+
+ // 3. add node to child list of new parent node
+ // check if parent is cached
+ Node<Serializable, Object> newParent = nodesRoot.getChild(makeNodeFqn(data.getParentIdentifier()));
+ if (newParent == null)
+ {
+ throw new InvalidItemStateException("Node's new parent doesn't exist " + data.getParentIdentifier()
+ + ". Node " + data.getQPath().getAsString());
+ }
+
+ // add child to Parent
+ Node<Serializable, Object> childNode =
+ newParent.addChild(makeChildNodeFqn(data.getQPath().getEntries()[data.getQPath().getEntries().length - 1]));
+
+ // set child id attr
+ childNode.put(ITEM_ID, data.getIdentifier());
+
+ // 4. update all child nodes
+ updateTreePath(node, data.getQPath());//treePrint(node)
+
+ // TODO cleanup
// for (Node<Serializable, Object> child : node.getChildren())
// {
// String childNodeId = (String)child.get(ITEM_ID);
@@ -809,6 +821,123 @@
}
/**
+ * Update Nodes tree with new path.
+ *
+ * @param node Node - cache node containing root of JCR subtree.
+ * @throws RepositoryException on error state detected
+ */
+ protected void updateTreePath(Node<Serializable, Object> node, QPath rootPath)
+ throws RepositoryException
+ {
+ QPath nodePath = rootPath;
+
+ // update path of properties
+ for (Object key : node.getKeys())
+ {
+ if (key.equals(ITEM_DATA))
+ {
+ NodeData prevData = (NodeData)node.get(ITEM_DATA);
+ if (prevData == null)
+ {
+ throw new RepositoryException("FATAL Node data " + rootPath + " is empty at " + node.getFqn());
+ }
+
+ if (!prevData.getQPath().equals(nodePath))
+ {
+ // recreate with new path for child Nodes only
+ nodePath =
+ QPath.makeChildPath(rootPath, prevData.getQPath().getEntries()[prevData.getQPath()
+ .getEntries().length - 1]);
+ TransientNodeData newData =
+ new TransientNodeData(nodePath, prevData.getIdentifier(), prevData.getPersistedVersion(),
+ prevData.getPrimaryTypeName(), prevData.getMixinTypeNames(), prevData
+ .getOrderNumber(), prevData.getParentIdentifier(), prevData.getACL());
+ newData.addState(TransientPropertyData.TRANSITIVE_PATH_UPDATED);
+ node.put(ITEM_DATA, newData);
+ }
+ }
+ else
+ {
+ // property
+ String propId = (String)node.get((String)key);
+ if (propId != null)
+ {
+ Node<Serializable, Object> prop = propsRoot.getChild(Fqn.fromElements(propId));
+ if (prop == null)
+ {
+ throw new IllegalStateException("Property not exists or was deleted by another Session " + rootPath
+ + key);
+ }
+
+ // get prev PropertyData
+ PropertyData prevData = (PropertyData)prop.get(ITEM_DATA);
+ if (prevData == null)
+ {
+ throw new RepositoryException("FATAL Property data is empty " + rootPath + key);
+ }
+
+ // recreate the property data with new path
+ QPath newPath =
+ QPath.makeChildPath(rootPath, prevData.getQPath().getEntries()[prevData.getQPath()
+ .getEntries().length - 1]);
+ TransientPropertyData newData =
+ new TransientPropertyData(newPath, prevData.getIdentifier(), prevData.getPersistedVersion(),
+ prevData.getType(), prevData.getParentIdentifier(), prevData.isMultiValued());
+ newData.addState(TransientPropertyData.TRANSITIVE_PATH_UPDATED);
+ newData.setValues(prevData.getValues());
+ prop.put(ITEM_DATA, newData);
+ }
+ else
+ {
+ throw new RepositoryException("FATAL Property extists but ITEM_ID is empty " + node.getFqn()
+ + ". Update of " + rootPath);
+ }
+ }
+ }
+
+ if (nodePath == null)
+ {
+ throw new RepositoryException("FATAL Broken JCR Nodes tree. Node's ITEM_DATA was not found at "
+ + node.getFqn() + ". Update of " + rootPath);
+ }
+
+ // update path of child nodes
+ for (Node<Serializable, Object> child : node.getChildren())
+ {
+ String childNodeId = (String)child.get(ITEM_ID);
+ if (childNodeId == null)
+ {
+ throw new RepositoryException("FATAL Child Node Id key is null. Parent " + rootPath);
+ }
+
+ Node<Serializable, Object> childNode = nodesRoot.getChild(makeNodeFqn(childNodeId));
+ if (childNode == null)
+ {
+ throw new RepositoryException("FATAL Node record not found (" + childNodeId + "), but listed in childs of "
+ + rootPath);
+ }
+
+ updateTreePath(childNode, nodePath);
+
+ // TODO cleanup
+ // NodeData cacheNodeData = (NodeData)childNode.get(ITEM_DATA);
+ // if (cacheNodeData == null)
+ // {
+ // throw new RepositoryException("Child node data is null. Parent " + rootPath);
+ // }
+ //
+ // // recreate child Node with new path
+ // QPath newPath = QPath.makeChildPath(rootPath, cacheNodeData.getQPath().getName());
+ // TransientNodeData newNodeData =
+ // new TransientNodeData(newPath, cacheNodeData.getIdentifier(), cacheNodeData.getPersistedVersion(),
+ // cacheNodeData.getPrimaryTypeName(), cacheNodeData.getMixinTypeNames(), cacheNodeData.getOrderNumber(),
+ // cacheNodeData.getParentIdentifier(), cacheNodeData.getACL());
+ // newNodeData.addState(TransientPropertyData.TRANSITIVE_PATH_UPDATED);
+ // childNode.put(ITEM_DATA, newNodeData);
+ }
+ }
+
+ /**
* {@inheritDoc}
*/
public void update(NodeData data) throws RepositoryException, UnsupportedOperationException,
@@ -886,7 +1015,7 @@
{
startBatch();
- Fqn propFqn = Fqn.fromElements(data.getIdentifier());
+ final Fqn propFqn = Fqn.fromElements(data.getIdentifier());
// update in PROPERTIES
Node<Serializable, Object> prop = propsRoot.getChild(propFqn);
@@ -895,22 +1024,21 @@
throw new IllegalStateException("Property was deleted " + data.getQPath().getAsString());
}
- // get old PropertyData
- prop.get(ITEM_DATA);
- PropertyData propData = (PropertyData)prop.get(ITEM_DATA);
- if (propData == null)
+ // get prev PropertyData
+ PropertyData prevData = (PropertyData)prop.get(ITEM_DATA);
+ if (prevData == null)
{
throw new RepositoryException("FATAL Old Property data is null. Parent " + data.getQPath().getAsString());
}
- if (propData.getType() == PropertyType.REFERENCE || data.getType() == PropertyType.REFERENCE)
+ if (prevData.getType() == PropertyType.REFERENCE || data.getType() == PropertyType.REFERENCE)
{
//get Set of old values
Set<String> removeSet = new HashSet<String>();
- if (propData.getType() == PropertyType.REFERENCE)
+ if (prevData.getType() == PropertyType.REFERENCE)
{
- for (ValueData value : propData.getValues())
+ for (ValueData value : prevData.getValues())
{
try
{
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-23 17:05:27 UTC (rev 813)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-23 17:09:12 UTC (rev 814)
@@ -23,6 +23,7 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
+import org.exoplatform.services.jcr.impl.dataflow.TransientItemData;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnection;
import org.exoplatform.services.jcr.impl.storage.jdbc.PropertyDataInfo;
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
@@ -272,20 +273,30 @@
private void doUpdate(Modification modification, WorkspaceStorageConnection conn) throws IllegalStateException,
RepositoryException
{
- if (modification.getValue() instanceof NodeData)
+ if (modification.getValue() instanceof ItemData)
{
- //update node data
- NodeData nodeData = (NodeData)modification.getValue();
+ TransientItemData item = (TransientItemData)modification.getValue();
- conn.update(nodeData);
+ if ((item.getState() & TransientItemData.TRANSITIVE_PATH_UPDATED) == 0)
+ {
+ // update if it's non transitive update
+ if (item.isNode())
+ {
+ //update node data
+ conn.update((NodeData)item);
+ }
+ else
+ {
+ //update property data
+ conn.update((PropertyData)item);
+ }
+ }
+ else
+ {
+ // TODO for debug
+ LOG.info("TRANSITIVE_PATH_UPDATED " + item.getQPath().getAsString());
+ }
}
- else if (modification.getValue() instanceof PropertyData)
- {
- //update property data
- PropertyData propertyData = (PropertyData)modification.getValue();
-
- conn.update(propertyData);
- }
}
/**
16 years, 8 months
exo-jcr SVN: r813 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2009-11-23 12:05:27 -0500 (Mon, 23 Nov 2009)
New Revision: 813
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
Log:
EXOJCR-246: JBossCacheStorageConnection remove references fixed
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-23 15:07:10 UTC (rev 812)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-23 17:05:27 UTC (rev 813)
@@ -371,29 +371,44 @@
for (String refNodeUUID : remNodes)
{
// remove property from referencedNode in $REFS map
+ Node<Serializable, Object> refParent = refsRoot.getChild(makeNodeFqn(refNodeUUID));
- Node<Serializable, Object> refParent = refsRoot.getChild(makeNodeFqn(refNodeUUID));
if (refParent != null)
{
- if (!refParent.removeChild(propUUID))
+ if (refParent.hasChild(propUUID))
{
- throw new RepositoryException("FATAL Reference property was not removed from REFS table of node "
- + refNodeUUID);
+ // do we need remove node record also
+ boolean removeParent = (refParent.getChildrenNames().size() == 1);
- }
- // check is there is no more references
- if (refParent.getChildrenNames().size() == 0)
- {
- if (!refsRoot.removeChild(makeNodeFqn(refNodeUUID)))
+ if (!refParent.removeChild(propUUID))
{
- throw new RepositoryException("FATAL Node record was node removed from REFS table " + refNodeUUID);
+ throw new RepositoryException("FATAL Reference property was not removed from REFS table of node "
+ + refNodeUUID);
}
+
+ if (removeParent)
+ {
+ if (!refsRoot.removeChild(makeNodeFqn(refNodeUUID)))
+ {
+ throw new RepositoryException("FATAL Node record was node removed from REFS table "
+ + refNodeUUID);
+ }
+ }
}
+ else
+ {
+ LOG.warn("Property reference " + data.getIdentifier() + " to node " + refNodeUUID
+ + " was already removed.");
+ }
}
+ else
+ {
+ LOG.warn("Reference record of node " + refNodeUUID + " was already removed.");
+ }
}
}
- // remove from parent's properties attr
+ // remove from parent's properties attributes
// TODO validate does deleted
if (parent.remove(data.getQPath().getName().getAsString()) == null)
{
@@ -1059,6 +1074,11 @@
}
}
+ private void removePropertyReferenceToNode(String nodeId, Fqn propFqn)
+ {
+
+ }
+
/**
* @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getLockData(java.lang.String)
*/
16 years, 8 months
exo-jcr SVN: r812 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/api/writing and 1 other directories.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2009-11-23 10:07:10 -0500 (Mon, 23 Nov 2009)
New Revision: 812
Added:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/usecases/TestGetReference.java
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestNodeReference.java
Log:
EXOJCR-246: TestGetReference added. TestNodeReference updated. JBossCacheStorageConnection fix
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-23 14:43:39 UTC (rev 811)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-23 15:07:10 UTC (rev 812)
@@ -347,13 +347,14 @@
{
// get values from cahce
+ Set<String> remNodes = new HashSet<String>();
+
for (ValueData value : oldData.getValues())
{
- String refNodeUUID;
try
{
- refNodeUUID = ValueDataConvertor.readString(value);
+ remNodes.add(ValueDataConvertor.readString(value));
}
catch (UnsupportedEncodingException e)
{
@@ -365,18 +366,28 @@
// TODO Auto-generated catch block
throw new RepositoryException(e.getMessage(), e);
}
+ }
+ for (String refNodeUUID : remNodes)
+ {
// remove property from referencedNode in $REFS map
Node<Serializable, Object> refParent = refsRoot.getChild(makeNodeFqn(refNodeUUID));
if (refParent != null)
{
- refParent.removeChild(propUUID);
+ if (!refParent.removeChild(propUUID))
+ {
+ throw new RepositoryException("FATAL Reference property was not removed from REFS table of node "
+ + refNodeUUID);
+
+ }
// check is there is no more references
if (refParent.getChildrenNames().size() == 0)
{
- //TODO remove children
- refsRoot.removeChild(makeNodeFqn(refNodeUUID));
+ if (!refsRoot.removeChild(makeNodeFqn(refNodeUUID)))
+ {
+ throw new RepositoryException("FATAL Node record was node removed from REFS table " + refNodeUUID);
+ }
}
}
}
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestNodeReference.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestNodeReference.java 2009-11-23 14:43:39 UTC (rev 811)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestNodeReference.java 2009-11-23 15:07:10 UTC (rev 812)
@@ -161,7 +161,7 @@
log.debug(testNode1.getPath() + " ref >>> " + p.getPath());
}
- assertEquals(5, testNode1.getReferences().getSize());
+ assertEquals(4, testNode1.getReferences().getSize()); // not 5 because p1_multiple occures onlu once
refs = testNode2.getReferences();
if (log.isDebugEnabled())
Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/usecases/TestGetReference.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/usecases/TestGetReference.java (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/usecases/TestGetReference.java 2009-11-23 15:07:10 UTC (rev 812)
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2003-2009 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.usecases;
+
+import org.apache.jackrabbit.test.NotExecutableException;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date:
+ *
+ * @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
+ * @version $Id: TestGetReference.java 111 2008-11-11 11:11:11Z serg $
+ */
+public class TestGetReference extends BaseUsecasesTest
+{
+
+ /**
+ * Tests Property.getNode();
+ */
+ public void testReferenceTarget() throws RepositoryException, NotExecutableException
+ {
+ String nodeName1 = "node1";
+ String nodeName2 = "node2";
+ String propertyName1 = "prop1";
+ String testNodeType = "nt:unstructured";
+
+ Node n1 = root.addNode(nodeName1, testNodeType);
+ n1.addMixin("mix:referenceable");
+
+ // with some impls. the mixin type has only affect upon save
+ root.save();
+
+ // make sure the node is now referenceable
+ assertTrue("test node should be mix:referenceable", n1.isNodeType("mix:referenceable"));
+
+ // create references: n2.p1 -> n1
+ Node n2 = root.addNode(nodeName2, testNodeType);
+
+ n2.setProperty(propertyName1, n1);
+ root.save();
+ assertEquals("Wrong reference target.", n2.getProperty(propertyName1).getNode(), n1);
+ n2.remove();
+ root.save();
+
+ assertTrue(n1.getReferences().getSize() == 0);
+ }
+
+}
16 years, 8 months
exo-jcr SVN: r811 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-11-23 09:43:39 -0500 (Mon, 23 Nov 2009)
New Revision: 811
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionLockTest.java
Log:
EXOJCR-203 : To JBossCacheStorageConnectionLockTest was added use case with cache restart.
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionLockTest.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionLockTest.java 2009-11-23 14:29:49 UTC (rev 810)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionLockTest.java 2009-11-23 14:43:39 UTC (rev 811)
@@ -18,7 +18,14 @@
*/
package org.exoplatform.services.jcr.impl.storage.jbosscache;
+import org.exoplatform.services.jcr.access.AccessControlList;
+import org.exoplatform.services.jcr.datamodel.InternalQName;
+import org.exoplatform.services.jcr.datamodel.PropertyData;
+import org.exoplatform.services.jcr.datamodel.QPath;
+import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.core.lock.LockData;
+import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
+import org.exoplatform.services.jcr.util.IdGenerator;
import java.util.List;
@@ -99,4 +106,39 @@
locks = conn.getLocksData();
assertEquals(count, locks.size());
}
+
+ public void testCheckLockAfterRestart() throws Exception
+ {
+ // add root (/)
+ initJCRRoot();
+
+ // add node (/node)
+ String node1id = IdGenerator.generate();
+ QPath node1path = QPath.parse("[]:1[]node:1");
+ conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_UNSTRUCTURED, new InternalQName[0], 0,
+ Constants.ROOT_UUID, new AccessControlList()));
+
+ PropertyData primaryType =
+ createProperty(node1path, node1id, Constants.JCR_PRIMARYTYPE, Constants.NT_UNSTRUCTURED, false);
+ conn.add(primaryType);
+ conn.commit();
+
+ // add lock to node '/node'
+ LockData lockData = new LockData(node1id, "token's hash", true, false, "owner", 10000);
+ conn.addLockData(lockData);
+ assertEquals(lockData.getTokenHash(), conn.getLockData(node1id).getTokenHash());
+
+ // stop cache
+ cache.stop();
+ cache.destroy();
+
+ // start cache
+ super.setUp();
+
+ // check
+ // after restart the lock should be removed.
+ //TODO should be removed fail after created locks persistent.
+ fail("This fail should be removed after created locks persistent.");
+ assertNull(conn.getLockData(node1id));
+ }
}
16 years, 8 months
exo-jcr SVN: r810 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-11-23 09:29:49 -0500 (Mon, 23 Nov 2009)
New Revision: 810
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java
Log:
EXOJCR-200: impl of getItemData by Id for version manager
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 2009-11-23 13:46:17 UTC (rev 809)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 2009-11-23 14:29:49 UTC (rev 810)
@@ -118,41 +118,41 @@
return super.getItemData(parentData, name);
}
- // /**
- // * {@inheritDoc}
- // */
- // public ItemData getItemData(String identifier) throws RepositoryException
- // {
- // // from cache at first
- // ItemData cdata = persistentManager.getCachedItemData(identifier);
- // if (cdata != null)
- // return super.getItemData(identifier);
- //
- // if (!this.equals(versionDataManager) && !identifier.equals(Constants.ROOT_UUID))
- // {
- // // search in System cache for /jcr:system nodes only
- // cdata = versionDataManager.persistentManager.getCachedItemData(identifier);
- // if (cdata != null)
- // if (isSystemDescendant(cdata.getQPath()))
- // return versionDataManager.getItemData(identifier);
- // else
- // return null;
- // }
- //
- // // then from persistence
- // ItemData data = super.getItemData(identifier);
- // if (data != null)
- // return data;
- // else if (!this.equals(versionDataManager))
- // {
- // // try from version storage if not the same
- // data = versionDataManager.getItemData(identifier);
- // if (data != null && isSystemDescendant(data.getQPath()))
- // return data;
- // }
- // return null;
- // }
+ /**
+ * {@inheritDoc}
+ */
+ public ItemData getItemData(String identifier) throws RepositoryException
+ {
+// // from cache at first
+// ItemData cdata = persistentManager.getCachedItemData(identifier);
+// if (cdata != null)
+// return super.getItemData(identifier);
+//
+// if (!this.equals(versionDataManager) && !identifier.equals(Constants.ROOT_UUID))
+// {
+// // search in System cache for /jcr:system nodes only
+// cdata = versionDataManager.persistentManager.getCachedItemData(identifier);
+// if (cdata != null)
+// if (isSystemDescendant(cdata.getQPath()))
+// return versionDataManager.getItemData(identifier);
+// else
+// return null;
+// }
+ // then from persistence
+ ItemData data = super.getItemData(identifier);
+ if (data != null)
+ return data;
+ else if (!this.equals(versionDataManager))
+ {
+ // try from version storage if not the same
+ data = versionDataManager.getItemData(identifier);
+ if (data != null && isSystemDescendant(data.getQPath()))
+ return data;
+ }
+ return null;
+ }
+
public void save(CompositeChangesLog changesLog) throws RepositoryException, InvalidItemStateException
{
16 years, 8 months
exo-jcr SVN: r809 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2009-11-23 08:46:17 -0500 (Mon, 23 Nov 2009)
New Revision: 809
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
Log:
EXOJCR-246: JBossCacheStorageConnection updateProperty fixed
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-23 13:32:26 UTC (rev 808)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-23 13:46:17 UTC (rev 809)
@@ -334,19 +334,19 @@
+ data.getQPath().getAsString());
}
- if (data.getType() == PropertyType.REFERENCE)
+ Fqn propUUID = makePropFqn(data.getIdentifier());
+
+ Node<Serializable, Object> prop = propsRoot.getChild(propUUID);
+ PropertyData oldData = (PropertyData)prop.get(ITEM_DATA);
+ if (oldData == null)
{
+ throw new RepositoryException("FATAL PropertyData already empty " + data.getQPath().getAsString());
+ }
+
+ if (oldData.getType() == PropertyType.REFERENCE)
+ {
// get values from cahce
- Fqn propUUID = makeNodeFqn(data.getIdentifier());
-
- Node<Serializable, Object> prop = propsRoot.getChild(propUUID);
- PropertyData oldData = (PropertyData)prop.get(ITEM_DATA);
- if (oldData == null)
- {
- throw new RepositoryException("FATAL PropertyData already empty " + data.getQPath().getAsString());
- }
-
for (ValueData value : oldData.getValues())
{
@@ -869,52 +869,61 @@
throw new IllegalStateException("Property was deleted " + data.getQPath().getAsString());
}
- if (data.getType() == PropertyType.REFERENCE)
+ // get old PropertyData
+ prop.get(ITEM_DATA);
+ PropertyData propData = (PropertyData)prop.get(ITEM_DATA);
+ if (propData == null)
{
- PropertyData propData = (PropertyData)prop.get(ITEM_DATA);
- if (propData == null)
- {
- throw new RepositoryException("FATAL Property data is null. Parent " + data.getQPath().getAsString());
- }
+ throw new RepositoryException("FATAL Old Property data is null. Parent " + data.getQPath().getAsString());
+ }
+ if (propData.getType() == PropertyType.REFERENCE || data.getType() == PropertyType.REFERENCE)
+ {
+
//get Set of old values
Set<String> removeSet = new HashSet<String>();
- for (ValueData value : propData.getValues())
+ if (propData.getType() == PropertyType.REFERENCE)
{
- try
+ for (ValueData value : propData.getValues())
{
- removeSet.add(ValueDataConvertor.readString(value));
+ try
+ {
+ removeSet.add(ValueDataConvertor.readString(value));
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ // TODO Auto-generated catch block
+ throw new RepositoryException(e.getMessage(), e);
+ }
+ catch (IOException e)
+ {
+ // TODO Auto-generated catch block
+ throw new RepositoryException(e.getMessage(), e);
+ }
}
- catch (UnsupportedEncodingException e)
- {
- // TODO Auto-generated catch block
- throw new RepositoryException(e.getMessage(), e);
- }
- catch (IOException e)
- {
- // TODO Auto-generated catch block
- throw new RepositoryException(e.getMessage(), e);
- }
}
+ // check new
Set<String> addSet = new HashSet<String>();
- // check new
- for (ValueData value : data.getValues())
+ if (data.getType() == PropertyType.REFERENCE)
{
- try
+ for (ValueData value : data.getValues())
{
- addSet.add(ValueDataConvertor.readString(value));
+ try
+ {
+ addSet.add(ValueDataConvertor.readString(value));
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ // TODO Auto-generated catch block
+ throw new RepositoryException(e.getMessage(), e);
+ }
+ catch (IOException e)
+ {
+ // TODO Auto-generated catch block
+ throw new RepositoryException(e.getMessage(), e);
+ }
}
- catch (UnsupportedEncodingException e)
- {
- // TODO Auto-generated catch block
- throw new RepositoryException(e.getMessage(), e);
- }
- catch (IOException e)
- {
- // TODO Auto-generated catch block
- throw new RepositoryException(e.getMessage(), e);
- }
}
String[] added = new String[addSet.size()];
16 years, 8 months