PropertyList list = new PropertyList(); list.put("Provider", "mondrian"); list.put("Jdbc", jdbcConnectionUrl); list.put("Catalog", file.toURI().toURL().toString()); list.put("JdbcDrivers", jdbcDriverClassName); if (jdbcUsername != null && jdbcUsername.length() > 0) { list.put("JdbcUser", jdbcUsername); list.put("JdbcPassword", jdbcPassword);
final Util.PropertyList connectInfo) final String connectionUuidStr = connectInfo.get( JdbcConnectionUuid.name()); final boolean useSchemaPool = Boolean.parseBoolean( connectInfo.get(UseSchemaPool.name(), "true")); final String pinSchemaTimeout = connectInfo.get(PinSchemaTimeout.name(), "-1s"); final boolean useContentChecksum = Boolean.parseBoolean( connectInfo.get( RolapConnectionProperties.UseContentChecksum.name())); if (LOGGER.isDebugEnabled()) {
/** * convert string to property to do a lookup "Provider=Mondrian;DataSource=Pentaho" * * @param parameters * @param key * @return */ private String getValue( String parameters, String key ) { mondrian.olap.Util.PropertyList propertyList = mondrian.olap.Util.parseConnectString( parameters ); return propertyList.get( key ); }
String provider = connectInfo.get( RolapConnectionProperties.Provider.name(), "mondrian"); Util.assertTrue(provider.equalsIgnoreCase("mondrian")); this.connectInfo = connectInfo; this.catalogUrl = connectInfo.get(RolapConnectionProperties.Catalog.name()); final String jdbcUser = connectInfo.get(RolapConnectionProperties.JdbcUser.name()); final String jdbcConnectString = connectInfo.get(RolapConnectionProperties.Jdbc.name()); final String strDataSource = connectInfo.get(RolapConnectionProperties.DataSource.name()); StringBuilder buf = new StringBuilder(); this.dataSource = schema.getInternalConnection().getInternalStatement(); String roleNameList = connectInfo.get(RolapConnectionProperties.Role.name()); if (roleNameList != null) { List<String> roleNames = Util.parseCommaList(roleNameList); connectInfo.get(RolapConnectionProperties.Locale.name()); if (localeString != null) { this.locale = Util.parseLocale(localeString);
connectInfo.get(RolapConnectionProperties.Jdbc.name()); final String jdbcUser = connectInfo.get(RolapConnectionProperties.JdbcUser.name()); final String jdbcPassword = connectInfo.get(RolapConnectionProperties.JdbcPassword.name()); final String dataSourceName = connectInfo.get(RolapConnectionProperties.DataSource.name()); buf, RolapConnectionProperties.JdbcUser.name(), jdbcUser); String jdbcDrivers = connectInfo.get(RolapConnectionProperties.JdbcDrivers.name()); if (jdbcDrivers != null) { RolapUtil.loadDrivers(jdbcDrivers); connectInfo.get( RolapConnectionProperties.PoolNeeded.name(), "true").equalsIgnoreCase("true"); connectInfo.get( RolapConnectionProperties.PoolNeeded.name(), "false").equalsIgnoreCase("true"); } else { throw Util.newInternal( "Connect string '" + connectInfo.toString() + "' must contain either '" + RolapConnectionProperties.Jdbc + "' or '" + RolapConnectionProperties.DataSource + "'");
final Map<String, String> map = Util.toMap(info); for (Map.Entry<String, String> entry : map.entrySet()) { list.put(entry.getKey(), entry.getValue());
PropertyList list = new PropertyList(); list.put("Provider", "mondrian"); list.put("Jdbc", se.getJdbcConnectionUrl()); list.put("Catalog", se.getSchemaFile().toURL().toString()); final String jdbcUsername = se.getJdbcUsername(); if (!ValidationUtils.isEmpty(jdbcUsername)) { list.put("JdbcUser", jdbcUsername); list.put("JdbcPassword", jdbcPassword);
Util.parseConnectString(connectString); if (connectProperties .get(RolapConnectionProperties.Catalog.name()) == null)
connectProperties = new Util.PropertyList(); connectProperties.put( RolapConnectionProperties.Provider.name(), "mondrian"); connectProperties.put( RolapConnectionProperties.Jdbc.name(), jdbcURL); connectProperties.put( RolapConnectionProperties.JdbcDrivers.name(), jdbcDrivers); connectProperties.put( RolapConnectionProperties.Catalog.name(), catalogURL); connectProperties.put( RolapConnectionProperties.JdbcUser.name(), jdbcUser); connectProperties.put( RolapConnectionProperties.JdbcPassword.name(), jdbcPassword); connectProperties.put( RolapConnectionProperties.Role.name(), options.roleName);
DataSource dataSource) String provider = properties.get("PROVIDER", "mondrian"); if (!provider.equalsIgnoreCase("mondrian")) { throw Util.newError("Provider not recognized: " + provider); properties.get(RolapConnectionProperties.Instance.name()); MondrianServer server = MondrianServer.forId(instance); if (server == null) { String catalog = properties.get( RolapConnectionProperties.Catalog.name()); properties.put( RolapConnectionProperties.Catalog.name(), locator.locate(catalog));
Util.PropertyList propertyList = Util.parseConnectString(connectString); String roleName = propertyList.get(RolapConnectionProperties.Role.name());
String dataSourceChangeListenerStr = connectInfo.get( RolapConnectionProperties.DataSourceChangeListener.name());
void remove( final String catalogUrl, final String connectionKey, final String jdbcUser, final String dataSourceStr) { final SchemaContentKey schemaContentKey = SchemaContentKey.create( new Util.PropertyList(), catalogUrl, null); final ConnectionKey connectionUuid = ConnectionKey.create( null, null, catalogUrl, connectionKey, jdbcUser, dataSourceStr); final SchemaKey key = new SchemaKey(schemaContentKey, connectionUuid); if (RolapSchema.LOGGER.isDebugEnabled()) { RolapSchema.LOGGER.debug( "Pool.remove: schema \"" + catalogUrl + "\" and datasource string \"" + dataSourceStr + "\""); } remove(key); }
public List<Map<String, Object>> getDataSources(OlapConnection connection) throws OlapException { MondrianOlap4jConnection olap4jConnection = (MondrianOlap4jConnection) connection; MondrianServer server = MondrianServer.forConnection( olap4jConnection.getMondrianConnection()); final List<Map<String, Object>> databases = server.getDatabases(olap4jConnection.getMondrianConnection()); // We can't let JdbcPassword leak out of the public API, so we remove // it here. This is only called by the XMLA servlets. for (Map<String, Object> db : databases) { String dsi = (String) db.get("DataSourceInfo"); if (dsi == null) { break; } PropertyList pl = Util.parseConnectString(dsi); boolean removed = pl.remove(RolapConnectionProperties.Jdbc.name()); removed |= pl.remove(RolapConnectionProperties.JdbcUser.name()); removed |= pl.remove(RolapConnectionProperties.JdbcPassword.name()); if (removed) { db.put("DataSourceInfo", pl.toString()); } } return databases; }
static SchemaContentKey create( final Util.PropertyList connectInfo, final String catalogUrl, final String catalogContents) { final String catalogContentProp = RolapConnectionProperties.CatalogContent.name(); final String dynamicSchemaProp = RolapConnectionProperties.DynamicSchemaProcessor.name(); StringBuilder buf = new StringBuilder(); if (!Util.isEmpty(connectInfo.get(catalogContentProp)) || !Util.isEmpty(connectInfo.get(dynamicSchemaProp))) { ConnectionKey.attributeValue(buf, "catalogStr", catalogContents); } else { ConnectionKey.attributeValue(buf, "catalog", catalogUrl); } return new SchemaContentKey( new ByteString(Util.digestMd5(buf.toString())).toString()); } }
void remove( final String catalogUrl, final DataSource dataSource) { final SchemaContentKey schemaContentKey = SchemaContentKey.create( new Util.PropertyList(), catalogUrl, null); final ConnectionKey connectionKey = ConnectionKey.create( null, dataSource, catalogUrl, null, null, null); final SchemaKey key = new SchemaKey(schemaContentKey, connectionKey); if (RolapSchema.LOGGER.isDebugEnabled()) { RolapSchema.LOGGER.debug( "Pool.remove: schema \"" + catalogUrl + "\" and datasource object"); } remove(key); }
/** * Reads "name=value;" or "name=value<EOF>". */ void parsePair(PropertyList list) { String name = parseName(); if (name == null) { return; } String value; if (i >= n) { value = ""; } else if (s.charAt(i) == ';') { i++; value = ""; } else { value = parseValue(); } list.put(name, value); }