public class ServerConnection
extends java.lang.Thread
Constructor and Description |
---|
ServerConnection(java.net.Socket socket,
OLcServer server,
boolean messageaudit)
Creates a server connection
|
Modifier and Type | Method and Description |
---|---|
SPage |
getDefaultPage(SModule module)
gets the default page for the module
|
SPage |
getMainModuleStartPage()
gets the main module start page for the server
|
static <E extends DataObject<E>> |
isAuthorized(ActionExecution action,
E object)
checks if the action is authorized, limited access to pesistence
|
static ActionAuthorization |
isAuthorized(ActionExecution action,
SActionData actiondata,
SecurityBuffer buffer)
checks if the action is authorized, getting all the action data
|
void |
logAction(ActionExecution action)
logging the action on the server.
|
void |
processCLink(java.lang.String address,
MessageBufferedWriter writer)
launches the action corresponding to the CLink, or throw a RuntimeException
else
|
void |
run() |
void |
sendClientVersionError(MessageWriter writer,
java.lang.String clientversion)
sends a client server version mismatch
|
void |
sendPage(SPage page,
MessageWriter writer,
SecurityBuffer buffer,
java.util.ArrayList<PageBufferSpec> clientpagesinbuffer)
sends a page
|
void |
setInactive()
sets the connection to inactive.
|
void |
setLoginWithContextAction(ActionExecution action,
SActionData actiondata,
MessageBufferedWriter writer)
performs a login, keeping the action context.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public ServerConnection(java.net.Socket socket, OLcServer server, boolean messageaudit)
socket
- server socketserver
- main server classmessageaudit
- true if messages should be audited in logspublic void processCLink(java.lang.String address, MessageBufferedWriter writer) throws java.io.IOException
address
- address to processwriter
- message writer for sending the result of the actionjava.io.IOException
- if any issue is encountered sending the action to the
clientpublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void setLoginWithContextAction(ActionExecution action, SActionData actiondata, MessageBufferedWriter writer) throws java.io.IOException
action
- action to executeactiondata
- data to executewriter
- writer to provide outputjava.io.IOException
- if any communication issue is encounteredpublic void sendClientVersionError(MessageWriter writer, java.lang.String clientversion) throws java.io.IOException
writer
- writer to communicate to the clientclientversion
- client versionjava.io.IOException
- if any transmission error is encounteredpublic void sendPage(SPage page, MessageWriter writer, SecurityBuffer buffer, java.util.ArrayList<PageBufferSpec> clientpagesinbuffer) throws java.io.IOException
page
- page to sendwriter
- writer to communicate back to the clientbuffer
- security bufferclientpagesinbuffer
- client pages already on the clientjava.io.IOException
- if any communication issue is encounteredpublic static <E extends DataObject<E>> ActionAuthorization isAuthorized(ActionExecution action, E object)
action
- action to checkobject
- context objectpublic static ActionAuthorization isAuthorized(ActionExecution action, SActionData actiondata, SecurityBuffer buffer)
action
- actionactiondata
- all action databuffer
- security bufferpublic SPage getDefaultPage(SModule module)
module
- modulepublic SPage getMainModuleStartPage()
public void setInactive()
public void logAction(ActionExecution action)
action
- action