This project has retired. For details please refer to its
Attic page.
RepositoryImpl 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.runtime.repository;
2021import java.util.HashMap;
22import java.util.Map;
2324import org.apache.chemistry.opencmis.client.api.ObjectFactory;
25import org.apache.chemistry.opencmis.client.api.Repository;
26import org.apache.chemistry.opencmis.client.api.Session;
27import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
28import org.apache.chemistry.opencmis.client.runtime.cache.Cache;
29import org.apache.chemistry.opencmis.commons.SessionParameter;
30import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
31import org.apache.chemistry.opencmis.commons.impl.dataobjects.RepositoryInfoImpl;
32import org.apache.chemistry.opencmis.commons.spi.AuthenticationProvider;
3334publicclassRepositoryImplextends RepositoryInfoImpl implements Repository {
3536privatestaticfinallong serialVersionUID = 1L;
3738privatefinal Map<String, String> parameters;
39privatefinalSessionFactoryImpl sessionFactory;
40privatefinal ObjectFactory objectFactory;
41privatefinal AuthenticationProvider authenticationProvider;
42privatefinalCache cache;
4344/**45 * Constructor.46 */47publicRepositoryImpl(RepositoryInfo data, Map<String, String> parameters, SessionFactoryImpl sessionFactory,
48 ObjectFactory objectFactory, AuthenticationProvider authenticationProvider, Cache cache) {
49super(data);
5051this.parameters = new HashMap<String, String>(parameters);
52this.parameters.put(SessionParameter.REPOSITORY_ID, getId());
5354this.sessionFactory = sessionFactory;
55this.objectFactory = objectFactory;
56this.authenticationProvider = authenticationProvider;
57this.cache = cache;
58 }
5960 @SuppressWarnings("unchecked")
61public <T extends Session> T createSession() {
62return (T) sessionFactory.createSession(parameters, objectFactory, authenticationProvider, cache);
63 }
64 }