|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object i3.dragos.core.services.datasources.DataSourceURL
public final class DataSourceURL
The DataSourceURL
uniquely represents a specific data
source ("physical DataSourceURL", e.g. location of a
database server) or the DataSource and GraphPool object built
upon such a data source ("logical DataSourceURL").
A logical DataSourceURL is generated by the GraphPoolFactory to hide the implementation specific data (which may e.g. include the database password) and provide stable identifiers even if the underlying implementation is changed or the database is moved. These DataSourceURLs all have the following form:
dragos://<server_name>/<graphpool_name>
The exact structure of a physical DataSourceURL depends on the implementation using it, the basic form is as follows:
<implementation_identifier>:<implementation_specific_data>The
implementation-identifier
is used by the
DataSourceFactory to determine and instantiate the corresponding
DataSource implementation
(as configured in the server.xml
file).
The implementation then interprets the specific data.
Usually, you will need to deal with physical DatasourceURLs only when configuring the data source (or writing a DataSource implementation yourself), and use only logical DatasourceURLs in an application or extension.
// TODO: the following text is old documentation, update, move or remove when making the DataSourceURL changes proposed by Erhard!The syntax of a URL is defined as follows:
database-identifier://[user:password@][host][:port]/database[parameters]Where the different parts of the URL is defined as follows:
"://"
."localhost"
it can be dropped.?key=value[&key=value]*
DataSource
,
DataSourceFactory
,
GraphPoolFactory
,
Serialized FormConstructor Summary | |
---|---|
DataSourceURL(java.lang.String datasourceURL)
Constructs a new URL which uniquely identifies a data source. |
Method Summary | |
---|---|
static DataSourceURL |
createLogicalDataSourceURL(java.lang.String name)
creates a logical datasource URL from the unique name of the running DRAGOS instance. |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getDatasource()
Returns the data source name. |
java.lang.String |
getHost()
Returns the host of the data source. |
java.lang.String |
getPassword()
Returns the password which is used to obtain access to the data source. |
java.lang.String |
getPort()
Returns the port on which the data source listens for incoming connections. |
java.util.Properties |
getProperties()
Returns the properties for this URL. |
java.lang.String |
getProtocol()
Returns the protocol used by the data source. |
java.lang.String |
getUsername()
Returns the username which is used to obtain access to the data source. |
int |
hashCode()
|
boolean |
hasProperties()
Returns true if properties for this URL were definied and
false otherwise. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DataSourceURL(java.lang.String datasourceURL) throws java.net.MalformedURLException
datasourceURL
- The URL that identifies a data source.
java.net.MalformedURLException
- if the URL does not match the syntax.Method Detail |
---|
public java.lang.String getProtocol()
public java.lang.String getDatasource()
public java.lang.String getHost()
public java.lang.String getPort()
public java.lang.String getUsername()
public java.lang.String getPassword()
public java.util.Properties getProperties()
public boolean hasProperties()
true
if properties for this URL were definied and
false
otherwise.
true
if properties for this URL were definied.public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static DataSourceURL createLogicalDataSourceURL(java.lang.String name) throws java.net.MalformedURLException
name
- unique name of the running DRAGOS instance
java.net.MalformedURLException
- if the URL cannot be constructed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |