|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openptk.connection.Setup
public class Setup
Boot-straps the connection to the Server.
A client-side Properties file is used to determine relationship
between the server and a client. The Properties file must contain
the following information:
openptk.connection.clientid=_CLIENT_ID_
openptk.connection.sharedsecret=_SHARED_SECRET_
openptk.connection.uri=http://localhost:8080/openptk
The clientid and sharedsecret are used to establish a
trust between the client and the server.
In addition to this data, a userid and password may be used to obtain
the "connection".
Field Summary |
---|
Constructor Summary | |
---|---|
Setup(java.lang.String propertyFile)
Create a new Setup object using the specified Property file. |
Method Summary | |
---|---|
ConnectionIF |
getConnection()
Returns a connection, no user name, no user password. |
ConnectionIF |
getConnection(java.lang.String token)
Returns a connection, only token |
ConnectionIF |
getConnection(java.lang.String user,
java.lang.String password)
Returns a connection, authenticates with user name and user password. |
boolean |
isDebug()
Get the debug flag. |
ConnectionIF |
useConnection(java.lang.String sessionId)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Setup(java.lang.String propertyFile) throws ConnectionException
Create a new Setup object using the specified Property file.
Setup setup = new Setup("openptk_client");
propertyFile
- name of the Property file
java.lang.Exception
ConnectionException
Method Detail |
---|
public final ConnectionIF getConnection() throws ConnectionException, AuthenticationException
getConnection
in interface SetupIF
java.lang.Exception
ConnectionException
AuthenticationException
public final ConnectionIF getConnection(java.lang.String token) throws ConnectionException, AuthenticationException
getConnection
in interface SetupIF
token
- unique value
java.lang.Exception
ConnectionException
AuthenticationException
public final ConnectionIF getConnection(java.lang.String user, java.lang.String password) throws ConnectionException, AuthenticationException
getConnection
in interface SetupIF
user
- unique id for the end-userpassword
- authenticate the end-user
java.lang.Exception
ConnectionException
AuthenticationException
public final boolean isDebug()
SetupIF
isDebug
in interface SetupIF
public final ConnectionIF useConnection(java.lang.String sessionId) throws ConnectionException, AuthenticationException
useConnection
in interface SetupIF
sessionId
- String a current and valid session id
ConnectionException
AuthenticationException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |