chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1100433 - in /chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/ chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/ja...
Date Sat, 07 May 2011 02:35:34 GMT
Author: fmui
Date: Sat May  7 02:35:34 2011
New Revision: 1100433

URL: http://svn.apache.org/viewvc?rev=1100433&view=rev
Log:
added infrastructure to handle HTTP response headers in authentication providers

Added:
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/AuthenticationProvider.java   (with props)
Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/AbstractAuthenticationProvider.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/HttpUtils.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractPortProvider.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AclServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/DiscoveryServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/MultiFilingServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/NavigationServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/ObjectServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PolicyServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PortProvider.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/RelationshipServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/RepositoryServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/VersioningServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/CmisBinding.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingImpl.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/impl/CmisBindingImpl.java?rev=1100433&r1=1100432&r2=1100433&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingImpl.java Sat May  7 02:35:34 2011
@@ -27,6 +27,7 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.commons.SessionParameter;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.BindingsObjectFactoryImpl;
 import org.apache.chemistry.opencmis.commons.spi.AclService;
+import org.apache.chemistry.opencmis.commons.spi.AuthenticationProvider;
 import org.apache.chemistry.opencmis.commons.spi.BindingsObjectFactory;
 import org.apache.chemistry.opencmis.commons.spi.CmisBinding;
 import org.apache.chemistry.opencmis.commons.spi.DiscoveryService;
@@ -51,7 +52,7 @@ public class CmisBindingImpl implements 
 
     /**
      * Constructor.
-     *
+     * 
      * @param sessionParameters
      *            the session parameters
      */
@@ -161,6 +162,10 @@ public class CmisBindingImpl implements 
         return objectFactory;
     }
 
