Added: chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/FilterCmisService.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/FilterCmisService.html?rev=1671608&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/FilterCmisService.html (added) +++ chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/FilterCmisService.html Mon Apr 6 17:15:57 2015 @@ -0,0 +1,502 @@ + + + + +FilterCmisService xref + + + +
View Javadoc
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.bridge;
+20  
+21  import java.io.Serializable;
+22  import java.math.BigInteger;
+23  import java.util.ArrayList;
+24  import java.util.List;
+25  import java.util.Map;
+26  
+27  import org.apache.chemistry.opencmis.commons.data.Ace;
+28  import org.apache.chemistry.opencmis.commons.data.Acl;
+29  import org.apache.chemistry.opencmis.commons.data.AllowableActions;
+30  import org.apache.chemistry.opencmis.commons.data.ContentStream;
+31  import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
+32  import org.apache.chemistry.opencmis.commons.data.FailedToDeleteData;
+33  import org.apache.chemistry.opencmis.commons.data.ObjectData;
+34  import org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer;
+35  import org.apache.chemistry.opencmis.commons.data.ObjectInFolderList;
+36  import org.apache.chemistry.opencmis.commons.data.ObjectList;
+37  import org.apache.chemistry.opencmis.commons.data.ObjectParentData;
+38  import org.apache.chemistry.opencmis.commons.data.Properties;
+39  import org.apache.chemistry.opencmis.commons.data.RenditionData;
+40  import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
+41  import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
+42  import org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer;
+43  import org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionList;
+44  import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
+45  import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+46  import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
+47  import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
+48  import org.apache.chemistry.opencmis.commons.enums.VersioningState;
+49  import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlListImpl;
+50  import org.apache.chemistry.opencmis.commons.impl.server.AbstractCmisService;
+51  import org.apache.chemistry.opencmis.commons.server.CallContext;
+52  import org.apache.chemistry.opencmis.commons.server.ObjectInfo;
+53  import org.apache.chemistry.opencmis.commons.spi.AclService;
+54  import org.apache.chemistry.opencmis.commons.spi.DiscoveryService;
+55  import org.apache.chemistry.opencmis.commons.spi.Holder;
+56  import org.apache.chemistry.opencmis.commons.spi.MultiFilingService;
+57  import org.apache.chemistry.opencmis.commons.spi.NavigationService;
+58  import org.apache.chemistry.opencmis.commons.spi.ObjectService;
+59  import org.apache.chemistry.opencmis.commons.spi.PolicyService;
+60  import org.apache.chemistry.opencmis.commons.spi.RelationshipService;
+61  import org.apache.chemistry.opencmis.commons.spi.RepositoryService;
+62  import org.apache.chemistry.opencmis.commons.spi.VersioningService;
+63  import org.apache.chemistry.opencmis.server.support.wrapper.CallContextAwareCmisService;
+64  
+65  /**
+66   * Forwards incoming calls to a CMIS repository.
+67   */
+68  public abstract class FilterCmisService extends AbstractCmisService implements CallContextAwareCmisService,
+69          Serializable {
+70  
+71      private static final long serialVersionUID = 1L;
+72  
+73      private CallContext context;
+74  
+75      /**
+76       * Called after the object has been created.
+77       * 
+78       * @param parameters
+79       *            the parameters provided to bridge service factory
+80       * @param lock
+81       *            a lock object shared by all service instances
+82       */
+83      public void init(Map<String, String> parameters) {
+84      }
+85  
+86      /**
+87       * Called at the beginning of a request.
+88       */
+89      public void setCallContext(CallContext context) {
+90          this.context = context;
+91      }
+92  
+93      /**
+94       * Returns the current call context.
+95       */
+96      public CallContext getCallContext() {
+97          return context;
+98      }
+99  
+100     /**
+101      * Returns a client repository service.
+102      */
+103     public abstract RepositoryService getRepositoryService();
+104 
+105     /**
+106      * Returns a client navigation service.
+107      */
+108     public abstract NavigationService getNavigationService();
+109 
+110     /**
+111      * Returns a client object service.
+112      */
+113     public abstract ObjectService getObjectService();
+114 
+115     /**
+116      * Returns a client versioning service.
+117      */
+118     public abstract VersioningService getVersioningService();
+119 
+120     /**
+121      * Returns a client discovery service.
+122      */
+123     public abstract DiscoveryService getDiscoveryService();
+124 
+125     /**
+126      * Returns a client multifiling service.
+127      */
+128     public abstract MultiFilingService getMultiFilingService();
+129 
+130     /**
+131      * Returns a client relationship service.
+132      */
+133     public abstract RelationshipService getRelationshipService();
+134 
+135     /**
+136      * Returns a client ACL service.
+137      */
+138     public abstract AclService getAclService();
+139 
+140     /**
+141      * Returns a client policy service.
+142      */
+143     public abstract PolicyService getPolicyService();
+144 
+145     @Override
+146     public RepositoryInfo getRepositoryInfo(String repositoryId, ExtensionsData extension) {
+147         return getRepositoryService().getRepositoryInfo(repositoryId, extension);
+148     }
+149 
+150     @Override
+151     public List<RepositoryInfo> getRepositoryInfos(ExtensionsData extension) {
+152         return getRepositoryService().getRepositoryInfos(extension);
+153     }
+154 
+155     @Override
+156     public TypeDefinitionList getTypeChildren(String repositoryId, String typeId, Boolean includePropertyDefinitions,
+157             BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+158         return getRepositoryService().getTypeChildren(repositoryId, typeId, includePropertyDefinitions, maxItems,
+159                 skipCount, extension);
+160     }
+161 
+162     @Override
+163     public List<TypeDefinitionContainer> getTypeDescendants(String repositoryId, String typeId, BigInteger depth,
+164             Boolean includePropertyDefinitions, ExtensionsData extension) {
+165         return getRepositoryService().getTypeDescendants(repositoryId, typeId, depth, includePropertyDefinitions,
+166                 extension);
+167     }
+168 
+169     @Override
+170     public TypeDefinition getTypeDefinition(String repositoryId, String typeId, ExtensionsData extension) {
+171         return getRepositoryService().getTypeDefinition(repositoryId, typeId, extension);
+172     }
+173 
+174     @Override
+175     public ObjectInFolderList getChildren(String repositoryId, String folderId, String filter, String orderBy,
+176             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+177             Boolean includePathSegment, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+178         return getNavigationService().getChildren(repositoryId, folderId, filter, orderBy, includeAllowableActions,
+179                 includeRelationships, renditionFilter, includePathSegment, maxItems, skipCount, extension);
+180     }
+181 
+182     @Override
+183     public List<ObjectInFolderContainer> getDescendants(String repositoryId, String folderId, BigInteger depth,
+184             String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+185             String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
+186         return getNavigationService().getDescendants(repositoryId, folderId, depth, filter, includeAllowableActions,
+187                 includeRelationships, renditionFilter, includePathSegment, extension);
+188     }
+189 
+190     @Override
+191     public List<ObjectInFolderContainer> getFolderTree(String repositoryId, String folderId, BigInteger depth,
+192             String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+193             String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
+194         return getNavigationService().getFolderTree(repositoryId, folderId, depth, filter, includeAllowableActions,
+195                 includeRelationships, renditionFilter, includePathSegment, extension);
+196     }
+197 
+198     @Override
+199     public List<ObjectParentData> getObjectParents(String repositoryId, String objectId, String filter,
+200             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+201             Boolean includeRelativePathSegment, ExtensionsData extension) {
+202         return getNavigationService().getObjectParents(repositoryId, objectId, filter, includeAllowableActions,
+203                 includeRelationships, renditionFilter, includeRelativePathSegment, extension);
+204     }
+205 
+206     @Override
+207     public ObjectData getFolderParent(String repositoryId, String folderId, String filter, ExtensionsData extension) {
+208         return getNavigationService().getFolderParent(repositoryId, folderId, filter, extension);
+209     }
+210 
+211     @Override
+212     public ObjectList getCheckedOutDocs(String repositoryId, String folderId, String filter, String orderBy,
+213             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+214             BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+215         return getNavigationService().getCheckedOutDocs(repositoryId, folderId, filter, orderBy,
+216                 includeAllowableActions, includeRelationships, renditionFilter, maxItems, skipCount, extension);
+217     }
+218 
+219     @Override
+220     public String create(String repositoryId, Properties properties, String folderId, ContentStream contentStream,
+221             VersioningState versioningState, List<String> policies, ExtensionsData extension) {
+222         return super.create(repositoryId, properties, folderId, contentStream, versioningState, policies, extension);
+223     }
+224 
+225     @Override
+226     public String createDocument(String repositoryId, Properties properties, String folderId,
+227             ContentStream contentStream, VersioningState versioningState, List<String> policies, Acl addAces,
+228             Acl removeAces, ExtensionsData extension) {
+229         return getObjectService().createDocument(repositoryId, properties, folderId, contentStream, versioningState,
+230                 policies, addAces, removeAces, extension);
+231     }
+232 
+233     @Override
+234     public String createDocumentFromSource(String repositoryId, String sourceId, Properties properties,
+235             String folderId, VersioningState versioningState, List<String> policies, Acl addAces, Acl removeAces,
+236             ExtensionsData extension) {
+237         return getObjectService().createDocumentFromSource(repositoryId, sourceId, properties, folderId,
+238                 versioningState, policies, addAces, removeAces, extension);
+239     }
+240 
+241     @Override
+242     public String createFolder(String repositoryId, Properties properties, String folderId, List<String> policies,
+243             Acl addAces, Acl removeAces, ExtensionsData extension) {
+244         return getObjectService().createFolder(repositoryId, properties, folderId, policies, addAces, removeAces,
+245                 extension);
+246     }
+247 
+248     @Override
+249     public String createRelationship(String repositoryId, Properties properties, List<String> policies, Acl addAces,
+250             Acl removeAces, ExtensionsData extension) {
+251         return getObjectService()
+252                 .createRelationship(repositoryId, properties, policies, addAces, removeAces, extension);
+253     }
+254 
+255     @Override
+256     public String createPolicy(String repositoryId, Properties properties, String folderId, List<String> policies,
+257             Acl addAces, Acl removeAces, ExtensionsData extension) {
+258         return getObjectService().createPolicy(repositoryId, properties, folderId, policies, addAces, removeAces,
+259                 extension);
+260     }
+261 
+262     @Override
+263     public AllowableActions getAllowableActions(String repositoryId, String objectId, ExtensionsData extension) {
+264         return getObjectService().getAllowableActions(repositoryId, objectId, extension);
+265     }
+266 
+267     @Override
+268     public ObjectData getObject(String repositoryId, String objectId, String filter, Boolean includeAllowableActions,
+269             IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
+270             Boolean includeAcl, ExtensionsData extension) {
+271         return getObjectService().getObject(repositoryId, objectId, filter, includeAllowableActions,
+272                 includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension);
+273     }
+274 
+275     @Override
+276     public Properties getProperties(String repositoryId, String objectId, String filter, ExtensionsData extension) {
+277         return getObjectService().getProperties(repositoryId, objectId, filter, extension);
+278     }
+279 
+280     @Override
+281     public List<RenditionData> getRenditions(String repositoryId, String objectId, String renditionFilter,
+282             BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+283         return getObjectService()
+284                 .getRenditions(repositoryId, objectId, renditionFilter, maxItems, skipCount, extension);
+285     }
+286 
+287     @Override
+288     public ObjectData getObjectByPath(String repositoryId, String path, String filter, Boolean includeAllowableActions,
+289             IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
+290             Boolean includeAcl, ExtensionsData extension) {
+291         return getObjectService().getObjectByPath(repositoryId, path, filter, includeAllowableActions,
+292                 includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension);
+293     }
+294 
+295     @Override
+296     public ContentStream getContentStream(String repositoryId, String objectId, String streamId, BigInteger offset,
+297             BigInteger length, ExtensionsData extension) {
+298         return getObjectService().getContentStream(repositoryId, objectId, streamId, offset, length, extension);
+299     }
+300 
+301     @Override
+302     public void updateProperties(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
+303             Properties properties, ExtensionsData extension) {
+304         getObjectService().updateProperties(repositoryId, objectId, changeToken, properties, extension);
+305     }
+306 
+307     @Override
+308     public void moveObject(String repositoryId, Holder<String> objectId, String targetFolderId, String sourceFolderId,
+309             ExtensionsData extension) {
+310         getObjectService().moveObject(repositoryId, objectId, targetFolderId, sourceFolderId, extension);
+311     }
+312 
+313     @Override
+314     public void deleteObject(String repositoryId, String objectId, Boolean allVersions, ExtensionsData extension) {
+315         getObjectService().deleteObject(repositoryId, objectId, allVersions, extension);
+316     }
+317 
+318     @Override
+319     public void deleteObjectOrCancelCheckOut(String repositoryId, String objectId, Boolean allVersions,
+320             ExtensionsData extension) {
+321         // TODO: rework -> object cache
+322         getObjectService().deleteObject(repositoryId, objectId, allVersions, extension);
+323     }
+324 
+325     @Override
+326     public FailedToDeleteData deleteTree(String repositoryId, String folderId, Boolean allVersions,
+327             UnfileObject unfileObjects, Boolean continueOnFailure, ExtensionsData extension) {
+328         return getObjectService().deleteTree(repositoryId, folderId, allVersions, unfileObjects, continueOnFailure,
+329                 extension);
+330     }
+331 
+332     @Override
+333     public void setContentStream(String repositoryId, Holder<String> objectId, Boolean overwriteFlag,
+334             Holder<String> changeToken, ContentStream contentStream, ExtensionsData extension) {
+335         getObjectService().setContentStream(repositoryId, objectId, overwriteFlag, changeToken, contentStream,
+336                 extension);
+337     }
+338 
+339     @Override
+340     public void deleteContentStream(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
+341             ExtensionsData extension) {
+342         getObjectService().deleteContentStream(repositoryId, objectId, changeToken, extension);
+343     }
+344 
+345     @Override
+346     public void checkOut(String repositoryId, Holder<String> objectId, ExtensionsData extension,
+347             Holder<Boolean> contentCopied) {
+348         getVersioningService().checkOut(repositoryId, objectId, extension, contentCopied);
+349     }
+350 
+351     @Override
+352     public void cancelCheckOut(String repositoryId, String objectId, ExtensionsData extension) {
+353         getVersioningService().cancelCheckOut(repositoryId, objectId, extension);
+354     }
+355 
+356     @Override
+357     public void checkIn(String repositoryId, Holder<String> objectId, Boolean major, Properties properties,
+358             ContentStream contentStream, String checkinComment, List<String> policies, Acl addAces, Acl removeAces,
+359             ExtensionsData extension) {
+360         getVersioningService().checkIn(repositoryId, objectId, major, properties, contentStream, checkinComment,
+361                 policies, addAces, removeAces, extension);
+362     }
+363 
+364     @Override
+365     public ObjectData getObjectOfLatestVersion(String repositoryId, String objectId, String versionSeriesId,
+366             Boolean major, String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+367             String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension) {
+368         return getVersioningService()
+369                 .getObjectOfLatestVersion(repositoryId, objectId, versionSeriesId, major, filter,
+370                         includeAllowableActions, includeRelationships, renditionFilter, includePolicyIds, includeAcl,
+371                         extension);
+372     }
+373 
+374     @Override
+375     public Properties getPropertiesOfLatestVersion(String repositoryId, String objectId, String versionSeriesId,
+376             Boolean major, String filter, ExtensionsData extension) {
+377         return getVersioningService().getPropertiesOfLatestVersion(repositoryId, objectId, versionSeriesId, major,
+378                 filter, extension);
+379     }
+380 
+381     @Override
+382     public List<ObjectData> getAllVersions(String repositoryId, String objectId, String versionSeriesId, String filter,
+383             Boolean includeAllowableActions, ExtensionsData extension) {
+384         return getVersioningService().getAllVersions(repositoryId, objectId, versionSeriesId, filter,
+385                 includeAllowableActions, extension);
+386     }
+387 
+388     @Override
+389     public ObjectList getContentChanges(String repositoryId, Holder<String> changeLogToken, Boolean includeProperties,
+390             String filter, Boolean includePolicyIds, Boolean includeAcl, BigInteger maxItems, ExtensionsData extension) {
+391         return getDiscoveryService().getContentChanges(repositoryId, changeLogToken, includeProperties, filter,
+392                 includePolicyIds, includeAcl, maxItems, extension);
+393     }
+394 
+395     @Override
+396     public ObjectList query(String repositoryId, String statement, Boolean searchAllVersions,
+397             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+398             BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+399         return getDiscoveryService().query(repositoryId, statement, searchAllVersions, includeAllowableActions,
+400                 includeRelationships, renditionFilter, maxItems, skipCount, extension);
+401     }
+402 
+403     @Override
+404     public void addObjectToFolder(String repositoryId, String objectId, String folderId, Boolean allVersions,
+405             ExtensionsData extension) {
+406         getMultiFilingService().addObjectToFolder(repositoryId, objectId, folderId, allVersions, extension);
+407     }
+408 
+409     @Override
+410     public void removeObjectFromFolder(String repositoryId, String objectId, String folderId, ExtensionsData extension) {
+411         getMultiFilingService().removeObjectFromFolder(repositoryId, objectId, folderId, extension);
+412     }
+413 
+414     @Override
+415     public ObjectList getObjectRelationships(String repositoryId, String objectId, Boolean includeSubRelationshipTypes,
+416             RelationshipDirection relationshipDirection, String typeId, String filter, Boolean includeAllowableActions,
+417             BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+418         return getRelationshipService().getObjectRelationships(repositoryId, objectId, includeSubRelationshipTypes,
+419                 relationshipDirection, typeId, filter, includeAllowableActions, maxItems, skipCount, extension);
+420     }
+421 
+422     @Override
+423     public Acl applyAcl(String repositoryId, String objectId, Acl addAces, Acl removeAces,
+424             AclPropagation aclPropagation, ExtensionsData extension) {
+425         return getAclService().applyAcl(repositoryId, objectId, addAces, removeAces, aclPropagation, extension);
+426     }
+427 
+428     @Override
+429     public Acl applyAcl(String repositoryId, String objectId, Acl aces, AclPropagation aclPropagation) {
+430         Acl orgAcl = getAclService().getAcl(repositoryId, objectId, Boolean.FALSE, null);
+431 
+432         Acl removeAces = null;
+433         if (orgAcl != null && orgAcl.getAces() != null && !orgAcl.getAces().isEmpty()) {
+434             List<Ace> directAces = new ArrayList<Ace>();
+435 
+436             for (Ace ace : orgAcl.getAces()) {
+437                 if (ace.isDirect()) {
+438                     directAces.add(ace);
+439                 }
+440             }
+441 
+442             if (!directAces.isEmpty()) {
+443                 removeAces = new AccessControlListImpl(directAces);
+444             }
+445         }
+446 
+447         return getAclService().applyAcl(repositoryId, objectId, aces, removeAces, aclPropagation, null);
+448     }
+449 
+450     @Override
+451     public Acl getAcl(String repositoryId, String objectId, Boolean onlyBasicPermissions, ExtensionsData extension) {
+452         return getAclService().getAcl(repositoryId, objectId, onlyBasicPermissions, extension);
+453     }
+454 
+455     @Override
+456     public void applyPolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension) {
+457         getPolicyService().applyPolicy(repositoryId, policyId, objectId, extension);
+458     }
+459 
+460     @Override
+461     public List<ObjectData> getAppliedPolicies(String repositoryId, String objectId, String filter,
+462             ExtensionsData extension) {
+463         return getPolicyService().getAppliedPolicies(repositoryId, objectId, filter, extension);
+464     }
+465 
+466     @Override
+467     public void removePolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension) {
+468         getPolicyService().removePolicy(repositoryId, policyId, objectId, extension);
+469     }
+470 
+471     @Override
+472     public ObjectInfo getObjectInfo(String repositoryId, String objectId) {
+473         // TODO: add intelligent object info cache
+474         return super.getObjectInfo(repositoryId, objectId);
+475     }
+476 
+477     @Override
+478     protected ObjectInfo getObjectInfoIntern(String repositoryId, ObjectData object) {
+479         // TODO: add intelligent object info cache
+480         return super.getObjectInfoIntern(repositoryId, object);
+481     }
+482 
+483     @Override
+484     public void close() {
+485         super.close();
+486         context = null;
+487     }
+488 }
+
+
+ + Added: chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/client/SimpleCmisBindingFactory.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/client/SimpleCmisBindingFactory.html?rev=1671608&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/client/SimpleCmisBindingFactory.html (added) +++ chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/client/SimpleCmisBindingFactory.html Mon Apr 6 17:15:57 2015 @@ -0,0 +1,78 @@ + + + + +SimpleCmisBindingFactory xref + + + +
View Javadoc
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.bridge.client;
+20  
+21  import java.util.HashMap;
+22  import java.util.Map;
+23  
+24  import org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
+25  import org.apache.chemistry.opencmis.commons.SessionParameter;
+26  import org.apache.chemistry.opencmis.commons.enums.BindingType;
+27  import org.apache.chemistry.opencmis.commons.server.CallContext;
+28  import org.apache.chemistry.opencmis.commons.spi.CmisBinding;
+29  
+30  /**
+31   * Creates a {@link CmisBinding} object for a set of parameters and a
+32   * {@link CallContext}.
+33   */
+34  public class SimpleCmisBindingFactory {
+35  
+36      private static final CmisBindingFactory BINDING_FACTORY = CmisBindingFactory.newInstance();
+37  
+38      public static CmisBinding createCmisBinding(CallContext context, Map<String, String> bindingParameters) {
+39          Map<String, String> parameters = new HashMap<String, String>(bindingParameters);
+40  
+41          // forward user name and password
+42          parameters.put(SessionParameter.USER, context.getUsername());
+43          parameters.put(SessionParameter.PASSWORD, context.getPassword());
+44  
+45          // create the binding object
+46          String bindingTypeStr = parameters.get(SessionParameter.BINDING_TYPE);
+47          BindingType bindingType = BindingType.fromValue(bindingTypeStr);
+48  
+49          CmisBinding binding = null;
+50          switch (bindingType) {
+51          case WEBSERVICES:
+52              binding = BINDING_FACTORY.createCmisWebServicesBinding(parameters);
+53              break;
+54          case BROWSER:
+55              binding = BINDING_FACTORY.createCmisBrowserBinding(parameters);
+56              break;
+57          default:
+58              binding = BINDING_FACTORY.createCmisAtomPubBinding(parameters);
+59              break;
+60          }
+61  
+62          return binding;
+63      }
+64  }
+
+
+ + Added: chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/client/package-frame.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/client/package-frame.html?rev=1671608&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/client/package-frame.html (added) +++ chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/client/package-frame.html Mon Apr 6 17:15:57 2015 @@ -0,0 +1,24 @@ + + + + + + OpenCMIS Bridge WAR packaging 0.13.0 Reference Package org.apache.chemistry.opencmis.bridge.client + + + + +

