|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.palo.api.ConnectionFactory
public abstract class ConnectionFactory
ConnectionFactory
An instance of ConnectionFactory
is obtained with the
getInstance()
method. Subsequently a connection to a PALO server
can be created by invoking the
newConnection(String, String, String, String)
method.
Example:
Connection c = ConnectionFactory.getInstance().newConnection( "localhost", "1234", "user", "pass"); // use the connection here c.disconnect();
PaloAPIException
Constructor Summary | |
---|---|
ConnectionFactory()
|
Method Summary | |
---|---|
abstract ConnectionConfiguration |
getConfiguration(java.lang.String host,
java.lang.String service)
Creates a new ConnectionConfiguration instance. |
abstract ConnectionConfiguration |
getConfiguration(java.lang.String host,
java.lang.String service,
java.lang.String user,
java.lang.String password)
Creates a new ConnectionConfiguration instance with the specified
settings for host, service, user and password. |
static ConnectionFactory |
getInstance()
|
abstract Connection |
newConnection(ConnectionConfiguration cfg)
Creates a new Connection using the connection settings from the
given ConnectionConfiguration |
abstract Connection |
newConnection(java.lang.String server,
java.lang.String service,
java.lang.String user,
java.lang.String pass)
Deprecated. please use {@link #newConnection(ConnectionConfiguration) |
abstract Connection |
newConnection(java.lang.String server,
java.lang.String service,
java.lang.String user,
java.lang.String pass,
boolean doLoadOnDemand,
int type)
Deprecated. please use {@link #newConnection(ConnectionConfiguration) |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConnectionFactory()
Method Detail |
---|
public static ConnectionFactory getInstance()
public abstract Connection newConnection(java.lang.String server, java.lang.String service, java.lang.String user, java.lang.String pass)
Connection
which is connected to the specified
palo-server. The default connection is of type HTTP
and no
load on demand is activated. To
define the connection type and to use load on demand please call
newConnection(String, String, String, String, boolean, int)
server
- the server to connect to.service
- the service to use (corresponds to port numbers given as a string)user
- the username to use for authenticationpass
- the password to use for authentication
PaloAPIException
- thrown if connecting failed.public abstract Connection newConnection(java.lang.String server, java.lang.String service, java.lang.String user, java.lang.String pass, boolean doLoadOnDemand, int type)
Connection
which is connected to the specified
palo-server using specified type (legacy of HTTP). Load on demand can
be used. In this case the API tries to load only the information which
is currently required.
server
- the server to connect to.service
- the service to use (corresponds to port numbers given as a string)user
- the username to use for authenticationpass
- the password to use for authenticationdoLoadOnDemand
- activate load on demandtype
- palo server type to be used. Please use one of the defined
constants Connection.TYPE_LEGACY
or Connection.TYPE_HTTP
PaloAPIException
- thrown if connecting failed.public abstract ConnectionConfiguration getConfiguration(java.lang.String host, java.lang.String service)
ConnectionConfiguration
instance. Only the name
of the palo server host and its service are set. All other fields
have their default values.
host
- host which runs the palo serverservice
- the service which handles palo requests
ConnectionConfiguration
instancepublic abstract ConnectionConfiguration getConfiguration(java.lang.String host, java.lang.String service, java.lang.String user, java.lang.String password)
ConnectionConfiguration
instance with the specified
settings for host, service, user and password.
host
- host which runs the palo serverservice
- the service which handles palo requestsuser
- the login namepassword
- the login password
ConnectionConfiguration
instancepublic abstract Connection newConnection(ConnectionConfiguration cfg)
Connection
using the connection settings from the
given ConnectionConfiguration
cfg
- ConnectionConfiguration
containg connection settings
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |