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.browser;
2021import java.math.BigInteger;
22import java.util.Map;
2324import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
25import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
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.impl.Constants;
30import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
31import org.apache.chemistry.opencmis.commons.impl.UrlBuilder;
32import org.apache.chemistry.opencmis.commons.spi.RelationshipService;
3334/**35 * Relationship Service Browser Binding client.36 */37publicclassRelationshipServiceImplextendsAbstractBrowserBindingService implements RelationshipService {
3839/**40 * Constructor.41 */42publicRelationshipServiceImpl(BindingSession session) {
43 setSession(session);
44 }
4546public ObjectList getObjectRelationships(String repositoryId, String objectId, Boolean includeSubRelationshipTypes,
47 RelationshipDirection relationshipDirection, String typeId, String filter, Boolean includeAllowableActions,
48 BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
49// build URL50 UrlBuilder url = getObjectUrl(repositoryId, objectId, Constants.SELECTOR_RELATIONSHIPS);
51 url.addParameter(Constants.PARAM_SUB_RELATIONSHIP_TYPES, includeSubRelationshipTypes);
52 url.addParameter(Constants.PARAM_RELATIONSHIP_DIRECTION, relationshipDirection);
53 url.addParameter(Constants.PARAM_TYPE_ID, typeId);
54 url.addParameter(Constants.PARAM_FILTER, filter);
55 url.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);
56 url.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
57 url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
5859// read and parse60 HttpUtils.Response resp = read(url);
61 Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());
6263return JSONConverter.convertObjectList(json, false);
64 }
65 }