001: // ResourceSpace.java
002: // $Id: ResourceSpace.java,v 1.10 2000/08/16 21:37:53 ylafon Exp $
003: // (c) COPYRIGHT MIT and INRIA, 1996.
004: // Please first read the full copyright statement in file COPYRIGHT.html
005:
006: package org.w3c.tools.resources;
007:
008: import java.util.Enumeration;
009: import java.util.Hashtable;
010:
011: import java.io.File;
012:
013: import org.w3c.tools.resources.event.ResourceEventQueue;
014:
015: public interface ResourceSpace {
016:
017: public ResourceEventQueue getEventQueue();
018:
019: /**
020: * Shutdown this resource space.
021: * Go through all entries, and shut them down.
022: */
023: public void shutdown();
024:
025: /**
026: * Checkpoint all modified resource, by saving them to disk.
027: */
028: public void checkpoint();
029:
030: /**
031: * Restore the resource whose name is given from the root.
032: * @param identifier The identifier of the resource to restore.
033: * @param defs Default attribute values.
034: */
035: public ResourceReference loadRootResource(String identifier,
036: Hashtable defs);
037:
038: /**
039: * Lookup this resource.
040: * @param sentry The resource space entry.
041: * @param identifier The resource identifier.
042: * @return A Resource instance, or <strong>null</strong> if either the
043: * resource doesn't exist, or it isn't loaded yet.
044: */
045: public ResourceReference lookupResource(SpaceEntry sentry,
046: String identifier);
047:
048: /**
049: * Restore the resource whose name is given.
050: * @param sentry The resource space entry.
051: * @param identifier The identifier of the resource to restore.
052: * @param defs Default attribute values.
053: */
054: public ResourceReference loadResource(SpaceEntry sentry,
055: String identifier, Hashtable defs);
056:
057: /**
058: * Add this resource to the space.
059: * @param sentry The resource space entry.
060: * @param resource The resource to add.
061: * @param defs Default attribute values.
062: */
063: public ResourceReference addResource(SpaceEntry sentry,
064: Resource resource, Hashtable defs);
065:
066: /**
067: * Save this resource to the space.
068: * @param sentry The resource space entry.
069: * @param resource The resource to save.
070: */
071: public void saveResource(SpaceEntry sentry, Resource resource);
072:
073: /**
074: * Mark the given resource as being modified.
075: * @param sentry The resource space entry.
076: * @param resource The resource to mark as modified.
077: */
078: public void markModified(SpaceEntry sentry, Resource resource);
079:
080: /**
081: * Rename a resource in this resource space.
082: * @param sentry The resource space entry.
083: * @param oldid The old resorce identifier.
084: * @param newid The new resorce identifier.
085: */
086: public void renameResource(SpaceEntry sentry, String oldid,
087: String newid);
088:
089: /**
090: * Delete this resource from the space.
091: * @param sentry The resource space entry.
092: * @param resource The resource to delete.
093: */
094: public void deleteResource(SpaceEntry sentry, Resource resource);
095:
096: /**
097: * Delete all the children of resource indentified by its
098: * space entry.
099: * @param sentry The resource space entry
100: */
101: public void deleteChildren(SpaceEntry sentry);
102:
103: /**
104: * Save all the children of the resource indentified by its
105: * spaec entry.
106: * @param sentry The resource space entry
107: */
108: public void saveChildren(SpaceEntry sentry);
109:
110: /**
111: * Acquire the children of the resource.
112: * @param sentry The resource space entry.
113: */
114: public void acquireChildren(SpaceEntry sentry);
115:
116: /**
117: * acquire children from an external file.
118: * @param sentry The resource space entry.
119: * @param repository The file used to store children.
120: */
121: public void acquireChildren(SpaceEntry sentry, File repository,
122: boolean transientFlag);
123:
124: /**
125: * Enumerate the name (ie identifiers) of the resource children
126: * identified by its space entry.
127: * @param sentry The space entry.
128: * @return An enumeration, providing one element per child, which is
129: * the name of the child, as a String.
130: */
131: public Enumeration enumerateResourceIdentifiers(SpaceEntry sentry);
132:
133: }
|