com.bagri.rest.LocalRepositoryProvider Maven / Gradle / Ivy
package com.bagri.rest;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.bagri.core.api.SchemaRepository;
import com.bagri.core.system.Module;
import com.bagri.core.system.Schema;
public class LocalRepositoryProvider implements RepositoryProvider {
private Map repos = new ConcurrentHashMap<>();
private Map schemas;
public LocalRepositoryProvider() {
initSchemas();
}
private void initSchemas() {
schemas = new HashMap<>();
schemas.put("default", new Schema(1, new Date(), "admin", "default", "default schema for test and demo purpose", true, null));
schemas.put("TPoX", new Schema(1, new Date(), "admin", "TPoX", "TPoX: schema for TPoX-related tests", false, null));
schemas.put("XMark", new Schema(1, new Date(), "admin", "XMark", "XMark benchmark schema", false, null));
}
@Override
public Module getModule(String moduleName) {
return null;
}
@Override
public Collection getSchemaNames() {
//return repos.keySet();
return schemas.keySet();
}
@Override
public Schema getSchema(String name) {
//
return schemas.get(name);
}
@Override
public Collection getSchemas() {
//
return schemas.values();
}
@Override
public SchemaRepository getRepository(String clientId) {
return null;
}
//public boolean isRepositoryActive(String schemaName) {
// return false;
//}
@Override
public SchemaRepository connect(String schemaName, String userName, String password) {
return null;
}
@Override
public void disconnect(String clientId) {
//
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy