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

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.client.api;
20  
21  import java.io.InputStream;
22  import java.util.List;
23  import java.util.Map;
24  import java.util.Set;
25  
26  import org.apache.chemistry.opencmis.commons.data.Ace;
27  import org.apache.chemistry.opencmis.commons.data.Acl;
28  import org.apache.chemistry.opencmis.commons.data.ContentStream;
29  import org.apache.chemistry.opencmis.commons.data.ObjectData;
30  import org.apache.chemistry.opencmis.commons.data.ObjectList;
31  import org.apache.chemistry.opencmis.commons.data.Properties;
32  import org.apache.chemistry.opencmis.commons.data.PropertyData;
33  import org.apache.chemistry.opencmis.commons.data.RenditionData;
34  import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
35  import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
36  import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
37  import org.apache.chemistry.opencmis.commons.enums.Updatability;
38  
39  /**
40   * A factory to create CMIS objects.
41   * 
42   * @see org.apache.chemistry.opencmis.client.api.Session#getObjectFactory()
43   */
44  public interface ObjectFactory {
45  
46      void initialize(Session session, Map<String, String> parameters);
47  
48      // repository info
49  
50      RepositoryInfo convertRepositoryInfo(RepositoryInfo repositoryInfo);
51  
52      // ACL and ACE
53  
54      Acl convertAces(List<Ace> aces);
55  
56      Acl createAcl(List<Ace> aces);
57  
58      Ace createAce(String principal, List<String> permissions);
59  
60      // policies
61  
62      List<String> convertPolicies(List<Policy> policies);
63  
64      // renditions
65  
66      Rendition convertRendition(String objectId, RenditionData rendition);
67  
68      // content stream
69  
70      ContentStream createContentStream(String filename, long length, String mimetype, InputStream stream);
71  
72      ContentStream convertContentStream(ContentStream contentStream);
73  
74      // types
75  
76      ObjectType convertTypeDefinition(TypeDefinition typeDefinition);
77  
78      ObjectType getTypeFromObjectData(ObjectData objectData);
79  
80      // properties
81  
82      <T> Property<T> createProperty(PropertyDefinition<T> type, List<T> values);
83  
84      Map<String, Property<?>> convertProperties(ObjectType objectType, Properties properties);
85  
86      Properties convertProperties(Map<String, ?> properties, ObjectType type, Set<Updatability> updatabilityFilter);
87  
88      List<PropertyData<?>> convertQueryProperties(Properties properties);
89  
90      // objects
91  
92      CmisObject convertObject(ObjectData objectData, OperationContext context);
93  
94      QueryResult convertQueryResult(ObjectData objectData);
95  
96      ChangeEvent convertChangeEvent(ObjectData objectData);
97  
98      ChangeEvents convertChangeEvents(String changeLogToken, ObjectList objectList);
99  }