+    public AuthenticationProvider getAuthenticationProvider() {
+        return CmisBindingsHelper.getAuthenticationProvider(session);
+    }
+
     public void clearAllCaches() {
         checkSession();
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/AbstractAuthenticationProvider.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/AbstractAuthenticationProvider.java?rev=1100433&r1=1100432&r2=1100433&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/AbstractAuthenticationProvider.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/AbstractAuthenticationProvider.java Sat May  7 02:35:34 2011
@@ -23,60 +23,43 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.chemistry.opencmis.commons.SessionParameter;
+import org.apache.chemistry.opencmis.commons.spi.AuthenticationProvider;
 import org.w3c.dom.Element;
 
 /**
  * Authentication provider class.
  */
-public abstract class AbstractAuthenticationProvider implements Serializable {
+public abstract class AbstractAuthenticationProvider implements AuthenticationProvider, Serializable {
 
     private static final long serialVersionUID = 1L;
 
-    private Session fSession;
+    private Session session;
 
     /**
      * Sets the {@link Session} the authentication provider lives in.
      */
     public void setSession(Session session) {
-        fSession = session;
+        this.session = session;
     }
 
     /**
      * Returns {@link Session}.
      */
     public Session getSession() {
-        return fSession;
+        return session;
     }
 
-    /**
-     * Returns a set of HTTP headers (key-value pairs) that should be added to a
-     * HTTP call. This will be called by the AtomPub and the Web Services
-     * binding. You might want to check the binding in use before you set the
-     * headers.
-     * 
-     * @param url
-     *            the URL of the HTTP call
-     * 
-     * @return the HTTP headers or <code>null</code> if no additional headers
-     *         should be set
-     */
     public Map<String, List<String>> getHTTPHeaders(String url) {
         return null;
     }
 
-    /**
-     * Returns a SOAP header that should be added to a Web Services call.
-     * 
-     * @param portObject
-     *            the port object
-     * 
-     * @return the SOAP headers or <code>null</code> if no additional headers
-     *         should be set
-     */
     public Element getSOAPHeaders(Object portObject) {
         return null;
     }
 
+    public void setResponseHeaders(String url, Map<String, List<String>> headers) {
+    }
+
     /**
      * Gets the user name from the session.
      * 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/HttpUtils.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/atompub/HttpUtils.java?rev=1100433&r1=1100432&r2=1100433&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/HttpUtils.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/HttpUtils.java Sat May  7 02:35:34 2011
@@ -35,12 +35,12 @@ import java.util.zip.Inflater;
 import java.util.zip.InflaterInputStream;
 
 import org.apache.chemistry.opencmis.client.bindings.impl.CmisBindingsHelper;
-import org.apache.chemistry.opencmis.client.bindings.spi.AbstractAuthenticationProvider;
 import org.apache.chemistry.opencmis.client.bindings.spi.Session;
 import org.apache.chemistry.opencmis.commons.SessionParameter;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException;
 import org.apache.chemistry.opencmis.commons.impl.Base64;
 import org.apache.chemistry.opencmis.commons.impl.UrlBuilder;
+import org.apache.chemistry.opencmis.commons.spi.AuthenticationProvider;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -115,7 +115,7 @@ public class HttpUtils {
             }
 
             // authenticate
-            AbstractAuthenticationProvider authProvider = CmisBindingsHelper.getAuthenticationProvider(session);
+            AuthenticationProvider authProvider = CmisBindingsHelper.getAuthenticationProvider(session);
             if (authProvider != null) {
                 Map<String, List<String>> httpHeaders = authProvider.getHTTPHeaders(url.toString());
                 if (httpHeaders != null) {
@@ -188,6 +188,11 @@ public class HttpUtils {
                 inputStream = conn.getInputStream();
             }
 
+            // forward response HTTP headers
+            if (authProvider != null) {
+                authProvider.setResponseHeaders(url.toString(), conn.getHeaderFields());
+            }
+
             // get the response
             return new Response(respCode, conn.getResponseMessage(), conn.getHeaderFields(), inputStream,
                     conn.getErrorStream());

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractPortProvider.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/webservices/AbstractPortProvider.java?rev=1100433&r1=1100432&r2=1100433&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractPortProvider.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractPortProvider.java Sat May  7 02:35:34 2011
@@ -21,11 +21,15 @@ package org.apache.chemistry.opencmis.cl
 import java.net.URL;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Service;
+import javax.xml.ws.handler.MessageContext;
 
+import org.apache.chemistry.opencmis.client.bindings.impl.CmisBindingsHelper;
 import org.apache.chemistry.opencmis.client.bindings.spi.Session;
 import org.apache.chemistry.opencmis.commons.SessionParameter;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisBaseException;
@@ -49,6 +53,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.impl.jaxb.RepositoryServicePort;
 import org.apache.chemistry.opencmis.commons.impl.jaxb.VersioningService;
 import org.apache.chemistry.opencmis.commons.impl.jaxb.VersioningServicePort;
+import org.apache.chemistry.opencmis.commons.spi.AuthenticationProvider;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -135,6 +140,18 @@ public abstract class AbstractPortProvid
         return (ACLServicePort) getPortObject(SessionParameter.WEBSERVICES_ACL_SERVICE);
     }
 
+    public void endCall(Object portObject) {
+        AuthenticationProvider authProvider = CmisBindingsHelper.getAuthenticationProvider(session);
+        if (authProvider != null) {
+            BindingProvider bp = (BindingProvider) portObject;
+            String url = (String) bp.getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+            @SuppressWarnings("unchecked")
+            Map<String, List<String>> headers = (Map<String, List<String>>) bp.getResponseContext().get(
+                    MessageContext.HTTP_RESPONSE_HEADERS);
+            authProvider.setResponseHeaders(url, headers);
+        }
+    }
+
     // ---- internal ----
 
     /**

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AclServiceImpl.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/webservices/AclServiceImpl.java?rev=1100433&r1=1100432&r2=1100433&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AclServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AclServiceImpl.java Sat May  7 02:35:34 2011
@@ -45,38 +45,22 @@ public class AclServiceImpl extends Abst
         this.portProvider = portProvider;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ACLService#applyACL(java.lang.String,
-     * java.lang.String, org.apache.opencmis.client.provider.AccessControlList,
-     * org.apache.opencmis.client.provider.AccessControlList,
-     * org.apache.opencmis.commons.enums.ACLPropagation,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public Acl applyAcl(String repositoryId, String objectId, Acl addACEs, Acl removeACEs,
             AclPropagation aclPropagation, ExtensionsData extension) {
         ACLServicePort port = portProvider.getACLServicePort();
 
         try {
-            return convert(port.applyACL(repositoryId, objectId, convert(addACEs), convert(removeACEs), convert(
-                    EnumACLPropagation.class, aclPropagation), convert(extension)));
+            return convert(port.applyACL(repositoryId, objectId, convert(addACEs), convert(removeACEs),
+                    convert(EnumACLPropagation.class, aclPropagation), convert(extension)));
         } catch (CmisException e) {
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ACLService#getACL(java.lang.String,
-     * java.lang.String, java.lang.Boolean,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public Acl getAcl(String repositoryId, String objectId, Boolean onlyBasicPermissions, ExtensionsData extension) {
         ACLServicePort port = portProvider.getACLServicePort();
 
@@ -86,6 +70,8 @@ public class AclServiceImpl extends Abst
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/DiscoveryServiceImpl.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/webservices/DiscoveryServiceImpl.java?rev=1100433&r1=1100432&r2=1100433&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/DiscoveryServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/DiscoveryServiceImpl.java Sat May  7 02:35:34 2011
@@ -51,16 +51,6 @@ public class DiscoveryServiceImpl extend
         this.portProvider = portProvider;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.DiscoveryService#getContentChanges
-     * (java.lang.String, org.apache.opencmis.client.provider.Holder,
-     * java.lang.Boolean, java.lang.String, java.lang.Boolean,
-     * java.lang.Boolean, java.math.BigInteger,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public ObjectList getContentChanges(String repositoryId, Holder<String> changeLogToken, Boolean includeProperties,
             String filter, Boolean includePolicyIds, Boolean includeACL, BigInteger maxItems, ExtensionsData extension) {
         DiscoveryServicePort port = portProvider.getDiscoveryServicePort();
@@ -79,33 +69,26 @@ public class DiscoveryServiceImpl extend
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.DiscoveryService#query(java.lang.
-     * String, java.lang.String, java.lang.Boolean, java.lang.Boolean,
-     * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String,
-     * java.math.BigInteger, java.math.BigInteger,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public ObjectList query(String repositoryId, String statement, Boolean searchAllVersions,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
             BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
         DiscoveryServicePort port = portProvider.getDiscoveryServicePort();
 
         try {
-            return convert(port.query(repositoryId, statement, searchAllVersions, includeAllowableActions, convert(
-                    EnumIncludeRelationships.class, includeRelationships), renditionFilter, maxItems, skipCount,
-                    convert(extension)));
+            return convert(port.query(repositoryId, statement, searchAllVersions, includeAllowableActions,
+                    convert(EnumIncludeRelationships.class, includeRelationships), renditionFilter, maxItems,
+                    skipCount, convert(extension)));
         } catch (CmisException e) {
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
-
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/MultiFilingServiceImpl.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/webservices/MultiFilingServiceImpl.java?rev=1100433&r1=1100432&r2=1100433&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/MultiFilingServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/MultiFilingServiceImpl.java Sat May  7 02:35:34 2011
@@ -44,14 +44,6 @@ public class MultiFilingServiceImpl exte
         this.portProvider = portProvider;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.MultiFilingService#addObjectToFolder
-     * (java.lang.String, java.lang.String, java.lang.String, java.lang.Boolean,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public void addObjectToFolder(String repositoryId, String objectId, String folderId, Boolean allVersions,
             ExtensionsData extension) {
         MultiFilingServicePort port = portProvider.getMultiFilingServicePort();
@@ -66,17 +58,11 @@ public class MultiFilingServiceImpl exte
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.MultiFilingService#removeObjectFromFolder
-     * (java.lang.String, java.lang.String, java.lang.String,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public void removeObjectFromFolder(String repositoryId, String objectId, String folderId, ExtensionsData extension) {
         MultiFilingServicePort port = portProvider.getMultiFilingServicePort();
 
@@ -90,7 +76,8 @@ public class MultiFilingServiceImpl exte
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
-
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/NavigationServiceImpl.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/webservices/NavigationServiceImpl.java?rev=1100433&r1=1100432&r2=1100433&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/NavigationServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/NavigationServiceImpl.java Sat May  7 02:35:34 2011
@@ -55,43 +55,24 @@ public class NavigationServiceImpl exten
         this.portProvider = portProvider;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.NavigationService#getChildren(java
-     * .lang.String, java.lang.String, java.lang.String, java.lang.String,
-     * java.lang.Boolean,
-     * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String,
-     * java.lang.Boolean, java.math.BigInteger, java.math.BigInteger,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public ObjectInFolderList getChildren(String repositoryId, String folderId, String filter, String orderBy,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
             Boolean includePathSegment, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
         NavigationServicePort port = portProvider.getNavigationServicePort();
 
         try {
-            return convert(port.getChildren(repositoryId, folderId, filter, orderBy, includeAllowableActions, convert(
-                    EnumIncludeRelationships.class, includeRelationships), renditionFilter, includePathSegment,
+            return convert(port.getChildren(repositoryId, folderId, filter, orderBy, includeAllowableActions,
+                    convert(EnumIncludeRelationships.class, includeRelationships), renditionFilter, includePathSegment,
                     maxItems, skipCount, convert(extension)));
         } catch (CmisException e) {
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.NavigationService#getDescendants(
-     * java.lang.String, java.lang.String, java.math.BigInteger,
-     * java.lang.String, java.lang.Boolean,
-     * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String,
-     * java.lang.Boolean, org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public List<ObjectInFolderContainer> getDescendants(String repositoryId, String folderId, BigInteger depth,
             String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
             String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
@@ -118,17 +99,11 @@ public class NavigationServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.NavigationService#getFolderParent
-     * (java.lang.String, java.lang.String, java.lang.String,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public ObjectData getFolderParent(String repositoryId, String folderId, String filter, ExtensionsData extension) {
         NavigationServicePort port = portProvider.getNavigationServicePort();
 
@@ -138,19 +113,11 @@ public class NavigationServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.NavigationService#getFolderTree(java
-     * .lang.String, java.lang.String, java.math.BigInteger, java.lang.String,
-     * java.lang.Boolean,
-     * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String,
-     * java.lang.Boolean, org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public List<ObjectInFolderContainer> getFolderTree(String repositoryId, String folderId, BigInteger depth,
             String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
             String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
@@ -177,18 +144,11 @@ public class NavigationServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.NavigationService#getObjectParents
-     * (java.lang.String, java.lang.String, java.lang.String, java.lang.Boolean,
-     * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String,
-     * java.lang.Boolean, org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public List<ObjectParentData> getObjectParents(String repositoryId, String objectId, String filter,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
             Boolean includeRelativePathSegment, ExtensionsData extension) {
@@ -215,20 +175,11 @@ public class NavigationServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.NavigationService#getCheckedOutDocs
-     * (java.lang.String, java.lang.String, java.lang.String, java.lang.String,
-     * java.lang.Boolean,
-     * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String,
-     * java.math.BigInteger, java.math.BigInteger,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public ObjectList getCheckedOutDocs(String repositoryId, String folderId, String filter, String orderBy,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
             BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
@@ -242,6 +193,8 @@ public class NavigationServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/ObjectServiceImpl.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/webservices/ObjectServiceImpl.java?rev=1100433&r1=1100432&r2=1100433&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/ObjectServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/ObjectServiceImpl.java Sat May  7 02:35:34 2011
@@ -66,18 +66,6 @@ public class ObjectServiceImpl extends A
         this.portProvider = portProvider;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#createDocument(java
-     * .lang.String, org.apache.opencmis.client.provider.PropertiesData,
-     * java.lang.String, org.apache.opencmis.client.provider.ContentStreamData,
-     * org.apache.opencmis.commons.enums.VersioningState, java.util.List,
-     * org.apache.opencmis.client.provider.AccessControlList,
-     * org.apache.opencmis.client.provider.AccessControlList,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public String createDocument(String repositoryId, Properties properties, String folderId,
             ContentStream contentStream, VersioningState versioningState, List<String> policies, Acl addACEs,
             Acl removeACEs, ExtensionsData extension) {
@@ -87,9 +75,9 @@ public class ObjectServiceImpl extends A
             javax.xml.ws.Holder<String> objectId = new javax.xml.ws.Holder<String>();
             javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
 
-            port.createDocument(repositoryId, convert(properties), folderId, convert(contentStream), convert(
-                    EnumVersioningState.class, versioningState), policies, convert(addACEs), convert(removeACEs),
-                    portExtension, objectId);
+            port.createDocument(repositoryId, convert(properties), folderId, convert(contentStream),
+                    convert(EnumVersioningState.class, versioningState), policies, convert(addACEs),
+                    convert(removeACEs), portExtension, objectId);
 
             setExtensionValues(portExtension, extension);
 
@@ -98,21 +86,11 @@ public class ObjectServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#createDocumentFromSource
-     * (java.lang.String, java.lang.String,
-     * org.apache.opencmis.client.provider.PropertiesData, java.lang.String,
-     * org.apache.opencmis.commons.enums.VersioningState, java.util.List,
-     * org.apache.opencmis.client.provider.AccessControlList,
-     * org.apache.opencmis.client.provider.AccessControlList,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public String createDocumentFromSource(String repositoryId, String sourceId, Properties properties,
             String folderId, VersioningState versioningState, List<String> policies, Acl addACEs, Acl removeACEs,
             ExtensionsData extension) {
@@ -122,9 +100,9 @@ public class ObjectServiceImpl extends A
             javax.xml.ws.Holder<String> objectId = new javax.xml.ws.Holder<String>();
             javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
 
-            port.createDocumentFromSource(repositoryId, sourceId, convert(properties), folderId, convert(
-                    EnumVersioningState.class, versioningState), policies, convert(addACEs), convert(removeACEs),
-                    portExtension, objectId);
+            port.createDocumentFromSource(repositoryId, sourceId, convert(properties), folderId,
+                    convert(EnumVersioningState.class, versioningState), policies, convert(addACEs),
+                    convert(removeACEs), portExtension, objectId);
 
             setExtensionValues(portExtension, extension);
 
@@ -133,20 +111,11 @@ public class ObjectServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#createFolder(java.lang
-     * .String, org.apache.opencmis.client.provider.PropertiesData,
-     * java.lang.String, java.util.List,
-     * org.apache.opencmis.client.provider.AccessControlList,
-     * org.apache.opencmis.client.provider.AccessControlList,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public String createFolder(String repositoryId, Properties properties, String folderId, List<String> policies,
             Acl addACEs, Acl removeACEs, ExtensionsData extension) {
         ObjectServicePort port = portProvider.getObjectServicePort();
@@ -165,20 +134,11 @@ public class ObjectServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#createPolicy(java.lang
-     * .String, org.apache.opencmis.client.provider.PropertiesData,
-     * java.lang.String, java.util.List,
-     * org.apache.opencmis.client.provider.AccessControlList,
-     * org.apache.opencmis.client.provider.AccessControlList,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public String createPolicy(String repositoryId, Properties properties, String folderId, List<String> policies,
             Acl addACEs, Acl removeACEs, ExtensionsData extension) {
         ObjectServicePort port = portProvider.getObjectServicePort();
@@ -197,19 +157,11 @@ public class ObjectServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#createRelationship(
-     * java.lang.String, org.apache.opencmis.client.provider.PropertiesData,
-     * java.util.List, org.apache.opencmis.client.provider.AccessControlList,
-     * org.apache.opencmis.client.provider.AccessControlList,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public String createRelationship(String repositoryId, Properties properties, List<String> policies, Acl addACEs,
             Acl removeACEs, ExtensionsData extension) {
         ObjectServicePort port = portProvider.getObjectServicePort();
@@ -228,19 +180,11 @@ public class ObjectServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#updateProperties(java
-     * .lang.String, org.apache.opencmis.client.provider.Holder,
-     * org.apache.opencmis.client.provider.Holder,
-     * org.apache.opencmis.client.provider.PropertiesData,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public void updateProperties(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
             Properties properties, ExtensionsData extension) {
         ObjectServicePort port = portProvider.getObjectServicePort();
@@ -259,17 +203,11 @@ public class ObjectServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#deleteObject(java.lang
-     * .String, java.lang.String, java.lang.Boolean,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public void deleteObject(String repositoryId, String objectId, Boolean allVersions, ExtensionsData extension) {
         ObjectServicePort port = portProvider.getObjectServicePort();
 
@@ -283,40 +221,27 @@ public class ObjectServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#deleteTree(java.lang
-     * .String, java.lang.String, java.lang.Boolean,
-     * org.apache.opencmis.commons.enums.UnfileObject, java.lang.Boolean,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public FailedToDeleteData deleteTree(String repositoryId, String folderId, Boolean allVersions,
             UnfileObject unfileObjects, Boolean continueOnFailure, ExtensionsData extension) {
         ObjectServicePort port = portProvider.getObjectServicePort();
 
         try {
-            return convert(port.deleteTree(repositoryId, folderId, allVersions, convert(EnumUnfileObject.class,
-                    unfileObjects), continueOnFailure, convert(extension)));
+            return convert(port.deleteTree(repositoryId, folderId, allVersions,
+                    convert(EnumUnfileObject.class, unfileObjects), continueOnFailure, convert(extension)));
         } catch (CmisException e) {
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#getAllowableActions
-     * (java.lang.String, java.lang.String,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public AllowableActions getAllowableActions(String repositoryId, String objectId, ExtensionsData extension) {
         ObjectServicePort port = portProvider.getObjectServicePort();
 
@@ -326,17 +251,11 @@ public class ObjectServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#getContentStream(java
-     * .lang.String, java.lang.String, java.lang.String, java.math.BigInteger,
-     * java.math.BigInteger, org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public ContentStream getContentStream(String repositoryId, String objectId, String streamId, BigInteger offset,
             BigInteger length, ExtensionsData extension) {
         ObjectServicePort port = portProvider.getObjectServicePort();
@@ -347,69 +266,47 @@ public class ObjectServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#getObject(java.lang
-     * .String, java.lang.String, java.lang.String, java.lang.Boolean,
-     * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String,
-     * java.lang.Boolean, java.lang.Boolean,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public ObjectData getObject(String repositoryId, String objectId, String filter, Boolean includeAllowableActions,
             IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
             Boolean includeACL, ExtensionsData extension) {
         ObjectServicePort port = portProvider.getObjectServicePort();
 
         try {
-            return convert(port.getObject(repositoryId, objectId, filter, includeAllowableActions, convert(
-                    EnumIncludeRelationships.class, includeRelationships), renditionFilter, includePolicyIds,
+            return convert(port.getObject(repositoryId, objectId, filter, includeAllowableActions,
+                    convert(EnumIncludeRelationships.class, includeRelationships), renditionFilter, includePolicyIds,
                     includeACL, convert(extension)));
         } catch (CmisException e) {
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#getObjectByPath(java
-     * .lang.String, java.lang.String, java.lang.String, java.lang.Boolean,
-     * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String,
-     * java.lang.Boolean, java.lang.Boolean,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public ObjectData getObjectByPath(String repositoryId, String path, String filter, Boolean includeAllowableActions,
             IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
             Boolean includeACL, ExtensionsData extension) {
         ObjectServicePort port = portProvider.getObjectServicePort();
 
         try {
-            return convert(port.getObjectByPath(repositoryId, path, filter, includeAllowableActions, convert(
-                    EnumIncludeRelationships.class, includeRelationships), renditionFilter, includePolicyIds,
+            return convert(port.getObjectByPath(repositoryId, path, filter, includeAllowableActions,
+                    convert(EnumIncludeRelationships.class, includeRelationships), renditionFilter, includePolicyIds,
                     includeACL, convert(extension)));
         } catch (CmisException e) {
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#getProperties(java.
-     * lang.String, java.lang.String, java.lang.String,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public Properties getProperties(String repositoryId, String objectId, String filter, ExtensionsData extension) {
         ObjectServicePort port = portProvider.getObjectServicePort();
 
@@ -419,17 +316,11 @@ public class ObjectServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#getRenditions(java.
-     * lang.String, java.lang.String, java.lang.String, java.math.BigInteger,
-     * java.math.BigInteger, org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public List<RenditionData> getRenditions(String repositoryId, String objectId, String renditionFilter,
             BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
         ObjectServicePort port = portProvider.getObjectServicePort();
@@ -454,17 +345,11 @@ public class ObjectServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#moveObject(java.lang
-     * .String, org.apache.opencmis.client.provider.Holder, java.lang.String,
-     * java.lang.String, org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public void moveObject(String repositoryId, Holder<String> objectId, String targetFolderId, String sourceFolderId,
             ExtensionsData extension) {
         ObjectServicePort port = portProvider.getObjectServicePort();
@@ -481,19 +366,11 @@ public class ObjectServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#setContentStream(java
-     * .lang.String, org.apache.opencmis.client.provider.Holder,
-     * java.lang.Boolean, org.apache.opencmis.client.provider.Holder,
-     * org.apache.opencmis.client.provider.ContentStreamData,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public void setContentStream(String repositoryId, Holder<String> objectId, Boolean overwriteFlag,
             Holder<String> changeToken, ContentStream contentStream, ExtensionsData extension) {
         ObjectServicePort port = portProvider.getObjectServicePort();
@@ -513,18 +390,11 @@ public class ObjectServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.ObjectService#deleteContentStream
-     * (java.lang.String, org.apache.opencmis.client.provider.Holder,
-     * org.apache.opencmis.client.provider.Holder,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public void deleteContentStream(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
             ExtensionsData extension) {
         ObjectServicePort port = portProvider.getObjectServicePort();
@@ -543,6 +413,8 @@ public class ObjectServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PolicyServiceImpl.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/webservices/PolicyServiceImpl.java?rev=1100433&r1=1100432&r2=1100433&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PolicyServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PolicyServiceImpl.java Sat May  7 02:35:34 2011
@@ -50,14 +50,6 @@ public class PolicyServiceImpl extends A
         this.portProvider = portProvider;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.PolicyService#applyPolicy(java.lang
-     * .String, java.lang.String, java.lang.String,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public void applyPolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension) {
         PolicyServicePort port = portProvider.getPolicyServicePort();
 
@@ -71,17 +63,11 @@ public class PolicyServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.PolicyService#removePolicy(java.lang
-     * .String, java.lang.String, java.lang.String,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public void removePolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension) {
         PolicyServicePort port = portProvider.getPolicyServicePort();
 
@@ -95,17 +81,11 @@ public class PolicyServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.PolicyService#getAppliedPolicies(
-     * java.lang.String, java.lang.String, java.lang.String,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public List<ObjectData> getAppliedPolicies(String repositoryId, String objectId, String filter,
             ExtensionsData extension) {
         PolicyServicePort port = portProvider.getPolicyServicePort();
@@ -115,7 +95,7 @@ public class PolicyServiceImpl extends A
                     convert(extension));
 
             List<ObjectData> result = new ArrayList<ObjectData>();
-            
+
             // no list?
             if (policyList == null) {
                 return result;
@@ -131,6 +111,8 @@ public class PolicyServiceImpl extends A
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PortProvider.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/webservices/PortProvider.java?rev=1100433&r1=1100432&r2=1100433&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PortProvider.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PortProvider.java Sat May  7 02:35:34 2011
@@ -29,7 +29,6 @@ import javax.xml.ws.handler.MessageConte
 import javax.xml.ws.soap.MTOMFeature;
 
 import org.apache.chemistry.opencmis.client.bindings.impl.CmisBindingsHelper;
-import org.apache.chemistry.opencmis.client.bindings.spi.AbstractAuthenticationProvider;
 import org.apache.chemistry.opencmis.client.bindings.spi.Session;
 import org.apache.chemistry.opencmis.commons.SessionParameter;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisBaseException;
@@ -44,6 +43,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.impl.jaxb.RelationshipService;
 import org.apache.chemistry.opencmis.commons.impl.jaxb.RepositoryService;
 import org.apache.chemistry.opencmis.commons.impl.jaxb.VersioningService;
+import org.apache.chemistry.opencmis.commons.spi.AuthenticationProvider;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.w3c.dom.Element;
@@ -136,7 +136,7 @@ public class PortProvider extends Abstra
             }
 
             // add SOAP and HTTP authentication headers
-            AbstractAuthenticationProvider authProvider = CmisBindingsHelper.getAuthenticationProvider(session);
+            AuthenticationProvider authProvider = CmisBindingsHelper.getAuthenticationProvider(session);
             Map<String, List<String>> httpHeaders = null;
             if (authProvider != null) {
                 // SOAP header

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/RelationshipServiceImpl.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/webservices/RelationshipServiceImpl.java?rev=1100433&r1=1100432&r2=1100433&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/RelationshipServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/RelationshipServiceImpl.java Sat May  7 02:35:34 2011
@@ -47,31 +47,21 @@ public class RelationshipServiceImpl ext
         this.portProvider = portProvider;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @seeorg.apache.opencmis.client.provider.RelationshipService#
-     * getObjectRelationships(java.lang.String, java.lang.String,
-     * java.lang.Boolean,
-     * org.apache.opencmis.commons.enums.RelationshipDirection,
-     * java.lang.String, java.lang.String, java.lang.Boolean,
-     * java.math.BigInteger, java.math.BigInteger,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public ObjectList getObjectRelationships(String repositoryId, String objectId, Boolean includeSubRelationshipTypes,
             RelationshipDirection relationshipDirection, String typeId, String filter, Boolean includeAllowableActions,
             BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
         RelationshipServicePort port = portProvider.getRelationshipServicePort();
 
         try {
-            return convert(port.getObjectRelationships(repositoryId, objectId, includeSubRelationshipTypes, convert(
-                    EnumRelationshipDirection.class, relationshipDirection), typeId, filter, includeAllowableActions,
-                    maxItems, skipCount, convert(extension)));
+            return convert(port.getObjectRelationships(repositoryId, objectId, includeSubRelationshipTypes,
+                    convert(EnumRelationshipDirection.class, relationshipDirection), typeId, filter,
+                    includeAllowableActions, maxItems, skipCount, convert(extension)));
         } catch (CmisException e) {
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
-
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/RepositoryServiceImpl.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/webservices/RepositoryServiceImpl.java?rev=1100433&r1=1100432&r2=1100433&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/RepositoryServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/RepositoryServiceImpl.java Sat May  7 02:35:34 2011
@@ -53,13 +53,6 @@ public class RepositoryServiceImpl exten
         this.portProvider = portProvider;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.RepositoryService#getRepositoryInfos
-     * (org.apache.opencmis.client.provider .ExtensionsData)
-     */
     public List<RepositoryInfo> getRepositoryInfos(ExtensionsData extension) {
         RepositoryServicePort port = portProvider.getRepositoryServicePort();
 
@@ -81,18 +74,13 @@ public class RepositoryServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
 
         return infos;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.RepositoryService#getRepositoryInfo
-     * (java.lang.String, org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public RepositoryInfo getRepositoryInfo(String repositoryId, ExtensionsData extension) {
         RepositoryServicePort port = portProvider.getRepositoryServicePort();
 
@@ -102,17 +90,11 @@ public class RepositoryServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.RepositoryService#getTypeDefinition
-     * (java.lang.String, java.lang.String,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public TypeDefinition getTypeDefinition(String repositoryId, String typeId, ExtensionsData extension) {
         RepositoryServicePort port = portProvider.getRepositoryServicePort();
 
@@ -122,18 +104,11 @@ public class RepositoryServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.RepositoryService#getTypeChildren
-     * (java.lang.String, java.lang.String, java.lang.Boolean,
-     * java.math.BigInteger, java.math.BigInteger,
-     * org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public TypeDefinitionList getTypeChildren(String repositoryId, String typeId, Boolean includePropertyDefinitions,
             BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
         RepositoryServicePort port = portProvider.getRepositoryServicePort();
@@ -145,17 +120,11 @@ public class RepositoryServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.opencmis.client.provider.RepositoryService#getTypeDescendants
-     * (java.lang.String, java.lang.String, java.math.BigInteger,
-     * java.lang.Boolean, org.apache.opencmis.client.provider.ExtensionsData)
-     */
     public List<TypeDefinitionContainer> getTypeDescendants(String repositoryId, String typeId, BigInteger depth,
             Boolean includePropertyDefinitions, ExtensionsData extension) {
         RepositoryServicePort port = portProvider.getRepositoryServicePort();
@@ -167,7 +136,8 @@ public class RepositoryServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
-
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/VersioningServiceImpl.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/webservices/VersioningServiceImpl.java?rev=1100433&r1=1100432&r2=1100433&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/VersioningServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/VersioningServiceImpl.java Sat May  7 02:35:34 2011
@@ -76,6 +76,8 @@ public class VersioningServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
@@ -92,6 +94,8 @@ public class VersioningServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
@@ -113,6 +117,8 @@ public class VersioningServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
@@ -140,6 +146,8 @@ public class VersioningServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
@@ -156,6 +164,8 @@ public class VersioningServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 
@@ -170,6 +180,8 @@ public class VersioningServiceImpl exten
             throw convertException(e);
         } catch (Exception e) {
             throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+        } finally {
+            portProvider.endCall(port);
         }
     }
 }

Added: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/AuthenticationProvider.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/AuthenticationProvider.java?rev=1100433&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/AuthenticationProvider.java (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/AuthenticationProvider.java Sat May  7 02:35:34 2011
@@ -0,0 +1,62 @@
+/*
+ * 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.commons.spi;
+
+import java.util.List;
+import java.util.Map;
+
+import org.w3c.dom.Element;
+
+/**
+ * Authentication provider interface.
+ */
+public interface AuthenticationProvider {
+    /**
+     * Returns a set of HTTP headers (key-value pairs) that should be added to a
+     * HTTP call. This will be called by the AtomPub and the Web Services
+     * binding. You might want to check the binding in use before you set the
+     * headers.
+     * 
+     * @param url
+     *            the URL of the HTTP call
+     * 
+     * @return the HTTP headers or <code>null</code> if no additional headers
+     *         should be set
+     */
+    Map<String, List<String>> getHTTPHeaders(String url);
+
+    /**
+     * Returns a SOAP header that should be added to a Web Services call.
+     * 
+     * @param portObject
+     *            the port object
+     * 
+     * @return the SOAP headers or <code>null</code> if no additional headers
+     *         should be set
+     */
+    Element getSOAPHeaders(Object portObject);
+
+    /**
+     * Receives the HTTP headers after a call.
+     * 
+     * @param headers
+     *            the HTTP headers
+     */
+    void setResponseHeaders(String url, Map<String, List<String>> headers);
+}

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/AuthenticationProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/CmisBinding.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/CmisBinding.java?rev=1100433&r1=1100432&r2=1100433&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/CmisBinding.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/spi/CmisBinding.java Sat May  7 02:35:34 2011
@@ -22,7 +22,7 @@ package org.apache.chemistry.opencmis.co
  * Entry point for all CMIS binding related operations. It provides access to
  * the service interface objects which are very similar to the CMIS 1.0 domain
  * model.
- *
+ * 
  * <p>
  * Each instance of this class represents a session. A session comprises of a
  * connection to one CMIS endpoint over one binding for one particular user and
@@ -84,6 +84,11 @@ public interface CmisBinding {
     BindingsObjectFactory getObjectFactory();
 
     /**
+     * Gets the authentication provider.
+     */
+    AuthenticationProvider getAuthenticationProvider();
+
+    /**
      * Clears all caches of the current CMIS binding session.
      */
     void clearAllCaches();
@@ -91,7 +96,7 @@ public interface CmisBinding {
     /**
      * Clears all caches of the current CMIS binding session that are related to
      * the given repository.
-     *
+     * 
      * @param repositoryId
      *            the repository id
      */



Mime
View raw message