|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openptk.api.Element org.openptk.connection.Connection
public abstract class Connection
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.openptk.connection.ConnectionIF |
---|
ConnectionIF.Session |
Field Summary | |
---|---|
protected ConverterIF |
_converter
|
protected java.lang.String |
_uriClients
|
protected java.lang.String |
_uriContexts
|
protected java.lang.String |
_uriLogin
|
protected java.lang.String |
_uriLogout
|
protected java.lang.String |
_uriSessionInfo
|
protected java.lang.String |
_uriSubjects
|
Fields inherited from interface org.openptk.connection.ConnectionIF |
---|
PARAM_CLIENTCRED, PARAM_CLIENTID, PARAM_PASSWORD, PARAM_TOKEN, PARAM_USER, PROP_COOKIE_NAME, PROP_URI_CLIENTS, PROP_URI_CONTEXTS, PROP_URI_LOGIN, PROP_URI_LOGOUT, RESOURCE_SESSION |
Constructor Summary | |
---|---|
Connection(java.util.Properties props)
Create a new instance. |
Method Summary | |
---|---|
void |
close()
Close the open connection. |
protected void |
debug(java.lang.String str)
|
protected StructureIF |
decode(java.lang.String str)
Convert the "encoded" string to a StructureIF object. |
protected Output |
doCreate(Input input)
Execute CREATE operation. |
protected Output |
doDelete(Input input)
Execute DELETE operation. |
protected Output |
doPwdChange(Input input)
Execute PWDCHANGE operation. |
protected Output |
doPwdForgot(Input input)
Execute PWDFORGOT operation. |
protected Output |
doPwdReset(Input input)
Execute PWDRESET operation. |
protected Output |
doRead(Input input)
Execute READ operation. |
protected Output |
doSearch(Input input)
Execute SEARCH operation. |
protected Output |
doUpdate(Input input)
Execute UPDATE operation. |
protected java.lang.String |
encode(StructureIF struct)
Convert the StructureIF object to an "encoded" string. |
protected java.lang.String |
encrypt(java.lang.String value)
Encrypt the provided String. |
Output |
execute(Opcode opcode,
Input input)
Execute the operation (Opcode) on the Server. |
java.lang.String |
getContextId()
Gets the id of the current Context. |
java.lang.String[] |
getContextIds()
Get all of the available Context Ids. |
abstract java.lang.String |
getSessionData(ConnectionIF.Session session)
Get the String representing a Session data item. |
protected java.lang.String |
getSessionId()
Get the Session Id. |
protected StructureIF |
getStructureFromAttribute(AttributeIF attr)
Create a StructureIF object from the AttributeIF object. |
protected StructureIF |
getStructureFromInput(Opcode opcode,
Input input)
Create a StructureIF object from the Input object. |
protected void |
handleError(java.lang.String msg)
Handle an error condition. |
boolean |
hasSessionChanged()
Has the Session changed from the initial connection. |
boolean |
isDebug()
Get the debug flag. |
protected void |
logError(java.lang.String str)
|
protected void |
logInfo(java.lang.String str)
|
protected void |
logWarning(java.lang.String str)
|
protected void |
processClientStructure(StructureIF structClient)
Process the Client Structure that comes from the server. |
void |
setContextId(java.lang.String contextId)
Set the "current" Context Id. |
void |
setDebug(boolean debug)
Set the debug flag. |
protected void |
setSessionChanged(boolean bool)
|
protected void |
setSessionId(java.lang.String str)
|
protected void |
updateOutputFromReadStructure(Output output,
StructureIF structResponse)
Update the StructureIF from the Read response (Structure). |
protected void |
updateOutputFromSearchStructure(Output output,
StructureIF structResponse)
Update Output from the Search response (Structure). |
protected java.lang.String |
urlDecode(java.lang.String str)
URL Decode a string. |
protected java.lang.String |
urlEncode(java.lang.String str)
URL Encode a string. |
Methods inherited from class org.openptk.api.Element |
---|
addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttributes, copy, getAttribute, getAttributeNames, getAttributes, getAttributesSize, getDescription, getKey, getProperties, getPropertiesSize, getProperty, getState, getStateAsString, getStatus, getUniqueId, getUniqueIdType, isError, removeAttribute, removeProperty, setAttributes, setDescription, setError, setKey, setProperties, setProperty, setState, setStatus, setUniqueId, setUniqueId, setUniqueId, setUniqueId, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.openptk.api.ElementIF |
---|
addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttributes, copy, getAttribute, getAttributeNames, getAttributes, getAttributesSize, getDescription, getKey, getProperties, getPropertiesSize, getProperty, getState, getStateAsString, getStatus, getUniqueId, getUniqueIdType, isError, removeAttribute, removeProperty, setAttributes, setDescription, setError, setKey, setProperties, setProperty, setState, setStatus, setUniqueId, setUniqueId, setUniqueId, setUniqueId |
Field Detail |
---|
protected ConverterIF _converter
protected java.lang.String _uriClients
protected java.lang.String _uriContexts
protected java.lang.String _uriLogin
protected java.lang.String _uriLogout
protected java.lang.String _uriSessionInfo
protected java.lang.String _uriSubjects
Constructor Detail |
---|
public Connection(java.util.Properties props) throws ConnectionException
java.lang.Exception
ConnectionException
Method Detail |
---|
public void close() throws ConnectionException
close
in interface ConnectionIF
java.lang.Exception
ConnectionException
protected void debug(java.lang.String str)
protected final StructureIF decode(java.lang.String str) throws ConnectionException
str
-
java.lang.Exception
ConnectionException
protected Output doCreate(Input input) throws ConnectionException, StructureException
input
-
java.lang.Exception
ConnectionException
StructureException
protected Output doDelete(Input input) throws ConnectionException, StructureException
input
-
java.lang.Exception
ConnectionException
StructureException
protected Output doPwdChange(Input input) throws ConnectionException, StructureException
input
-
java.lang.Exception
ConnectionException
StructureException
protected Output doPwdForgot(Input input) throws ConnectionException, StructureException
input
-
java.lang.Exception
ConnectionException
StructureException
protected Output doPwdReset(Input input) throws ConnectionException, StructureException
input
-
java.lang.Exception
ConnectionException
StructureException
protected Output doRead(Input input) throws ConnectionException, StructureException
input
-
java.lang.Exception
ConnectionException
StructureException
protected Output doSearch(Input input) throws ConnectionException, StructureException
input
-
java.lang.Exception
ConnectionException
StructureException
protected Output doUpdate(Input input) throws ConnectionException, StructureException
input
-
java.lang.Exception
ConnectionException
StructureException
protected final java.lang.String encode(StructureIF struct) throws ConnectionException
struct
-
java.lang.Exception
ConnectionException
protected final java.lang.String encrypt(java.lang.String value) throws ConnectionException
value
- clear text value.
java.lang.Exception
ConnectionException
public final Output execute(Opcode opcode, Input input) throws ConnectionException
execute
in interface ConnectionIF
opcode
- Opcode what operation to executeinput
- Input data used by the operation
java.lang.Exception
ConnectionException
public final java.lang.String getContextId()
getContextId
in interface ConnectionIF
public final java.lang.String[] getContextIds()
getContextIds
in interface ConnectionIF
public abstract java.lang.String getSessionData(ConnectionIF.Session session) throws ConnectionException
getSessionData
in interface ConnectionIF
ConnectionException
protected java.lang.String getSessionId()
protected StructureIF getStructureFromAttribute(AttributeIF attr) throws ConnectionException, StructureException
attr
-
java.lang.Exception
ConnectionException
StructureException
protected StructureIF getStructureFromInput(Opcode opcode, Input input) throws ConnectionException, StructureException
opcode
- input
-
java.lang.Exception
ConnectionException
StructureException
protected final void handleError(java.lang.String msg) throws ConnectionException
msg
-
java.lang.Exception
ConnectionException
public final boolean hasSessionChanged()
hasSessionChanged
in interface ConnectionIF
public final boolean isDebug()
isDebug
in interface ConnectionIF
protected void logError(java.lang.String str)
protected void logInfo(java.lang.String str)
protected void logWarning(java.lang.String str)
protected void processClientStructure(StructureIF structClient) throws ConnectionException
structClient
-
java.lang.Exception
ConnectionException
public final void setContextId(java.lang.String contextId) throws ConnectionException
setContextId
in interface ConnectionIF
contextId
- a valid Context Id
java.lang.Exception
ConnectionException
public final void setDebug(boolean debug)
setDebug
in interface ConnectionIF
debug
- should debug data be displayed.protected void setSessionChanged(boolean bool)
protected void setSessionId(java.lang.String str)
protected void updateOutputFromReadStructure(Output output, StructureIF structResponse) throws ConnectionException
output
- structResponse
-
java.lang.Exception
ConnectionException
protected void updateOutputFromSearchStructure(Output output, StructureIF structResponse) throws ConnectionException
output
- structResponse
-
java.lang.Exception
ConnectionException
protected final java.lang.String urlDecode(java.lang.String str) throws ConnectionException
str
- String Data to be decoded
java.lang.Exception
ConnectionException
protected final java.lang.String urlEncode(java.lang.String str) throws ConnectionException
str
- String Data to be encoded
java.lang.Exception
ConnectionException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |