chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1573279 - in /chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local: AbstractLocalService.java LocalCallContext.java
Date Sun, 02 Mar 2014 10:50:39 GMT
Author: fmui
Date: Sun Mar  2 10:50:39 2014
New Revision: 1573279

URL: http://svn.apache.org/r1573279
Log:
made LocalCallContext public for reuse

Added:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/LocalCallContext.java
Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/AbstractLocalService.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/AbstractLocalService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/AbstractLocalService.java?rev=1573279&r1=1573278&r2=1573279&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/AbstractLocalService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/AbstractLocalService.java
Sun Mar  2 10:50:39 2014
@@ -20,18 +20,11 @@
  */
 package org.apache.chemistry.opencmis.client.bindings.spi.local;
 
-import java.io.File;
-import java.math.BigInteger;
-import java.util.HashMap;
-import java.util.Map;
-
 import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
 import org.apache.chemistry.opencmis.commons.SessionParameter;
-import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
 import org.apache.chemistry.opencmis.commons.server.CallContext;
 import org.apache.chemistry.opencmis.commons.server.CmisService;
 import org.apache.chemistry.opencmis.commons.server.CmisServiceFactory;
-import org.apache.chemistry.opencmis.commons.server.MutableCallContext;
 
 /**
  * Base class for all local clients.
@@ -88,84 +81,4 @@ public abstract class AbstractLocalServi
     protected CmisService getService(String repositoryId) {
         return factory.getService(createCallContext(repositoryId));
     }
-
-    // ------------------------------------------------------------------
-
-    /**
-     * Simple {@link CallContext} implementation.
-     */
-    static class LocalCallContext implements MutableCallContext {
-
-        private final Map<String, Object> contextMap = new HashMap<String, Object>();
-
-        public LocalCallContext(String repositoryId, String user, String password) {
-            contextMap.put(REPOSITORY_ID, repositoryId);
-            contextMap.put(USERNAME, user);
-            contextMap.put(PASSWORD, password);
-        }
-
-        public String getBinding() {
-            return BINDING_LOCAL;
-        }
-
-        public Object get(String key) {
-            return contextMap.get(key);
-        }
-
-        public CmisVersion getCmisVersion() {
-            return CmisVersion.CMIS_1_1;
-        }
-
-        public String getRepositoryId() {
-            return (String) get(REPOSITORY_ID);
-        }
-
-        public String getUsername() {
-            return (String) get(USERNAME);
-        }
-
-        public String getPassword() {
-            return (String) get(PASSWORD);
-        }
-
-        public String getLocale() {
-            return null;
-        }
-
-        public BigInteger getOffset() {
-            return (BigInteger) get(OFFSET);
-        }
-
-        public BigInteger getLength() {
-            return (BigInteger) get(LENGTH);
-        }
-
-        public boolean isObjectInfoRequired() {
-            return false;
-        }
-
-        public File getTempDirectory() {
-            return null;
-        }
-
-        public boolean encryptTempFiles() {
-            return false;
-        }
-
-        public int getMemoryThreshold() {
-            return 0;
-        }
-
-        public long getMaxContentSize() {
-            return -1;
-        }
-
-		public void put(String key, Object value) {
-			contextMap.put(key, value);
-		}
-
-		public Object remove(String key) {
-			return contextMap.remove(key);
-		}
-    }
 }

Added: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/LocalCallContext.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/LocalCallContext.java?rev=1573279&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/LocalCallContext.java
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/LocalCallContext.java
Sun Mar  2 10:50:39 2014
@@ -0,0 +1,108 @@
+/*
+ *
+ * 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.chemistry.opencmis.client.bindings.spi.local;
+
+import java.io.File;
+import java.math.BigInteger;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
+import org.apache.chemistry.opencmis.commons.server.CallContext;
+import org.apache.chemistry.opencmis.commons.server.MutableCallContext;
+
+/**
+ * Simple {@link CallContext} implementation.
+ */
+public class LocalCallContext implements MutableCallContext {
+
+    private final Map<String, Object> contextMap = new HashMap<String, Object>();
+
+    public LocalCallContext(String repositoryId, String user, String password) {
+        contextMap.put(REPOSITORY_ID, repositoryId);
+        contextMap.put(USERNAME, user);
+        contextMap.put(PASSWORD, password);
+    }
+
+    public String getBinding() {
+        return BINDING_LOCAL;
+    }
+
+    public Object get(String key) {
+        return contextMap.get(key);
+    }
+
+    public CmisVersion getCmisVersion() {
+        return CmisVersion.CMIS_1_1;
+    }
+
+    public String getRepositoryId() {
+        return (String) get(REPOSITORY_ID);
+    }
+
+    public String getUsername() {
+        return (String) get(USERNAME);
+    }
+
+    public String getPassword() {
+        return (String) get(PASSWORD);
+    }
+
+    public String getLocale() {
+        return null;
+    }
+
+    public BigInteger getOffset() {
+        return (BigInteger) get(OFFSET);
+    }
+
+    public BigInteger getLength() {
+        return (BigInteger) get(LENGTH);
+    }
+
+    public boolean isObjectInfoRequired() {
+        return false;
+    }
+
+    public File getTempDirectory() {
+        return null;
+    }
+
+    public boolean encryptTempFiles() {
+        return false;
+    }
+
+    public int getMemoryThreshold() {
+        return 0;
+    }
+
+    public long getMaxContentSize() {
+        return -1;
+    }
+
+    public void put(String key, Object value) {
+        contextMap.put(key, value);
+    }
+
+    public Object remove(String key) {
+        return contextMap.remove(key);
+    }
+}
\ No newline at end of file



Mime
View raw message