public class OLcServer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DBTYPE_DERBY |
static java.lang.String |
DBTYPE_MARIA10_2 |
Constructor and Description |
---|
OLcServer(java.lang.String logfolder,
java.lang.String dbtype,
java.lang.String jdbcurl,
java.lang.String jdbcuser,
java.lang.String jdbcpassword,
int minconnection,
int maxconnection,
int port,
java.lang.String[] modulenamelist,
boolean messageaudit,
java.lang.String ldapconnectionstring,
java.lang.String ldapuser,
java.lang.String ldappassword,
java.lang.String smtpurl,
int smtpport,
java.lang.String smtpuser,
java.lang.String stmppassword,
boolean reducedlogs,
java.lang.String clientjar)
Creates the server with all the attributes provided by the main method
|
Modifier and Type | Method and Description |
---|---|
void |
addException(java.lang.String path,
java.util.logging.Level level,
boolean filelog)
adds an exception to the normal log level, either for file log or console log
|
void |
addTriggerToList(TriggerToExecute<?> newtrigger)
adds a trigger to the list of triggers to execute for the thread
|
void |
executeTriggerList()
This method will execute triggers for the calling thread with the following
order
first execute the internal triggers
then persist objects
then execute custom triggers
|
java.lang.String |
generateCid()
generates a client id
|
java.lang.String |
getCidForConnection() |
java.lang.String |
getClientJar() |
ConnectionPool |
getConnectionpool()
gets the connection pool of the server
|
ConnectionPool |
getConnectionPool()
gets the connection pool to the database
|
Appuser |
getCurrentUser()
This method returns in a high performance manner the current user.
|
DataObjectId<Appuser> |
getCurrentUserId()
This method returns in an efficient manner the current user id.
|
java.lang.String |
getIpForConnection()
gets the ip for the connection for the calling thread (client ip)
|
java.net.InetAddress |
getLocalhost()
gets the internet address of the server
|
SModule |
getMainmodule()
gets the main module on the server
|
SModule |
getModule(int index)
gets the module at given index
|
SModule |
getModuleByName(java.lang.String name)
gest the module by name
|
int |
getModuleNumber()
gets the number of modules registered on the server
|
long |
getNextSequence()
gets a transient sequence for the given thread
|
<E extends DataObject<E> & UniqueidentifiedInterface<E>> |
getObjectInTriggerUpdateBuffer(DataObjectId<E> id)
accesses to a buffer specific to the thread calling to get objects based on
their data object ids
|
SecurityManager |
getSecuritymanager()
gets the security manager of the server
|
static OLcServer |
getServer()
gets the server singleton
|
DataObjectId<Appuser> |
getUserIdForConnection() |
static void |
main(java.lang.String[] args) |
java.util.logging.Level |
minimumLevelForClass(java.lang.String path)
get log level for this path, considering exception list and normal log level
|
void |
removeCidConnectionReference()
remove the reference to the client id for the connection for the calling
thread
|
void |
removeIpConnectionReference()
removes the reference to the ip address of the client
|
void |
removeLogExceptions(boolean filelog)
removes the all the log exceptions
|
void |
reportThreadFinished(long id)
reports that the thread with the following id is finished
|
void |
resetTriggersList()
reset the list of triggers for the given thread (this method will manipulate
different data for each thread)
|
void |
sendShutdownToAllConnections()
sends a shutdown request to all connections
|
void |
setCidForConnection(java.lang.String cid)
sets the client id for the connection for the calling thread
|
void |
setIpForConnection(java.lang.String ip)
sets the ip for the connection for the calling thread (client ip)
|
void |
setObjectInTriggerUpdateBuffer(UniqueidentifiedInterface<?> object)
adds a data object to put in the buffer specific to the thread calling
|
void |
setUserIdForConnection(DataObjectId<Appuser> appuserid)
sets the user if for the connection for the calling thread
|
public static final java.lang.String DBTYPE_DERBY
public static final java.lang.String DBTYPE_MARIA10_2
public OLcServer(java.lang.String logfolder, java.lang.String dbtype, java.lang.String jdbcurl, java.lang.String jdbcuser, java.lang.String jdbcpassword, int minconnection, int maxconnection, int port, java.lang.String[] modulenamelist, boolean messageaudit, java.lang.String ldapconnectionstring, java.lang.String ldapuser, java.lang.String ldappassword, java.lang.String smtpurl, int smtpport, java.lang.String smtpuser, java.lang.String stmppassword, boolean reducedlogs, java.lang.String clientjar)
logfolder
- relative log folder pathdbtype
- type of database, amonst the type of databases
supportedjdbcurl
- URL of the databasejdbcuser
- database userjdbcpassword
- database passwordminconnection
- minimum connection in the connection poolmaxconnection
- maximum connection in the connection poolport
- listening port for the servermodulenamelist
- the list of modules (pathes to the main module
class)messageaudit
- true if messages are audited in logldapconnectionstring
- connection string to the ldapldapuser
- service user for LDAPldappassword
- service password for LDAPsmtpurl
- url of the SMTP serversmtpport
- port of the SMTP serversmtpuser
- user of the service account of the SMTP serverstmppassword
- password of the service account of the SMTP
serverreducedlogs
- if true, only warnings and severe logs are set in
logsclientjar
- name of the clientjar to send for the client
updater (default: OLcClient.jar). The file has to
be in the ./client/ folder.public java.lang.String getClientJar()
public java.net.InetAddress getLocalhost()
public ConnectionPool getConnectionpool()
public int getModuleNumber()
public SModule getModule(int index)
index
- the index of the module between 0 (included) and getModuleNumber
(excluded)public SModule getModuleByName(java.lang.String name)
name
- name of the modulepublic SecurityManager getSecuritymanager()
public SModule getMainmodule()
public ConnectionPool getConnectionPool()
public static void main(java.lang.String[] args)
public void addException(java.lang.String path, java.util.logging.Level level, boolean filelog)
path
- path of the class for which exceptional log level should be
set, or an alias.level
- filelog
- true if exception to be added to file log, false if exception
to be added to console logpublic java.util.logging.Level minimumLevelForClass(java.lang.String path)
path
- full class pathpublic static OLcServer getServer()
public void resetTriggersList()
public <E extends DataObject<E> & UniqueidentifiedInterface<E>> E getObjectInTriggerUpdateBuffer(DataObjectId<E> id)
id
- id of the data objectpublic void setObjectInTriggerUpdateBuffer(UniqueidentifiedInterface<?> object)
object
- the object to put in bufferpublic void addTriggerToList(TriggerToExecute<?> newtrigger)
newtrigger
- the trigger to add in the list of triggers to executepublic void executeTriggerList()
public long getNextSequence()
public void setIpForConnection(java.lang.String ip)
ip
- ip calling for the threadpublic java.lang.String getIpForConnection()
public void removeIpConnectionReference()
public void setUserIdForConnection(DataObjectId<Appuser> appuserid)
appuserid
- userid for the calling threadpublic DataObjectId<Appuser> getUserIdForConnection()
public void setCidForConnection(java.lang.String cid)
cid
- client idpublic java.lang.String getCidForConnection()
public void removeCidConnectionReference()
public java.lang.String generateCid()
public DataObjectId<Appuser> getCurrentUserId()
public Appuser getCurrentUser()
public void sendShutdownToAllConnections()
public void reportThreadFinished(long id)
id
- reports that a thread withpublic void removeLogExceptions(boolean filelog)
filelog
- true if exceptions are removed from the file log, false if
exceptions are removed from the console log