From: <jbo...@li...> - 2005-12-20 22:13:34
|
Author: adamw Date: 2005-12-20 17:13:30 -0500 (Tue, 20 Dec 2005) New Revision: 1894 Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnResource.java Log: Some comments Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java 2005-12-20 17:54:10 UTC (rev 1893) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java 2005-12-20 22:13:30 UTC (rev 1894) @@ -28,6 +28,14 @@ * @author Adam Warski (ad...@as...) */ public interface SvnNode extends SvnResource, Node { + /** + * Sets this node's content to the given one. Used when switching + * implementations (possible content changes must propagate). + * @param content + */ public void setNodeContent(NodeContent content); + /** + * @return This node's content representation (possibly modified). + */ public NodeContent getNodeContent(); } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnResource.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnResource.java 2005-12-20 17:54:10 UTC (rev 1893) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnResource.java 2005-12-20 22:13:30 UTC (rev 1894) @@ -33,24 +33,86 @@ * @author Adam Warski (ad...@as...) */ public interface SvnResource extends Resource { + /** + * @return True iff this resource has been changed in any way (modified + * properties or content). + */ public boolean checkForChanges(); + /** + * To the given collection, adds operations that have to be executed + * on this resource to save modification that have been done (this can + * be: adding a node/ directory, modifying properties, modifying content). + * @param ops + */ public void addOperations(Collection<ResourceOperation> ops); + /** + * To the given collection, adds an operation which, when executed, will + * cause the resource to be deleted. + * @param ops + * @throws DeleteException + */ public void addDeleteOperation(Collection<ResourceOperation> ops) throws DeleteException ; + /** + * Called when this resource has been saved. For example, memory resources + * have to "know" that they have been saved, and that they should start + * behaving like an ordinary resource. + */ public void notifySaved(); + /** + * @return True iff this this resource's impelementation can be switched + * between repository and file, basing on the state of the "dirty sets". + * In general, new, not-yet-saved resources aren't switchable. Used by + * the proxy classes. + */ public boolean switchable(); + /** + * @return True iff the current implementation should be forced to be + * switched (for example, a just saved memory node should be switched; + * used by the proxy classes). + */ public boolean forceSwitch(); + /** + * To the given set, adds this resource's path if it's content is large and + * should be stored in a temporary file instead of a in-memoery array. + * @param toFill + */ public void addLargePaths(Set<String> toFill); + /** + * @return Full path to this resource (in the svn repository, with the + * prefix). + */ public String getFullPath(); + /** + * @return Id of the current content manager. + */ public String getId(); + /** + * @return Content manager from which this node was obtained from. + */ public SvnContentManager getSvnCm(); + /** + * @return A map of properties that have been modified in this resource. + */ public Map<String, String> getModifiedProperties(); + /** + * @return A set of property names, which have been deleted in this + * resource. + */ public Set<String> getDeletedProperties(); + /** + * Sets the modified & deleted properties collections to the given ones. + * Used when implemenation of a resource is switched and it is modified + * (the modifications must propagate to the new implementation that is + * to be used). + * @param properties + * @param deletedProperties + */ public void setModifiedProperties(Map<String, String> properties, Set<String> deletedProperties); } |