}
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;