This project has retired. For details please refer to its
Attic page.
RelationshipServiceImpl xref
1/*2 * Licensed to the Apache Software Foundation (ASF) under one3 * or more contributor license agreements. See the NOTICE file4 * distributed with this work for additional information5 * regarding copyright ownership. The ASF licenses this file6 * to you under the Apache License, Version 2.0 (the7 * "License"); you may not use this file except in compliance8 * with the License. You may obtain a copy of the License at9 *10 * http://www.apache.org/licenses/LICENSE-2.011 *12 * Unless required by applicable law or agreed to in writing,13 * software distributed under the License is distributed on an14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY15 * KIND, either express or implied. See the License for the16 * specific language governing permissions and limitations17 * under the License.18 */19package org.apache.chemistry.opencmis.client.bindings.spi.webservices;
2021importstatic org.apache.chemistry.opencmis.commons.impl.Converter.convert;
2223import java.math.BigInteger;
2425import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
26import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
27import org.apache.chemistry.opencmis.commons.data.ObjectList;
28import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
29import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
30import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisException;
31import org.apache.chemistry.opencmis.commons.impl.jaxb.EnumRelationshipDirection;
32import org.apache.chemistry.opencmis.commons.impl.jaxb.RelationshipServicePort;
33import org.apache.chemistry.opencmis.commons.spi.RelationshipService;
3435/**36 * Relationship Service Web Services client.37 */38publicclassRelationshipServiceImplextendsAbstractWebServicesService implements RelationshipService {
3940privatefinalAbstractPortProvider portProvider;
4142/**43 * Constructor.44 */45publicRelationshipServiceImpl(BindingSession session, AbstractPortProvider portProvider) {
46 setSession(session);
47this.portProvider = portProvider;
48 }
4950public ObjectList getObjectRelationships(String repositoryId, String objectId, Boolean includeSubRelationshipTypes,
51 RelationshipDirection relationshipDirection, String typeId, String filter, Boolean includeAllowableActions,
52 BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
53 RelationshipServicePort port = portProvider.getRelationshipServicePort();
5455try {
56return convert(port.getObjectRelationships(repositoryId, objectId, includeSubRelationshipTypes,
57 convert(EnumRelationshipDirection.class, relationshipDirection), typeId, filter,
58 includeAllowableActions, maxItems, skipCount, convert(extension)));
59 } catch (CmisException e) {
60throw convertException(e);
61 } catch (Exception e) {
62thrownew CmisRuntimeException("Error: " + e.getMessage(), e);
63 } finally {
64 portProvider.endCall(port);
65 }
66 }
67 }