001: /**
002: *
003: */package org.sakaiproject.content.impl;
004:
005: import java.io.InputStream;
006: import java.util.List;
007:
008: import org.sakaiproject.content.api.ContentCollection;
009: import org.sakaiproject.content.api.ContentCollectionEdit;
010: import org.sakaiproject.content.api.ContentHostingHandlerResolver;
011: import org.sakaiproject.content.api.ContentResource;
012: import org.sakaiproject.content.api.ContentResourceEdit;
013: import org.sakaiproject.content.impl.BaseContentService.Storage;
014: import org.sakaiproject.content.impl.DbContentService.DbStorage;
015: import org.sakaiproject.entity.api.Edit;
016: import org.sakaiproject.exception.ServerOverloadException;
017: import org.sakaiproject.util.StorageUser;
018:
019: /**
020: * <p>
021: * The ContentHostingHandlerResolver performs operations on the ContentHostingService storage area to resolve operations in the storage area to the correct location. This can either be the default storage implementation or the ContentHostingHandler
022: * associated with nodes in the path to the ContentEntity in question. i.e. traditional ContentHosting resources are dealt with as they always have been, storage commands applied to virtual entities are passed to the ContentHostingHandler which represents
023: * them in CHH (johnf@caret.cam.ac.uk)
024: * </p>
025: * <p>
026: * Implementors should be aware that there may be heavy access to this component on a per- request basis, so they might want to consider a caching mechanism if the resolution of ContentEntities is expensive.
027: * </p>
028: *
029: * @author ieb
030: */
031: public interface BaseContentHostingHandlerResolver extends
032: ContentHostingHandlerResolver {
033: /**
034: * @param storage
035: * @param edit
036: */
037: void cancelCollection(Storage storage, ContentCollectionEdit edit);
038:
039: /**
040: * @param storage
041: * @param edit
042: */
043: void cancelResource(Storage storage, ContentResourceEdit edit);
044:
045: /**
046: * @param storage
047: * @param id
048: * @return
049: */
050: boolean checkCollection(Storage storage, String id);
051:
052: /**
053: * @param storage
054: * @param id
055: * @return
056: */
057: boolean checkResource(Storage storage, String id);
058:
059: /**
060: * @param storage
061: * @param edit
062: */
063: void commitCollection(Storage storage, ContentCollectionEdit edit);
064:
065: /**
066: * @param storage
067: * @param edit
068: * @param uuid
069: */
070: void commitDeleteResource(Storage storage,
071: ContentResourceEdit edit, String uuid);
072:
073: /**
074: * @param storage
075: * @param edit
076: * @throws ServerOverloadException
077: */
078: void commitResource(Storage storage, ContentResourceEdit edit)
079: throws ServerOverloadException;
080:
081: /**
082: * @param storage
083: * @param id
084: * @return
085: */
086: ContentCollectionEdit editCollection(Storage storage, String id);
087:
088: /**
089: * @param storage
090: * @param id
091: * @return
092: */
093: ContentResourceEdit editResource(Storage storage, String id);
094:
095: /**
096: * @param storage
097: * @param id
098: * @return
099: */
100: ContentCollection getCollection(Storage storage, String id);
101:
102: /**
103: * @param storage
104: * @param collection
105: * @return
106: */
107: List getCollections(Storage storage, ContentCollection collection);
108:
109: /**
110: * @param storage
111: * @param collectionId
112: * @return
113: */
114: List getFlatResources(Storage storage, String collectionId);
115:
116: /**
117: * @param storage
118: * @param id
119: * @return
120: */
121: ContentResource getResource(Storage storage, String id);
122:
123: /**
124: * @param storage
125: * @param resource
126: * @return
127: * @throws ServerOverloadException
128: */
129: byte[] getResourceBody(Storage storage, ContentResource resource)
130: throws ServerOverloadException;
131:
132: /**
133: * @param storage
134: * @param collection
135: * @return
136: */
137: List getResources(Storage storage, ContentCollection collection);
138:
139: /**
140: * @param storage
141: * @param id
142: * @return
143: */
144: ContentCollectionEdit putCollection(Storage storage, String id);
145:
146: /**
147: * @param storage
148: * @param uuid
149: * @param userId
150: * @param object
151: * @return
152: */
153: ContentResourceEdit putDeleteResource(Storage storage, String id,
154: String uuid, String userId);
155:
156: /**
157: * @param storage
158: * @param id
159: * @return
160: */
161: ContentResourceEdit putResource(Storage storage, String id);
162:
163: /**
164: * @param storage
165: * @param edit
166: */
167: void removeCollection(Storage storage, ContentCollectionEdit edit);
168:
169: /**
170: * @param storage
171: * @param edit
172: */
173: void removeResource(Storage storage, ContentResourceEdit edit);
174:
175: /**
176: * @param storage
177: * @param resource
178: * @return
179: * @throws ServerOverloadException
180: */
181: InputStream streamResourceBody(Storage storage,
182: ContentResource resource) throws ServerOverloadException;
183:
184: void setResourceUser(StorageUser rsu);
185:
186: void setCollectionUser(StorageUser csu);
187:
188: int getMemberCount(Storage storage, String collectionId);
189:
190: }
|