Package org.openrdf.sail.federation

Examples of org.openrdf.sail.federation.Federation


  @Override
  protected Repository createRepository()
    throws IOException
  {
    Federation sail = new Federation();
    sail.addMember(new SailRepository(new MemoryStore()));
    sail.addMember(new SailRepository(new MemoryStore()));
    sail.addMember(new SailRepository(new MemoryStore()));
    return new SailRepository(sail);
  }
View Full Code Here


    throws Exception
  {
    SailRepository ref = new SailRepository(new MemoryStore());
    ref.initialize();
    reference = ref.getConnection();
    Federation federation = new Federation();
    SailRepository repo = new SailRepository(federation);
    repo.initialize();
    federation.addMember(createMember("1"));
    federation.addMember(createMember("2"));
    federation.addMember(createMember("3"));
    federation.setLocalPropertySpace(Arrays.asList("urn:schema:b:", "urn:schema:d:"));
    con = repo.getConnection();
  }
View Full Code Here

  @Override
  protected Sail createSail()
    throws StoreException
  {
    Federation sail = new Federation();
    sail.addMember(new SailRepository(new MemoryStore()));
    sail.addMember(new SailRepository(new MemoryStore()));
    sail.addMember(new SailRepository(new MemoryStore()));
    sail.initialize();
    return sail;
  }
View Full Code Here

    if (!SAIL_TYPE.equals(config.getType())) {
      throw new StoreConfigException("Invalid Sail type: " + config.getType());
    }
    assert config instanceof FederationConfig;
    FederationConfig cfg = (FederationConfig)config;
    Federation sail = new Federation();
    for (RepositoryImplConfig member : cfg.getMembers()) {
      RepositoryFactory factory = RepositoryRegistry.getInstance().get(member.getType());
      if (factory == null) {
        throw new StoreConfigException("Unsupported repository type: " + config.getType());
      }
      sail.addMember(factory.getRepository(member));
    }
    sail.setLocalPropertySpace(cfg.getLocalPropertySpace());
    sail.setDistinct(cfg.isDistinct());
    sail.setReadOnly(cfg.isReadOnly());
    return sail;
  }
View Full Code Here

        log.info("creating new HTTP repository client for server at {}", serverUrl);

        httpRepository = new HTTPRepository(serverUrl);

        // TODO: would be better to implement a RepositorySail as NotifyingSail wrapper around a repository
        Federation store = new Federation();
        store.addMember(httpRepository);

        return (NotifyingSail)store;
    }
View Full Code Here

TOP

Related Classes of org.openrdf.sail.federation.Federation

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.