HowTo-Configuration-FilesHow to modify configuration filescontext.xml file from tomcat/conf directory: Here you will have to define the database access through the servlet in a DataSourceFactory. You can change the value and also the localization of this definition if you know what you do.
<!-- The contents of this file will be loaded for each web application --> <Context>
<!-- Default set of monitored resources --> <WatchedResource>WEB-INF/web.xml</WatchedResource> <Resource name="jdbc/poollsd" auth="Container" type="javax.sql.DataSource" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="2" username="lsd" maxWait="5000" driverClassName="oracle.jdbc.OracleDriver" password="lsd" url="jdbc:oracle:thin:@localhost:1521:lsd"/> <!--Uncomment this to disable session persistence across Tomcat restarts --> <!-- <Manager pathname="" /> -->
</Context>
Here are the possible values:
openlsd.cfg This file defines the LSD Server configuration (ports, functions, but no database), legacy configuration files inclusions and Log4j configuration file inclusion.
<openlsd> <server> <timeout>60</timeout> <blocksize>16277</blocksize> <fastmd5path>D:/ALLJARS/lib/arch/win32_x86/MD5.dll</fastmd5path> <getfilepath>D:/LSD/getFileFromPath3.exe</getfilepath> <runlsdpath>D:/Source/OpenLSD/Scripts-Ora/LSDServerOra.bat</runlsdpath> <runlsdcheckpath>D:/Source/OpenLSD/Scripts-Ora/LSDCheckInDbThreadedOra.bat</runlsdcheckpath> <dfpath>df -kP</dfpath> <dupath>D:/LSD/openlsddu.exe</dupath> <slf4jpath>D:/LSDORA/slf4j-server.xml</slf4jpath> <httpport>8085</httpport> </server> <admin> <port>8082</port> <compressionserver>false</compressionserver> <compressionclient>false</compressionclient> <password>abcdefghijkl</password> <funcadmin>true</funcadmin> <funcdel>false</funcdel> <funcget>true</funcget> <funcgetna>true</funcgetna> <funcinfo>true</funcinfo> <funcmove>true</funcmove> <funcput>true</funcput> <funcputna>true</funcputna> <funcputfile>true</funcputfile> </admin> <client> <port>8084</port> <compressionserver>false</compressionserver> <compressionclient>false</compressionclient> <funcadmin>false</funcadmin> <funcdel>false</funcdel> <funcget>true</funcget> <funcgetna>true</funcgetna> <funcinfo>false</funcinfo> <funcmove>false</funcmove> <funcput>true</funcput> <funcputna>true</funcputna> <funcputfile>true</funcputfile> </client> <clientcomp> <port>8081</port> <compressionserver>true</compressionserver> <compressionclient>true</compressionclient> <funcadmin>false</funcadmin> <funcdel>false</funcdel> <funcget>true</funcget> <funcgetna>true</funcgetna> <funcinfo>false</funcinfo> <funcmove>false</funcmove> <funcput>true</funcput> <funcputna>true</funcputna> <funcputfile>true</funcputfile> </clientcomp> <protected> <port>8083</port> <compressionserver>false</compressionserver> <compressionclient>false</compressionclient> <password>abcdefghijkl</password> <funcadmin>false</funcadmin> <funcdel>true</funcdel> <funcget>false</funcget> <funcgetna>false</funcgetna> <funcinfo>true</funcinfo> <funcmove>true</funcmove> <funcput>true</funcput> <funcputna>true</funcputna> <funcputfile>true</funcputfile> </protected> <legacy> <file>D:/LSDORA/legacy1.xml</file> <file>D:/LSDORA/legacy2.xml</file> </legacy> </openlsd>
Here are the possible values:
The mapping of the function should be as follow, but one can change this according to specific needs. We specify the necessity of this support.
legacy<n>.xml This file defines the Legacy storage configuration (mounting point, size, crypto, …) that are included in the openlsd.xml file.
<legacy> <lid>-9223372036854775807</lid> <name>MON LEGACY1</name> <base>d:/LSDORA/Legacy1/files</base> <outbase>d:/LSDORA/Legacy1/out</outbase> <storagesize>100000000</storagesize> <crypted>false</crypted> <key></key> <status>true</status> </legacy>
Here are the possible values:
openlsddb.cfg This file defines the LSD Clients configuration (database access and log4j configuration file inclusion).
<openlsddb> <driver>oracle.jdbc.OracleDriver</driver> <server>jdbc:oracle:thin:@localhost:1521:lsd</server> <user>lsd</user> <password>lsd</password> <timeoutcon>3000</timeoutcon> <timeout>60</timeout> <blocksize>16277</blocksize> <slf4jpath>D:/LSDORA/slf4j-client.xml</slf4jpath> <business>openlsd.business.LSDBusinessImpl</business> </openlsddb>
Here are the possible values:
For PostGreSQL, only two values need to be changed: <driver>org.postgresql.Driver</driver> <server>jdbc:postgresql://localhost:5432/lsd</server>
slf4j.lcf Each type of client has its own slf4j.lcf configuration file. So there is one for the Server, one for the Client and one for the Web support.
Server version: rotation each day on files <configuration> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>D:/LSDORA/log/LSDServer2.log</file> <Append>true</Append> <BufferedIO>false</BufferedIO> <ImmediateFlush>true</ImmediateFlush> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern> D:/LSDORA/log/LSDServer2-%d{yyyy-MM-dd}.log </FileNamePattern> </rollingPolicy> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern> %date %level [%thread] %logger [%file %method : %line] %msg%n </Pattern> </layout> </appender> <root> <level value="warn" /> <appender-ref ref="FILE" /> </root> </configuration>
Client version: rotation each day on files and output <configuration> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>D:/LSDORA/log/LSDClient2.log</file> <Append>true</Append> <BufferedIO>false</BufferedIO> <ImmediateFlush>true</ImmediateFlush> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern> D:/LSDORA/log/LSDClient2-%d{yyyy-MM-dd}.log </FileNamePattern> </rollingPolicy> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern> %date %level [%thread] %logger [%file : %line] %msg%n </Pattern> </layout> </appender> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <ImmediateFlush>true</ImmediateFlush> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>%date %level [%thread] %logger [%file %method : %line] %msg%n</Pattern> </layout> </appender> <root> <level value="debug" /> <appender-ref ref="FILE" /> <appender-ref ref="STDOUT" /> </root> </configuration>
Web version: rotations each day on files only <configuration> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>D:/LSDORA/log/LSDWeb.log</file> <Append>true</Append> <BufferedIO>false</BufferedIO> <ImmediateFlush>true</ImmediateFlush> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern> D:/LSDORA/log/LSDWeb-%d{yyyy-MM-dd}.log </FileNamePattern> </rollingPolicy> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern> %date %level [%thread] %logger [%file : %line] %msg%n </Pattern> </layout> </appender> <root> <level value="warn" /> <appender-ref ref="FILE" /> </root> </configuration>
Adapt any value as wanted in openlsd.common.LSDConstantsSome values can be changed to allow different behaviour.
Logging properties: /** * Mode debug (very verbose) */ public static final boolean DEBUG = false; /** * Mode logging (partially verbose) */ public static final boolean LOGGING = false;
External C functions: /** * Use C functions : only for some specific functions in Server */ public static final boolean useCFunctions = false;
Size of internal buffers: /** * Default size for buffers (NIO) */ public static final int buffersizedefault = 65536; // 64K
Limit Size for switching between Ack and No Acked method for Web retrieve: /** * Limit size where NoAck method will be used (in Web retrieve functions) */ public static final int WEBRETRIEVENOACKLIMIT = 1024000;
Time limit before retry and limit number of retry: /** * Time elapse for retry in ms */ public static final long RETRYINMS = 10; /** * Number of retry before error */ public static final int RETRYNB = 3;
Size of blocks in the filesystems: /** * Size of one block in the filesystem: could be later in the Legacy * definition. * JFS2 supports multiple file system block sizes of 512, 1024, 2048, and * 4096, with 4 KBytes as standard. * EXT3 supports multiple file system block sizes of 1024, 2048 and 4096, * with 4 KBytes as standard. * NTFS supports sizes of clusters from 512 bytes up to 64 KBytes, with 4 * KBytes as standard. */ public static final long sizeblockfs = 4096; // 4K by default /** * Size of one block in the filesystem (double version): could be later in * the Legacy definition. */ public static final double DSIZEBLOCKFS = 4096.0;
If you use JDK6 or greater, you can enable this value and uncomment the following code:
/** * Is this running under JAVA6 (some optimisation) */ public static final boolean ISJAVA6 = false; /** * Get the Global Used and Free space in KB ONLY FROM JDK6 * @param storage * @return the global and used and free space in KB in long[] or null */ private static double[] getGlobalUsedFreeSpaceJava6(File storage) { double []size = new double[3]; /* JDK6 ONLY size[0] = storage.getTotalSpace(); size[1] = size[0] - storage.getUsableSpace(); size[2] = storage.getFreeSpace(); */ return size; }
|