You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by sk...@apache.org on 2010/02/22 17:20:43 UTC

svn commit: r912643 - in /incubator/chemistry/trunk/opencmis: opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/ opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/ opencmis-c...

Author: sklevenz
Date: Mon Feb 22 16:20:43 2010
New Revision: 912643

URL: http://svn.apache.org/viewvc?rev=912643&view=rev
Log:
API SessionParameter clean up and re-factoring
https://issues.apache.org/jira/browse/CMIS-120
Continuous Runtime Implementation and Unit Tests
https://issues.apache.org/jira/browse/CMIS-124

Added:
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/enums/BindingType.java   (with props)
Modified:
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/SessionFactoryImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/Cache.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/CacheImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/misc/CacheTest.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/mock/MockTestSuite.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/otx/OtxAtomPubCmisTestSuite.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/SessionParameter.java

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java?rev=912643&r1=912642&r2=912643&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java Mon Feb 22 16:20:43 2010
@@ -25,6 +25,8 @@
 import java.util.Map;
 import java.util.UUID;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.opencmis.client.api.ChangeEvent;
 import org.apache.opencmis.client.api.CmisObject;
 import org.apache.opencmis.client.api.Document;
@@ -44,6 +46,7 @@
 import org.apache.opencmis.client.runtime.cache.CacheImpl;
 import org.apache.opencmis.client.runtime.repository.PropertyFactoryImpl;
 import org.apache.opencmis.commons.SessionParameter;
+import org.apache.opencmis.commons.enums.BindingType;
 import org.apache.opencmis.commons.enums.CmisProperties;
 import org.apache.opencmis.commons.enums.IncludeRelationships;
 import org.apache.opencmis.commons.enums.UnfileObjects;
