001: // RemoteResource.java
002: // $Id: RemoteResource.java,v 1.13 2000/08/16 21:37:34 ylafon Exp $
003: // (c) COPYRIGHT MIT and INRIA, 1997.
004: // Please first read the full copyright statement in file COPYRIGHT.html
005:
006: package org.w3c.jigsaw.admin;
007:
008: import java.net.URL;
009:
010: import org.w3c.tools.resources.serialization.AttributeDescription;
011:
012: /**
013: * The client side view of a server-side resource.
014: * The whole servers state are exported through resources, which allows
015: * the administration application to discover and query it using a
016: * homogeneous interface.
017: * All methods will throw a <code>RemoteAccessException</code> in case of
018: * network failure.
019: * @see ResourceBroker
020: */
021:
022: public interface RemoteResource {
023:
024: /**
025: * Get the target resource class hierarchy.
026: * This method will return the class hierarchy as an array of String. The
027: * first string in the array is the name of the resource class itself, the
028: * last string will always be <em>java.lang.Object</em>.
029: * @return A String array givimg the target resource's class description.
030: * @exception RemoteAccessException If somenetwork failure occured.
031: */
032:
033: public String[] getClassHierarchy() throws RemoteAccessException;
034:
035: /**
036: * Delete that resource, and detach it from its container.
037: * @exception RemoteAccessException If somenetwork failure occured.
038: */
039:
040: public void delete() throws RemoteAccessException;
041:
042: /**
043: * Reindex the resource's children if this resource is a DirectoryResource.
044: * @param rec recursivly?
045: * @exception RemoteAccessException If it's not a DirectoryResource
046: */
047: public void reindex(boolean rec) throws RemoteAccessException;
048:
049: /**
050: * Get the target resource list of attributes.
051: * This method returns the target resource attributes description. The
052: * resulting array contains instances of the Attribute class, one item
053: * per described attributes.
054: * <p>Even though this returns all the attribute resources, only the
055: * ones that are advertized as being editable can be set through this
056: * interface.
057: * @return An array of Attribute.
058: * @exception RemoteAccessException If somenetwork failure occured.
059: */
060:
061: public AttributeDescription[] getAttributes()
062: throws RemoteAccessException;
063:
064: /**
065: * @param name The attribute whose value is to be fetched, encoded as
066: * its name.
067: * @exception RemoteAccessException If somenetwork failure occured.
068: */
069:
070: public Object getValue(String attr) throws RemoteAccessException;
071:
072: /**
073: * @param attrs The (ordered) set of attributes whose value is to be
074: * fetched.
075: * @return An (ordered) set of values, one per queried attribute.
076: * @exception RemoteAccessException If somenetwork failure occured.
077: */
078:
079: public Object[] getValues(String attrs[])
080: throws RemoteAccessException;
081:
082: /**
083: * @param attr The attribute to set, encoded as it's name.
084: * @param value The new value for that attribute.
085: * @exception RemoteAccessException If somenetwork failure occured.
086: */
087:
088: public void setValue(String attr, Object value)
089: throws RemoteAccessException;
090:
091: /**
092: * Set a set of attribute values in one shot.
093: * This method guarantees that either all setting is done, or none of
094: * them are.
095: * @param attrs The (ordered) list of attribute to set, encoded as their
096: * names.
097: * @param values The (ordered) list of values, for each of the above
098: * attributes.
099: * @exception RemoteAccessException If somenetwork failure occured.
100: */
101:
102: public void setValues(String attrs[], Object values[])
103: throws RemoteAccessException;
104:
105: /**
106: * @exception RemoteAccessException If somenetwork failure occured.
107: */
108:
109: public boolean isContainer() throws RemoteAccessException;
110:
111: public boolean isDirectoryResource() throws RemoteAccessException;
112:
113: public boolean isIndexersCatalog() throws RemoteAccessException;
114:
115: /**
116: * @exception RemoteAccessException If somenetwork failure occured.
117: */
118:
119: public String[] enumerateResourceIdentifiers()
120: throws RemoteAccessException;
121:
122: /**
123: * @exception RemoteAccessException If somenetwork failure occured.
124: */
125:
126: public RemoteResource loadResource(String identifier)
127: throws RemoteAccessException;
128:
129: /**
130: * Register a new resource within this container.
131: * @param id The identifier of the resource to be created.
132: * @param classname The name of the class of the resource to be added.
133: * @exception RemoteAccessException if a remote access error occurs.
134: */
135:
136: public RemoteResource registerResource(String id, String classname)
137: throws RemoteAccessException;
138:
139: /**
140: * Is this resource a framed resource ?
141: * @return A boolean, <strong>true</strong> if the resource is framed
142: * and it currently has some frames attached, <strong>false</strong>
143: * otherwise.
144: * @exception RemoteAccessException if a remote access error occurs.
145: */
146:
147: public boolean isFramed() throws RemoteAccessException;
148:
149: public boolean isFrame();
150:
151: /**
152: * Get the frames attached to that resource.
153: * Each frame is itself a resource, so it is returned as an instance of
154: * a remote resource.
155: * @return A (posssibly <strong>null</strong>) array of frames attached
156: * to that resource.
157: * @exception RemoteAccessException if a remote access error occurs.
158: */
159:
160: public RemoteResource[] getFrames() throws RemoteAccessException;
161:
162: /**
163: * Unregister a given frame from that resource.
164: * @param filter The frame to unregister.
165: * @exception RemoteAccessException if a remote access error occurs.
166: */
167:
168: public void unregisterFrame(RemoteResource frame)
169: throws RemoteAccessException;
170:
171: /**
172: * Attach a new frame to that resource.
173: * @param identifier The name for this frame (if any).
174: * @param clsname The name of the frame's class.
175: * @return A remote handle to the (remotely) created frame instance.
176: * @exception RemoteAccessException if a remote access error occurs.
177: */
178:
179: public RemoteResource registerFrame(String identifier,
180: String classname) throws RemoteAccessException;
181:
182: /**
183: * Is this resource a filtered resource ?
184: * @return A boolean, <strong>true</strong> if the resource is filtered
185: * and it currently has some filters attached, <strong>false</strong>
186: * otherwise.
187: */
188:
189: public void updateURL(URL parentURL);
190:
191: }
|