This project has retired. For details please refer to its
Attic page.
PolicyServiceImpl xref
1/*2 *3 * Licensed to the Apache Software Foundation (ASF) under one4 * or more contributor license agreements. See the NOTICE file5 * distributed with this work for additional information6 * regarding copyright ownership. The ASF licenses this file7 * to you under the Apache License, Version 2.0 (the8 * "License"); you may not use this file except in compliance9 * with the License. You may obtain a copy of the License at10 *11 * http://www.apache.org/licenses/LICENSE-2.012 *13 * Unless required by applicable law or agreed to in writing,14 * software distributed under the License is distributed on an15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY16 * KIND, either express or implied. See the License for the17 * specific language governing permissions and limitations18 * under the License.19 *20 */21package org.apache.chemistry.opencmis.client.bindings.spi.local;
2223import java.util.List;
2425import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
26import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
27import org.apache.chemistry.opencmis.commons.data.ObjectData;
28import org.apache.chemistry.opencmis.commons.server.CmisService;
29import org.apache.chemistry.opencmis.commons.server.CmisServiceFactory;
30import org.apache.chemistry.opencmis.commons.spi.PolicyService;
3132publicclassPolicyServiceImplextendsAbstractLocalService implements PolicyService {
3334/**35 * Constructor.36 */37publicPolicyServiceImpl(BindingSession session, CmisServiceFactory factory) {
38 setSession(session);
39 setServiceFactory(factory);
40 }
4142publicvoid applyPolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension) {
43 CmisService service = getService(repositoryId);
4445try {
46 service.applyPolicy(repositoryId, policyId, objectId, extension);
47 } finally {
48 service.close();
49 }
50 }
5152public List<ObjectData> getAppliedPolicies(String repositoryId, String objectId, String filter,
53 ExtensionsData extension) {
54 CmisService service = getService(repositoryId);
5556try {
57return service.getAppliedPolicies(repositoryId, objectId, filter, extension);
58 } finally {
59 service.close();
60 }
61 }
6263publicvoid removePolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension) {
64 CmisService service = getService(repositoryId);
6566try {
67 service.removePolicy(repositoryId, policyId, objectId, extension);
68 } finally {
69 service.close();
70 }
71 }
72 }