Package org.openrdf.repository.config

Examples of org.openrdf.repository.config.RepositoryConfigException


  private Repository createRepositoryStack(RepositoryImplConfig config)
    throws RepositoryConfigException
  {
    RepositoryFactory factory = RepositoryRegistry.getInstance().get(config.getType());
    if (factory == null) {
      throw new RepositoryConfigException("Unsupported repository type: " + config.getType());
    }

    Repository repository = factory.getRepository(config);

    if (config instanceof DelegatingRepositoryImplConfig) {
      RepositoryImplConfig delegateConfig = ((DelegatingRepositoryImplConfig)config).getDelegate();

      Repository delegate = createRepositoryStack(delegateConfig);

      try {
        ((DelegatingRepository)repository).setDelegate(delegate);
      }
      catch (ClassCastException e) {
        throw new RepositoryConfigException(
            "Delegate specified for repository that is not a DelegatingRepository: "
                + delegate.getClass());
      }
    }
View Full Code Here


  public void validate()
    throws RepositoryConfigException
  {
    super.validate();
    if (sailImplConfig == null) {
      throw new RepositoryConfigException("No Sail implementation specified for Sail repository");
    }

    try {
      sailImplConfig.validate();
    }
    catch (SailConfigException e) {
      throw new RepositoryConfigException(e.getMessage(), e);
    }
  }
View Full Code Here

        if (typeLit != null) {
          SailFactory factory = SailRegistry.getInstance().get(typeLit.getLabel());

          if (factory == null) {
            throw new RepositoryConfigException("Unsupported Sail type: " + typeLit.getLabel());
          }

          sailImplConfig = factory.getConfig();
          sailImplConfig.parse(graph, sailImplNode);
        }
      }
    }
    catch (GraphUtilException e) {
      throw new RepositoryConfigException(e.getMessage(), e);
    }
    catch (SailConfigException e) {
      throw new RepositoryConfigException(e.getMessage(), e);
    }
  }
View Full Code Here

      try {
        Sail sail = createSailStack(sailRepConfig.getSailImplConfig());
        return new SailRepository(sail);
      }
      catch (SailConfigException e) {
        throw new RepositoryConfigException(e.getMessage(), e);
      }
    }

    throw new RepositoryConfigException("Invalid configuration class: " + config.getClass());
  }
View Full Code Here

    if (sailFactory != null) {
      return sailFactory.getSail(config);
    }

    throw new RepositoryConfigException("Unsupported Sail type: " + config.getType());
  }
View Full Code Here

    try {
      ((StackableSail)sail).setBaseSail(delegateSail);
    }
    catch (ClassCastException e) {
      throw new RepositoryConfigException("Delegate configured but " + sail.getClass()
          + " is not a StackableSail");
    }
  }
View Full Code Here

  {
    if (config instanceof DatasetRepositoryConfig) {
      return new DatasetRepository();
    }

    throw new RepositoryConfigException("Invalid configuration class: " + config.getClass());
  }
View Full Code Here

      HTTPRepositoryConfig httpConfig = (HTTPRepositoryConfig)config;
      result = new HTTPRepository(httpConfig.getURL());
//      result.setUsernameAndPassword(httpConfig.getUsername(), httpConfig.getPassword());
    }
    else {
      throw new RepositoryConfigException("Invalid configuration class: " + config.getClass());
    }
    return result;
  }
View Full Code Here

  public void validate()
    throws RepositoryConfigException
  {
    super.validate();
    if (url == null) {
      throw new RepositoryConfigException("No URL specified for HTTP repository");
    }
  }
View Full Code Here

      if (password != null) {
        setPassword(password.getLabel());
      }
    }
    catch (GraphUtilException e) {
      throw new RepositoryConfigException(e.getMessage(), e);
    }
  }
View Full Code Here

TOP

Related Classes of org.openrdf.repository.config.RepositoryConfigException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.