+ org.apache.chemistry.opencmis.bridge.client +

+ +

Classes

+ + + + + \ No newline at end of file Added: chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/client/package-summary.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/client/package-summary.html?rev=1671608&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/client/package-summary.html (added) +++ chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/client/package-summary.html Mon Apr 6 17:15:57 2015 @@ -0,0 +1,67 @@ + + + + + + OpenCMIS Bridge WAR packaging 0.13.0 Reference Package org.apache.chemistry.opencmis.bridge.client + + + +
+ +
+
+ +
+ +

Package org.apache.chemistry.opencmis.bridge.client

+ + + + + + + + + + + + +
Class Summary
+ SimpleCmisBindingFactory +
+ +
+ +
+
+ +
+
+ Copyright © 2009-2015 The Apache Software Foundation. All Rights Reserved. + + \ No newline at end of file Added: chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/httpsession/HttpSessionBridgeServiceFactory.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/httpsession/HttpSessionBridgeServiceFactory.html?rev=1671608&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/httpsession/HttpSessionBridgeServiceFactory.html (added) +++ chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-bridge/chemistry-opencmis-bridge/xref/org/apache/chemistry/opencmis/bridge/httpsession/HttpSessionBridgeServiceFactory.html Mon Apr 6 17:15:57 2015 @@ -0,0 +1,60 @@ + + + + +HttpSessionBridgeServiceFactory xref + + + +
View Javadoc
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.bridge.httpsession;
+20  
+21  import java.util.concurrent.locks.ReentrantReadWriteLock;
+22  
+23  import org.apache.chemistry.opencmis.bridge.AbstractBridgeServiceFactory;
+24  import org.apache.chemistry.opencmis.bridge.FilterCmisService;
+25  import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
+26  import org.apache.chemistry.opencmis.commons.server.CallContext;
+27  
+28  public class HttpSessionBridgeServiceFactory extends AbstractBridgeServiceFactory {
+29  
+30      private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
+31  
+32      @Override
+33      protected FilterCmisService createService(CallContext context) {
+34          HttpSessionCmisService service = null;
+35          try {
+36              service = (HttpSessionCmisService) getServiceClass().newInstance();
+37          } catch (Exception e) {
+38              throw new CmisRuntimeException("Could not create service instance: " + e, e);
+39          }
+40  
+41          service.init(getParameters(), lock);
+42  
+43          return service;
+44      }
+45  
+46  }
+
+
+ +