/** * It will create a new Object for the URI selected schema. * the propertyOverrides is used to replace whatever was defined on the URL string * * @param uri The URI * @param propertyOverrides used to replace whatever was defined on the URL string * @return new Object * @throws Exception On error */ public T newObject(URI uri, Map<String, String> propertyOverrides, P param) throws Exception { return internalNewObject(uri, parseQuery(uri.getQuery(), propertyOverrides), param); }
protected int getPort(URI uri) { URI defaultFactory = getDefaultURI(); if (defaultFactory != null && uri.getPort() < 0 && defaultFactory.getScheme().equals(uri.getScheme())) { uri = defaultFactory; } return uri.getPort(); }
protected URI getDefaultURI() { URIFactory<T, P> factory = getFactory(); if (factory == null) { return null; } else { return factory.getDefaultURI(); } }
public void registerSchema(URISchema<T, P> schemaFactory) { schemas.put(schemaFactory.getSchemaName(), schemaFactory); schemaFactory.setFactory(this); }
public T newObject(URI uri, P param) throws Exception { return newObject(uri, null, param); }
public void populateObject(URI uri, T bean) throws Exception { BeanSupport.setData(uri, bean, parseQuery(uri.getQuery(), null)); }
public void populateObject(URI uri, T bean) throws Exception { URISchema<T, P> schemaFactory = schemas.get(uri.getScheme()); if (schemaFactory == null) { throw new NullPointerException("Schema " + uri.getScheme() + " not found"); } schemaFactory.populateObject(uri, bean); }
/** * This is the default implementation. * Sub classes are should provide a proper implementation for their schemas. */ protected URI internalNewURI(T bean) throws Exception { String query = BeanSupport.getData(null, bean); return new URI(getSchemaName(), null, "//", query, null); }
public URI createSchema(String scheme, T bean) throws Exception { URISchema<T, P> schemaFactory = schemas.get(scheme); if (schemaFactory == null) { throw new NullPointerException("Schema " + scheme + " not found"); } return schemaFactory.newURI(bean); }
public URI newURI(T bean) throws Exception { return internalNewURI(bean); }
public void registerSchema(URISchema<T, P> schemaFactory) { schemas.put(schemaFactory.getSchemaName(), schemaFactory); schemaFactory.setFactory(this); }
public T newObject(URI uri, Map<String, String> overrides, P param) throws Exception { URISchema<T, P> schemaFactory = schemas.get(uri.getScheme()); if (schemaFactory == null) { throw new NullPointerException("Schema " + uri.getScheme() + " not found"); } return schemaFactory.newObject(uri, overrides, param); }
public JMSFactoryType getFactoryType(String uri) throws Exception { ConnectionFactoryParser parser = new ConnectionFactoryParser(); Map<String, String> queryParams = URISchema.parseQuery(parser.expandURI(uri).getQuery(), null); String type = queryParams.get("type"); return type == null ? null : JMSConnectionOptions.convertCFType(type); } }
public void populateObject(URI uri, T bean) throws Exception { URISchema<T, P> schemaFactory = schemas.get(uri.getScheme()); if (schemaFactory == null) { throw new NullPointerException("Schema " + uri.getScheme() + " not found"); } schemaFactory.populateObject(uri, bean); }
/** * This is the default implementation. * Sub classes are should provide a proper implementation for their schemas. */ protected URI internalNewURI(T bean) throws Exception { String query = BeanSupport.getData(null, bean); return new URI(getSchemaName(), null, "//", query, null); }
public URI createSchema(String scheme, T bean) throws Exception { URISchema<T, P> schemaFactory = schemas.get(scheme); if (schemaFactory == null) { throw new NullPointerException("Schema " + scheme + " not found"); } return schemaFactory.newURI(bean); }
public URI newURI(T bean) throws Exception { return internalNewURI(bean); }
/** * It will create a new Object for the URI selected schema. * the propertyOverrides is used to replace whatever was defined on the URL string * * @param uri The URI * @param propertyOverrides used to replace whatever was defined on the URL string * @return new Object * @throws Exception On error */ public T newObject(URI uri, Map<String, String> propertyOverrides, P param) throws Exception { return internalNewObject(uri, parseQuery(uri.getQuery(), propertyOverrides), param); }
public void registerSchema(URISchema<T, P> schemaFactory) { schemas.put(schemaFactory.getSchemaName(), schemaFactory); schemaFactory.setFactory(this); }
public T newObject(URI uri, P param) throws Exception { URISchema<T, P> schemaFactory = schemas.get(uri.getScheme()); if (schemaFactory == null) { throw new NullPointerException("Schema " + uri.getScheme() + " not found"); } return schemaFactory.newObject(uri, param); }