@@ -55,48 +58,44 @@
 public class PersistentSessionImpl implements PersistentSession, Testable,
 		Serializable {
 
+	private static Log log = LogFactory.getLog(PersistentSessionImpl.class);
+
 	/*
-	 * root folder containing generated test data
-	 * (not serializable)
+	 * root folder containing generated test data (not serializable)
 	 */
 	private transient Folder testRootFolder = null;
 
 	/*
-	 * session parameter
-	 * (serializable)
+	 * session parameter (serializable)
 	 */
 	private Map<String, String> parameters = null;
 
 	/*
-	 * CMIS provider
-	 * (serializable)
+	 * CMIS provider (serializable)
 	 */
 	private CmisProvider provider = null;
 
 	/*
-	 * Session Locale, determined from session parameter
-	 * (serializable)
+	 * Session Locale, determined from session parameter (serializable)
 	 */
 	private Locale locale = null;
 
 	/*
-	 * If not set explicitly then the repository id is returned by the repository
-	 * (serializable)
+	 * If not set explicitly then the repository id is returned by the
+	 * repository (serializable)
 	 */
 	private String repositoryId;
 
 	/*
-	 * helper factory
-	 * (non serializable)
+	 * helper factory (non serializable)
 	 */
 	private transient PropertyFactory propertyFactory = new PropertyFactoryImpl();
 
 	/*
-	 * Object cache
-	 * (serializable)
+	 * Object cache (serializable)
 	 */
-	private Cache cache = new CacheImpl();
-	
+	private Cache cache = null;
+
 	/**
 	 * required for serialization
 	 */
@@ -104,8 +103,31 @@
 
 	public PersistentSessionImpl(Map<String, String> parameters) {
 		this.parameters = parameters;
+		PersistentSessionImpl.log.info("Session Parameters: " + parameters);
+
 		this.locale = this.determineLocale(parameters);
+		PersistentSessionImpl.log.info("Session Locale: "
+				+ this.locale.toString());
+
 		this.repositoryId = this.determineRepositoryId(parameters);
+		PersistentSessionImpl.log.info("Session Repository Id: "
+				+ this.repositoryId);
+
+		int cacheSize = this.determineCacheSize(parameters);
+
+		if (cacheSize == -1) {
+			this.cache = CacheImpl.newInstance();
+		} else {
+			this.cache = CacheImpl.newInstance(cacheSize);
+		}
+		PersistentSessionImpl.log.info("Session Cache Size: "
+				+ this.cache.size());
+	}
+
+	private int determineCacheSize(Map<String, String> parameters) {
+		int size = -1;
+
+		return size;
 	}
 
 	private String determineRepositoryId(Map<String, String> parameters) {
@@ -113,10 +135,10 @@
 		// if null then the provider will return a repository id (lazy)
 		return repositoryId;
 	}
-	
+
 	private Locale determineLocale(Map<String, String> parameters) {
 		Locale locale = null;
-		
+
 		String language = parameters
 				.get(SessionParameter.LOCALE_ISO639_LANGUAGE);
 		String country = parameters
@@ -124,22 +146,22 @@
 		String variant = parameters.get(SessionParameter.LOCALE_VARIANT);
 
 		if (variant != null) {
-			// all 3 parameter must not be null and valid 
+			// all 3 parameter must not be null and valid
 			locale = new Locale(language, country, variant);
-		}else {
+		} else {
 			if (country != null) {
-				// 2 parameter must not be null and valid 
+				// 2 parameter must not be null and valid
 				locale = new Locale(language, country);
-			}else {
+			} else {
 				if (language != null) {
-					// 1 parameter must not be null and valid 
+					// 1 parameter must not be null and valid
 					locale = new Locale(language);
 				} else {
 					locale = Locale.getDefault();
 				}
 			}
 		}
-		
+
 		return locale;
 	}
 
@@ -195,16 +217,18 @@
 
 	public Folder getRootFolder() {
 		Folder rootFolder = null;
-		
+
 		if (this.cache.containsPath("/")) {
 			rootFolder = (Folder) this.cache.getByPath("/");
 		} else {
 			String rootFolderId = this.getRepositoryInfo().getRootFolderId();
-			ObjectData od = this.provider.getObjectService().getObject(this.repositoryId, rootFolderId, "", false, IncludeRelationships.NONE, "", false, false, null);
+			ObjectData od = this.provider.getObjectService().getObject(
+					this.repositoryId, rootFolderId, "", false,
+					IncludeRelationships.NONE, "", false, false, null);
 			rootFolder = new PersistentFolderImpl(this, od);
 			this.cache.put(rootFolder);
 		}
-		
+
 		return rootFolder;
 	}
 
@@ -241,7 +265,9 @@
 	}
 
 	public void generateTestData(Map<String, String> parameter) {
-		ObjectGenerator og = new ObjectGenerator(this.provider.getObjectFactory(), this.provider.getNavigationService(), this.provider.getObjectService(), this.repositoryId);
+		ObjectGenerator og = new ObjectGenerator(this.provider
+				.getObjectFactory(), this.provider.getNavigationService(),
+				this.provider.getObjectService(), this.repositoryId);
 		Folder rootFolder = null;
 		String documentTypeId = null;
 		String folderTypeId = null;
@@ -310,47 +336,30 @@
 		if (this.parameters == null || this.parameters.isEmpty()) {
 			throw new CmisRuntimeException("Session parameter not set!");
 		}
-		// Is the AtomPub URL set?
-		boolean isAtomPub = this.parameters
-				.containsKey(SessionParameter.ATOMPUB_URL) ? true : false;
-		// Are the WebService Prefix or all service URLS are set?
-		boolean isWebService = this.parameters
-				.containsKey(SessionParameter.WEBSERVICE_URL_PREFIX)
-				|| (this.parameters
-						.containsKey(SessionParameter.WEBSERVICES_ACL_SERVICE)
-						&& this.parameters
-								.containsKey(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE)
-						&& this.parameters
-								.containsKey(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE)
-						&& this.parameters
-								.containsKey(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE)
-						&& this.parameters
-								.containsKey(SessionParameter.WEBSERVICES_OBJECT_SERVICE)
-						&& this.parameters
-								.containsKey(SessionParameter.WEBSERVICES_POLICY_SERVICE)
-						&& this.parameters
-								.containsKey(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE)
-						&& this.parameters
-								.containsKey(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE) && this.parameters
-						.containsKey(SessionParameter.WEBSERVICES_VERSIONING_SERVICE)) ? true
-				: false;
 
-		if (!(isAtomPub ^ isWebService)) {
-			// Illegal parameter combination
-			throw new CmisRuntimeException("Ambiguous session parameter: "
-					+ this.parameters);
-		}
+		BindingType bt = BindingType.fromValue(this.parameters
+				.get(SessionParameter.BINDING_TYPE));
 
-		if (isAtomPub) {
+		switch (bt) {
+		case ATOM:
 			this.provider = this.creaetAtomPubProvider(this.parameters);
-		} else if (isWebService) {
+			break;
+		case SOAP:
 			this.provider = this.creaetWebServiceProvider(this.parameters);
-		} else {
-			// Illegal parameter combination
+			break;
+		case UNSPECIFIC:
+			this.provider = this.creaetUnspecificProvider(this.parameters);
+			break;
+		default:
 			throw new CmisRuntimeException("Ambiguous session parameter: "
 					+ this.parameters);
 		}
+	}
 
+	private CmisProvider creaetUnspecificProvider(Map<String, String> parameters) {
+		CmisProviderFactory factory = CmisProviderFactory.newInstance();
+		CmisProvider provider = factory.createCmisProvider(parameters);
+		return provider;
 	}
 
 	private CmisProvider creaetWebServiceProvider(Map<String, String> parameters) {

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/SessionFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/SessionFactoryImpl.java?rev=912643&r1=912642&r2=912643&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/SessionFactoryImpl.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/SessionFactoryImpl.java Mon Feb 22 16:20:43 2010
@@ -46,6 +46,14 @@
  */
 public class SessionFactoryImpl implements SessionFactory {
 
+	protected SessionFactoryImpl() {
+
+	}
+
+	public static SessionFactory newInstance() {
+		return new SessionFactoryImpl();
+	}
+
 	@SuppressWarnings("unchecked")
 	public <T extends Session> T createSession(Map<String, String> parameters) {
 		Session s = null;
@@ -63,7 +71,7 @@
 		switch (t) {
 		case PERSISTENT:
 			PersistentSessionImpl ps = new PersistentSessionImpl(parameters);
-			ps.connect();  // connect session with provider
+			ps.connect(); // connect session with provider
 			s = ps;
 			break;
 		case TRANSIENT:

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/Cache.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/Cache.java?rev=912643&r1=912642&r2=912643&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/Cache.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/Cache.java Mon Feb 22 16:20:43 2010
@@ -44,4 +44,5 @@
 	// public List<CmisObject> get(int pageNumber);
 	
 	void clear();
+	int size();
 }

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/CacheImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/CacheImpl.java?rev=912643&r1=912642&r2=912643&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/CacheImpl.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/CacheImpl.java Mon Feb 22 16:20:43 2010
@@ -42,12 +42,20 @@
 	 */
 	private static final long serialVersionUID = 1978445442452564094L;
 
-	public CacheImpl() {
+	public static Cache newInstance() {
+		return new CacheImpl();
+	}
+
+	public static Cache newInstance(int cacheSize) {
+		return new CacheImpl(cacheSize);
+	}
+
+	protected CacheImpl() {
 		this.idMap = this.createLruCache();
 		this.pathMap = this.createLruCache();
 	}
 
-	public CacheImpl(int cacheSize) {
+	protected CacheImpl(int cacheSize) {
 		this.cacheSize = cacheSize;
 
 		this.idMap = this.createLruCache();
@@ -99,4 +107,8 @@
 		this.pathMap.put(object.getPath(), object);
 	}
 
+	public int size() {
+		return this.cacheSize;
+	}
+
 }

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/misc/CacheTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/misc/CacheTest.java?rev=912643&r1=912642&r2=912643&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/misc/CacheTest.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/misc/CacheTest.java Mon Feb 22 16:20:43 2010
@@ -18,17 +18,24 @@
  */
 package org.apache.opencmis.client.runtime.misc;
 
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
 import junit.framework.Assert;
 
 import org.apache.opencmis.client.api.CmisObject;
 import org.apache.opencmis.client.runtime.cache.Cache;
 import org.apache.opencmis.client.runtime.cache.CacheImpl;
-import static org.easymock.EasyMock.createNiceMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
 import org.junit.Before;
 import org.junit.Test;
 
+import com.sun.xml.ws.util.ByteArrayBuffer;
+
 public class CacheTest {
 
 	@Before
@@ -36,8 +43,8 @@
 	}
 
 	@Test
-	public void cacheSingleobject() {
-		Cache cache = new CacheImpl();
+	public void cacheSingleObjectTest() {
+		Cache cache = CacheImpl.newInstance();
 
 		String id = "1";
 		String path = "/1";
@@ -71,20 +78,53 @@
 	}
 
 	@Test
+	public void cacheSizeTest() {
+		int cacheSize = 50000;
+		Cache cache = CacheImpl.newInstance(cacheSize);
+		Assert.assertEquals(cacheSize, cache.size());
+	}
+
+	@Test
 	public void lruTest() {
 		int cacheSize = 3;
-		Cache cache = new CacheImpl(cacheSize);
+		Cache cache = CacheImpl.newInstance(cacheSize);
 
 		for (int i = 0; i < cacheSize + 1; i++) {
 			CmisObject obj = this.createCmisObject("id" + i, "path" + i);
 			cache.put(obj);
 		}
-		
-		Assert.assertNull(cache.get("id0"));    // thrown out
+
+		Assert.assertNull(cache.get("id0")); // thrown out
 		Assert.assertNotNull(cache.get("id1"));
 		Assert.assertNotNull(cache.get("id2"));
 		Assert.assertNotNull(cache.get("id3"));
-		
+	}
+
+	@Test
+	public void serializationTest() throws IOException, ClassNotFoundException {
+		int cacheSize = 10;
+		Cache cache = CacheImpl.newInstance(cacheSize);
+
+		for (int i = 0; i < cacheSize; i++) {
+			CmisObject obj = this.createCmisObject("id" + i, "path" + i);
+			cache.put(obj);
+		}
+
+		ByteArrayBuffer buffer = new ByteArrayBuffer();
+		ObjectOutputStream out = new ObjectOutputStream(buffer);
+		out.writeObject(cache);
+		out.close();
+
+		ObjectInputStream in = new ObjectInputStream(buffer.newInputStream());
+		Cache cache2 = (Cache) in.readObject();
+		in.close();
+
+		for (int k = 0; k < cacheSize; k++) {
+			CmisObject o1 = cache.get("id" + k);
+			CmisObject o2 = cache2.get("id" + k);
+			Assert.assertEquals(o1.getId(), o2.getId());
+		}
+
 	}
 
 	/**

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/mock/MockTestSuite.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/mock/MockTestSuite.java?rev=912643&r1=912642&r2=912643&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/mock/MockTestSuite.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/mock/MockTestSuite.java Mon Feb 22 16:20:43 2010
@@ -31,6 +31,7 @@
 import org.apache.opencmis.client.runtime.ReadOnlyRepositoryInfoTest;
 import org.apache.opencmis.client.runtime.ReadOnlySessionTest;
 import org.apache.opencmis.client.runtime.ReadOnlyTypeTest;
+import org.apache.opencmis.client.runtime.misc.CacheTest;
 import org.apache.opencmis.client.runtime.mock.MockSessionFactory;
 import org.apache.opencmis.client.runtime.suite.AbstractCmisTestSuite;
 import org.apache.opencmis.commons.SessionParameter;
@@ -46,7 +47,7 @@
 @SuiteClasses( { ReadOnlyCreateSessionTest.class, ReadOnlySessionTest.class,
     ReadOnlyRepositoryInfoTest.class, ReadOnlyAclCapabilityTest.class, ReadOnlyObjectTest.class,
     ReadOnlyTypeTest.class, ReadOnlyNavigationTest.class, ReadOnlyContentStreamTest.class,
-    ReadOnlyDiscoverTest.class })
+    ReadOnlyDiscoverTest.class, CacheTest.class })
 public class MockTestSuite extends AbstractCmisTestSuite {
 
   public MockTestSuite(Class<?> klass, RunnerBuilder r) throws InitializationError {

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/otx/OtxAtomPubCmisTestSuite.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/otx/OtxAtomPubCmisTestSuite.java?rev=912643&r1=912642&r2=912643&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/otx/OtxAtomPubCmisTestSuite.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/otx/OtxAtomPubCmisTestSuite.java Mon Feb 22 16:20:43 2010
@@ -28,6 +28,7 @@
 import org.apache.opencmis.client.runtime.SessionFactoryImpl;
 import org.apache.opencmis.client.runtime.suite.AbstractCmisTestSuite;
 import org.apache.opencmis.commons.SessionParameter;
+import org.apache.opencmis.commons.enums.BindingType;
 import org.apache.opencmis.commons.enums.SessionType;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite.SuiteClasses;
@@ -54,8 +55,8 @@
     parameter.put(SessionParameter.SESSION_TYPE, SessionType.PERSISTENT.value());
     parameter.put(SessionParameter.LOCALE_ISO3166_COUNTRY, Locale.GERMANY.getISO3Country());
     parameter.put(SessionParameter.LOCALE_ISO639_LANGUAGE, Locale.GERMANY.getISO3Language());
+    parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOM.value());
     parameter.put(SessionParameter.ATOMPUB_URL, "http://pwdf6227:8080/cmis/atom");
-//    parameter.put(SessionParameter.WEBSERVICE_URL_PREFIX, "http://pwdf6227:8080/cmis/services");
     
     Fixture.DOCUMENT_TYPE_ID = "sap.doc";
     Fixture.FOLDER_TYPE_ID = "sap.folder";
@@ -71,7 +72,7 @@
 //    -Dopencmis.test.atompub.url=http://pwdf6227:8080/cmis/atom
     
     Fixture.setParamter(parameter);
-    Fixture.setSessionFactory(new SessionFactoryImpl());
+    Fixture.setSessionFactory(SessionFactoryImpl.newInstance());
   }
 
 }

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/SessionParameter.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/SessionParameter.java?rev=912643&r1=912642&r2=912643&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/SessionParameter.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/SessionParameter.java Mon Feb 22 16:20:43 2010
@@ -34,14 +34,15 @@
 	public static final String PASSWORD = "org.apache.opencmis.password";
 
 	// ---- provider parameter ----
+	/** Predefined binding types (see {@code BindingType}) */
+	public static final String BINDING_TYPE = "org.apache.opencmis.provider.binding.type";
+	
 	/** Class name of the binding class. */
 	public static final String BINDING_SPI_CLASS = "org.apache.opencmis.provider.binding.classname";
 
 	/** URL of the AtomPub service document. */
 	public static final String ATOMPUB_URL = "org.apache.opencmis.provider.atompub.url";
 
-	public static final String WEBSERVICE_URL_PREFIX = "org.apache.opencmis.provider.webservices.url";
-
 	public static final String WEBSERVICES_REPOSITORY_SERVICE = "org.apache.opencmis.provider.webservices.RepositoryService";
 	public static final String WEBSERVICES_NAVIGATION_SERVICE = "org.apache.opencmis.provider.webservices.NavigationService";
 	public static final String WEBSERVICES_OBJECT_SERVICE = "org.apache.opencmis.provider.webservices.ObjectService";

Added: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/enums/BindingType.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/enums/BindingType.java?rev=912643&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/enums/BindingType.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/enums/BindingType.java Mon Feb 22 16:20:43 2010
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.commons.enums;
+
+/**
+ * Binding Type Enum.
+ * 
+ * 
+ */
+public enum BindingType {
+
+  SOAP("soap"), ATOM("atom"), UNSPECIFIC("unspecific");
+  private final String value;
+
+  BindingType(String v) {
+    value = v;
+  }
+
+  public String value() {
+    return value;
+  }
+
+  public static BindingType fromValue(String v) {
+    for (BindingType c : BindingType.values()) {
+      if (c.value.equals(v)) {
+        return c;
+      }
+    }
+    throw new IllegalArgumentException(v);
+  }
+
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/enums/BindingType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain