chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r934878 [5/13] - in /incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src: main/java/org/apache/chemistry/opencmis/inmemory/ main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/ mai...
Date Fri, 16 Apr 2010 14:00:25 GMT
Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java?rev=934878&r1=934877&r2=934878&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java Fri Apr 16 14:00:23 2010
@@ -46,230 +46,220 @@ import org.apache.chemistry.opencmis.ser
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-public class InMemoryVersioningServiceImpl extends AbstractServiceImpl implements
-    CmisVersioningService {
+public class InMemoryVersioningServiceImpl extends AbstractServiceImpl implements CmisVersioningService {
 
-  private static final Log LOG = LogFactory.getLog(InMemoryVersioningServiceImpl.class.getName());
+	private static final Log LOG = LogFactory.getLog(InMemoryVersioningServiceImpl.class.getName());
 
-  InMemoryObjectServiceImpl fObjectService; // real implementation of the service
-  AtomLinkInfoProvider fAtomLinkProvider;
-
-  public InMemoryVersioningServiceImpl(StoreManager storeManager,
-      InMemoryObjectServiceImpl objectService) {
-    super(storeManager);
-    fObjectService = objectService;
-    fAtomLinkProvider = new AtomLinkInfoProvider(fStoreManager);
-  }
-
-  public void cancelCheckOut(CallContext context, String repositoryId, String objectId,
-      ExtensionsData extension) {
-
-    try {
-      // Attach the CallContext to a thread local context that can be accessed from everywhere
-      RuntimeContext.attachCfg(context);
-
-      StoredObject so = checkStandardParameters(repositoryId, objectId);
-      String user = RuntimeContext.getRuntimeConfigValue(CallContext.USERNAME);
-      VersionedDocument verDoc = testHasProperCheckedOutStatus(so, user);
-
-      verDoc.cancelCheckOut(user);
-    }
-    finally {
-      RuntimeContext.remove();
-    }
-  }
-
-  public ObjectData checkIn(CallContext context, String repositoryId, Holder<String> objectId,
-      Boolean major, Properties properties, ContentStream contentStream,
-      String checkinComment, List<String> policies, Acl addAces,
-      Acl removeAces, ExtensionsData extension, ObjectInfoHolder objectInfos) {
-
-    try {
-      // Attach the CallContext to a thread local context that can be accessed from everywhere
-      RuntimeContext.attachCfg(context);
-
-      StoredObject so = checkStandardParameters(repositoryId, objectId.getValue());
-      String user = RuntimeContext.getRuntimeConfigValue(CallContext.USERNAME);
-      VersionedDocument verDoc = testHasProperCheckedOutStatus(so, user);
-
-      DocumentVersion pwc = verDoc.getPwc();
-
-      if (null != contentStream)
-        pwc.setContent(contentStream, false);
-
-      if (null != properties && null != properties.getProperties())
-        pwc.setCustomProperties(properties.getProperties());
-
-      verDoc.checkIn(major, checkinComment, user);
-
-      // To be able to provide all Atom links in the response we need additional information:
-      fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
-
-      ObjectData od = PropertyCreationHelper.getObjectData(fStoreManager, so, null, false,
-          IncludeRelationships.NONE, null, false, false, extension);
-
-      return od;
-    }
-    finally {
-      RuntimeContext.remove();
-    }
-  }
-
-  public ObjectData checkOut(CallContext context, String repositoryId, Holder<String> objectId,
-      ExtensionsData extension, Holder<Boolean> contentCopied, ObjectInfoHolder objectInfos) {
-
-    try {
-      // Attach the CallContext to a thread local context that can be accessed from everywhere
-      RuntimeContext.attachCfg(context);
-
-      StoredObject so = checkStandardParameters(repositoryId, objectId.getValue());
-      TypeDefinition typeDef = getTypeDefinition(repositoryId, so);
-      if (!typeDef.getBaseTypeId().equals(BaseTypeId.CMIS_DOCUMENT))
-        throw new CmisNotSupportedException("Only documents can be checked-out.");
-      else if (!((DocumentTypeDefinition) typeDef).isVersionable())
-        throw new CmisNotSupportedException("Object can't be checked-out, type is not versionable.");
-
-      checkIsVersionableObject(so);
-
-      VersionedDocument verDoc = getVersionedDocumentOfObjectId(so);
-
-      ContentStream content = null;
-
-      if (so instanceof DocumentVersion) {
-        // get document the version is contained in to c
-        content = ((DocumentVersion) so).getContent(0, -1);
-      }
-      else {
-        content = ((VersionedDocument) so).getLatestVersion(false).getContent(0, -1);
-      }
-
-      if (verDoc.isCheckedOut())
-        throw new CmisUpdateConflictException("Document " + objectId.getValue()
-            + " is already checked out.");
-
-      String user = RuntimeContext.getRuntimeConfigValue(CallContext.USERNAME);
-      checkHasUser(user);
-
-      DocumentVersion pwc = verDoc.checkOut(content, user);
-      objectId.setValue(pwc.getId()); // return the id of the created pwc
-
-      // To be able to provide all Atom links in the response we need additional information:
-      fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
-
-      ObjectData od = PropertyCreationHelper.getObjectData(fStoreManager, so, null, false,
-          IncludeRelationships.NONE, null, false, false, extension);
-
-      return od;
-    }
-    finally {
-      RuntimeContext.remove();
-    }
-  }
-
-  public List<ObjectData> getAllVersions(CallContext context, String repositoryId,
-      String versionSeriesId, String filter, Boolean includeAllowableActions,
-      ExtensionsData extension, ObjectInfoHolder objectInfos) {
-
-    try {
-      // Attach the CallContext to a thread local context that can be accessed from everywhere
-      RuntimeContext.attachCfg(context);
-
-      StoredObject so = checkStandardParameters(repositoryId, versionSeriesId);
-
-      if (!(so instanceof VersionedDocument))
-        throw new RuntimeException("Object is not instance of a VersionedDocument (version series)");
-
-      VersionedDocument verDoc = (VersionedDocument) so;
-      List<ObjectData> res = new ArrayList<ObjectData>();
-      List<DocumentVersion> versions = verDoc.getAllVersions();
-      for (DocumentVersion version : versions) {
-        ObjectData objData = getObject(context, repositoryId, version.getId(), filter,
-            includeAllowableActions, extension, objectInfos);
-        res.add(objData);
-      }
-
-      // provide information for Atom links for version series:
-      fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
-
-      return res;
-    }
-    finally {
-      RuntimeContext.remove();
-    }
-  }
-
-  public ObjectData getObjectOfLatestVersion(CallContext context, String repositoryId,
-      String versionSeriesId, Boolean major, String filter, Boolean includeAllowableActions,
-      IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
-      Boolean includeAcl, ExtensionsData extension, ObjectInfoHolder objectInfos) {
-
-    try {
-      // Attach the CallContext to a thread local context that can be accessed from everywhere
-      RuntimeContext.attachCfg(context);
-
-      StoredObject so = checkStandardParameters(repositoryId, versionSeriesId);
-      ObjectData objData = null;
-
-      if (so instanceof VersionedDocument) {
-        VersionedDocument verDoc = (VersionedDocument) so;
-        DocumentVersion latestVersion = verDoc.getLatestVersion(major);
-        objData = getObject(context, repositoryId, latestVersion.getId(), filter,
-            includeAllowableActions, extension, objectInfos);
-      }
-      else if (so instanceof Document) {
-        objData = getObject(context, repositoryId, so.getId(), filter, includeAllowableActions,
-            extension, objectInfos);
-      }
-      else
-        throw new RuntimeException("Object is not instance of a document (version series)");
-
-      // provide information for Atom links for version series:
-      fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
-
-      return objData;
-    }
-    finally {
-      RuntimeContext.remove();
-    }
-  }
-
-  public Properties getPropertiesOfLatestVersion(CallContext context, String repositoryId,
-      String versionSeriesId, Boolean major, String filter, ExtensionsData extension) {
-
-    try {
-      // Attach the CallContext to a thread local context that can be accessed from everywhere
-      RuntimeContext.attachCfg(context);
-
-      StoredObject so = checkStandardParameters(repositoryId, versionSeriesId);
-      StoredObject latestVersionObject = null;
-
-      if (so instanceof VersionedDocument) {
-        VersionedDocument verDoc = (VersionedDocument) so;
-        latestVersionObject = verDoc.getLatestVersion(major);
-      }
-      else if (so instanceof Document) {
-        latestVersionObject = so;
-      }
-      else
-        throw new RuntimeException("Object is not instance of a document (version series)");
-
-      List<String> requestedIds = FilterParser.getRequestedIdsFromFilter(filter);
-      Properties props = PropertyCreationHelper.getPropertiesFromObject(repositoryId,
-          latestVersionObject, fStoreManager, requestedIds);
-
-      return props;
-    }
-    finally {
-      RuntimeContext.remove();
-    }
-  }
-
-  private ObjectData getObject(CallContext context, String repositoryId, String objectId,
-      String filter, Boolean includeAllowableActions, ExtensionsData extension,
-      ObjectInfoHolder objectInfos) {
-
-    return fObjectService.getObject(context, repositoryId, objectId, filter,
-        includeAllowableActions, IncludeRelationships.NONE, null, false, includeAllowableActions,
-        extension, objectInfos);
-  }
+	InMemoryObjectServiceImpl fObjectService; // real implementation of the
+												// service
+	AtomLinkInfoProvider fAtomLinkProvider;
+
+	public InMemoryVersioningServiceImpl(StoreManager storeManager, InMemoryObjectServiceImpl objectService) {
+		super(storeManager);
+		fObjectService = objectService;
+		fAtomLinkProvider = new AtomLinkInfoProvider(fStoreManager);
+	}
+
+	public void cancelCheckOut(CallContext context, String repositoryId, String objectId, ExtensionsData extension) {
+
+		try {
+			// Attach the CallContext to a thread local context that can be
+			// accessed from everywhere
+			RuntimeContext.attachCfg(context);
+
+			StoredObject so = checkStandardParameters(repositoryId, objectId);
+			String user = RuntimeContext.getRuntimeConfigValue(CallContext.USERNAME);
+			VersionedDocument verDoc = testHasProperCheckedOutStatus(so, user);
+
+			verDoc.cancelCheckOut(user);
+		} finally {
+			RuntimeContext.remove();
+		}
+	}
+
+	public ObjectData checkIn(CallContext context, String repositoryId, Holder<String> objectId, Boolean major,
+			Properties properties, ContentStream contentStream, String checkinComment, List<String> policies,
+			Acl addAces, Acl removeAces, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+
+		try {
+			// Attach the CallContext to a thread local context that can be
+			// accessed from everywhere
+			RuntimeContext.attachCfg(context);
+
+			StoredObject so = checkStandardParameters(repositoryId, objectId.getValue());
+			String user = RuntimeContext.getRuntimeConfigValue(CallContext.USERNAME);
+			VersionedDocument verDoc = testHasProperCheckedOutStatus(so, user);
+
+			DocumentVersion pwc = verDoc.getPwc();
+
+			if (null != contentStream)
+				pwc.setContent(contentStream, false);
+
+			if (null != properties && null != properties.getProperties())
+				pwc.setCustomProperties(properties.getProperties());
+
+			verDoc.checkIn(major, checkinComment, user);
+
+			// To be able to provide all Atom links in the response we need
+			// additional information:
+			fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+
+			ObjectData od = PropertyCreationHelper.getObjectData(fStoreManager, so, null, false,
+					IncludeRelationships.NONE, null, false, false, extension);
+
+			return od;
+		} finally {
+			RuntimeContext.remove();
+		}
+	}
+
+	public ObjectData checkOut(CallContext context, String repositoryId, Holder<String> objectId,
+			ExtensionsData extension, Holder<Boolean> contentCopied, ObjectInfoHolder objectInfos) {
+
+		try {
+			// Attach the CallContext to a thread local context that can be
+			// accessed from everywhere
+			RuntimeContext.attachCfg(context);
+
+			StoredObject so = checkStandardParameters(repositoryId, objectId.getValue());
+			TypeDefinition typeDef = getTypeDefinition(repositoryId, so);
+			if (!typeDef.getBaseTypeId().equals(BaseTypeId.CMIS_DOCUMENT))
+				throw new CmisNotSupportedException("Only documents can be checked-out.");
+			else if (!((DocumentTypeDefinition) typeDef).isVersionable())
+				throw new CmisNotSupportedException("Object can't be checked-out, type is not versionable.");
+
+			checkIsVersionableObject(so);
+
+			VersionedDocument verDoc = getVersionedDocumentOfObjectId(so);
+
+			ContentStream content = null;
+
+			if (so instanceof DocumentVersion) {
+				// get document the version is contained in to c
+				content = ((DocumentVersion) so).getContent(0, -1);
+			} else {
+				content = ((VersionedDocument) so).getLatestVersion(false).getContent(0, -1);
+			}
+
+			if (verDoc.isCheckedOut())
+				throw new CmisUpdateConflictException("Document " + objectId.getValue() + " is already checked out.");
+
+			String user = RuntimeContext.getRuntimeConfigValue(CallContext.USERNAME);
+			checkHasUser(user);
+
+			DocumentVersion pwc = verDoc.checkOut(content, user);
+			objectId.setValue(pwc.getId()); // return the id of the created pwc
+
+			// To be able to provide all Atom links in the response we need
+			// additional information:
+			fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+
+			ObjectData od = PropertyCreationHelper.getObjectData(fStoreManager, so, null, false,
+					IncludeRelationships.NONE, null, false, false, extension);
+
+			return od;
+		} finally {
+			RuntimeContext.remove();
+		}
+	}
+
+	public List<ObjectData> getAllVersions(CallContext context, String repositoryId, String versionSeriesId,
+			String filter, Boolean includeAllowableActions, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+
+		try {
+			// Attach the CallContext to a thread local context that can be
+			// accessed from everywhere
+			RuntimeContext.attachCfg(context);
+
+			StoredObject so = checkStandardParameters(repositoryId, versionSeriesId);
+
+			if (!(so instanceof VersionedDocument))
+				throw new RuntimeException("Object is not instance of a VersionedDocument (version series)");
+
+			VersionedDocument verDoc = (VersionedDocument) so;
+			List<ObjectData> res = new ArrayList<ObjectData>();
+			List<DocumentVersion> versions = verDoc.getAllVersions();
+			for (DocumentVersion version : versions) {
+				ObjectData objData = getObject(context, repositoryId, version.getId(), filter, includeAllowableActions,
+						extension, objectInfos);
+				res.add(objData);
+			}
+
+			// provide information for Atom links for version series:
+			fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+
+			return res;
+		} finally {
+			RuntimeContext.remove();
+		}
+	}
+
+	public ObjectData getObjectOfLatestVersion(CallContext context, String repositoryId, String versionSeriesId,
+			Boolean major, String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+			String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension,
+			ObjectInfoHolder objectInfos) {
+
+		try {
+			// Attach the CallContext to a thread local context that can be
+			// accessed from everywhere
+			RuntimeContext.attachCfg(context);
+
+			StoredObject so = checkStandardParameters(repositoryId, versionSeriesId);
+			ObjectData objData = null;
+
+			if (so instanceof VersionedDocument) {
+				VersionedDocument verDoc = (VersionedDocument) so;
+				DocumentVersion latestVersion = verDoc.getLatestVersion(major);
+				objData = getObject(context, repositoryId, latestVersion.getId(), filter, includeAllowableActions,
+						extension, objectInfos);
+			} else if (so instanceof Document) {
+				objData = getObject(context, repositoryId, so.getId(), filter, includeAllowableActions, extension,
+						objectInfos);
+			} else
+				throw new RuntimeException("Object is not instance of a document (version series)");
+
+			// provide information for Atom links for version series:
+			fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+
+			return objData;
+		} finally {
+			RuntimeContext.remove();
+		}
+	}
+
+	public Properties getPropertiesOfLatestVersion(CallContext context, String repositoryId, String versionSeriesId,
+			Boolean major, String filter, ExtensionsData extension) {
+
+		try {
+			// Attach the CallContext to a thread local context that can be
+			// accessed from everywhere
+			RuntimeContext.attachCfg(context);
+
+			StoredObject so = checkStandardParameters(repositoryId, versionSeriesId);
+			StoredObject latestVersionObject = null;
+
+			if (so instanceof VersionedDocument) {
+				VersionedDocument verDoc = (VersionedDocument) so;
+				latestVersionObject = verDoc.getLatestVersion(major);
+			} else if (so instanceof Document) {
+				latestVersionObject = so;
+			} else
+				throw new RuntimeException("Object is not instance of a document (version series)");
+
+			List<String> requestedIds = FilterParser.getRequestedIdsFromFilter(filter);
+			Properties props = PropertyCreationHelper.getPropertiesFromObject(repositoryId, latestVersionObject,
+					fStoreManager, requestedIds);
+
+			return props;
+		} finally {
+			RuntimeContext.remove();
+		}
+	}
+
+	private ObjectData getObject(CallContext context, String repositoryId, String objectId, String filter,
+			Boolean includeAllowableActions, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+
+		return fObjectService.getObject(context, repositoryId, objectId, filter, includeAllowableActions,
+				IncludeRelationships.NONE, null, false, includeAllowableActions, extension, objectInfos);
+	}
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/RuntimeContext.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/RuntimeContext.java?rev=934878&r1=934877&r2=934878&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/RuntimeContext.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/RuntimeContext.java Fri Apr 16 14:00:23 2010
@@ -20,71 +20,60 @@ package org.apache.chemistry.opencmis.in
 
 import org.apache.chemistry.opencmis.server.spi.CallContext;
 
-
 /**
- * This class uses a thread local storage to store the runtime context. The runtime
- * context can be accessed from everywhere using thread local storage access The runtime
- * context is only valid during the lifetime of a single request.
+ * This class uses a thread local storage to store the runtime context. The
+ * runtime context can be accessed from everywhere using thread local storage
+ * access The runtime context is only valid during the lifetime of a single
+ * request.
+ * 
  * @author jens
- *
+ * 
  */
 
 /*
+ * public class RuntimeContext { public static class ThreadLocalRuntimeConfig
+ * extends ThreadLocal<CallContext> {
+ * 
+ * public void attachCfg(CallContext ctx) { if (null != ctx) set(ctx); }
+ * 
+ * public synchronized String getConfigValue(String key) { return get().get(key)
+ * ; }
+ * 
+ * public void deleteCfg() { set(null); } };
+ * 
+ * private static ThreadLocalRuntimeConfig CONN = new
+ * ThreadLocalRuntimeConfig();
+ * 
+ * public static ThreadLocalRuntimeConfig getRuntimeConfig() { return CONN; }
+ * 
+ * public static String getRuntimeConfigValue(String key) { return
+ * CONN.getConfigValue(key); }
+ * 
+ * public static void remove() { CONN.remove(); } }
+ */
+
 public class RuntimeContext {
-  public static class ThreadLocalRuntimeConfig extends ThreadLocal<CallContext> {    
 
-    public void attachCfg(CallContext ctx) {
-      if (null != ctx)
-        set(ctx);      
-    }
-
-    public synchronized String getConfigValue(String key) {
-      return get().get(key) ;
-    }
-
-    public void deleteCfg() {
-      set(null);      
-    }
-  };
-
-  private static ThreadLocalRuntimeConfig CONN = new ThreadLocalRuntimeConfig();
-  
-  public static ThreadLocalRuntimeConfig getRuntimeConfig() {
-    return CONN;
-  }
-
-  public static String getRuntimeConfigValue(String key) {
-    return CONN.getConfigValue(key);
-  }
-  
-  public static void remove() {
-    CONN.remove();
-  }
-}
-*/
+	private static ThreadLocal<CallContext> CTX_TLS = new ThreadLocal<CallContext>();
 
-public class RuntimeContext {
-  
-  private static ThreadLocal<CallContext> CTX_TLS =  new ThreadLocal<CallContext>(); 
+	public static void attachCfg(CallContext ctx) {
+		CTX_TLS.set(ctx);
+	}
+
+	public static synchronized String getRuntimeConfigValue(String key) {
+		CallContext ctx = CTX_TLS.get();
+		if (null == ctx)
+			return null;
+		else
+			return CTX_TLS.get().get(key);
+	}
+
+	public static void remove() {
+		CTX_TLS.remove();
+	}
+
+	public static final CallContext getCurrentContext() {
+		return CTX_TLS.get();
+	}
 
-  public static void attachCfg(CallContext ctx) {      
-    CTX_TLS.set(ctx);      
-  }
-
-  public static synchronized String getRuntimeConfigValue(String key) {
-    CallContext ctx = CTX_TLS.get();
-    if (null == ctx)
-      return null;
-    else      
-      return CTX_TLS.get().get(key) ;
-  }
-  
-  public static void remove() {
-    CTX_TLS.remove();
-  }
-
-  public static final CallContext getCurrentContext() {
-    return CTX_TLS.get();
-  }
-  
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/ServiceFactory.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/ServiceFactory.java?rev=934878&r1=934877&r2=934878&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/ServiceFactory.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/ServiceFactory.java Fri Apr 16 14:00:23 2010
@@ -55,234 +55,231 @@ import org.apache.commons.logging.LogFac
 
 public class ServiceFactory extends AbstractServicesFactory {
 
-  private static final Log LOG = LogFactory.getLog(ServiceFactory.class.getName());
-  private static final BigInteger DEFAULT_MAX_ITEMS_OBJECTS = BigInteger.valueOf(1000);
-  private static final BigInteger DEFAULT_MAX_ITEMS_TYPES = BigInteger.valueOf(100);
-  private static final BigInteger DEFAULT_DEPTH_OBJECTS = BigInteger.valueOf(2);
-  private static final BigInteger DEFAULT_DEPTH_TYPES = BigInteger.valueOf(-1);
-
-  private StoreManager fStoreManager; // singleton root of everything
-
-  private CmisRepositoryService fRepositoryService;
-  private CmisNavigationService fNavigationService;
-  private CmisObjectService fObjectService;
-  private CmisVersioningService fVersioningService;
-  private CmisDiscoveryService fDiscoveryService;
-  InMemoryRepositoryServiceImpl fRepSvc;
-  InMemoryObjectServiceImpl fObjSvc;
-  InMemoryNavigationServiceImpl fNavSvc;
-  
-  public StoreManager getStoreManager() {
-    return fStoreManager;
-  }
-
-  @Override
-  public void init(Map<String, String> parameters) {
-    LOG.info("Initializing in-memory repository...");
-
-    // initialize in-memory management
-    String repositoryClassName = (String) parameters.get(ConfigConstants.REPOSITORY_CLASS);
-    if (null == repositoryClassName)
-      repositoryClassName = StoreManagerImpl.class.getName();
-
-    if (null == fStoreManager)
-      fStoreManager = StoreManagerFactory.createInstance(repositoryClassName);
-
-    String repositoryId = parameters.get(ConfigConstants.REPOSITORY_ID);
-
-    List<String> allAvailableRepositories = fStoreManager.getAllRepositoryIds();
-
-    // init existing repositories
-    for (String existingRepId : allAvailableRepositories)
-      fStoreManager.initRepository(existingRepId);
-
-    // create repository if configured as a startup parameter
-    if (null != repositoryId) {
-      if (allAvailableRepositories.contains(repositoryId))
-        LOG.warn("Repostory " + repositoryId + " already exists and will not be created.");
-      else {
-        String typeCreatorClassName = parameters.get(ConfigConstants.TYPE_CREATOR_CLASS);
-        fStoreManager.createAndInitRepository(repositoryId, typeCreatorClassName);
-      }
-    }
-
-    fRepSvc = new InMemoryRepositoryServiceImpl(fStoreManager);
-    fNavSvc = new InMemoryNavigationServiceImpl(fStoreManager);
-    fObjSvc = new InMemoryObjectServiceImpl(fStoreManager);
-    InMemoryVersioningServiceImpl verSvc = new InMemoryVersioningServiceImpl(fStoreManager, fObjSvc);
-    InMemoryDiscoveryServiceImpl disSvc = new InMemoryDiscoveryServiceImpl(fStoreManager, fRepSvc,
-        fNavSvc);
-    
-    // Initialize services, use the service wrappers to provide suitable default parameters and
-    // paging sets
-    fRepositoryService = new RepositoryServiceWrapper(fRepSvc, DEFAULT_MAX_ITEMS_TYPES,
-        DEFAULT_DEPTH_TYPES);
-    fNavigationService = new NavigationServiceWrapper(fNavSvc, DEFAULT_MAX_ITEMS_OBJECTS,
-        DEFAULT_DEPTH_OBJECTS);
-    fObjectService = new ObjectServiceWrapper(fObjSvc, DEFAULT_MAX_ITEMS_OBJECTS);
-    fVersioningService = new VersioningServiceWrapper(verSvc);
-    fDiscoveryService = new DiscoveryServiceWrapper(disSvc, DEFAULT_MAX_ITEMS_OBJECTS);
-    
-    // With some special configuration settings fill the repository with some documents and folders
-    // if is empty
-    if (!allAvailableRepositories.contains(repositoryId))
-      fillRepositoryIfConfigured(parameters, repositoryId);
-
-    LOG.info("...initialized in-memory repository.");
-  }
-
-  @Override
-  public void destroy() {
-    LOG.info("Destroyed in-memory repository.");
-  }
-
-  @Override
-  public CmisRepositoryService getRepositoryService() {
-    return fRepositoryService;
-  }
-
-  @Override
-  public CmisNavigationService getNavigationService() {
-    return fNavigationService;
-  }
-
-  @Override
-  public CmisObjectService getObjectService() {
-    return fObjectService;
-  }
-
-  @Override
-  public CmisVersioningService getVersioningService() {
-    return fVersioningService;
-  }
-
-  @Override
-  public CmisDiscoveryService getDiscoveryService() {
-    return fDiscoveryService;
-  }
-
-  private void fillRepositoryIfConfigured(Map<String, String> parameters, String repositoryId) {
-    class DummyCallContext implements CallContext {
-
-      public String get(String key) {
-        return null;
-      }
-
-      public String getBinding() {
-        return null;
-      }
-
-      public String getLocale() {
-        return null;
-      }
-
-      public String getPassword() {
-        return null;
-      }
-
-      public String getUsername() {
-        return null;
-      }
-    }
-
-    String doFillRepositoryStr = parameters.get(ConfigConstants.USE_REPOSITORY_FILER);
-    boolean doFillRepository = doFillRepositoryStr == null ? false : Boolean
-        .parseBoolean(doFillRepositoryStr);
-
-    if (!doFillRepository)
-      return;
-
-    BindingsObjectFactory objectFactory = new BindingsObjectFactoryImpl();
-    NavigationService navSvc = new NavigationServiceImpl(fNavSvc);
-    ObjectService objSvc = new ObjectServiceImpl(fObjSvc);
-    RepositoryService repSvc = new RepositoryServiceImpl(fRepSvc);
-
-    String levelsStr = parameters.get(ConfigConstants.FILLER_DEPTH);
-    int levels = 1;
-    if (null != levelsStr)
-      levels = Integer.parseInt(levelsStr);
-
-    String docsPerLevelStr = parameters.get(ConfigConstants.FILLER_DOCS_PER_FOLDER);
-    int docsPerLevel = 1;
-    if (null != docsPerLevelStr)
-      docsPerLevel = Integer.parseInt(docsPerLevelStr);
-
-    String childrenPerLevelStr = parameters.get(ConfigConstants.FILLER_FOLDERS_PER_FOLDER);
-    int childrenPerLevel = 2;
-    if (null != childrenPerLevelStr)
-      childrenPerLevel = Integer.parseInt(childrenPerLevelStr);
-
-    String documentTypeId = parameters.get(ConfigConstants.FILLER_DOCUMENT_TYPE_ID);
-    if (null == documentTypeId)
-      documentTypeId = BaseTypeId.CMIS_DOCUMENT.value();
-
-    String folderTypeId = parameters.get(ConfigConstants.FILLER_FOLDER_TYPE_ID);
-    if (null == folderTypeId)
-      folderTypeId = BaseTypeId.CMIS_FOLDER.value();
-
-    int contentSizeKB = 0;
-    String contentSizeKBStr = parameters.get(ConfigConstants.FILLER_CONTENT_SIZE);
-    if (null != contentSizeKBStr)
-      contentSizeKB = Integer.parseInt(contentSizeKBStr);
-
-    // Create a hierarchy of folders and fill it with some documents
-    ObjectGenerator gen = new ObjectGenerator(objectFactory, navSvc, objSvc, repositoryId);
-
-    gen.setNumberOfDocumentsToCreatePerFolder(docsPerLevel);
-
-    // Set the type id for all created documents:
-    gen.setDocumentTypeId(documentTypeId);
-
-    // Set the type id for all created folders:
-    gen.setFolderTypeId(folderTypeId);
-
-    // Set contentSize
-    gen.setContentSizeInKB(contentSizeKB);
-
-    // set properties that need to be filled
-    // set the properties the generator should fill with values for documents:
-    // Note: must be valid properties in configured document and folder type
-
-    List<String> propsToSet = readPropertiesToSetFromConfig(parameters,
-        ConfigConstants.FILLER_DOCUMENT_PROPERTY);
-    if (null != propsToSet)
-      gen.setDocumentPropertiesToGenerate(propsToSet);
-
-    propsToSet = readPropertiesToSetFromConfig(parameters, ConfigConstants.FILLER_FOLDER_PROPERTY);
-    if (null != propsToSet)
-      gen.setFolderPropertiesToGenerate(propsToSet);
-
-    // Simulate a runtime context with configuration parameters
-    // Attach the CallContext to a thread local context that can be accessed from everywhere
-   RuntimeContext.attachCfg(new DummyCallContext());
-
-    // Build the tree
-    RepositoryInfo rep = repSvc.getRepositoryInfo(repositoryId, null);
-    String rootFolderId = rep.getRootFolderId();
-
-    try {
-      gen.createFolderHierachy(levels, childrenPerLevel, rootFolderId);
-      // Dump the tree
-      gen.dumpFolder(rootFolderId, "*");
-    }
-    catch (Exception e) {
-      LOG.error("Could not create folder hierarchy with documents. " + e);
-      e.printStackTrace();
-    }
-
-  }
-
-  private List<String> readPropertiesToSetFromConfig(Map<String, String> parameters,
-      String keyPrefix) {
-    List<String> propsToSet = new ArrayList<String>();
-    for (int i = 0;; ++i) {
-      String propertyKey = keyPrefix + Integer.toString(i);
-      String propertyToAdd = parameters.get(propertyKey);
-      if (null == propertyToAdd)
-        break;
-      else
-        propsToSet.add(propertyToAdd);
-    }
-    return propsToSet;
-  }
+	private static final Log LOG = LogFactory.getLog(ServiceFactory.class.getName());
+	private static final BigInteger DEFAULT_MAX_ITEMS_OBJECTS = BigInteger.valueOf(1000);
+	private static final BigInteger DEFAULT_MAX_ITEMS_TYPES = BigInteger.valueOf(100);
+	private static final BigInteger DEFAULT_DEPTH_OBJECTS = BigInteger.valueOf(2);
+	private static final BigInteger DEFAULT_DEPTH_TYPES = BigInteger.valueOf(-1);
+
+	private StoreManager fStoreManager; // singleton root of everything
+
+	private CmisRepositoryService fRepositoryService;
+	private CmisNavigationService fNavigationService;
+	private CmisObjectService fObjectService;
+	private CmisVersioningService fVersioningService;
+	private CmisDiscoveryService fDiscoveryService;
+	InMemoryRepositoryServiceImpl fRepSvc;
+	InMemoryObjectServiceImpl fObjSvc;
+	InMemoryNavigationServiceImpl fNavSvc;
+
+	public StoreManager getStoreManager() {
+		return fStoreManager;
+	}
+
+	@Override
+	public void init(Map<String, String> parameters) {
+		LOG.info("Initializing in-memory repository...");
+
+		// initialize in-memory management
+		String repositoryClassName = (String) parameters.get(ConfigConstants.REPOSITORY_CLASS);
+		if (null == repositoryClassName)
+			repositoryClassName = StoreManagerImpl.class.getName();
+
+		if (null == fStoreManager)
+			fStoreManager = StoreManagerFactory.createInstance(repositoryClassName);
+
+		String repositoryId = parameters.get(ConfigConstants.REPOSITORY_ID);
+
+		List<String> allAvailableRepositories = fStoreManager.getAllRepositoryIds();
+
+		// init existing repositories
+		for (String existingRepId : allAvailableRepositories)
+			fStoreManager.initRepository(existingRepId);
+
+		// create repository if configured as a startup parameter
+		if (null != repositoryId) {
+			if (allAvailableRepositories.contains(repositoryId))
+				LOG.warn("Repostory " + repositoryId + " already exists and will not be created.");
+			else {
+				String typeCreatorClassName = parameters.get(ConfigConstants.TYPE_CREATOR_CLASS);
+				fStoreManager.createAndInitRepository(repositoryId, typeCreatorClassName);
+			}
+		}
+
+		fRepSvc = new InMemoryRepositoryServiceImpl(fStoreManager);
+		fNavSvc = new InMemoryNavigationServiceImpl(fStoreManager);
+		fObjSvc = new InMemoryObjectServiceImpl(fStoreManager);
+		InMemoryVersioningServiceImpl verSvc = new InMemoryVersioningServiceImpl(fStoreManager, fObjSvc);
+		InMemoryDiscoveryServiceImpl disSvc = new InMemoryDiscoveryServiceImpl(fStoreManager, fRepSvc, fNavSvc);
+
+		// Initialize services, use the service wrappers to provide suitable
+		// default parameters and
+		// paging sets
+		fRepositoryService = new RepositoryServiceWrapper(fRepSvc, DEFAULT_MAX_ITEMS_TYPES, DEFAULT_DEPTH_TYPES);
+		fNavigationService = new NavigationServiceWrapper(fNavSvc, DEFAULT_MAX_ITEMS_OBJECTS, DEFAULT_DEPTH_OBJECTS);
+		fObjectService = new ObjectServiceWrapper(fObjSvc, DEFAULT_MAX_ITEMS_OBJECTS);
+		fVersioningService = new VersioningServiceWrapper(verSvc);
+		fDiscoveryService = new DiscoveryServiceWrapper(disSvc, DEFAULT_MAX_ITEMS_OBJECTS);
+
+		// With some special configuration settings fill the repository with
+		// some documents and folders
+		// if is empty
+		if (!allAvailableRepositories.contains(repositoryId))
+			fillRepositoryIfConfigured(parameters, repositoryId);
+
+		LOG.info("...initialized in-memory repository.");
+	}
+
+	@Override
+	public void destroy() {
+		LOG.info("Destroyed in-memory repository.");
+	}
+
+	@Override
+	public CmisRepositoryService getRepositoryService() {
+		return fRepositoryService;
+	}
+
+	@Override
+	public CmisNavigationService getNavigationService() {
+		return fNavigationService;
+	}
+
+	@Override
+	public CmisObjectService getObjectService() {
+		return fObjectService;
+	}
+
+	@Override
+	public CmisVersioningService getVersioningService() {
+		return fVersioningService;
+	}
+
+	@Override
+	public CmisDiscoveryService getDiscoveryService() {
+		return fDiscoveryService;
+	}
+
+	private void fillRepositoryIfConfigured(Map<String, String> parameters, String repositoryId) {
+		class DummyCallContext implements CallContext {
+
+			public String get(String key) {
+				return null;
+			}
+
+			public String getBinding() {
+				return null;
+			}
+
+			public String getLocale() {
+				return null;
+			}
+
+			public String getPassword() {
+				return null;
+			}
+
+			public String getUsername() {
+				return null;
+			}
+		}
+
+		String doFillRepositoryStr = parameters.get(ConfigConstants.USE_REPOSITORY_FILER);
+		boolean doFillRepository = doFillRepositoryStr == null ? false : Boolean.parseBoolean(doFillRepositoryStr);
+
+		if (!doFillRepository)
+			return;
+
+		BindingsObjectFactory objectFactory = new BindingsObjectFactoryImpl();
+		NavigationService navSvc = new NavigationServiceImpl(fNavSvc);
+		ObjectService objSvc = new ObjectServiceImpl(fObjSvc);
+		RepositoryService repSvc = new RepositoryServiceImpl(fRepSvc);
+
+		String levelsStr = parameters.get(ConfigConstants.FILLER_DEPTH);
+		int levels = 1;
+		if (null != levelsStr)
+			levels = Integer.parseInt(levelsStr);
+
+		String docsPerLevelStr = parameters.get(ConfigConstants.FILLER_DOCS_PER_FOLDER);
+		int docsPerLevel = 1;
+		if (null != docsPerLevelStr)
+			docsPerLevel = Integer.parseInt(docsPerLevelStr);
+
+		String childrenPerLevelStr = parameters.get(ConfigConstants.FILLER_FOLDERS_PER_FOLDER);
+		int childrenPerLevel = 2;
+		if (null != childrenPerLevelStr)
+			childrenPerLevel = Integer.parseInt(childrenPerLevelStr);
+
+		String documentTypeId = parameters.get(ConfigConstants.FILLER_DOCUMENT_TYPE_ID);
+		if (null == documentTypeId)
+			documentTypeId = BaseTypeId.CMIS_DOCUMENT.value();
+
+		String folderTypeId = parameters.get(ConfigConstants.FILLER_FOLDER_TYPE_ID);
+		if (null == folderTypeId)
+			folderTypeId = BaseTypeId.CMIS_FOLDER.value();
+
+		int contentSizeKB = 0;
+		String contentSizeKBStr = parameters.get(ConfigConstants.FILLER_CONTENT_SIZE);
+		if (null != contentSizeKBStr)
+			contentSizeKB = Integer.parseInt(contentSizeKBStr);
+
+		// Create a hierarchy of folders and fill it with some documents
+		ObjectGenerator gen = new ObjectGenerator(objectFactory, navSvc, objSvc, repositoryId);
+
+		gen.setNumberOfDocumentsToCreatePerFolder(docsPerLevel);
+
+		// Set the type id for all created documents:
+		gen.setDocumentTypeId(documentTypeId);
+
+		// Set the type id for all created folders:
+		gen.setFolderTypeId(folderTypeId);
+
+		// Set contentSize
+		gen.setContentSizeInKB(contentSizeKB);
+
+		// set properties that need to be filled
+		// set the properties the generator should fill with values for
+		// documents:
+		// Note: must be valid properties in configured document and folder type
+
+		List<String> propsToSet = readPropertiesToSetFromConfig(parameters, ConfigConstants.FILLER_DOCUMENT_PROPERTY);
+		if (null != propsToSet)
+			gen.setDocumentPropertiesToGenerate(propsToSet);
+
+		propsToSet = readPropertiesToSetFromConfig(parameters, ConfigConstants.FILLER_FOLDER_PROPERTY);
+		if (null != propsToSet)
+			gen.setFolderPropertiesToGenerate(propsToSet);
+
+		// Simulate a runtime context with configuration parameters
+		// Attach the CallContext to a thread local context that can be accessed
+		// from everywhere
+		RuntimeContext.attachCfg(new DummyCallContext());
+
+		// Build the tree
+		RepositoryInfo rep = repSvc.getRepositoryInfo(repositoryId, null);
+		String rootFolderId = rep.getRootFolderId();
+
+		try {
+			gen.createFolderHierachy(levels, childrenPerLevel, rootFolderId);
+			// Dump the tree
+			gen.dumpFolder(rootFolderId, "*");
+		} catch (Exception e) {
+			LOG.error("Could not create folder hierarchy with documents. " + e);
+			e.printStackTrace();
+		}
+
+	}
+
+	private List<String> readPropertiesToSetFromConfig(Map<String, String> parameters, String keyPrefix) {
+		List<String> propsToSet = new ArrayList<String>();
+		for (int i = 0;; ++i) {
+			String propertyKey = keyPrefix + Integer.toString(i);
+			String propertyToAdd = parameters.get(propertyKey);
+			if (null == propertyToAdd)
+				break;
+			else
+				propsToSet.add(propertyToAdd);
+		}
+		return propsToSet;
+	}
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Children.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Children.java?rev=934878&r1=934877&r2=934878&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Children.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Children.java Fri Apr 16 14:00:23 2010
@@ -21,74 +21,72 @@ package org.apache.chemistry.opencmis.in
 import java.util.List;
 
 /**
- * A folder is a StoredObject that that has a path and children. Children can be 
+ * A folder is a StoredObject that that has a path and children. Children can be
  * folder or documents
  * 
  * @author Jens
  */
 public interface Children {
 
-  /**
-   * Create a subfolder in an existing folder. This call persists parent and child folder
-   * as transactional step. 
-   * 
-   * @param folder
-   *    new child folder
-   */
-  public void addChildFolder(Folder folder);
-
-  /**
-   * Add a document to a folder. This call persists the folder and the document as a
-   * transactional step.
-   * 
-   * @param doc
-   *    document to be added
-   */
-  public void addChildDocument(Document doc);
-
-  /**
-   * Add a versioned document to a folder. This call persists the folder and the document as a
-   * transactional step.
-   * 
-   * @param doc
-   *    document to be added
-   */
-  public void addChildDocument(VersionedDocument doc);
-
-  /**
-   * get all the children of this folder. To support paging an initial offset and a
-   * maximum number of children to retrieve can be passed
-   * 
-   * @param maxItems
-   *    max. number of items to return
-   * @param skipCount
-   *    initial offset where to start fetching
-   * @return
-   *    list of children objects
-   */
-  public List<StoredObject> getChildren(int maxItems, int skipCount);
-
-  /**
-   * get all the children of this folder which are folders. To support paging an 
-   * initial offset and a maximum number of childrent to retrieve can be passed.
-   * 
-   * @param maxItems
-   *    max. number of items to return
-   * @param skipCount
-   *    initial offset where to start fetching
-   * @return
-   *    list of children folders
-   */
-  public List<Folder> getFolderChildren(int maxItems, int skipCount);
-
-  /**
-   * indicate if a child with the given name exists in this folder
-   * 
-   * @param name
-   *    name to check
-   * @return
-   *    true if the name exists in the folderas child, false otherwise
-   */
-  public boolean hasChild(String name);
+	/**
+	 * Create a subfolder in an existing folder. This call persists parent and
+	 * child folder as transactional step.
+	 * 
+	 * @param folder
+	 *            new child folder
+	 */
+	public void addChildFolder(Folder folder);
+
+	/**
+	 * Add a document to a folder. This call persists the folder and the
+	 * document as a transactional step.
+	 * 
+	 * @param doc
+	 *            document to be added
+	 */
+	public void addChildDocument(Document doc);
+
+	/**
+	 * Add a versioned document to a folder. This call persists the folder and
+	 * the document as a transactional step.
+	 * 
+	 * @param doc
+	 *            document to be added
+	 */
+	public void addChildDocument(VersionedDocument doc);
+
+	/**
+	 * get all the children of this folder. To support paging an initial offset
+	 * and a maximum number of children to retrieve can be passed
+	 * 
+	 * @param maxItems
+	 *            max. number of items to return
+	 * @param skipCount
+	 *            initial offset where to start fetching
+	 * @return list of children objects
+	 */
+	public List<StoredObject> getChildren(int maxItems, int skipCount);
+
+	/**
+	 * get all the children of this folder which are folders. To support paging
+	 * an initial offset and a maximum number of childrent to retrieve can be
+	 * passed.
+	 * 
+	 * @param maxItems
+	 *            max. number of items to return
+	 * @param skipCount
+	 *            initial offset where to start fetching
+	 * @return list of children folders
+	 */
+	public List<Folder> getFolderChildren(int maxItems, int skipCount);
+
+	/**
+	 * indicate if a child with the given name exists in this folder
+	 * 
+	 * @param name
+	 *            name to check
+	 * @return true if the name exists in the folderas child, false otherwise
+	 */
+	public boolean hasChild(String name);
 
 }
\ No newline at end of file

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Content.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Content.java?rev=934878&r1=934877&r2=934878&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Content.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Content.java Fri Apr 16 14:00:23 2010
@@ -21,28 +21,32 @@ package org.apache.chemistry.opencmis.in
 import org.apache.chemistry.opencmis.commons.api.ContentStream;
 
 public interface Content {
-  
-  /** 
-   * return true if this object has content or false if there is no content attached.
-   * @return
-   */
-  boolean hasContent();
-  
-  /**
-   * retrieve the content of a document
-   * @return
-   *    object containing mime-type, length and a stream with content
-   */
-  ContentStream getContent(long offset, long length);
 
-  /**
-   * Assign content do a document. Existing content gets overwritten.
-   * The document is not yet persisted in the new state.
-   * @param content
-   *    content to be assigned to the document.
-   * @param mustPersist
-   *    persist document (set to false if content is set during creation of a document)
-   */
-  void setContent(ContentStream content, boolean mustPersist);
-  
+	/**
+	 * return true if this object has content or false if there is no content
+	 * attached.
+	 * 
+	 * @return
+	 */
+	boolean hasContent();
+
+	/**
+	 * retrieve the content of a document
+	 * 
+	 * @return object containing mime-type, length and a stream with content
+	 */
+	ContentStream getContent(long offset, long length);
+
+	/**
+	 * Assign content do a document. Existing content gets overwritten. The
+	 * document is not yet persisted in the new state.
+	 * 
+	 * @param content
+	 *            content to be assigned to the document.
+	 * @param mustPersist
+	 *            persist document (set to false if content is set during
+	 *            creation of a document)
+	 */
+	void setContent(ContentStream content, boolean mustPersist);
+
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Document.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Document.java?rev=934878&r1=934877&r2=934878&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Document.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Document.java Fri Apr 16 14:00:23 2010
@@ -18,16 +18,14 @@
  */
 package org.apache.chemistry.opencmis.inmemory.storedobj.api;
 
-
 /**
- * A document is a concrete object (meaning it can be stored) and has 
- * content. It also has a path (is contained in a parent folder)
+ * A document is a concrete object (meaning it can be stored) and has content.
+ * It also has a path (is contained in a parent folder)
  * 
  * @author Jens
- *
+ * 
  */
 
 public interface Document extends StoredObject, MultiFiling, Content {
 
 }
-

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/DocumentVersion.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/DocumentVersion.java?rev=934878&r1=934877&r2=934878&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/DocumentVersion.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/DocumentVersion.java Fri Apr 16 14:00:23 2010
@@ -19,13 +19,13 @@
 package org.apache.chemistry.opencmis.inmemory.storedobj.api;
 
 /**
- * A DocumentVersion is a concrete version of a versioned document. It has an id,
- * is stored in the object store, has content and adds versioning functionality. 
- * It does not have a path. It inherits also properties so each version may have 
- * its own properties. 
+ * A DocumentVersion is a concrete version of a versioned document. It has an
+ * id, is stored in the object store, has content and adds versioning
+ * functionality. It does not have a path. It inherits also properties so each
+ * version may have its own properties.
  * 
  * @author Jens
- *
+ * 
  */
 public interface DocumentVersion extends Version, Content, StoredObject, MultiFiling {
 

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Filing.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Filing.java?rev=934878&r1=934877&r2=934878&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Filing.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Filing.java Fri Apr 16 14:00:23 2010
@@ -20,39 +20,38 @@ package org.apache.chemistry.opencmis.in
 
 import java.util.List;
 
-
 /**
- * Path is the capability of an object to get accessed by a path in addition to the identifier.
- * Paths are hierarchical, each object with a path has a parent where the parent is always a 
- * folder. Paths do not exist on its own but are part of other objects (documents and folders).
- * Most of the functionality is defined in interfaces that are subclasses.
+ * Path is the capability of an object to get accessed by a path in addition to
+ * the identifier. Paths are hierarchical, each object with a path has a parent
+ * where the parent is always a folder. Paths do not exist on its own but are
+ * part of other objects (documents and folders). Most of the functionality is
+ * defined in interfaces that are subclasses.
  * 
  * @author Jens
  */
 public interface Filing {
 
-  /**
-   * character indicating how folders are separated within a path string. This char must not be a
-   * valid character of an object name.
-   */
-  public static final String PATH_SEPARATOR = "/";
-
-  /**
-   * return a list of parents. for single parent object this list must contain
-   * only one element. returns an empty list if this is an unfiled document.
-   * 
-   * @return
-   *    list of parent folders
-   */
-  List<Folder> getParents();
-  
-  /**
-   * Move an object to a different folder. Source and target object are persisted in this 
-   * call as part of a transactional step.
-   *  
-   * @param newParent
-   *    new parent folder for the object
-   */
-  public void move(Folder oldParent, Folder newParent);
-  
+	/**
+	 * character indicating how folders are separated within a path string. This
+	 * char must not be a valid character of an object name.
+	 */
+	public static final String PATH_SEPARATOR = "/";
+
+	/**
+	 * return a list of parents. for single parent object this list must contain
+	 * only one element. returns an empty list if this is an unfiled document.
+	 * 
+	 * @return list of parent folders
+	 */
+	List<Folder> getParents();
+
+	/**
+	 * Move an object to a different folder. Source and target object are
+	 * persisted in this call as part of a transactional step.
+	 * 
+	 * @param newParent
+	 *            new parent folder for the object
+	 */
+	public void move(Folder oldParent, Folder newParent);
+
 }
\ No newline at end of file

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Folder.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Folder.java?rev=934878&r1=934877&r2=934878&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Folder.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Folder.java Fri Apr 16 14:00:23 2010
@@ -21,20 +21,21 @@ package org.apache.chemistry.opencmis.in
 import java.util.List;
 
 /**
- * A folder is a concrete object (meaning it can be stored) and has 
- * Each folder is contained in a parent folder. The parent folder for
- * the special root folder is null.
+ * A folder is a concrete object (meaning it can be stored) and has Each folder
+ * is contained in a parent folder. The parent folder for the special root
+ * folder is null.
  * 
  * @author Jens
- *
+ * 
  */
 
 public interface Folder extends Children, SingleFiling, StoredObject {
-  
-  /**
-   * return a list of allowed types of children in this folder
-   * @return
-   */
-  List<String> getAllowedChildObjectTypeIds();
-  
+
+	/**
+	 * return a list of allowed types of children in this folder
+	 * 
+	 * @return
+	 */
+	List<String> getAllowedChildObjectTypeIds();
+
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/MultiFiling.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/MultiFiling.java?rev=934878&r1=934877&r2=934878&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/MultiFiling.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/MultiFiling.java Fri Apr 16 14:00:23 2010
@@ -21,33 +21,34 @@ package org.apache.chemistry.opencmis.in
 import java.util.List;
 
 /**
- * Documents can have in the CMIS specification multiple parents. This interface describes
- * the behavior of objects with multiple parent objects.
+ * Documents can have in the CMIS specification multiple parents. This interface
+ * describes the behavior of objects with multiple parent objects.
  * 
  * @author Jens
- *
+ * 
  */
 public interface MultiFiling extends Filing {
 
-  /**
-   * retrieve the path segment of this folder
-   * @return
-   */
-  String getPathSegment();
+	/**
+	 * retrieve the path segment of this folder
+	 * 
+	 * @return
+	 */
+	String getPathSegment();
+
+	/**
+	 * Add this document to a new parent folder as child object
+	 * 
+	 * @param parent
+	 *            new parent folder of the document.
+	 */
+	void addParent(Folder parent);
 
-  /** 
-   * Add this document to a new parent folder as child object
-   * 
-   * @param parent
-   *    new parent folder of the document.
-   */
-  void addParent(Folder parent);
-  
-  /**
-   * Remove this object from the children of parent
-   * 
-   * @param parent
-   *    parent folder of the document
-   */
-  void removeParent(Folder parent);
+	/**
+	 * Remove this object from the children of parent
+	 * 
+	 * @param parent
+	 *            parent folder of the document
+	 */
+	void removeParent(Folder parent);
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/ObjectStore.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/ObjectStore.java?rev=934878&r1=934877&r2=934878&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/ObjectStore.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/ObjectStore.java Fri Apr 16 14:00:23 2010
@@ -23,92 +23,90 @@ import java.util.List;
 /**
  * @author Jens
  * 
- * This is the interface an implementation must provide to store any kind of CMIS
- * objects. The ObjectStore is the topmost container of all CMIS object that get 
- * persisted. It is comparable to a file system, one object store exists per 
- * repository id. The object store allows access objects by an id. In addition a
- * object can be retrieved by path. Typically the object store owns the list of 
- * object ids and maintains the path hierarchy.
+ *         This is the interface an implementation must provide to store any
+ *         kind of CMIS objects. The ObjectStore is the topmost container of all
+ *         CMIS object that get persisted. It is comparable to a file system,
+ *         one object store exists per repository id. The object store allows
+ *         access objects by an id. In addition a object can be retrieved by
+ *         path. Typically the object store owns the list of object ids and
+ *         maintains the path hierarchy.
  */
 public interface ObjectStore {
 
-  /**
-   * Get the root folder of this object store
-   * @return
-   *    the root folder of this store
-   */
-  Folder getRootFolder();
-
-  /**
-   * return an object by path. 
-   * @param path
-   *    the path to the object
-   * @return
-   *    the stored object with this path
-   */
-  StoredObject getObjectByPath(String path);
-
-  /**
-   * get an object by its id
-   * @param folderId
-   *      the id of the object
-   * @return
-   *      the object identified by this id
-   */
-  StoredObject getObjectById(String folderId);
-  
-  /**
-   * Deletes an object from the store. For a folders the folder must be empty.
-   * @param objectId
-   */
-  void deleteObject(String objectId);
-
-  /**
-   * Create a document as initial step. The document is created but still temporary
-   * It is not yet persisted and does not have an id yet. After this call additional
-   * actions can take place (like assigning properties and a type) before it is 
-   * persisted.
-   * 
-   * @param name
-   *    name of the document
-   * @return
-   *    document object
-   */
-  Document createDocument(String name);
-  
-  /**
-   * Create a folder as initial step. The folder is created but still temporary
-   * It is not yet persisted and does not have an id yet. After this call additional
-   * actions can take place (like assigning properties and a type) before it is 
-   * persisted.
-   * 
-   * @param name
-   *    name of the folder
-   * @return
-   *    folder object
-   */
-  Folder createFolder(String name);
-
-  /**
-   * Create a document that supports versions as initial step. The document is created 
-   * but still temporary. It is not yet persisted and does not have an id yet. After 
-   * this call additional actions can take place (like assigning properties and a type) 
-   * before it is persisted.
-   * 
-   * @param name
-   *    name of the document
-   * @return
-   *    versioned document object
-   */
-  VersionedDocument createVersionedDocument(String name);
-
-  /**
-   * Return a list of all documents that are checked out in the repository.
-   * 
-   * @param orderBy
-   *    orderBy specification according to CMIS spec.
-   * @return
-   *    list of checked out documents in the repository
-   */
-  List<VersionedDocument> getCheckedOutDocuments(String orderBy);
+	/**
+	 * Get the root folder of this object store
+	 * 
+	 * @return the root folder of this store
+	 */
+	Folder getRootFolder();
+
+	/**
+	 * return an object by path.
+	 * 
+	 * @param path
+	 *            the path to the object
+	 * @return the stored object with this path
+	 */
+	StoredObject getObjectByPath(String path);
+
+	/**
+	 * get an object by its id
+	 * 
+	 * @param folderId
+	 *            the id of the object
+	 * @return the object identified by this id
+	 */
+	StoredObject getObjectById(String folderId);
+
+	/**
+	 * Deletes an object from the store. For a folders the folder must be empty.
+	 * 
+	 * @param objectId
+	 */
+	void deleteObject(String objectId);
+
+	/**
+	 * Create a document as initial step. The document is created but still
+	 * temporary It is not yet persisted and does not have an id yet. After this
+	 * call additional actions can take place (like assigning properties and a
+	 * type) before it is persisted.
+	 * 
+	 * @param name
+	 *            name of the document
+	 * @return document object
+	 */
+	Document createDocument(String name);
+
+	/**
+	 * Create a folder as initial step. The folder is created but still
+	 * temporary It is not yet persisted and does not have an id yet. After this
+	 * call additional actions can take place (like assigning properties and a
+	 * type) before it is persisted.
+	 * 
+	 * @param name
+	 *            name of the folder
+	 * @return folder object
+	 */
+	Folder createFolder(String name);
+
+	/**
+	 * Create a document that supports versions as initial step. The document is
+	 * created but still temporary. It is not yet persisted and does not have an
+	 * id yet. After this call additional actions can take place (like assigning
+	 * properties and a type) before it is persisted.
+	 * 
+	 * @param name
+	 *            name of the document
+	 * @return versioned document object
+	 */
+	VersionedDocument createVersionedDocument(String name);
+
+	/**
+	 * Return a list of all documents that are checked out in the repository.
+	 * 
+	 * @param orderBy
+	 *            orderBy specification according to CMIS spec.
+	 * @return list of checked out documents in the repository
+	 */
+	List<VersionedDocument> getCheckedOutDocuments(String orderBy);
 }
\ No newline at end of file

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/SingleFiling.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/SingleFiling.java?rev=934878&r1=934877&r2=934878&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/SingleFiling.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/SingleFiling.java Fri Apr 16 14:00:23 2010
@@ -19,31 +19,33 @@
 package org.apache.chemistry.opencmis.inmemory.storedobj.api;
 
 /**
- * Folders have in the CMIS specification exactly one parent. This interface describes
- * the behavior of objects with a single parent object.
+ * Folders have in the CMIS specification exactly one parent. This interface
+ * describes the behavior of objects with a single parent object.
  * 
  * @author Jens
- *
+ * 
  */
 public interface SingleFiling extends Filing {
 
-  /**
-   * @return
-   */
-  String getPath();
+	/**
+	 * @return
+	 */
+	String getPath();
+
+	/**
+	 * @return
+	 */
+	Folder getParent();
 
-  /**
-   * @return
-   */
-  Folder getParent();
+	/**
+	 * Put the document in a folder and set the parent. This method should not
+	 * be used to file a document in a folder. It is used internally when a
+	 * document is filed to the folder. The document does not get persisted in
+	 * this call.
+	 * 
+	 * @param parent
+	 *            parent folder of the document to be assigned.
+	 */
+	void setParent(Folder parent);
 
-  /** Put the document in a folder and set the parent. This method should not 
-   * be used to file a document in a folder. It is used internally when a document
-   * is filed to the folder. The document does not get persisted in this call.
-   * 
-   * @param parent
-   *    parent folder of the document to be assigned.
-   */
-  void setParent(Folder parent);
-  
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoreManager.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoreManager.java?rev=934878&r1=934877&r2=934878&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoreManager.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoreManager.java Fri Apr 16 14:00:23 2010
@@ -26,124 +26,121 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.api.TypeDefinitionContainer;
 
 /**
- * interface to a repository implementation. This interface is the entry point to a 
- * repository that can persist CMIS objects. Using this interface the type information
- * can be retrieved or set, a repository can be created or for a given repository the
- * store can be retrieved. 
+ * interface to a repository implementation. This interface is the entry point
+ * to a repository that can persist CMIS objects. Using this interface the type
+ * information can be retrieved or set, a repository can be created or for a
+ * given repository the store can be retrieved.
  * 
  * @author Jens
  */
 public interface StoreManager {
 
-  /**
-   * return a list of all available repositories
-   * @return
-   */
-  List<String> getAllRepositoryIds();
-  
-  /**
-   * Initialize the store for the given repository. Only called for repositories
-   * that exist on startup (i.e. for each repository id returned in a previous
-   * getAllRepositoryIds() call.
-   * 
-   * @param repositoryId
-   *    id of repository to initialize
-   * @param isCreated
-   *    true if the repository was just created and is initialized for the first time
-   *    false if it existed before and is reloaded
-   */
-  public void initRepository(String repositoryId);
-  
-  /**
-   * get the object store for the given repository id.
-   * 
-   * @param repositoryId
-   * @return the object store in which objects for this repository are stored.
-   */
-  ObjectStore getObjectStore(String repositoryId);
-
-  /**
-   * create a new repository with the given id. Create the repository, initiate
-   * the type system and initialize it so that it is ready for use
-   * 
-   * @param repositoryId
-   *    id of repository
-   * @param typeCreatorClassName
-   *    class implementing the type creation, the class must implement the interface
-   *    TypeCreator
-   */
-  void createAndInitRepository(String repositoryId, String typeCreatorClassName);
-    
-  /**
-   * retrieve a list with all type definitions. 
-   * @param repositoryId
-   *    id of repository 
-   * @param includePropertyDefinitions
-   *    indicates whether to include property definitions in returned type
-   * @return
-   *    map with type definition
-   */
-  Collection<TypeDefinitionContainer> getTypeDefinitionList(String repositoryId,
-      boolean includePropertyDefinitions);
-  
-  /**
-   * Retrieve a type definition for a give repository and type id
-   * 
-   * @param repositoryId
-   *    id of repository 
-   * @param typeId
-   *    id of type definition
-   * @return
-   *    type definition
-   */
-  TypeDefinitionContainer getTypeById(String repositoryId, String typeId);
-
-  /**
-   * Retrieve a type definition for a give repository and type id with or
-   * without property definitions and limited to depth in hierarchy
-   * 
-   * @param repositoryId
-   *    id of repository 
-   * @param typeId
-   *    id of type definition
-   * @param includePropertyDefinitions
-   *    indicates whether to include property definitions in returned type
-   * @param depth
-   *    limit depth of type hierarchy in return (-1 means unlimited)
-   * @return
-   *    type definition
-   */
-  TypeDefinitionContainer getTypeById(String repositoryId, String typeId,
-      boolean includePropertyDefinitions, int depth);
-
-  /**
-   * Retrieve a factory to create CMIS data structures used as containers
-   * 
-   * @return
-   *    factory object
-   */
-  BindingsObjectFactory getObjectFactory();
-
-  /**
-   * Retrieve a list of root types in the repositories. Root types are available by
-   * definition and need to to be created by a client. CMIS supports documents,
-   * folders, relations and policies as root types
-   * 
-   * @param repositoryId
-   *    id of repository
-   * @return
-   *    list of root types
-   */
-  List<TypeDefinitionContainer> getRootTypes(String repositoryId);
-
-  /**
-   * Retrieve the repository information for a repository
-   * 
-   * @param repositoryId
-   *    id of repository
-   * @return
-   *    repository information
-   */
-  RepositoryInfo getRepositoryInfo(String repositoryId);
+	/**
+	 * return a list of all available repositories
+	 * 
+	 * @return
+	 */
+	List<String> getAllRepositoryIds();
+
+	/**
+	 * Initialize the store for the given repository. Only called for
+	 * repositories that exist on startup (i.e. for each repository id returned
+	 * in a previous getAllRepositoryIds() call.
+	 * 
+	 * @param repositoryId
+	 *            id of repository to initialize
+	 * @param isCreated
+	 *            true if the repository was just created and is initialized for
+	 *            the first time false if it existed before and is reloaded
+	 */
+	public void initRepository(String repositoryId);
+
+	/**
+	 * get the object store for the given repository id.
+	 * 
+	 * @param repositoryId
+	 * @return the object store in which objects for this repository are stored.
+	 */
+	ObjectStore getObjectStore(String repositoryId);
+
+	/**
+	 * create a new repository with the given id. Create the repository,
+	 * initiate the type system and initialize it so that it is ready for use
+	 * 
+	 * @param repositoryId
+	 *            id of repository
+	 * @param typeCreatorClassName
+	 *            class implementing the type creation, the class must implement
+	 *            the interface TypeCreator
+	 */
+	void createAndInitRepository(String repositoryId, String typeCreatorClassName);
+
+	/**
+	 * retrieve a list with all type definitions.
+	 * 
+	 * @param repositoryId
+	 *            id of repository
+	 * @param includePropertyDefinitions
+	 *            indicates whether to include property definitions in returned
+	 *            type
+	 * @return map with type definition
+	 */
+	Collection<TypeDefinitionContainer> getTypeDefinitionList(String repositoryId, boolean includePropertyDefinitions);
+
+	/**
+	 * Retrieve a type definition for a give repository and type id
+	 * 
+	 * @param repositoryId
+	 *            id of repository
+	 * @param typeId
+	 *            id of type definition
+	 * @return type definition
+	 */
+	TypeDefinitionContainer getTypeById(String repositoryId, String typeId);
+
+	/**
+	 * Retrieve a type definition for a give repository and type id with or
+	 * without property definitions and limited to depth in hierarchy
+	 * 
+	 * @param repositoryId
+	 *            id of repository
+	 * @param typeId
+	 *            id of type definition
+	 * @param includePropertyDefinitions
+	 *            indicates whether to include property definitions in returned
+	 *            type
+	 * @param depth
+	 *            limit depth of type hierarchy in return (-1 means unlimited)
+	 * @return type definition
+	 */
+	TypeDefinitionContainer getTypeById(String repositoryId, String typeId, boolean includePropertyDefinitions,
+			int depth);
+
+	/**
+	 * Retrieve a factory to create CMIS data structures used as containers
+	 * 
+	 * @return factory object
+	 */
+	BindingsObjectFactory getObjectFactory();
+
+	/**
+	 * Retrieve a list of root types in the repositories. Root types are
+	 * available by definition and need to to be created by a client. CMIS
+	 * supports documents, folders, relations and policies as root types
+	 * 
+	 * @param repositoryId
+	 *            id of repository
+	 * @return list of root types
+	 */
+	List<TypeDefinitionContainer> getRootTypes(String repositoryId);
+
+	/**
+	 * Retrieve the repository information for a repository
+	 * 
+	 * @param repositoryId
+	 *            id of repository
+	 * @return repository information
+	 */
+	RepositoryInfo getRepositoryInfo(String repositoryId);
 
 }
\ No newline at end of file

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoredObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoredObject.java?rev=934878&r1=934877&r2=934878&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoredObject.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoredObject.java Fri Apr 16 14:00:23 2010
@@ -26,194 +26,205 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.api.PropertyData;
 
 /**
- * Stored Object interface is common part that all objects handled by CMIS (Documents, Folders,
- * Relations, Policies, ACLs) share. Objects that implement this interface are always concrete
- * and can live in the object store. A stored object always has an id, a name and properties.
+ * Stored Object interface is common part that all objects handled by CMIS
+ * (Documents, Folders, Relations, Policies, ACLs) share. Objects that implement
+ * this interface are always concrete and can live in the object store. A stored
+ * object always has an id, a name and properties.
  * 
  * @author Jens
  */
 
 public interface StoredObject {
 
-  /**
-   * Retrieve the id of this object.
-   *  
-   * @return
-   *    id of this object
-   */
-  String getId();
-
-  /**
-   * Retrieve the name of this object
-   * 
-   * @return 
-   *    name of this object
-   */
-  String getName();
-
-  /**
-   * Set the name of this document. This method does not persist the object.
-   * 
-   * @param name
-   *    name that is assigned to this object
-   */
-  void setName(String name);
-
-  /**
-   * Retrieve the type of this document.
-   * 
-   * @return
-   *    Id of the type identifying the type of this object
-   */
-  String getTypeId();
-
-  /**
-   * Set the type of this document. This method does not persist the object.
-   * 
-   * @param type
-   *    id of the type this object gets assigned.
-   */
-  void setTypeId(String type);
-
-  /**
-   * Retrieve the user who created the document
-   * 
-   * @return
-   *    user who created the document. 
-   */
-  String getCreatedBy();
-
-  /** 
-   * Set the user who last modified the object. This method does not persist the object.
-   * 
-   * @param createdBy
-   *    user who last modified the document
-   */
-  void setCreatedBy(String createdBy);
-
-  /**
-   * Retrieve the user who last modified the document
-   * 
-   * @return
-   *    user who last modified the document. 
-   */
-  String getModifiedBy();
-
-  /** 
-   * Set the user who last modified the object. This method does not persist the object.
-   * 
-   * @param modifiedBy
-   *    user who last modified the document
-   */
-  void setModifiedBy(String modifiedBy);
-
-  GregorianCalendar getCreatedAt();
-
-  /**
-   * Assign date and time when the object was created. Usually you should not call this
-   * method externally. This method does not persist the object.
-   * 
-   * @param createdAt
-   *    date the object was created
-   */
-  void setCreatedAt(GregorianCalendar createdAt);
-
-  /** 
-   * Retrieve date and time when the object was last modified.
-   * @return
-   *    date the object was last modified
-   */
-  GregorianCalendar getModifiedAt();
-
-  /**
-   * Assign current date and time when the object was last modified. Usually you should not call this
-   * method externally. This method does not persist the object.
-   */
-  void setModifiedAtNow();
-  
-  /** Get the repository id of this object where the object is stored. 
-   * @return
-   */
-  String getRepositoryId();
-
-  /**
-   * Assign a repository where this object will be stored. This method does not persist the object.
-   * 
-   * @param repositoryId
-   *    id of the repository 
-   */
-  void setRepositoryId(String repositoryId);
-  
-  /**
-   * Retrieve the list of properties
-   * @return
-   */
-  Map<String, PropertyData<?>> getProperties();
-
-  /**
-   * Assign the properties to an object. This method does not persist the object.
-   * 
-   * @param props
-   *    properties to be assigned
-   */
-  void setProperties(Map<String, PropertyData<?>> props);
-  
-  /**
-   * Retrieve a change token uniquely identifying the state of the object when it was
-   * persisted (used for optimistic locking)
-   * 
-   * @return
-   *    String identifying the change token
-   */
-  String getChangeToken();
-
-  /**
-   * Persist the object so that it can be later retrieved by its id. Assign an id to the object
-   */
-  void persist();
-
-  /** 
-   * Rename an object 
-   * @param newName
-   *      the new name of the object
-   */
-  void rename(String newName);
-
-  /**
-   * Create all system base properties that need to be stored with every object in the repository
-   * This method is called when a new object is created to record all of the capturing data like the
-   * creation time, creator etc.
-   * 
-   * @param properties
-   *          The properties passed by the client, containing, name, type, etc
-   * @param user
-   *          The user creating the document
-   */
-  void createSystemBasePropertiesWhenCreated(Map<String, PropertyData<?>> properties, String user);
-
-  /**
-   * Update all system base properties that need to be stored with every object in the repository
-   * This method is called when an object is is updated to record all of the capturing data like the
-   * modification time, updating user etc.
-   * 
-   * @param properties
-   *          The properties passed by the client, containing, name, type, etc
-   * @param user
-   *          The user creating the document
-   */
-  void updateSystemBasePropertiesWhenModified(Map<String, PropertyData<?>> properties, String user);
-
-  void fillProperties(Map<String, PropertyData<?>> properties, BindingsObjectFactory objFactory,
-      List<String> requestedIds);
-
-  /**
-   * Set all properties which are not system properties. These are the properties as defined in Type
-   * system definition. This method is called when an object is created or updated. The
-   * implementation must ignore the system properties.
-   * 
-   * @param properties
-   *          Set of properties as set by the client, including system parameters
-   */
-  void setCustomProperties(Map<String, PropertyData<?>> properties);
+	/**
+	 * Retrieve the id of this object.
+	 * 
+	 * @return id of this object
+	 */
+	String getId();
+
+	/**
+	 * Retrieve the name of this object
+	 * 
+	 * @return name of this object
+	 */
+	String getName();
+
+	/**
+	 * Set the name of this document. This method does not persist the object.
+	 * 
+	 * @param name
+	 *            name that is assigned to this object
+	 */
+	void setName(String name);
+
+	/**
+	 * Retrieve the type of this document.
+	 * 
+	 * @return Id of the type identifying the type of this object
+	 */
+	String getTypeId();
+
+	/**
+	 * Set the type of this document. This method does not persist the object.
+	 * 
+	 * @param type
+	 *            id of the type this object gets assigned.
+	 */
+	void setTypeId(String type);
+
+	/**
+	 * Retrieve the user who created the document
+	 * 
+	 * @return user who created the document.
+	 */
+	String getCreatedBy();
+
+	/**
+	 * Set the user who last modified the object. This method does not persist
+	 * the object.
+	 * 
+	 * @param createdBy
+	 *            user who last modified the document
+	 */
+	void setCreatedBy(String createdBy);
+
+	/**
+	 * Retrieve the user who last modified the document
+	 * 
+	 * @return user who last modified the document.
+	 */
+	String getModifiedBy();
+
+	/**
+	 * Set the user who last modified the object. This method does not persist
+	 * the object.
+	 * 
+	 * @param modifiedBy
+	 *            user who last modified the document
+	 */
+	void setModifiedBy(String modifiedBy);
+
+	GregorianCalendar getCreatedAt();
+
+	/**
+	 * Assign date and time when the object was created. Usually you should not
+	 * call this method externally. This method does not persist the object.
+	 * 
+	 * @param createdAt
+	 *            date the object was created
+	 */
+	void setCreatedAt(GregorianCalendar createdAt);
+
+	/**
+	 * Retrieve date and time when the object was last modified.
+	 * 
+	 * @return date the object was last modified
+	 */
+	GregorianCalendar getModifiedAt();
+
+	/**
+	 * Assign current date and time when the object was last modified. Usually
+	 * you should not call this method externally. This method does not persist
+	 * the object.
+	 */
+	void setModifiedAtNow();
+
+	/**
+	 * Get the repository id of this object where the object is stored.
+	 * 
+	 * @return
+	 */
+	String getRepositoryId();
+
+	/**
+	 * Assign a repository where this object will be stored. This method does
+	 * not persist the object.
+	 * 
+	 * @param repositoryId
+	 *            id of the repository
+	 */
+	void setRepositoryId(String repositoryId);
+
+	/**
+	 * Retrieve the list of properties
+	 * 
+	 * @return
+	 */
+	Map<String, PropertyData<?>> getProperties();
+
+	/**
+	 * Assign the properties to an object. This method does not persist the
+	 * object.
+	 * 
+	 * @param props
+	 *            properties to be assigned
+	 */
+	void setProperties(Map<String, PropertyData<?>> props);
+
+	/**
+	 * Retrieve a change token uniquely identifying the state of the object when
+	 * it was persisted (used for optimistic locking)
+	 * 
+	 * @return String identifying the change token
+	 */
+	String getChangeToken();
+
+	/**
+	 * Persist the object so that it can be later retrieved by its id. Assign an
+	 * id to the object
+	 */
+	void persist();
+
+	/**
+	 * Rename an object
+	 * 
+	 * @param newName
+	 *            the new name of the object
+	 */
+	void rename(String newName);
+
+	/**
+	 * Create all system base properties that need to be stored with every
+	 * object in the repository This method is called when a new object is
+	 * created to record all of the capturing data like the creation time,
+	 * creator etc.
+	 * 
+	 * @param properties
+	 *            The properties passed by the client, containing, name, type,
+	 *            etc
+	 * @param user
+	 *            The user creating the document
+	 */
+	void createSystemBasePropertiesWhenCreated(Map<String, PropertyData<?>> properties, String user);
+
+	/**
+	 * Update all system base properties that need to be stored with every
+	 * object in the repository This method is called when an object is is
+	 * updated to record all of the capturing data like the modification time,
+	 * updating user etc.
+	 * 
+	 * @param properties
+	 *            The properties passed by the client, containing, name, type,
+	 *            etc
+	 * @param user
+	 *            The user creating the document
+	 */
+	void updateSystemBasePropertiesWhenModified(Map<String, PropertyData<?>> properties, String user);
+
+	void fillProperties(Map<String, PropertyData<?>> properties, BindingsObjectFactory objFactory,
+			List<String> requestedIds);
+
+	/**
+	 * Set all properties which are not system properties. These are the
+	 * properties as defined in Type system definition. This method is called
+	 * when an object is created or updated. The implementation must ignore the
+	 * system properties.
+	 * 
+	 * @param properties
+	 *            Set of properties as set by the client, including system
+	 *            parameters
+	 */
+	void setCustomProperties(Map<String, PropertyData<?>> properties);
 
 }
\ No newline at end of file



Mime
View raw message