All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.chemistry.opencmis.commons.spi.ObjectService Maven / Gradle / Ivy

The newest version!
/*
 * 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.math.BigInteger;
import java.util.List;

import org.apache.chemistry.opencmis.commons.data.Acl;
import org.apache.chemistry.opencmis.commons.data.AllowableActions;
import org.apache.chemistry.opencmis.commons.data.BulkUpdateObjectIdAndChangeToken;
import org.apache.chemistry.opencmis.commons.data.ContentStream;
import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
import org.apache.chemistry.opencmis.commons.data.FailedToDeleteData;
import org.apache.chemistry.opencmis.commons.data.ObjectData;
import org.apache.chemistry.opencmis.commons.data.Properties;
import org.apache.chemistry.opencmis.commons.data.RenditionData;
import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
import org.apache.chemistry.opencmis.commons.enums.VersioningState;

/**
 * Object Service interface.
 * 
 * 

* * See the CMIS 1.0 and CMIS 1.1 specifications for details on the operations, parameters, * exceptions and the domain model. * *

*/ public interface ObjectService { /** * Creates a document object of the specified type (given by the * cmis:objectTypeId property) in the (optionally) specified location. * * The stream in contentStream is consumed but not closed by * this method. * * @param repositoryId * the identifier for the repository * @param properties * the property values that must be applied to the newly created * document object * @param folderId * (optional) if specified, the identifier for the * folder that must be the parent folder for the newly created * document object * @param contentStream * (optional) the content stream that must be stored for * the newly created document object * @param versioningState * (optional) specifies what the versioning state of the * newly created object must be (default is * {@link VersioningState#MAJOR}) * @param policies * (optional) a list of policy IDs that must be applied * to the newly created document object * @param addAces * (optional) a list of ACEs that must be added to the * newly created document object, either using the ACL from * {@code folderId} if specified, or being applied if no * {@code folderId} is specified * @param removeAces * (optional) a list of ACEs that must be removed from * the newly created document object, either using the ACL from * {@code folderId} if specified, or being ignored if no * {@code folderId} is specified * @param extension * extension data * @return the ID of the newly created document */ String createDocument(String repositoryId, Properties properties, String folderId, ContentStream contentStream, VersioningState versioningState, List policies, Acl addAces, Acl removeAces, ExtensionsData extension); /** * Creates a document object as a copy of the given source document in the * (optionally) specified location. * * @param repositoryId * the identifier for the repository * @param sourceId * the identifier for the source document * @param properties * the property values that must be applied to the newly created * document object * @param folderId * (optional) if specified, the identifier for the * folder that must be the parent folder for the newly created * document object * @param versioningState * (optional) specifies what the versioning state of the * newly created object must be (default is * {@link VersioningState#MAJOR}) * @param policies * (optional) a list of policy IDs that must be applied * to the newly created document object * @param addAces * (optional) a list of ACEs that must be added to the * newly created document object, either using the ACL from * {@code folderId} if specified, or being applied if no * {@code folderId} is specified * @param removeAces * (optional) a list of ACEs that must be removed from * the newly created document object, either using the ACL from * {@code folderId} if specified, or being ignored if no * {@code folderId} is specified * @param extension * extension data * @return the ID of the newly created document */ String createDocumentFromSource(String repositoryId, String sourceId, Properties properties, String folderId, VersioningState versioningState, List policies, Acl addAces, Acl removeAces, ExtensionsData extension); /** * Creates a folder object of the specified type (given by the * cmis:objectTypeId property) in the specified location. * * @param repositoryId * the identifier for the repository * @param properties * the property values that must be applied to the newly created * folder object * @param folderId * the identifier for the parent folder * @param policies * (optional) a list of policy IDs that must be applied * to the newly created folder object * @param addAces * (optional) a list of ACEs that must be added to the * newly created folder object, either using the ACL from * {@code folderId} if specified, or being applied if no * {@code folderId} is specified * @param removeAces * (optional) a list of ACEs that must be removed from * the newly created folder object, either using the ACL from * {@code folderId} if specified, or being ignored if no * {@code folderId} is specified * @param extension * extension data * @return the ID of the newly created folder */ String createFolder(String repositoryId, Properties properties, String folderId, List policies, Acl addAces, Acl removeAces, ExtensionsData extension); /** * Creates a relationship object of the specified type (given by the * cmis:objectTypeId property). * * @param repositoryId * the identifier for the repository * @param properties * the property values that must be applied to the newly created * relationship object * @param policies * (optional) a list of policy IDs that must be applied * to the newly created relationship object * @param addAces * (optional) a list of ACEs that must be added to the * newly created relationship object, either using the ACL from * {@code folderId} if specified, or being applied if no * {@code folderId} is specified * @param removeAces * (optional) a list of ACEs that must be removed from * the newly created relationship object, either using the ACL * from {@code folderId} if specified, or being ignored if no * {@code folderId} is specified * @param extension * extension data * @return the ID of the newly created relationship */ String createRelationship(String repositoryId, Properties properties, List policies, Acl addAces, Acl removeAces, ExtensionsData extension); /** * Creates a policy object of the specified type (given by the * cmis:objectTypeId property). * * @param repositoryId * the identifier for the repository * @param properties * the property values that must be applied to the newly created * policy object * @param folderId * (optional) if specified, the identifier for the * folder that must be the parent folder for the newly created * policy object * @param policies * (optional) a list of policy IDs that must be applied * to the newly created policy object * @param addAces * (optional) a list of ACEs that must be added to the * newly created policy object, either using the ACL from * {@code folderId} if specified, or being applied if no * {@code folderId} is specified * @param removeAces * (optional) a list of ACEs that must be removed from * the newly created policy object, either using the ACL from * {@code folderId} if specified, or being ignored if no * {@code folderId} is specified * @param extension * extension data * @return the ID of the newly created policy */ String createPolicy(String repositoryId, Properties properties, String folderId, List policies, Acl addAces, Acl removeAces, ExtensionsData extension); /** * Creates an item object of the specified type (given by the * cmis:objectTypeId property). * * @param repositoryId * the identifier for the repository * @param properties * the property values that must be applied to the newly created * policy object * @param folderId * (optional) if specified, the identifier for the * folder that must be the parent folder for the newly created * policy object * @param policies * (optional) a list of policy IDs that must be applied * to the newly created policy object * @param addAces * (optional) a list of ACEs that must be added to the * newly created policy object, either using the ACL from * {@code folderId} if specified, or being applied if no * {@code folderId} is specified * @param removeAces * (optional) a list of ACEs that must be removed from * the newly created policy object, either using the ACL from * {@code folderId} if specified, or being ignored if no * {@code folderId} is specified * @param extension * extension data * @return the ID of the newly created item */ String createItem(String repositoryId, Properties properties, String folderId, List policies, Acl addAces, Acl removeAces, ExtensionsData extension); /** * Gets the list of allowable actions for an object. * * @param repositoryId * the identifier for the repository * @param objectId * the identifier for the object * @param extension * extension data * @return the allowable actions */ AllowableActions getAllowableActions(String repositoryId, String objectId, ExtensionsData extension); /** * Gets the specified information for the object specified by id. * * @param repositoryId * the identifier for the repository * @param objectId * the identifier for the object * @param filter * (optional) a comma-separated list of query names that * defines which properties must be returned by the repository * (default is repository specific) * @param includeAllowableActions * (optional) if {@code true}, then the repository must * return the allowable actions for the object (default is * {@code false}) * @param includeRelationships * (optional) indicates what relationships in which the * object participates must be returned (default is * {@link IncludeRelationships#NONE}) * @param renditionFilter * (optional) indicates what set of renditions the * repository must return whose kind matches this filter (default * is "cmis:none") * @param includePolicyIds * (optional) if {@code true}, then the repository must * return the policy ids for the object (default is {@code false} * ) * @param includeAcl * (optional) if {@code true}, then the repository must * return the ACL for the object (default is {@code false}) * @param extension * extension data * @return the object */ ObjectData getObject(String repositoryId, String objectId, String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension); /** * Gets the list of properties for an object. * * @param repositoryId * the identifier for the repository * @param objectId * the identifier for the object * @param filter * (optional) a comma-separated list of query names that * defines which properties must be returned by the repository * (default is repository specific) * @param extension * extension data * @return the object properties */ Properties getProperties(String repositoryId, String objectId, String filter, ExtensionsData extension); /** * Gets the list of associated renditions for the specified object. Only * rendition attributes are returned, not rendition stream. * * @param repositoryId * the identifier for the repository * @param objectId * the identifier for the object * @param renditionFilter * (optional) indicates what set of renditions the * repository must return whose kind matches this filter (default * is "cmis:none") * @param maxItems * (optional) the maximum number of items to return in a * response (default is repository specific) * @param skipCount * (optional) number of potential results that the * repository must skip/page over before returning any results * (default is 0) * @param extension * extension data * @return the list of renditions */ List getRenditions(String repositoryId, String objectId, String renditionFilter, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension); /** * Gets the specified information for the object specified by path. * * @param repositoryId * the identifier for the repository * @param path * the path to the object * @param filter * (optional) a comma-separated list of query names that * defines which properties must be returned by the repository * (default is repository specific) * @param includeAllowableActions * (optional) if {@code true}, then the repository must * return the allowable actions for the object (default is * {@code false}) * @param includeRelationships * (optional) indicates what relationships in which the * object participates must be returned (default is * {@link IncludeRelationships#NONE}) * @param renditionFilter * (optional) indicates what set of renditions the * repository must return whose kind matches this filter (default * is "cmis:none") * @param includePolicyIds * (optional) if {@code true}, then the repository must * return the policy ids for the object (default is {@code false} * ) * @param includeAcl * (optional) if {@code true}, then the repository must * return the ACL for the object (default is {@code false}) * @param extension * extension data * @return the object */ ObjectData getObjectByPath(String repositoryId, String path, String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension); /** * Gets the content stream for the specified document object, or gets a * rendition stream for a specified rendition of a document or folder * object. * * @param repositoryId * the identifier for the repository * @param objectId * the identifier for the object * @param extension * extension data * @return the content stream */ ContentStream getContentStream(String repositoryId, String objectId, String streamId, BigInteger offset, BigInteger length, ExtensionsData extension); /** * Updates properties of the specified object. * * @param repositoryId * the identifier for the repository * @param objectId * the identifier for the object. The repository might return a * different/new object id * @param changeToken * (optional) the last change token of this object that * the client received. The repository might return a new change * token (default is {@code null}) * @param properties * the updated property values that must be applied to the object * @param extension * extension data */ void updateProperties(String repositoryId, Holder objectId, Holder changeToken, Properties properties, ExtensionsData extension); /** * Updates properties and secondary types of one or more objects. * * @param repositoryId * the identifier for the repository * @param objectIdsAndChangeTokens * the ids and change tokens of the objects to update * @param properties * the properties to set * @param addSecondaryTypeIds * the secondary types to apply * @param removeSecondaryTypeIds * the secondary types to remove * @param extension * extension data * @return the list of updated objects with their change tokens */ List bulkUpdateProperties(String repositoryId, List objectIdsAndChangeTokens, Properties properties, List addSecondaryTypeIds, List removeSecondaryTypeIds, ExtensionsData extension); /** * Moves the specified file-able object from one folder to another. * * @param repositoryId * the identifier for the repository * @param objectId * the identifier for the object. The repository might return a * different/new object id * @param targetFolderId * the identifier for the target folder * @param sourceFolderId * the identifier for the source folder * @param extension * extension data */ void moveObject(String repositoryId, Holder objectId, String targetFolderId, String sourceFolderId, ExtensionsData extension); /** * Deletes the specified object. * * @param repositoryId * the identifier for the repository * @param objectId * the identifier for the object * @param allVersions * (optional) If {@code true} then delete all versions * of the document, otherwise delete only the document object * specified (default is {@code true}) * @param extension * extension data */ void deleteObject(String repositoryId, String objectId, Boolean allVersions, ExtensionsData extension); /** * Deletes the specified folder object and all of its child- and * descendant-objects. * * @param repositoryId * the identifier for the repository * @param folderId * the identifier for the folder * @param allVersions * (optional) If {@code true} then delete all versions * of the document, otherwise delete only the document object * specified (default is {@code true}) * @param unfileObjects * (optional) defines how the repository must process * file-able child- or descendant-objects (default is * {@link UnfileObject#DELETE}) * @param continueOnFailure * (optional) If {@code true}, then the repository * should continue attempting to perform this operation even if * deletion of a child- or descendant-object in the specified * folder cannot be deleted (default is {@code false}) * @param extension * extension data * @return a (possibly incomplete) collection of object IDs of objects that * couldn't be deleted */ FailedToDeleteData deleteTree(String repositoryId, String folderId, Boolean allVersions, UnfileObject unfileObjects, Boolean continueOnFailure, ExtensionsData extension); /** * Sets the content stream for the specified document object. * * The stream in contentStream is consumed but not closed by * this method. * * @param repositoryId * the identifier for the repository * @param objectId * the identifier for the object. The repository might return a * different/new object id * @param overwriteFlag * (optional) If {@code true}, then the repository must * replace the existing content stream for the object (if any) * with the input content stream. If If {@code false}, then the * repository must only set the input content stream for the * object if the object currently does not have a content stream * (default is {@code true}) * @param changeToken * (optional) the last change token of this object that * the client received. The repository might return a new change * token (default is {@code null}) * @param contentStream * the content stream * @param extension * extension data */ void setContentStream(String repositoryId, Holder objectId, Boolean overwriteFlag, Holder changeToken, ContentStream contentStream, ExtensionsData extension); /** * Deletes the content stream for the specified document object. * * @param repositoryId * the identifier for the repository * @param objectId * the identifier for the object. The repository might return a * different/new object id * @param changeToken * (optional) the last change token of this object that * the client received. The repository might return a new change * token (default is {@code null}) * @param extension * extension data */ void deleteContentStream(String repositoryId, Holder objectId, Holder changeToken, ExtensionsData extension); /** * Appends the content stream to the content of the document. * * @param repositoryId * the identifier for the repository * @param objectId * the identifier for the object. The repository might return a * different/new object id * @param changeToken * (optional) the last change token of this object that * the client received. The repository might return a new change * token (default is {@code null}) * @param contentStream * the content stream to append * @param isLastChunk * indicates if this content stream is the last chunk * @param extension * extension data */ void appendContentStream(String repositoryId, Holder objectId, Holder changeToken, ContentStream contentStream, boolean isLastChunk, ExtensionsData extension); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy