value = param.lookUp(params); } catch (IOException e) {
if (Repository.class.equals(p.getType())) { connectionParameters.put(p.getName(), repository); if (resolver != null && params != null) { for (Param p : params) { if (EntityResolver.class.equals(p.getType())) { if (!(resolver instanceof Serializable)) { resolver = new SerializableEntityResolver(resolver); connectionParameters.put(p.getName(), (Serializable) resolver);
new Param( DBTYPE.key, DBTYPE.type,
p.lookUp(connectionParameters); } catch (Exception e) { connectionParameters.put(JDBCDataStoreFactory.DATABASE.getName(), f.getAbsolutePath()); } else if (factory.getDisplayName().equalsIgnoreCase("H2")) { HttpStatus.INTERNAL_SERVER_ERROR); connectionParameters.put(JDBCDataStoreFactory.DATABASE.getName(), matcher.group(1));
if("namespace".equals(p.getName())) { final IModel paramsModel = new PropertyModel(model, "connectionParameters"); namespaceModel = new NamespaceParamModel(paramsModel, "namespace");
new Param(DBTYPE.key, DBTYPE.type, DBTYPE.description, DBTYPE.required, getDatabaseID())); parameters.put(HOST.key, HOST); parameters.put(PORT.key, PORT);
if ("namespace".equals(p.getName())) { final IModel paramsModel = new PropertyModel(model, "connectionParameters");
Param tabSchema = new Param("tabschema", String.class, "Schema", false); list.add(new DatabaseConnectionField(tabSchema)); list.add(new DatabaseConnectionField(DB2NGDataStoreFactory.DATABASE));
@SuppressWarnings({"unchecked", "rawtypes"}) public ParamInfo(Param param) { this.name = param.key; this.deprecated = param.isDeprecated(); param.title != null && !param.title.toString().equals(param.key) ? param.title.toString() : param.getDescription().toString(); this.password = param.isPassword(); this.level = param.getLevel(); this.largeText = param.metadata != null
if (!p.isDeprecated()) { Option opt = Option.builder(null) .longOpt(p.getName()) .argName(p.getName()) .hasArg() .desc(p.getDescription().toString()) .required(p.isRequired()) .build(); options.addOption(opt);
new Param(DBTYPE.key, DBTYPE.type, DBTYPE.description, DBTYPE.required, getDatabaseID())); parameters.put(HOST.key, HOST); parameters.put(PORT.key, PORT);
@Override public Param apply(final ConfigOption input) { if (input.isPassword()) { return new Param( input.getName(), String.class, input.getDescription(), !input.isOptional(), "mypassword", Collections.singletonMap(Parameter.IS_PASSWORD, Boolean.TRUE)); } if (input.getType().isPrimitive() && (input.getType() == boolean.class)) { return new Param( input.getName(), input.getType(), input.getDescription(), true, "true", Collections.singletonMap(Parameter.OPTIONS, BooleanOptions)); } return new Param( input.getName(), input.getType(), input.getDescription(), !input.isOptional()); } }
@Override public Options createOptions(Param[] parameters) { Options options = super.createOptions(parameters); // make visibilities and auths required Param visibility = AccumuloDataStoreParams.VisibilitiesParam(); Option vis = Option.builder(null) .longOpt(visibility.getName()) .argName(visibility.getName()) .hasArg() .desc(visibility.getDescription().toString()) .required(true) .build(); options.addOption(vis); Param authorizations = AccumuloDataStoreParams.AuthsParam(); Option auths = Option.builder(null) .longOpt(authorizations.getName()) .argName(authorizations.getName()) .hasArg() .desc(authorizations.getDescription().toString()) .required(true) .build(); options.addOption(auths); return options; }
public static Options createOptions(Param[] parameters) { Options options = new Options(); for (Param p: parameters) { if (!p.isDeprecated()) { Option opt = Option.builder(null) .longOpt(p.getName()) .argName(p.getName()) .hasArg() .desc(p.getDescription().toString()) .required(p.isRequired()) .build(); options.addOption(opt); } } return options; }
/** * Override to omit all those parameters which define the creation of * the connection. */ protected void setupParameters(Map parameters) { parameters.put(DBTYPE.key, new Param(DBTYPE.key, DBTYPE.type, DBTYPE.description, DBTYPE.required, getDatabaseID())); parameters.put(JNDI_REFNAME.key, JNDI_REFNAME); parameters.put(SCHEMA.key, SCHEMA); parameters.put(NAMESPACE.key, NAMESPACE); parameters.put(EXPOSE_PK.key, EXPOSE_PK); parameters.put(PK_METADATA_TABLE.key, PK_METADATA_TABLE); parameters.put(SQL_ON_BORROW.key, SQL_ON_BORROW); parameters.put(SQL_ON_RELEASE.key, SQL_ON_RELEASE); }
@Override public boolean canProcess(Map<String, Serializable> map) { try { File file = (File) FILE_PARAM.lookUp(map); if (file != null) { return file.isDirectory() || file.getPath().toLowerCase().endsWith(".pbf") || file.getPath().toLowerCase().endsWith(".geobuf"); } } catch (IOException e) { // ignore as we are expected to return true or false } return false; }
@Override protected String getJDBCUrl(Map params) throws IOException { File db = (File) DATABASE.lookUp(params); if (db.getPath().startsWith("file:")) { db = new File(db.getPath().substring(5)); } if (baseDirectory != null) { // check for a relative path if (!db.isAbsolute()) { db = new File(baseDirectory, db.getPath()); } } return "jdbc:sqlite:" + db; }
public DataStore createDataStore(Map<String, Serializable> params) throws IOException { if (!canProcess(params)) { throw new IOException("Invalid parameters for DirectoryDataStore"); } URL url = (URL) URLP.lookUp(params); File f = DataUtilities.urlToFile(url); if (!f.isDirectory()) { throw new IOException("Invalid parameter " + URLP.key + " : is not a valid directory"); } URI namespace = (URI) NAMESPACE.lookUp(params); return new DirectoryDataStore(f, namespace); }
public DataStore createDataStore(Map<String, Serializable> params) throws IOException { File file = (File) FILE_PARAM.lookUp(params); return new CSVDataStore(file); }
@Override public Param[] getParametersInfo() { return new DataStoreFactorySpi.Param[] { new Param("ParentLocation") }; }