|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.palo.api.impl.ConnectionImpl
public class ConnectionImpl
TODO DOCUMENT ME
Field Summary |
---|
Fields inherited from interface org.palo.api.Connection |
---|
DEFAULT_TIMEOUT, TYPE_HTTP, TYPE_LEGACY, TYPE_WSS, TYPE_XMLA |
Method Summary | |
---|---|
void |
addConnectionListener(ConnectionListener connectionListener)
This method adds a ConnectionListener to this
connection. |
Database |
addDatabase(java.lang.String name)
Adds a new database with the given name to this Connection . |
void |
addProperty(Property2 property)
Adds the given property to the list of properties for this connection. |
boolean |
canBeModified()
Returns true if this object can be modified (renamed, deleted, ...), false otherwise. |
boolean |
canCreateChildren()
Returns true if this object can create child objects, false otherwise. |
void |
disconnect()
Disconnects from the PALO server. |
boolean |
equals(java.lang.Object other)
|
java.lang.String[] |
getAllPropertyIds()
Returns all ids of properties that can be set for this connection. |
com.tensegrity.palojava.DbConnection |
getConnectionInternal()
|
ConnectionContext |
getContext()
Returns the ConnectionContext which allows to retrieve further
information about current connection |
java.lang.Object |
getData(java.lang.String id)
API INTERNAL |
Database |
getDatabaseAt(int index)
Returns the database stored at the given index. |
Database |
getDatabaseById(java.lang.String id)
Returns the database stored under the given id or null if no such database exists. |
Database |
getDatabaseByName(java.lang.String name)
Returns the database stored under the given name or null if no such database exists. |
int |
getDatabaseCount()
Returns the number of databases. |
Database[] |
getDatabases()
Returns an array of Database instances available
for this connection. |
java.lang.String |
getFunctions()
Returns all available Function s which are defined for this
connection. |
java.lang.String |
getPassword()
Returns the password used to login. |
Property2 |
getProperty(java.lang.String id)
Returns the property identified by the given id. |
java.lang.String |
getServer()
Returns the server name. |
java.lang.String |
getService()
Returns the service name. |
Database[] |
getSystemDatabases()
Returns an array of system Database instances available
for this connection. |
int |
getType()
Returns the connection type for this connection. |
java.lang.String |
getUsername()
Returns the username. |
int |
hashCode()
|
boolean |
isConnected()
Checks if this connection is still connected to a PALO server. |
boolean |
isLegacy()
Checks if connection uses the legacy palo server or not. |
FavoriteViewTreeNode |
loadFavoriteViews()
Loads all favorite views stored with this connection and returns the root of the favorite view tree representing those views or null, if no favorite views were stored in this connection. |
boolean |
login(java.lang.String username,
java.lang.String password)
Logs into this connection with the specified user name and password. |
void |
ping()
Tries to ping the palo server. |
void |
reload()
Reloads all internal objects of the connection. |
void |
removeConnectionListener(ConnectionListener connectionListener)
This method removes a ConnectionListener from this
connection. |
void |
removeDatabase(Database database)
Removes a database from this Connection . |
void |
removeProperty(java.lang.String id)
Removes the given property from the list of properties for this connection. |
boolean |
save()
Tells the Palo-Server to save everything on the server-side. |
void |
serverStructureChanged(com.tensegrity.palojava.events.ServerEvent event)
|
void |
storeFavoriteViews(FavoriteViewTreeNode favoriteViews)
Stores the favorite views for this connection. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public final boolean login(java.lang.String username, java.lang.String password)
Connection
login
in interface Connection
public final Database addDatabase(java.lang.String name)
Connection
Connection
. This operation fails
if a database with the same name exists already.
addDatabase
in interface Connection
name
- the name of the new Database
.
Database
.public final void disconnect()
Connection
Connection
instance
instead.
disconnect
in interface Connection
public final Database getDatabaseAt(int index)
Connection
null
is returned.
getDatabaseAt
in interface Connection
index
- the index
null
.public final Database getDatabaseByName(java.lang.String name)
Connection
null
if no such database exists.
getDatabaseByName
in interface Connection
name
- the database name to look-up.
null
if no such database exists.public final Database getDatabaseById(java.lang.String id)
Connection
null
if no such database exists.
getDatabaseById
in interface Connection
id
- identifier of the database to look-up.
null
if no such database exists.public final int getDatabaseCount()
Connection
getDatabaseCount
in interface Connection
public final Database[] getDatabases()
Connection
Database
instances available
for this connection.
The returned array is a copy of the internal datastructure. Changing the returned array does not change this instance.
getDatabases
in interface Connection
Database
instances available
for this connection.public final java.lang.String getPassword()
Connection
null
or the empty string if
configured to prevent password-retrieval
getPassword
in interface Connection
null
.public final java.lang.String getServer()
Connection
getServer
in interface Connection
public final java.lang.String getService()
Connection
getService
in interface Connection
public final Database[] getSystemDatabases()
Connection
Database
instances available
for this connection.
The returned array is a copy of the internal datastructure. Changing the returned array does not change this instance.
getSystemDatabases
in interface Connection
Database
instances available
for this connection.public final java.lang.String getUsername()
Connection
getUsername
in interface Connection
public final boolean isLegacy()
Connection
isLegacy
in interface Connection
public final int getType()
Connection
getType
in interface Connection
public final boolean isConnected()
Connection
isConnected
in interface Connection
true
if a connection to a PALO server is
established, false
otherwisepublic final void ping()
Connection
ping
in interface Connection
public final void reload()
Connection
reload
in interface Connection
public final void removeDatabase(Database database)
Connection
Connection
.
removeDatabase
in interface Connection
database
- the Database
to
remove from this Connection
.public final boolean save()
Connection
save
in interface Connection
true
if saving was successful, false
otherwisepublic final FavoriteViewTreeNode loadFavoriteViews()
Connection
loadFavoriteViews
in interface Connection
public final void storeFavoriteViews(FavoriteViewTreeNode favoriteViews)
Connection
storeFavoriteViews
in interface Connection
favoriteViews
- the root of a favorite views tree.public final void serverStructureChanged(com.tensegrity.palojava.events.ServerEvent event)
serverStructureChanged
in interface com.tensegrity.palojava.events.ServerListener
public final void addConnectionListener(ConnectionListener connectionListener)
Connection
ConnectionListener
to this
connection.
Note that connection-listeners are limited and do not
proactively report changes made on the palo server.
addConnectionListener
in interface Connection
connectionListener
- the ConnectionListener
to add.public final void removeConnectionListener(ConnectionListener connectionListener)
Connection
ConnectionListener
from this
connection.
Note that connection-listeners are limited and do not
proactively report changes made on the palo server.
removeConnectionListener
in interface Connection
connectionListener
- the ConnectionListener
to remove.public final java.lang.String getFunctions()
Connection
Function
s which are defined for this
connection.
getFunctions
in interface Connection
public final boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
public final ConnectionContext getContext()
Connection
ConnectionContext
which allows to retrieve further
information about current connection
getContext
in interface Connection
ConnectionContext
of current connection.public final java.lang.Object getData(java.lang.String id)
Connection
getData
in interface Connection
public final com.tensegrity.palojava.DbConnection getConnectionInternal()
public java.lang.String[] getAllPropertyIds()
Connection
getAllPropertyIds
in interface Connection
public Property2 getProperty(java.lang.String id)
Connection
getProperty
in interface Connection
id
- the id of the property to read.
public void addProperty(Property2 property)
Connection
addProperty
in interface Connection
property
- the property to add.public void removeProperty(java.lang.String id)
Connection
removeProperty
in interface Connection
id
- the id of the property which is to be cleared.public boolean canBeModified()
Writable
canBeModified
in interface Writable
public boolean canCreateChildren()
Writable
canCreateChildren
in interface Writable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |