This project has retired. For details please refer to its Attic page.
CmisService xref

1   /*
2    *
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *   http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   *
20   */
21  package org.apache.chemistry.opencmis.commons.server;
22  
23  
24  import java.util.List;
25  
26  import org.apache.chemistry.opencmis.commons.data.Acl;
27  import org.apache.chemistry.opencmis.commons.data.ContentStream;
28  import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
29  import org.apache.chemistry.opencmis.commons.data.Properties;
30  import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
31  import org.apache.chemistry.opencmis.commons.enums.VersioningState;
32  import org.apache.chemistry.opencmis.commons.spi.AclService;
33  import org.apache.chemistry.opencmis.commons.spi.DiscoveryService;
34  import org.apache.chemistry.opencmis.commons.spi.MultiFilingService;
35  import org.apache.chemistry.opencmis.commons.spi.NavigationService;
36  import org.apache.chemistry.opencmis.commons.spi.ObjectService;
37  import org.apache.chemistry.opencmis.commons.spi.PolicyService;
38  import org.apache.chemistry.opencmis.commons.spi.RelationshipService;
39  import org.apache.chemistry.opencmis.commons.spi.RepositoryService;
40  import org.apache.chemistry.opencmis.commons.spi.VersioningService;
41  
42  /**
43   * OpenCMIS server interface.
44   * 
45   * <p>
46   * <em>
47   * See CMIS 1.0 specification for details on the operations, parameters,
48   * exceptions and the domain model.
49   * </em>
50   * </p>
51   * 
52   * <p>
53   * This interface adds a few more operations to the operation set defined by
54   * CMIS to address binding specific requirements.
55   * </p>
56   */
57  public interface CmisService extends RepositoryService, NavigationService, ObjectService, VersioningService,
58          DiscoveryService, MultiFilingService, RelationshipService, AclService, PolicyService {
59  
60      /**
61       * Creates a new document, folder or policy.
62       * 
63       * The property "cmis:objectTypeId" defines the type and implicitly the base
64       * type.
65       * 
66       * @param repositoryId
67       *            the identifier for the repository
68       * @param properties
69       *            the property values that MUST be applied to the newly created
70       *            object
71       * @param folderId
72       *            <em>(optional)</em> if specified, the identifier for the
73       *            folder that MUST be the parent folder for the newly created
74       *            object
75       * @param contentStream
76       *            <em>(optional)</em> if the object to create is a document
77       *            object, the content stream that MUST be stored for the newly
78       *            created document object
79       * @param versioningState
80       *            <em>(optional)</em> if the object to create is a document
81       *            object, it specifies what the versioning state of the newly
82       *            created object MUST be (default is
83       *            {@link VersioningState#MAJOR})
84       * @param policies
85       *            <em>(optional)</em> a list of policy IDs that MUST be applied
86       *            to the newly created object
87       * @param addAces
88       *            <em>(optional)</em> a list of ACEs that MUST be added to the
89       *            newly created object, either using the ACL from
90       *            <code>folderId</code> if specified, or being applied if no
91       *            <code>folderId</code> is specified
92       * @param removeAces
93       *            <em>(optional)</em> a list of ACEs that MUST be removed from
94       *            the newly created object, either using the ACL from
95       *            <code>folderId</code> if specified, or being ignored if no
96       *            <code>folderId</code> is specified
97       */
98      String create(String repositoryId, Properties properties, String folderId, ContentStream contentStream,
99              VersioningState versioningState, List<String> policies, ExtensionsData extension);
100 
101     /**
102      * Deletes an object or cancels a check out.
103      * 
104      * For the Web Services binding this is always an object deletion. For the
105      * AtomPub it depends on the referenced object. If it is a checked out
106      * document then the check out must be canceled. If the object is not a
107      * checked out document then the object must be deleted.
108      * 
109      * @param repositoryId
110      *            the identifier for the repository
111      * @param objectId
112      *            the identifier for the object
113      * @param allVersions
114      *            <em>(optional)</em> If <code>true</code> then delete all
115      *            versions of the document, otherwise delete only the document
116      *            object specified (default is <code>true</code>)
117      */
118     void deleteObjectOrCancelCheckOut(String repositoryId, String objectId, Boolean allVersions,
119             ExtensionsData extension);
120 
121     /**
122      * Applies a new ACL to an object.
123      * 
124      * Since it is not possible to transmit an "add ACL" and a "remove ACL" via
125      * AtomPub, the merging has to be done the client side. The ACEs provided
126      * here is supposed to the new complete ACL.
127      * 
128      * @param repositoryId
129      *            the identifier for the repository
130      * @param objectId
131      *            the identifier for the object
132      * @param aces
133      *            the ACEs that should replace the current ACL of the object
134      * @param aclPropagation
135      *            <em>(optional)</em> specifies how ACEs should be handled
136      *            (default is {@link AclPropagation#REPOSITORYDETERMINED})
137      */
138     Acl applyAcl(String repositoryId, String objectId, Acl aces, AclPropagation aclPropagation);
139 
140     /**
141      * Returns the {@link ObjectInfo} of the given object id or
142      * <code>null</code> if no object info exists.
143      * 
144      * Only AtomPub requests will require object infos.
145      * 
146      * @param repositoryId
147      *            the identifier for the repository
148      * @param objectId
149      *            the identifier for the object
150      */
151     ObjectInfo getObjectInfo(String repositoryId, String objectId);
152 
153     /**
154      * Signals that this object will not be used anymore and resources can
155      * released.
156      */
157     void close();
158 }