RepositoryDelegate.java

  1. /*
  2.  * *********************************************************************************************************************
  3.  *
  4.  * blueMarine II: Semantic Media Centre
  5.  * http://tidalwave.it/projects/bluemarine2
  6.  *
  7.  * Copyright (C) 2015 - 2021 by Tidalwave s.a.s. (http://tidalwave.it)
  8.  *
  9.  * *********************************************************************************************************************
  10.  *
  11.  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
  12.  * the License. You may obtain a copy of the License at
  13.  *
  14.  *     http://www.apache.org/licenses/LICENSE-2.0
  15.  *
  16.  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
  17.  * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the
  18.  * specific language governing permissions and limitations under the License.
  19.  *
  20.  * *********************************************************************************************************************
  21.  *
  22.  * git clone https://bitbucket.org/tidalwave/bluemarine2-src
  23.  * git clone https://github.com/tidalwave-it/bluemarine2-src
  24.  *
  25.  * *********************************************************************************************************************
  26.  */
  27. package it.tidalwave.bluemarine2.persistence.impl;

  28. import java.io.File;
  29. import javax.inject.Inject;
  30. import org.eclipse.rdf4j.model.ValueFactory;
  31. import org.eclipse.rdf4j.repository.Repository;
  32. import org.eclipse.rdf4j.repository.RepositoryConnection;
  33. import org.eclipse.rdf4j.repository.RepositoryException;
  34. import it.tidalwave.bluemarine2.persistence.Persistence;

  35. /***********************************************************************************************************************
  36.  *
  37.  * @author  Fabrizio Giudici
  38.  *
  39.  **********************************************************************************************************************/
  40. public class RepositoryDelegate implements Repository
  41.   {
  42.     @Inject
  43.     private Persistence persistence;

  44.     @Override
  45.     public void setDataDir(File dataDir)
  46.       {
  47.         persistence.getRepository().setDataDir(dataDir);
  48.       }

  49.     @Override
  50.     public File getDataDir()
  51.       {
  52.         return persistence.getRepository().getDataDir();
  53.       }

  54.     @Override
  55.     public void initialize()
  56.       {
  57.       }

  58.     @Override
  59.     public boolean isInitialized()
  60.       {
  61.         return persistence.getRepository().isInitialized();
  62.       }

  63.     @Override
  64.     public void shutDown()
  65.       {
  66.       }

  67.     @Override
  68.     public boolean isWritable()
  69.       throws RepositoryException
  70.       {
  71.         return persistence.getRepository().isWritable();
  72.       }

  73.     @Override
  74.     public RepositoryConnection getConnection()
  75.       throws RepositoryException
  76.       {
  77.         return persistence.getRepository().getConnection();
  78.       }

  79.     @Override
  80.     public ValueFactory getValueFactory()
  81.       {
  82.         return persistence.getRepository().getValueFactory();
  83.       }
  84.   }