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.commons.server; 20 21 import java.util.GregorianCalendar; 22 import java.util.List; 23 24 import org.apache.chemistry.opencmis.commons.data.ObjectData; 25 import org.apache.chemistry.opencmis.commons.enums.BaseTypeId; 26 27 /** 28 * This class contains information about an object. This data is used to 29 * generate the appropriate links in AtomPub entries and feeds. 30 */ 31 public interface ObjectInfo { 32 33 /** 34 * Returns the object id. 35 */ 36 String getId(); 37 38 /** 39 * Returns the object name. 40 */ 41 String getName(); 42 43 /** 44 * Returns the creator. 45 */ 46 String getCreatedBy(); 47 48 /** 49 * Returns the creation date. 50 */ 51 GregorianCalendar getCreationDate(); 52 53 /** 54 * Returns the last modification date. 55 */ 56 GregorianCalendar getLastModificationDate(); 57 58 /** 59 * Returns the type id. 60 */ 61 String getTypeId(); 62 63 /** 64 * Returns the base type. 65 */ 66 BaseTypeId getBaseType(); 67 68 /** 69 * Returns <code>true</code> if the object is a document and if it is the 70 * current version or it is not versionable, <code>false</code> otherwise. 71 */ 72 boolean isCurrentVersion(); 73 74 /** 75 * Returns the version series id if the object is a document and it is 76 * versionable, <code>null</code> otherwise. 77 */ 78 String getVersionSeriesId(); 79 80 /** 81 * Returns the working copy id if the object is a document and a working 82 * copy exists, <code>null</code> otherwise. 83 */ 84 String getWorkingCopyId(); 85 86 /** 87 * Returns the original id of the working copy if the object is a document 88 * and a working copy, <code>null</code> otherwise. 89 */ 90 String getWorkingCopyOriginalId(); 91 92 /** 93 * Returns <code>true</code> if the object is a document and has content, 94 * <code>false</code> otherwise. 95 */ 96 boolean hasContent(); 97 98 /** 99 * Returns the content type of the content if the object is a document and 100 * has content, <code>null</code> otherwise. 101 */ 102 String getContentType(); 103 104 /** 105 * Returns the file name of the content if the object is a document and has 106 * content, <code>null</code> otherwise. 107 */ 108 String getFileName(); 109 110 /** 111 * Returns rendition information if the object has renditions, 112 * <code>null</code> otherwise. 113 */ 114 List<RenditionInfo> getRenditionInfos(); 115 116 /** 117 * Returns <code>true</code> if the object supports relationships even if no 118 * relationships exist, <code>false</code> otherwise. 119 */ 120 boolean supportsRelationships(); 121 122 /** 123 * Returns <code>true</code> if the object supports policies even if no 124 * policies are applied, <code>false</code> otherwise. 125 */ 126 boolean supportsPolicies(); 127 128 /** 129 * Returns <code>true</code> if the object has an ACL, <code>false</code> 130 * otherwise. 131 */ 132 boolean hasAcl(); 133 134 /** 135 * Returns <code>true</code> if the object has at least one parent, 136 * <code>false</code> otherwise. 137 */ 138 boolean hasParent(); 139 140 /** 141 * Returns <code>true</code> if the object is a folder and supports 142 * <code>getDescendants</code>, <code>false</code> otherwise. 143 */ 144 boolean supportsDescendants(); 145 146 /** 147 * Returns <code>true</code> if the object is a folder and supports 148 * <code>getFolderTree</code>, <code>false</code> otherwise. 149 */ 150 boolean supportsFolderTree(); 151 152 /** 153 * Returns the list of ids of the relationships that originate from this 154 * object, <code>null</code> is no such relationships exist. 155 */ 156 List<String> getRelationshipSourceIds(); 157 158 /** 159 * Returns the list of ids of the relationships that point to this object, 160 * <code>null</code> is no such relationships exist. 161 */ 162 List<String> getRelationshipTargetIds(); 163 164 /** 165 * Returns the full object. 166 */ 167 ObjectData getObject(); 168 }