1
0
Fork 0

init commit logstats bsd source

This commit is contained in:
Willem Cazander 2012-01-03 02:49:12 +01:00
parent 00a52478df
commit 99c93dbc0c
105 changed files with 8422 additions and 1 deletions

42
.gitignore vendored Normal file
View File

@ -0,0 +1,42 @@
#
# Ignore some files in the logstats project.
#
# Ignore all maven target directories
/target
*/target
*/*/target
*/*/*/target
# Ignore leftovers of really failed release build
release.properties
pom.xml.next
pom.xml.releaseBackup
pom.xml.backup
pom.xml.branch
pom.xml.tag
# Ignore version plugin backup
pom.xml.versionsBackup
# Ignore C/java/images binary files
*.o
*.hex
*.dat
*.bmp
*.gif
*.pdf
# Ignore netbeans directory
nbproject
# Ignore mac finder files
.DS_Store
# Ignore windows files.
Thumbs.db
Desktop.ini
# Ignore auto eclipse plugins settings
org.eclipse.wst.common.component
org.eclipse.wst.common.project.facet.core.xml

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>logstats-base</name>
<name>logstats</name>
<comment></comment>
<projects>
</projects>

6
logstats-ear/.classpath Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

29
logstats-ear/.project Normal file
View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>logstats-ear</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,3 @@
#Mon Jan 02 23:18:50 CET 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -0,0 +1,13 @@
#Thu Jun 10 02:50:42 CEST 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.4
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.4

View File

@ -0,0 +1,5 @@
#Mon Jan 02 23:18:47 CET 2012
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -0,0 +1,9 @@
#Wed Jun 09 21:35:29 CEST 2010
activeProfiles=
eclipse.preferences.version=1
fullBuildGoals=process-test-resources
includeModules=false
resolveWorkspaceProjects=true
resourceFilterGoals=process-resources resources\:testResources
skipCompilerPlugin=true
version=1

View File

@ -0,0 +1,3 @@
#Tue Jan 03 00:48:11 CET 2012
eclipse.preferences.version=1
org.maven.ide.eclipse.wtp.enabledProjectSpecificPrefs=false

185
logstats-ear/pom.xml Normal file
View File

@ -0,0 +1,185 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>logstats</artifactId>
<groupId>net.forwardfire.logstats</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>logstats-ear</artifactId>
<packaging>ear</packaging>
<name>logstats-ear</name>
<description>logstats-ear</description>
<build>
<finalName>logstats-jboss</finalName>
<plugins>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<generateApplicationXml>true</generateApplicationXml>
<jboss>
<!--
<version>5</version>
<loader-repository>net.forwardfire.logstats:archive=logstats-ear</loader-repository>
<data-sources>
<data-source>logstats-ds.xml</data-source>
</data-sources>
-->
</jboss>
<modules>
<jarModule>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
<includeInApplicationXml>true</includeInApplicationXml>
</jarModule>
<ejbModule>
<groupId>net.forwardfire.logstats</groupId>
<artifactId>logstats-ejb</artifactId>
</ejbModule>
<webModule>
<groupId>net.forwardfire.logstats</groupId>
<artifactId>logstats-war</artifactId>
<contextRoot>/logstats</contextRoot>
</webModule>
<jarModule>
<groupId>org.x4o</groupId>
<artifactId>x4o-core</artifactId>
<includeInApplicationXml>true</includeInApplicationXml>
</jarModule>
<jarModule>
<groupId>net.forwardfire.vasc</groupId>
<artifactId>vasc-core</artifactId>
<includeInApplicationXml>true</includeInApplicationXml>
</jarModule>
<jarModule>
<groupId>net.forwardfire.vasc</groupId>
<artifactId>vasc-backend-jpa</artifactId>
<includeInApplicationXml>true</includeInApplicationXml>
</jarModule>
<ejbModule>
<groupId>net.forwardfire.vasc</groupId>
<artifactId>vasc-xpql-ejb3</artifactId>
</ejbModule>
<ejbModule>
<groupId>net.forwardfire.vasc</groupId>
<artifactId>vasc-ejb3</artifactId>
</ejbModule>
<jarModule>
<groupId>net.forwardfire.vasc</groupId>
<artifactId>vasc-xpql</artifactId>
<includeInApplicationXml>true</includeInApplicationXml>
</jarModule>
<!--
<jarModule>
<groupId>jgroups</groupId>
<artifactId>jgroups</artifactId>
<includeInApplicationXml>true</includeInApplicationXml>
</jarModule>
<jarModule>
<groupId>de.odysseus.juel</groupId>
<artifactId>juel</artifactId>
<includeInApplicationXml>true</includeInApplicationXml>
</jarModule>
<jarModule>
<groupId>javax.el</groupId>
<artifactId>el-ri</artifactId>
<includeInApplicationXml>true</includeInApplicationXml>
</jarModule>
<jarModule>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<includeInApplicationXml>true</includeInApplicationXml>
</jarModule>
-->
</modules>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- projects dependcy -->
<dependency>
<groupId>net.forwardfire.logstats</groupId>
<artifactId>logstats-ejb</artifactId>
<type>ejb</type>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.forwardfire.logstats</groupId>
<artifactId>logstats-war</artifactId>
<type>war</type>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
<version>1.1.11</version>
</dependency>
<!-- X4O dependcy -->
<dependency>
<groupId>org.x4o</groupId>
<artifactId>x4o-core</artifactId>
<version>${x4o-core.version}</version>
</dependency>
<!-- Vasc depency -->
<dependency>
<groupId>net.forwardfire.vasc</groupId>
<artifactId>vasc-backend-jpa</artifactId>
<version>${vasc.version}</version>
</dependency>
<!-- Xtes depency -->
<dependency>
<groupId>net.forwardfire.vasc</groupId>
<artifactId>vasc-xpql-ejb3</artifactId>
<version>${vasc.version}</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>net.forwardfire.vasc</groupId>
<artifactId>vasc-ejb3</artifactId>
<version>${vasc.version}</version>
<type>ejb</type>
</dependency>
<!--
<dependency>
<groupId>jgroups</groupId>
<artifactId>jgroups</artifactId>
<version>2.6.2</version>
</dependency>
-->
<!-- X4O depency for EL
<dependency>
<groupId>de.odysseus.juel</groupId>
<artifactId>juel</artifactId>
<version>2.1.0</version>
<scope>provided</scope>
</dependency>
-->
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-ri</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

15
logstats-ejb/.classpath Normal file
View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

36
logstats-ejb/.project Normal file
View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>logstats-ejb</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,7 @@
#Mon Jan 02 23:18:50 CET 2012
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8

View File

@ -0,0 +1,13 @@
#Mon Jun 14 01:44:40 CEST 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5

View File

@ -0,0 +1,5 @@
#Mon Jan 02 23:18:47 CET 2012
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -0,0 +1,9 @@
#Wed Jun 09 21:36:34 CEST 2010
activeProfiles=
eclipse.preferences.version=1
fullBuildGoals=process-test-resources
includeModules=false
resolveWorkspaceProjects=true
resourceFilterGoals=process-resources resources\:testResources
skipCompilerPlugin=true
version=1

92
logstats-ejb/pom.xml Normal file
View File

@ -0,0 +1,92 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>logstats</artifactId>
<groupId>net.forwardfire.logstats</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>logstats-ejb</artifactId>
<packaging>ejb</packaging>
<name>logstats-ejb</name>
<description>logstats-ejb</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<configuration>
<ejbVersion>3.0</ejbVersion>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>ejb-api</artifactId>
<version>3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
<scope>provided</scope>
</dependency>
<!-- X4O dependcy -->
<dependency>
<groupId>org.x4o</groupId>
<artifactId>x4o-core</artifactId>
<version>${x4o-core.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-ri</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<!-- Vasc depency -->
<dependency>
<groupId>net.forwardfire.vasc</groupId>
<artifactId>vasc-backend-jpa</artifactId>
<version>${vasc.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.forwardfire.vasc</groupId>
<artifactId>vasc-xpql-ejb3</artifactId>
<version>${vasc.version}</version>
</dependency>
<dependency>
<groupId>net.forwardfire.vasc</groupId>
<artifactId>vasc-ejb3</artifactId>
<version>${vasc.version}</version>
</dependency>
<!-- quick fix for quartz ... -->
<dependency>
<groupId>opensymphony</groupId>
<artifactId>quartz</artifactId>
<version>1.6.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,437 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.jobs;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Resource;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.EJB;
import javax.ejb.MessageDriven;
import javax.ejb.TransactionManagement;
import javax.ejb.TransactionManagementType;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
import javax.transaction.NotSupportedException;
import javax.transaction.SystemException;
import javax.transaction.UserTransaction;
//import org.jboss.annotation.ejb.ResourceAdapter;
//import org.jboss.ejb3.annotation.ResourceAdapter;
import net.forwardfire.logstats.ejb.models.LogData;
import net.forwardfire.logstats.ejb.models.LogHost;
import net.forwardfire.logstats.ejb.models.LogLevel;
import net.forwardfire.logstats.ejb.models.LogServerRun;
import net.forwardfire.logstats.ejb.models.LogSource;
import net.forwardfire.logstats.ejb.models.LogStats;
import net.forwardfire.logstats.ejb.models.LogValueLine;
import net.forwardfire.logstats.ejb.models.LogValueType;
import org.quartz.InterruptableJob;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.UnableToInterruptJobException;
import net.forwardfire.vasc.xpql.XPQLParser;
import net.forwardfire.vasc.xpql.ejb3.XpqlQueryManager;
import net.forwardfire.vasc.xpql.query.Query;
/**
* 1.0 03 Aug 2007
*
* A "Cron-Expression" is a string comprised of 6 or 7 fields separated by white space. The 6 mandatory and 1 optional fields are as follows:
* FIELD NAME ALLOWED VALUES ALLOWED SPECIAL CHARACTERS
* Seconds 0-59 , - * /
* Minutes 0-59 , - * /
* Hours 0-23 , - * /
* Day-of-month 1-31 , - * ? / L W C
* Month 1-12 or JAN-DEC , - * /
* Day-of-Week 1-7 or SUN-SAT , - * ? / L C #
* Year (Optional) empty, 1970-2099 , - * /
*
* MORE INFO: http://quartz.sourceforge.net/javadoc/org/quartz/CronTrigger.html
*
*
*
* @author Willem Cazander
* @version 1.0 Sep 13, 2007
*/
@MessageDriven(
messageListenerInterface=Job.class,
activationConfig = {
@ActivationConfigProperty(propertyName = "cronTrigger", propertyValue = "13 */2 * * * ?"),
@ActivationConfigProperty(propertyName = "jobName", propertyValue = "UpdateIndexJob"),
@ActivationConfigProperty(propertyName = "jobGroup", propertyValue = "system")
})
//@ResourceAdapter("quartz-ra.rar")
@TransactionManagement(TransactionManagementType.BEAN)
public class UpdateIndexJob implements InterruptableJob {
private Logger logger = Logger.getLogger(UpdateIndexJob.class.getName());
@EJB(beanInterface=XpqlQueryManager.IRemote.class)
private XpqlQueryManager xtesManager;
@PersistenceContext
private EntityManager entityManager;
@Resource
private UserTransaction utx;
private static boolean running = false;
private int count = 0;
private volatile boolean interrupted = false;
static public Queue<LogData> logDataRealtime = new LinkedBlockingQueue<LogData>();
/**
* @see org.quartz.InterruptableJob#interrupt()
*/
public void interrupt() throws UnableToInterruptJobException {
interrupted=true;
logger.info("Job interrupted");
}
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
logger.info("executing UpdateIndexJob job");
long startTime = System.currentTimeMillis();
if (running) {
//serverLogManager.logMessage(UpdateIndexJob,"UpdateIndexJob is already running.");
return;
}
try {
running=true;
long startDate = System.currentTimeMillis();
long lastId = 0l;
try {
LogServerRun last = (LogServerRun)xtesManager.executeObject("LogServerRun.getLast", null);
lastId = last.getLastDataId();
} catch (NoResultException nre) {
// first run on this DB
}
// cache some lists for 5min
List<LogValueLine> logValueLines = (List)xtesManager.execute("LogValueLine.getAllIndexActive",null);
List<LogHost> logHosts = (List)xtesManager.execute("LogHost.getAll",null);
List<LogSource> logSources = (List)xtesManager.execute("LogSource.getAll",null);
List<LogValueLineData> lineData = prepareData(logValueLines);
logger.info("Cached data sizes; logValueLines: "+logValueLines.size()+" logHosts: "+logHosts.size()+" logSources: "+logSources.size()+" lineData: "+lineData.size() );
if (lineData.isEmpty()) {
return; // no data to match against
}
// loop until time is over
while (true) {
Query q = xtesManager.getQuery("LogData.getFromId");
String sql = q.toPreparedSQL(q);
javax.persistence.Query q2 = entityManager.createQuery(sql);
q2.setParameter(1, lastId);
q2.setMaxResults(1000);
List<LogData> logData = q2.getResultList();
if (logData.isEmpty()==false) {
logger.info("Got log data size: "+logData.size());
long lastIdNew = parseLogData(logData,lineData,logHosts,logSources);
if (lastIdNew>0) {
lastId = lastIdNew;
}
}
if (interrupted) {
break;
}
long thisTime = System.currentTimeMillis();
long diffTime = thisTime-startTime;
long minTime = 100*1000; // stop working just 20sec before next fire !!
if (diffTime>minTime) {
break;
}
Thread.sleep(10*1000); // sleep 10sec before checking again for new records.
}
LogServerRun thisRun = new LogServerRun();
thisRun.setLastDataId(lastId);
thisRun.setStartDate(new Date(startDate));
thisRun.setStopDate(new Date());
utx.begin();
entityManager.persist(thisRun);
utx.commit();
} catch (Exception e) {
e.printStackTrace();
//serverLogManager.logException(e);
} finally {
running=false;
long endTime = System.currentTimeMillis();
logger.info("UpdateIndexJob done in: "+(endTime-startTime)+" ms updated records: "+count);
//serverLogManager.logMessage(UpdateIndexJob.class,"Total UpdateIndexJob updated: "+count+" in "+(endTime-startTime)+" ms");
}
}
private List<LogValueLineData> prepareData(List<LogValueLine> logValueLines) throws Exception {
// create logValueLine List
List<LogValueLineData> lines = new ArrayList<LogValueLineData>(logValueLines.size());
for (LogValueLine line:logValueLines) {
if (line.getActive()==false) {
continue;
}
// todo: check start/stop date
// setup data obj
LogValueLineData data = new LogValueLineData();
data.logStats = new HashMap<String,LogStats>(100);
data.logValueLine=line;
String match = line.getMatchRegex();
if (match.isEmpty()) {
logger.info("Skipped LogValueLine because match regex is empty.");
continue;
}
data.matchPattern = Pattern.compile(match);
// fill regex
String regex = line.getSplitRegex();
if (regex.isEmpty()) {
logger.info("Skipped LogValueLine because split regex is empty.");
continue;
}
data.splitPattern = Pattern.compile(regex);
lines.add(data);
}
// put already calulated logStats in data obj.
List<LogStats> logStats = (List)xtesManager.execute("LogStats.getLastDay",null);
for (int i=0;i<logStats.size();i++) {
LogStats data = logStats.get(i);
for (LogValueLineData line :lines) {
if (line.logValueLine.getLogValue().getId().equals(data.getLogValueId())) {
line.logStats.put(data.getValueText(),data);
break;
}
}
}
for (LogValueLineData line:lines) {
logger.info("line: "+line.logValueLine.getId()+" logStats: "+line.logStats.size()+" fetchedStats: "+logStats.size());
}
return lines;
}
private long parseLogData(List<LogData> logData,List<LogValueLineData> lines,List<LogHost> logHosts,List<LogSource> logSources) throws Exception {
logger.info("parseLogData size: "+logData.size()+" lines: "+lines.size());
// process the raw log data
Long lastId = null;
for (int i=0;i<logData.size();i++) {
if (interrupted) {
break;
}
LogData data = logData.get(i);
logger.info("Check line: "+data.getMessage());
lastId = data.getId();
for (int l=0;l<lines.size();l++) {
LogValueLineData line = lines.get(l);
if (line.logValueLine.getLogHost()!=null && line.logValueLine.getLogHost().getHostname().equals(data.getHostname())==false) {
continue; // other host
}
if (line.logValueLine.getLogLevel()!=null && line.logValueLine.getLogLevel().getLevelNumber().equals(data.getLogLevel())==false) {
continue; // other level
}
if (line.logValueLine.getLogSource()!=null && line.logValueLine.getLogSource().getSource().equals(data.getSource())==false) {
continue; // other source
}
Matcher m = line.matchPattern.matcher(data.getMessage());
if (m.matches()==false) {
continue; // message does not match
}
String valueType = line.logValueLine.getLogValue().getLogValueType().getValueType();
// split
String[] columns = line.splitPattern.split(data.getMessage());
String value = getString(columns,line.logValueLine.getValueIndexNumber());
int timeNumber = 0;
if (LogValueType.VALUE_COUNT.equals(valueType)==false) {
String time = getString(columns,line.logValueLine.getTimeIndexNumber());
timeNumber = parseTime(time);
}
logger.info("Checking value: '"+value+"' and time: '"+timeNumber+"'");
LogStats stats = line.logStats.get(value);
if (stats==null) {
stats = new LogStats();
stats.setLogDay(new Date());
stats.setCreatedDate(new Date());
stats.setValueText(value);
stats.setValueCount(0);
stats.setTimeTotal(0);
stats.setTimeMin(timeNumber);
stats.setTimeMax(timeNumber);
stats.setTimeAvg(timeNumber);
LogHost logHost = findOrCreateLogHost(logHosts,data.getHostname());
stats.setLogHostId(logHost.getId());
stats.setLogHost(logHost.getHostname());
LogSource logSource = findOrCreateLogSource(logSources,data.getSource());
stats.setLogSourceId(logSource.getId());
stats.setLogSource(logSource.getSource());
stats.setLogValueId(line.logValueLine.getLogValue().getId());
stats.setLogValue(line.logValueLine.getLogValue().getName());
}
stats.setValueCount(stats.getValueCount()+1);
// in counting we don't need to calulate
if (LogValueType.VALUE_COUNT.equals(valueType)==false) {
stats.setTimeTotal(stats.getTimeTotal()+timeNumber);
if (stats.getTimeMin()>timeNumber) {
stats.setTimeMin(timeNumber);
}
if (stats.getTimeMax()<timeNumber) {
stats.setTimeMax(timeNumber);
}
stats.setTimeAvg(stats.getTimeTotal()/stats.getValueCount());
}
// mark changed
stats.setModifiedDate(new Date(0));
//put in map
line.logStats.put(stats.getValueText(), stats);
}
// data is processed lets kick to realtime view for last usage of the obj.
logDataRealtime.add(data);
if (logDataRealtime.size()>100) {
logDataRealtime.remove();
}
}
// save changed stats records.
for (LogValueLineData line:lines) {
utx.begin();
for (String key:line.logStats.keySet()) {
LogStats stats = line.logStats.get(key);
if (stats.getModifiedDate().getTime()==0l) {
stats.setModifiedDate(new Date());
entityManager.merge(stats);
count++;
}
}
utx.commit();
}
return lastId;
}
private LogHost findOrCreateLogHost(List<LogHost> logHosts,String hostname) throws Exception {
for (int i=0;i<logHosts.size();i++) {
LogHost logHost = logHosts.get(i);
if (logHost.getHostname().equalsIgnoreCase(hostname)) {
return logHost;
}
}
// not found lets create
LogHost logHost = new LogHost();
logHost.setActive(true);
logHost.setHostname(hostname);
utx.begin();
logHost = entityManager.merge(logHost);
utx.commit();
logHosts.add(logHost);
return logHost;
}
private LogSource findOrCreateLogSource(List<LogSource> logSources,String source) throws Exception {
for (int i=0;i<logSources.size();i++) {
LogSource logSource = logSources.get(i);
if (logSource.getSource().equalsIgnoreCase(source)) {
return logSource;
}
}
// not found lets create
LogSource logSource = new LogSource();
logSource.setActive(true);
logSource.setSource(source);
utx.begin();
logSource = entityManager.merge(logSource);
utx.commit();
logSources.add(logSource);
return logSource;
}
private int parseTime(String valueTime) {
int msIndex = valueTime.indexOf("ms");
if (msIndex>0) {
valueTime=valueTime.substring(0, msIndex); // remove "ms" from Long
}
return new Integer(valueTime);
}
private String getString(String[] lineValues,int index) {
try {
return lineValues[index];
} catch (ArrayIndexOutOfBoundsException e) {
return "";
}
}
class LogValueLineData {
LogValueLine logValueLine = null;
Pattern matchPattern = null;
Pattern splitPattern = null;
Map<String,LogStats> logStats = null;
}
}

View File

@ -0,0 +1,110 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.Id;
/**
* Base class for all enities
*
* Currenly only implements the overriden equals method.
* On list to do;
* - hashCode
* - 3x date
*
* @author Willem Cazander
* @version 1.0 Aug 08, 2009
*/
abstract public class AbstractEntityBase implements Serializable {
/** The serial version ID */
private static final long serialVersionUID = 10l;
/**
* static cacheing so it is only scanned one per classloader
*/
static private Map<Class<?>,Method> cachedEntityId = new HashMap<Class<?>,Method>(100);
/**
* Scannes the class for the "@Id" annotation and caches the result.
*
* @param clazz The class the get the id method for.
* @return The Method to invoke to return the Id of the clazz.
*/
static private Method lookupEntityIdMethod(Class<?> clazz) {
Method entityId = cachedEntityId.get(clazz);
if (entityId!=null) {
return entityId;
}
// scan class
Method[] methods = clazz.getMethods();
for (Method method : methods) {
if (method.isAnnotationPresent(Id.class)) {
entityId = method;
break;
}
}
if (entityId==null) {
throw new RuntimeException("Can't equal/hash entity bean with no @Id annotation class: "+clazz);
}
cachedEntityId.put(clazz,entityId);
return entityId;
}
/**
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if ( obj == null ) {
return false; // false on null
}
if ( this.hashCode() == obj.hashCode() ) {
return true; // true on same object ?
}
if ( obj.getClass() != this.getClass() ) {
return false; // false on other classes incl subclasses !
}
Method entityId = lookupEntityIdMethod(this.getClass());
Object idThis = null;
Object idObj = null;
try {
idThis = entityId.invoke(this, (Object[]) null);
idObj = entityId.invoke(obj, (Object[]) null);
} catch (Exception e) {
throw new RuntimeException(e);
}
if (idThis==null | idObj==null) {
return super.equals(obj); // no id, do super
}
boolean result = idThis.equals(idObj);
return result;
}
}

View File

@ -0,0 +1,109 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import java.util.Date;
import net.forwardfire.vasc.annotations.VascDefaultValue;
import net.forwardfire.vasc.annotations.VascDisplayName;
import net.forwardfire.vasc.annotations.VascField;
import net.forwardfire.vasc.annotations.VascFieldOrder;
import net.forwardfire.vasc.annotations.VascFieldType;
import net.forwardfire.vasc.annotations.VascI18n;
import net.forwardfire.vasc.annotations.VascPrimaryKey;
import net.forwardfire.vasc.annotations.VascStyle;
import net.forwardfire.vasc.validators.VascObjectNotNull;
import net.forwardfire.vasc.validators.VascStringLength;
/**
* Template class for common vasc annotations
*
* @author Willem Cazander
* @version 1.0 May 23, 2009
*/
abstract public class AbstractFieldTemplates {
/**
* Template for id field.
*/
@VascI18n(name="generic.id.labelText",description="generic.id.toolTipText")
@VascPrimaryKey
@VascStyle(sizeList=50)
@VascFieldOrder(orderIndex=0)
@VascField(create=false,editReadOnly=true)
abstract public Integer getId();
/**
* Template for name field.
*/
@VascI18n(name="generic.name.labelText",description="generic.name.toolTipText")
@VascDisplayName
@VascObjectNotNull
@VascStringLength(min=4,max=128)
@VascStyle(sizeList=250,sizeEdit=40)
@VascFieldOrder(orderIndex=1)
abstract public String getName();
/**
* Template for description field.
*/
@VascI18n(name="generic.description.labelText",description="generic.description.toolTipText")
@VascFieldType(type="TextAreaField",properties={"editor.columns=40","editor.rows=5"})
@VascField(list=false)
@VascStringLength(min=8,max=4096)
@VascObjectNotNull
@VascFieldOrder(orderIndex=2)
abstract public String getDescription();
/**
* Template for active field.
*/
@VascI18n(name="generic.active.labelText",description="generic.active.toolTipText")
@VascDefaultValue(value="true")
@VascObjectNotNull
@VascFieldOrder(orderIndex=4)
abstract public Boolean getActive();
/**
* Template for order number field.
*/
@VascI18n(name="generic.orderNumber.labelText",description="generic.orderNumber.toolTipText")
@VascField(view=false)
abstract public Integer getOrderNumber();
/**
* Template for createdDate field.
*/
@VascI18n(name="generic.createdDate.labelText",description="generic.createdDate.toolTipText")
@VascField(create=false,editReadOnly=true)
@VascDefaultValue(value="now()")
abstract public Date getCreatedDate();
/**
* Template for modifiedDate field.
*/
@VascI18n(name="generic.modifiedDate.labelText",description="generic.modifiedDate.toolTipText")
@VascField(create=false,editReadOnly=true)
@VascDefaultValue(value="now()")
abstract public Date getModifiedDate();
}

View File

@ -0,0 +1,158 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.ResultCheckStyle;
import org.hibernate.annotations.SQLInsert;
import net.forwardfire.vasc.annotations.VascDisplayName;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
/**
* LogData
*
* @author Willem Cazander
* @version 1.0 Jun 09, 2010
*/
@Entity
@Table(name = "log_data")
@SequenceGenerator(name="LOG_DATA_ID_SEQ", sequenceName="log_data_global_id_seq",allocationSize=1)
@Cache(usage=CacheConcurrencyStrategy.NONE)
@org.hibernate.annotations.Entity(selectBeforeUpdate=true,dynamicInsert=true,dynamicUpdate=true)
@SQLInsert(sql="SQL GENERATED BY dynamicInsert=true",check=ResultCheckStyle.NONE)
public class LogData extends AbstractEntityBase {
private static final long serialVersionUID = 10L;
private Long id = null;
private Date logDate = null;
private Integer logLevel = null;
private String hostname = null;
private String source = null;
private String message = null;
/**
* @return the id
*/
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="LOG_DATA_ID_SEQ")
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Long getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Long id) {
this.id = id;
}
/**
* @return the logDate
*/
@Column(name="log_date",nullable=false)
@VascDisplayName
public Date getLogDate() {
return logDate;
}
/**
* @param logDate the logDate to set
*/
public void setLogDate(Date logDate) {
this.logDate = logDate;
}
/**
* @return the logLevel
*/
@Column(name="log_level",nullable=false)
public Integer getLogLevel() {
return logLevel;
}
/**
* @param logLevel the logLevel to set
*/
public void setLogLevel(Integer logLevel) {
this.logLevel = logLevel;
}
/**
* @return the hostname
*/
@Column(name="hostname",nullable=false)
public String getHostname() {
return hostname;
}
/**
* @param hostname the hostname to set
*/
public void setHostname(String hostname) {
this.hostname = hostname;
}
/**
* @return the source
*/
@Column(name="source",nullable=false)
public String getSource() {
return source;
}
/**
* @param source the source to set
*/
public void setSource(String source) {
this.source = source;
}
/**
* @return the message
*/
@Column(name="message",nullable=false)
public String getMessage() {
return message;
}
/**
* @param message the message to set
*/
public void setMessage(String message) {
this.message = message;
}
}

View File

@ -0,0 +1,127 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import net.forwardfire.vasc.annotations.VascDisplayName;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
import net.forwardfire.vasc.annotations.VascModelReference;
/**
* LogHost
*
* @author Willem Cazander
* @version 1.0 Jun 09, 2010
*/
@Entity
@Table(name = "log_host")
@SequenceGenerator(name="LOG_HOST_ID_SEQ", sequenceName="log_host_id_seq",allocationSize=1)
@Cache(usage=CacheConcurrencyStrategy.NONE)
public class LogHost extends AbstractEntityBase {
private static final long serialVersionUID = 10L;
private Integer id = null;
private String hostname = null;
private Boolean active = null;
private LogHostGroup logHostGroup = null;
/**
* @return the id
*/
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="LOG_HOST_ID_SEQ")
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the hostname
*/
@Column(name="hostname",nullable=false)
@VascDisplayName
public String getHostname() {
return hostname;
}
/**
* @param hostname the hostname to set
*/
public void setHostname(String hostname) {
this.hostname = hostname;
}
/**
* @return the active
*/
@Column(name="active",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Boolean getActive() {
return active;
}
/**
* @param active the active to set
*/
public void setActive(Boolean active) {
this.active = active;
}
/**
* @return the logHostGroup
*/
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="log_host_group_id",nullable=true)
@VascModelReference
public LogHostGroup getLogHostGroup() {
return logHostGroup;
}
/**
* @param logHostGroup the logHostGroup to set
*/
public void setLogHostGroup(LogHostGroup logHostGroup) {
this.logHostGroup = logHostGroup;
}
}

View File

@ -0,0 +1,104 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
/**
* LogHostGroup
*
* @author Willem Cazander
* @version 1.0 Jun 09, 2010
*/
@Entity
@Table(name = "log_host_group")
@SequenceGenerator(name="LOG_HOST_GROUP_ID_SEQ", sequenceName="log_host_group_id_seq",allocationSize=1)
@Cache(usage=CacheConcurrencyStrategy.NONE)
public class LogHostGroup extends AbstractEntityBase {
private static final long serialVersionUID = 10L;
private Integer id = null;
private String name = null;
private String description = null;
/**
* @return the id
*/
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="LOG_HOST_GROUP_ID_SEQ")
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the name
*/
@Column(name="name",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the description
*/
@Column(name="description",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public String getDescription() {
return description;
}
/**
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
}
}

View File

@ -0,0 +1,138 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import net.forwardfire.vasc.annotations.VascDisplayName;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
/**
* LogLevel
*
* @author Willem Cazander
* @version 1.0 Jun 13, 2010
*/
@Entity
@Table(name = "log_level")
@SequenceGenerator(name="LOG_LEVEL_ID_SEQ", sequenceName="log_level_id_seq",allocationSize=1)
@Cache(usage=CacheConcurrencyStrategy.NONE)
public class LogLevel extends AbstractEntityBase {
private static final long serialVersionUID = 10L;
private Integer id = null;
private String levelType = null;
private Integer levelNumber = null;
private Integer orderNumber = null;
private Boolean active = null;
/**
* @return the id
*/
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="LOG_LEVEL_ID_SEQ")
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the levelType
*/
@Column(name="level_type",nullable=false)
@VascDisplayName
public String getLevelType() {
return levelType;
}
/**
* @param levelType the levelType to set
*/
public void setLevelType(String levelType) {
this.levelType = levelType;
}
/**
* @return the levelNumber
*/
@Column(name="level_number",nullable=false)
public Integer getLevelNumber() {
return levelNumber;
}
/**
* @param levelNumber the levelNumber to set
*/
public void setLevelNumber(Integer levelNumber) {
this.levelNumber = levelNumber;
}
/**
* @return the orderNumber
*/
@Column(name="order_number",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Integer getOrderNumber() {
return orderNumber;
}
/**
* @param orderNumber the orderNumber to set
*/
public void setOrderNumber(Integer orderNumber) {
this.orderNumber = orderNumber;
}
/**
* @return the active
*/
@Column(name="active",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Boolean getActive() {
return active;
}
/**
* @param active the active to set
*/
public void setActive(Boolean active) {
this.active = active;
}
}

View File

@ -0,0 +1,108 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import net.forwardfire.vasc.annotations.VascDisplayName;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
/**
* LogRightRole
*
* @author Willem Cazander
* @version 1.0 Jun 24, 2010
*/
@Entity
@Table(name = "log_right_role")
@SequenceGenerator(name="LOG_RIGHT_ROLE_ID_SEQ", sequenceName="log_right_role_id_seq",allocationSize=1)
@Cache(usage=CacheConcurrencyStrategy.NONE)
public class LogRightRole extends AbstractEntityBase {
private static final long serialVersionUID = 10L;
private Integer id = null;
private String roleKey = null;
private Date createdDate = null;
/**
* @return the id
*/
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="LOG_RIGHT_ROLE_ID_SEQ")
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the roleKey
*/
@VascDisplayName
@Column(name="role_key",nullable=false)
public String getRoleKey() {
return roleKey;
}
/**
* @param roleKey the roleKey to set
*/
public void setRoleKey(String roleKey) {
this.roleKey = roleKey;
}
/**
* @return the createdDate
*/
@Column(name="created_date",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Date getCreatedDate() {
return createdDate;
}
/**
* @param createdDate the createdDate to set
*/
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
}

View File

@ -0,0 +1,122 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import net.forwardfire.vasc.annotations.VascDisplayName;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
/**
* LogServerRun
*
* @author Willem Cazander
* @version 1.0 Jun 29, 2010
*/
@Entity
@Table(name = "log_server_run")
@SequenceGenerator(name="LOG_SERVER_RUN_ID_SEQ", sequenceName="log_server_run_id_seq",allocationSize=1)
@Cache(usage=CacheConcurrencyStrategy.NONE)
public class LogServerRun extends AbstractEntityBase {
private static final long serialVersionUID = 10L;
private Integer id = null;
private Date startDate = null;
private Date stopDate = null;
private Long lastDataId = null;
/**
* @return the id
*/
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="LOG_SERVER_RUN_ID_SEQ")
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the startDate
*/
@Column(name="start_date",nullable=false)
@VascDisplayName
public Date getStartDate() {
return startDate;
}
/**
* @param startDate the startDate to set
*/
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
/**
* @return the stopDate
*/
@Column(name="stop_date",nullable=false)
public Date getStopDate() {
return stopDate;
}
/**
* @param stopDate the stopDate to set
*/
public void setStopDate(Date stopDate) {
this.stopDate = stopDate;
}
/**
* @return the lastDataId
*/
@Column(name="last_data_id",nullable=false)
public Long getLastDataId() {
return lastDataId;
}
/**
* @param lastDataId the lastDataId to set
*/
public void setLastDataId(Long lastDataId) {
this.lastDataId = lastDataId;
}
}

View File

@ -0,0 +1,106 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import net.forwardfire.vasc.annotations.VascDisplayName;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
/**
* LogSource
*
* @author Willem Cazander
* @version 1.0 Jun 13, 2010
*/
@Entity
@Table(name = "log_source")
@SequenceGenerator(name="LOG_SOURCE_ID_SEQ", sequenceName="log_source_id_seq",allocationSize=1)
@Cache(usage=CacheConcurrencyStrategy.NONE)
public class LogSource extends AbstractEntityBase {
private static final long serialVersionUID = 10L;
private Integer id = null;
private String source = null;
private Boolean active = null;
/**
* @return the id
*/
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="LOG_SOURCE_ID_SEQ")
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the source
*/
@Column(name="source",nullable=false)
@VascDisplayName
public String getSource() {
return source;
}
/**
* @param source the source to set
*/
public void setSource(String source) {
this.source = source;
}
/**
* @return the active
*/
@Column(name="active",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Boolean getActive() {
return active;
}
/**
* @param active the active to set
*/
public void setActive(Boolean active) {
this.active = active;
}
}

View File

@ -0,0 +1,320 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.ResultCheckStyle;
import org.hibernate.annotations.SQLInsert;
import net.forwardfire.vasc.annotations.VascDisplayName;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
/**
* LogStats
*
* @author Willem Cazander
* @version 1.0 Jun 13, 2010
*/
@Entity
@Table(name = "log_stats")
@SequenceGenerator(name="LOG_STATS_ID_SEQ", sequenceName="log_stats_id_seq",allocationSize=1)
@Cache(usage=CacheConcurrencyStrategy.NONE)
@org.hibernate.annotations.Entity(selectBeforeUpdate=true,dynamicInsert=true,dynamicUpdate=true)
@SQLInsert(sql="SQL GENERATED BY dynamicInsert=true",check=ResultCheckStyle.NONE)
public class LogStats extends AbstractEntityBase {
private static final long serialVersionUID = 10L;
private Integer id = null;
private Date logDay = null;
private Integer logHostId = null;
private String logHost = null;
private Integer logSourceId = null;
private String logSource = null;
private Integer logValueId = null;
private String logValue = null;
private Integer timeTotal = null;
private Integer timeMin = null;
private Integer timeMax = null;
private Integer timeAvg = null;
private Integer valueCount = null;
private String valueText = null;
private Date createdDate = null;
private Date modifiedDate = null;
/**
* @return the id
*/
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="LOG_STATS_ID_SEQ")
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the logDay
*/
@Column(name="log_day",nullable=false)
@VascDisplayName
public Date getLogDay() {
return logDay;
}
/**
* @param logDay the logDay to set
*/
public void setLogDay(Date logDay) {
this.logDay = logDay;
}
/**
* @return the logHostId
*/
@Column(name="log_host_id",nullable=true)
public Integer getLogHostId() {
return logHostId;
}
/**
* @param logHostId the logHostId to set
*/
public void setLogHostId(Integer logHostId) {
this.logHostId = logHostId;
}
/**
* @return the logHost
*/
@Column(name="log_host",nullable=false)
public String getLogHost() {
return logHost;
}
/**
* @param logHost the logHost to set
*/
public void setLogHost(String logHost) {
this.logHost = logHost;
}
/**
* @return the logSourceId
*/
@Column(name="log_source_id",nullable=true)
public Integer getLogSourceId() {
return logSourceId;
}
/**
* @param logSourceId the logSourceId to set
*/
public void setLogSourceId(Integer logSourceId) {
this.logSourceId = logSourceId;
}
/**
* @return the logSource
*/
@Column(name="log_source",nullable=false)
public String getLogSource() {
return logSource;
}
/**
* @param logSource the logSource to set
*/
public void setLogSource(String logSource) {
this.logSource = logSource;
}
/**
* @return the logValueId
*/
@Column(name="log_value_id",nullable=true)
public Integer getLogValueId() {
return logValueId;
}
/**
* @param logValueId the logValueId to set
*/
public void setLogValueId(Integer logValueId) {
this.logValueId = logValueId;
}
/**
* @return the logValue
*/
@Column(name="log_value",nullable=false)
public String getLogValue() {
return logValue;
}
/**
* @param logValue the logValue to set
*/
public void setLogValue(String logValue) {
this.logValue = logValue;
}
/**
* @return the timeTotal
*/
@Column(name="time_total",nullable=false)
public Integer getTimeTotal() {
return timeTotal;
}
/**
* @param timeTotal the timeTotal to set
*/
public void setTimeTotal(Integer timeTotal) {
this.timeTotal = timeTotal;
}
/**
* @return the timeMin
*/
@Column(name="time_min",nullable=true)
public Integer getTimeMin() {
return timeMin;
}
/**
* @param timeMin the timeMin to set
*/
public void setTimeMin(Integer timeMin) {
this.timeMin = timeMin;
}
/**
* @return the timeMax
*/
@Column(name="time_max",nullable=true)
public Integer getTimeMax() {
return timeMax;
}
/**
* @param timeMax the timeMax to set
*/
public void setTimeMax(Integer timeMax) {
this.timeMax = timeMax;
}
/**
* @return the timeAvg
*/
@Column(name="time_avg",nullable=true)
public Integer getTimeAvg() {
return timeAvg;
}
/**
* @param timeAvg the timeAvg to set
*/
public void setTimeAvg(Integer timeAvg) {
this.timeAvg = timeAvg;
}
/**
* @return the valueCount
*/
@Column(name="value_count",nullable=false)
public Integer getValueCount() {
return valueCount;
}
/**
* @param valueCount the valueCount to set
*/
public void setValueCount(Integer valueCount) {
this.valueCount = valueCount;
}
/**
* @return the valueText
*/
@Column(name="value_text",nullable=false)
public String getValueText() {
return valueText;
}
/**
* @param valueText the valueText to set
*/
public void setValueText(String valueText) {
this.valueText = valueText;
}
/**
* @return the createdDate
*/
@Column(name="created_date",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Date getCreatedDate() {
return createdDate;
}
/**
* @param createdDate the createdDate to set
*/
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
/**
* @return the modifiedDate
*/
@Column(name="modified_date",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Date getModifiedDate() {
return modifiedDate;
}
/**
* @param modifiedDate the modifiedDate to set
*/
public void setModifiedDate(Date modifiedDate) {
this.modifiedDate = modifiedDate;
}
}

View File

@ -0,0 +1,173 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import net.forwardfire.vasc.annotations.VascDisplayName;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
/**
* LogUser
*
* @author Willem Cazander
* @version 1.0 Jun 24, 2010
*/
@Entity
@Table(name = "log_user")
@SequenceGenerator(name="LOG_USER_ID_SEQ", sequenceName="log_user_id_seq",allocationSize=1)
@Cache(usage=CacheConcurrencyStrategy.NONE)
public class LogUser extends AbstractEntityBase {
private static final long serialVersionUID = 10L;
private Integer id = null;
private String username = null;
private String password = null;
private Boolean active = null;
private String i18nLocale = null;
private Date createdDate = null;
private Date modifiedDate = null;
/**
* @return the id
*/
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="LOG_USER_ID_SEQ")
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the username
*/
@VascDisplayName
@Column(name="username",nullable=false)
public String getUsername() {
return username;
}
/**
* @param username the username to set
*/
public void setUsername(String username) {
this.username = username;
}
/**
* @return the password
*/
@Column(name="password",nullable=false)
public String getPassword() {
return password;
}
/**
* @param password the password to set
*/
public void setPassword(String password) {
this.password = password;
}
/**
* @return the active
*/
@Column(name="active",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Boolean getActive() {
return active;
}
/**
* @param active the active to set
*/
public void setActive(Boolean active) {
this.active = active;
}
/**
* @return the i18nLocale
*/
@Column(name="i18n_locale",nullable=false)
public String getI18nLocale() {
return i18nLocale;
}
/**
* @param i18nLocale the i18nLocale to set
*/
public void setI18nLocale(String i18nLocale) {
this.i18nLocale = i18nLocale;
}
/**
* @return the createdDate
*/
@Column(name="created_date",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Date getCreatedDate() {
return createdDate;
}
/**
* @param createdDate the createdDate to set
*/
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
/**
* @return the modifiedDate
*/
@Column(name="modified_date",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Date getModifiedDate() {
return modifiedDate;
}
/**
* @param modifiedDate the modifiedDate to set
*/
public void setModifiedDate(Date modifiedDate) {
this.modifiedDate = modifiedDate;
}
}

View File

@ -0,0 +1,133 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import net.forwardfire.vasc.annotations.VascDisplayName;
import net.forwardfire.vasc.annotations.VascField;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
import net.forwardfire.vasc.annotations.VascModelReference;
/**
* LogUserRightRole
*
* @author Willem Cazander
* @version 1.0 Jun 24, 2010
*/
@Entity
@Table(name = "log_user_right_role")
@SequenceGenerator(name="LOG_USER_RIGHT_ROLE_ID_SEQ", sequenceName="log_user_right_role_id_seq",allocationSize=1)
@Cache(usage=CacheConcurrencyStrategy.NONE)
public class LogUserRightRole extends AbstractEntityBase {
private static final long serialVersionUID = 10L;
private Integer id = null;
private LogUser logUser = null;
private LogRightRole logRightRole = null;
private Date createdDate = null;
/**
* @return the id
*/
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="LOG_USER_RIGHT_ROLE_ID_SEQ")
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the logUser
*/
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="log_user_id",nullable=false)
@VascModelReference
@VascField(edit=false,create=false)
public LogUser getLogUser() {
return logUser;
}
/**
* @param logUser the logUser to set
*/
public void setLogUser(LogUser logUser) {
this.logUser = logUser;
}
/**
* @return the logRightRole
*/
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="log_right_role_id",nullable=false)
@VascModelReference
@VascDisplayName
public LogRightRole getLogRightRole() {
return logRightRole;
}
/**
* @param logRightRole the logRightRole to set
*/
public void setLogRightRole(LogRightRole logRightRole) {
this.logRightRole = logRightRole;
}
/**
* @return the createdDate
*/
@Column(name="created_date",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Date getCreatedDate() {
return createdDate;
}
/**
* @param createdDate the createdDate to set
*/
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
}

View File

@ -0,0 +1,164 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import net.forwardfire.vasc.annotations.VascField;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
import net.forwardfire.vasc.annotations.VascModelReference;
/**
* LogUserSetting
*
* @author Willem Cazander
* @version 1.0 Jun 24, 2010
*/
@Entity
@Table(name = "log_user_setting")
@SequenceGenerator(name="LOG_USER_SETTING_ID_SEQ", sequenceName="log_user_setting_id_seq",allocationSize=1)
@Cache(usage=CacheConcurrencyStrategy.NONE)
public class LogUserSetting extends AbstractEntityBase {
private static final long serialVersionUID = 10L;
private Integer id = null;
private LogUser logUser = null;
private String name = null;
private String value = null;
private Date createdDate = null;
private Date modifiedDate = null;
/**
* @return the id
*/
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="LOG_USER_SETTING_ID_SEQ")
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the logUser
*/
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="log_user_id",nullable=false)
@VascField(list=false)
@VascModelReference
public LogUser getLogUser() {
return logUser;
}
/**
* @param logUser the logUser to set
*/
public void setLogUser(LogUser logUser) {
this.logUser = logUser;
}
/**
* @return the name
*/
@Column(name="name",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the value
*/
@Column(name="value",nullable=false)
public String getValue() {
return value;
}
/**
* @param value the value to set
*/
public void setValue(String value) {
this.value = value;
}
/**
* @return the createdDate
*/
@Column(name="created_date",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Date getCreatedDate() {
return createdDate;
}
/**
* @param createdDate the createdDate to set
*/
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
/**
* @return the modifiedDate
*/
@Column(name="modified_date",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Date getModifiedDate() {
return modifiedDate;
}
/**
* @param modifiedDate the modifiedDate to set
*/
public void setModifiedDate(Date modifiedDate) {
this.modifiedDate = modifiedDate;
}
}

View File

@ -0,0 +1,143 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
import net.forwardfire.vasc.annotations.VascModelReference;
/**
* LogValue
*
* @author Willem Cazander
* @version 1.0 Jun 09, 2010
*/
@Entity
@Table(name = "log_value")
@SequenceGenerator(name="LOG_VALUE_ID_SEQ", sequenceName="log_value_id_seq",allocationSize=1)
@Cache(usage=CacheConcurrencyStrategy.NONE)
public class LogValue extends AbstractEntityBase {
private static final long serialVersionUID = 10L;
private Integer id = null;
private String name = null;
private String description = null;
private Boolean active = null;
private LogValueType logValueType = null;
/**
* @return the id
*/
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="LOG_VALUE_ID_SEQ")
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the name
*/
@Column(name="name",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the description
*/
@Column(name="description",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public String getDescription() {
return description;
}
/**
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return the active
*/
@Column(name="active",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Boolean getActive() {
return active;
}
/**
* @param active the active to set
*/
public void setActive(Boolean active) {
this.active = active;
}
/**
* @return the logValueType
*/
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="log_value_type_id",nullable=false)
@VascModelReference
public LogValueType getLogValueType() {
return logValueType;
}
/**
* @param logValueType the logValueType to set
*/
public void setLogValueType(LogValueType logValueType) {
this.logValueType = logValueType;
}
}

View File

@ -0,0 +1,284 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import net.forwardfire.vasc.annotations.VascDefaultValue;
import net.forwardfire.vasc.annotations.VascDisplayName;
import net.forwardfire.vasc.annotations.VascField;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
import net.forwardfire.vasc.annotations.VascModelReference;
/**
* LogValueLine
*
* @author Willem Cazander
* @version 1.0 Jun 09, 2010
*/
@Entity
@Table(name = "log_value_line")
@SequenceGenerator(name="LOG_VALUE_LINE_ID_SEQ", sequenceName="log_value_line_id_seq",allocationSize=1)
@Cache(usage=CacheConcurrencyStrategy.NONE)
public class LogValueLine extends AbstractEntityBase {
private static final long serialVersionUID = 10L;
private Integer id = null;
private Boolean active = null;
private LogHost logHost = null;
private LogValue logValue = null;
private LogLevel logLevel = null;
private LogSource logSource = null;
private String matchRegex = null;
private String splitRegex = null;
private Integer timeIndexNumber = null;
private Integer valueIndexNumber = null;
private Integer valueMinimal = null;
private Date startDate = null;
private Date stopDate = null;
/**
* @return the id
*/
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="LOG_VALUE_LINE_ID_SEQ")
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the active
*/
@Column(name="active",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Boolean getActive() {
return active;
}
/**
* @param active the active to set
*/
public void setActive(Boolean active) {
this.active = active;
}
/**
* @return the splitRegex
*/
@Column(name="split_regex",nullable=false)
@VascDisplayName
@VascDefaultValue(value="\\s")
public String getSplitRegex() {
return splitRegex;
}
/**
* @param splitRegex the splitRegex to set
*/
public void setSplitRegex(String splitRegex) {
this.splitRegex = splitRegex;
}
/**
* @return the matchRegex
*/
@Column(name="match_regex",nullable=false)
public String getMatchRegex() {
return matchRegex;
}
/**
* @param matchRegex the matchRegex to set
*/
public void setMatchRegex(String matchRegex) {
this.matchRegex = matchRegex;
}
/**
* @return the timeIndexNumber
*/
@Column(name="time_index_number",nullable=false)
public Integer getTimeIndexNumber() {
return timeIndexNumber;
}
/**
* @param timeIndexNumber the timeIndexNumber to set
*/
public void setTimeIndexNumber(Integer timeIndexNumber) {
this.timeIndexNumber = timeIndexNumber;
}
/**
* @return the valueIndexNumber
*/
@Column(name="value_index_number",nullable=false)
public Integer getValueIndexNumber() {
return valueIndexNumber;
}
/**
* @param valueIndexNumber the valueIndexNumber to set
*/
public void setValueIndexNumber(Integer valueIndexNumber) {
this.valueIndexNumber = valueIndexNumber;
}
/**
* @return the valueMinimal
*/
@Column(name="value_minimal",nullable=true)
public Integer getValueMinimal() {
return valueMinimal;
}
/**
* @param valueMinimal the valueMinimal to set
*/
public void setValueMinimal(Integer valueMinimal) {
this.valueMinimal = valueMinimal;
}
/**
* @return the startDate
*/
@Column(name="start_date",nullable=true)
public Date getStartDate() {
return startDate;
}
/**
* @param startDate the startDate to set
*/
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
/**
* @return the stopDate
*/
@Column(name="stop_date",nullable=true)
public Date getStopDate() {
return stopDate;
}
/**
* @param stopDate the stopDate to set
*/
public void setStopDate(Date stopDate) {
this.stopDate = stopDate;
}
/**
* @return the logHost
*/
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="log_host_id",nullable=true)
@VascModelReference
public LogHost getLogHost() {
return logHost;
}
/**
* @param logHost the logHost to set
*/
public void setLogHost(LogHost logHost) {
this.logHost = logHost;
}
/**
* @return the logValue
*/
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="log_value_id",nullable=false)
@VascModelReference
@VascField(edit=false,list=false)
public LogValue getLogValue() {
return logValue;
}
/**
* @param logValue the logValue to set
*/
public void setLogValue(LogValue logValue) {
this.logValue = logValue;
}
/**
* @return the logLevel
*/
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="log_level_id",nullable=false)
@VascModelReference
public LogLevel getLogLevel() {
return logLevel;
}
/**
* @param logLevel the logLevel to set
*/
public void setLogLevel(LogLevel logLevel) {
this.logLevel = logLevel;
}
/**
* @return the logSource
*/
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="log_source_id",nullable=false)
@VascModelReference
public LogSource getLogSource() {
return logSource;
}
/**
* @param logSource the logSource to set
*/
public void setLogSource(LogSource logSource) {
this.logSource = logSource;
}
}

View File

@ -0,0 +1,128 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.models;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import net.forwardfire.vasc.annotations.VascDisplayName;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
/**
* LogValueType
*
* @author Willem Cazander
* @version 1.0 Jun 09, 2010
*/
@Entity
@Table(name = "log_value_type")
@SequenceGenerator(name="LOG_VALUE_TYPE_ID_SEQ", sequenceName="log_value_type_id_seq",allocationSize=1)
@Cache(usage=CacheConcurrencyStrategy.NONE)
public class LogValueType extends AbstractEntityBase {
private static final long serialVersionUID = 10L;
private Integer id = null;
private String valueType = null;
private Integer orderNumber = null;
private Boolean active = null;
public static final String VALUE_AVG = "VALUE_AVG"; // value and time , time avg
public static final String VALUE_COUNT = "VALUE_COUNT"; // value only , count hits.
public static final String VALUE_SUM = "VALUE_SUM"; // value only , sum hits
public static final String VALUE_TIME = "VALUE_TIME"; // value and time , sum time ?
/**
* @return the id
*/
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="LOG_VALUE_TYPE_ID_SEQ")
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the valueType
*/
@Column(name="value_type",nullable=false)
@VascDisplayName
public String getValueType() {
return valueType;
}
/**
* @param valueType the valueType to set
*/
public void setValueType(String valueType) {
this.valueType = valueType;
}
/**
* @return the orderNumber
*/
@Column(name="order_number",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Integer getOrderNumber() {
return orderNumber;
}
/**
* @param orderNumber the orderNumber to set
*/
public void setOrderNumber(Integer orderNumber) {
this.orderNumber = orderNumber;
}
/**
* @return the active
*/
@Column(name="active",nullable=false)
@VascFieldTemplate(templateClass=AbstractFieldTemplates.class)
public Boolean getActive() {
return active;
}
/**
* @param active the active to set
*/
public void setActive(Boolean active) {
this.active = active;
}
}

View File

@ -0,0 +1,151 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.services;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
//import javax.annotation.security.RolesAllowed;
import javax.ejb.EJB;
import javax.ejb.SessionContext;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import net.forwardfire.logstats.ejb.models.LogRightRole;
import net.forwardfire.logstats.ejb.models.LogUser;
import net.forwardfire.logstats.ejb.models.LogUserRightRole;
import net.forwardfire.vasc.xpql.ejb3.XpqlQueryManager;
import net.forwardfire.vasc.xpql.query.Query;
/**
* An simple ejb bean to force an login.
*
* @author Willem Cazander
* @version 1.0 16 Jul 2007
*/
@Stateless(name="ejb/loginManager")
public class LoginManager implements LoginManagerRemote {
@Resource
private SessionContext session;
@EJB(beanInterface=XpqlQueryManager.ILocal.class)
private XpqlQueryManager xtesManager;
@PersistenceContext
private EntityManager entityManager;
/**
* Tests for the login role
*/
//@RolesAllowed("login")
public String doClientLogin() {
/*
FlowUser u = null;
try {
u = getUser();
} catch (Exception e) {
throw new IllegalStateException("Could not lookup user from username: "+session.getCallerPrincipal().getName());
}
FlowUserSession us = new FlowUserSession();
us.setLoginDate(new Date());
us.setLogoutDate(null); // set when doing doClientLogout();
// current_time_in_secs + str_to_int(username)*10E20
long timeSS = us.getLoginDate().getTime();
int userSS = hashUserName(u.getUsername());
int modSS = 10230;
long sessionId = timeSS+userSS*modSS;
us.setSessionHash(sessionId+"");
//System.out.println("Created sessionId: timeSS: "+timeSS+" userSS: "+userSS+" modSS: "+modSS);
us.setFlowUser(u);
entityManager.persist(us);
return u.getUsername();
*/
return "";
}
//@RolesAllowed("login")
public void doClientLogout() {
try {
/*
Query q2 = xtesManager.getQuery("FlowUserSession.getLastestByUserName");
q2.setQueryParameter("username", session.getCallerPrincipal().getName());
q2.setProperty("limit", 1);
FlowUserSession userSession = (FlowUserSession)xtesManager.executeObject(q2);
userSession.setLogoutDate(new Date());
entityManager.merge(userSession);
*/
} catch (Exception e) {
e.printStackTrace();
}
}
private int hashUserName(String userName) {
int result = 0;
for (char c:userName.toCharArray()) {
result+=c;
}
return result;
}
/**
* Gets the currenly auth user
*/
//@RolesAllowed("login")
public LogUser getUser() throws Exception {
if (session.getCallerPrincipal()==null) {
return null;
}
Query q = xtesManager.getQuery("LogUser.getByUsername");
q.setQueryParameter("username", session.getCallerPrincipal().getName());
return (LogUser)xtesManager.executeObject(q);
}
/**
* Fetched the roles for the logged in client
* @return
*/
//@RolesAllowed("login")
public List<LogRightRole> getClientRoles() throws Exception {
List<LogRightRole> result = new ArrayList<LogRightRole>(5);
Query q = xtesManager.getQuery("LogRightRole.getAllByUsername");
q.setQueryParameter("username", session.getCallerPrincipal().getName());
List<Object> list = xtesManager.execute(q);
for (Object o:list) {
LogRightRole rr = ((LogRightRole)o);
result.add(rr);
}
return result;
}
}

View File

@ -0,0 +1,49 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.services;
import java.util.List;
import javax.ejb.Remote;
import net.forwardfire.logstats.ejb.models.LogRightRole;
import net.forwardfire.logstats.ejb.models.LogUser;
/**
* Remote exported method to force clients to login.
*
* @author Willem Cazander
* @version 1.0 16 Jul 2007
*/
@Remote
public interface LoginManagerRemote {
public String doClientLogin();
public void doClientLogout();
public LogUser getUser() throws Exception;
public List<LogRightRole> getClientRoles() throws Exception;
}

View File

@ -0,0 +1,82 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.services;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import net.forwardfire.logstats.ejb.jobs.UpdateIndexJob;
import net.forwardfire.logstats.ejb.models.LogData;
import net.forwardfire.vasc.xpql.ejb3.XpqlQueryManager;
/**
* An simple ejb bean to get wiki pages
*
* @author Willem Cazander
* @version 1.0 9 Nov 2009
*/
@Stateless(name="ejb/serverManager")
public class ServerManager implements ServerManagerRemote {
@EJB(beanInterface=XpqlQueryManager.ILocal.class)
private XpqlQueryManager xtesManager;
@PersistenceContext
private EntityManager entityManager;
public List<LogData> getRealTimeLogData() {
List<LogData> result = new ArrayList<LogData>(200);
result.addAll(UpdateIndexJob.logDataRealtime);
return result;
}
/*
public ServerWikiPage getWikiPage(String name) {
Map<String,Object> para = new HashMap<String,Object>(1);
para.put("name_url", name);
ServerWikiPage result = null;
try {
result = (ServerWikiPage)xtesManager.executeObject("ServerWikiPage.getByNameUrl", para);
} catch (NoResultException ee) {
} catch (Exception e) {
e.printStackTrace();//TODO Auto-generated catch block
}
return result;
}
public List<ServerWikiPageHistory> getWikiPageHistory(Integer serverWikiPageId) {
List<ServerWikiPageHistory> result = new ArrayList<ServerWikiPageHistory>(1);
return result;
}
*/
}

View File

@ -0,0 +1,52 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.ejb.services;
import java.util.Date;
import java.util.List;
import javax.ejb.Remote;
import net.forwardfire.logstats.ejb.models.LogData;
/**
* Remote exported method to get wiki pages
*
* @author Willem Cazander
* @version 1.0 09 Nov 2009
*/
@Remote
public interface ServerManagerRemote {
//public void updateIndex(Date startDate);
public List<LogData> getRealTimeLogData();
/*
public ServerWikiPage getWikiPage(String name);
public List<ServerWikiPageHistory> getWikiPageHistory(Integer serverWikiPageId);
*/
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
<description>logstats-ejb</description>
<display-name>logstats-ejb</display-name>
</ejb-jar>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<jboss>
<enterprise-beans>
<message-driven>
<ejb-name>UpdateIndexJob</ejb-name>
<resource-adapter-name>quartz-ra.rar</resource-adapter-name>
</message-driven>
<!--
<session>
<ejb-name>xpqlQueryManager</ejb-name>
<business-remote>net.forwardfire.xtes.xpql.ejb3.XpqlQueryManagerRemote</business-remote>
<ejb-class>net.forwardfire.vasc.xpql.ejb3.XpqlQueryManager</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
<ejb-ref>
<ejb-ref-name>ejb/xpqlQueryManager</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<remote>net.forwardfire.vasc.xpql.ejb3.XpqlQueryManagerRemote</remote>
<ejb-link>xpqlQueryManager</ejb-link>
<injection-target>xpqlQueryManager</injection-target>
</ejb-ref>
</session>
-->
</enterprise-beans>
</jboss>

View File

@ -0,0 +1,23 @@
<?xml version="1.0"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="logstats" transaction-type="JTA" >
<jta-data-source>java:logstats_dba</jta-data-source>
<properties>
<property name="jboss.entity.manager.factory.jndi.name" value="java:/logstats_pu_factory"/>
<property name="jboss.entity.manager.jndi.name" value="java:/logstats_pu"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<!-- Print SQL to stdout. -->
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
</properties>
</persistence-unit>
</persistence>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>
Files to load
</comment>
<entry key="load.1">net/forwardfire/logstats/resources/vasc/logstats.xml</entry>
<entry key="persistenceUnit">java:/logstats_pu</entry>
<entry key="xpqlController">logstats-jboss/ejb/xpqlQueryManager/local</entry>
<entry key="i18nBundle">net/forwardfire/logstats/resources/i18n/LogstatsBundleEJB</entry>
</properties>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>
Files to load
</comment>
<entry key="load.1">net/forwardfire/logstats/resources/xpql/logstats.xml</entry>
<entry key="persistenceUnit">java:/logstats_pu</entry>
</properties>

View File

@ -0,0 +1,173 @@
generic.active.labelText = active
generic.active.toolTipText = active
generic.createdDate.labelText = createdDate
generic.createdDate.toolTipText = createdDate
generic.description.labelText = description
generic.description.toolTipText = description
generic.id.labelText = id
generic.id.toolTipText = id
generic.modifiedDate.labelText = modifiedDate
generic.modifiedDate.toolTipText = modifiedDate
generic.name.labelText = name
generic.name.toolTipText = name
generic.orderNumber.labelText = orderNumber
generic.orderNumber.toolTipText = orderNumber
# hibernate validators
validator.assertFalse=assertion failed
validator.assertTrue=assertion failed
validator.future=Date must lie in the future
validator.length=Field must contain between {min} and {max} characters.
validator.max=Value must be equal to or lower than {value}
validator.min=Value must be equal to or higher than {value}
validator.notNull=A value must be entered
validator.past=Date must lie in the future
validator.pattern=Value must conform to "{regex}"
validator.range=Value must lie between {min} and {max}
validator.size=There must be between {min} and {max} characters
validator.email=The value must be a valid e-mail address
# vasc validators
vasc.validator.VascDateFutureValidator=The date must lie in the future.
vasc.validator.VascDatePastValidator=The date must lie in the past.
vasc.validator.VascIntSizeValidator=Value must lie between {0} and {1}
vasc.validator.VascLongSizeValidator=Value must lie between {0} and {1}
vasc.validator.VascObjectNotNullValidator=A value must be entered
vasc.validator.VascObjectNullValidator=No value may be entered
vasc.validator.VascStringEmailValidator=The value must be a valid e-mail address
vasc.validator.VascStringLengthValidator=There must be at least {0} and at most {1} items
vasc.validator.VascStringRegexValidator=Value must conform to "{0}"
vasc.validator.VascStringZipCodeValidator=Value must be a valid post code.
# Vasc actions labels
vasc.action.addRowAction.description = add a new record
vasc.action.addRowAction.name = Add
vasc.action.csvExportAction.description = CSV
vasc.action.csvExportAction.name = CSV
vasc.action.xmlExportAction.description = XML
vasc.action.xmlExportAction.name = XML
vasc.action.deleteRowAction.description = delete
vasc.action.deleteRowAction.name = delete
vasc.action.downloadAction.description = Select this record.
vasc.action.downloadAction.name = Select
vasc.action.editRowAction.description = edit
vasc.action.editRowAction.name = Edit
vasc.entry.logDataLastDay.listDescription = View logDataLastDay
vasc.entry.logDataLastDay.name = logDataLastDay
vasc.entry.logHostAdmin.listDescription = View logHostAdmin
vasc.entry.logHostAdmin.name = logHostAdmin
vasc.entry.logHostGroupAdmin.listDescription = View logHostGroupAdmin
vasc.entry.logHostGroupAdmin.name = logHostGroupAdmin
vasc.entry.logLevelAdmin.listDescription = View logLevelAdmin
vasc.entry.logLevelAdmin.name = logLevelAdmin
vasc.entry.logRightRoleAdmin.listDescription = View logRightRoleAdmin
vasc.entry.logRightRoleAdmin.name = logRightRoleAdmin
vasc.entry.logSourceAdmin.listDescription = View logSourceAdmin
vasc.entry.logSourceAdmin.name = logSourceAdmin
vasc.entry.logUserAdmin.listDescription = View logUserAdmin
vasc.entry.logUserAdmin.name = logUserAdmin
vasc.entry.logUserRightRoleLink.listDescription = View logUserRightRoleLink
vasc.entry.logUserRightRoleLink.name = logUserRightRoleLink
vasc.entry.logUserSettingLink.listDescription = View logUserSettingLink
vasc.entry.logUserSettingLink.name = logUserSettingLink
vasc.entry.logValueAdmin.listDescription = View logValueAdmin
vasc.entry.logValueAdmin.name = logValueAdmin
vasc.entry.logValueLineLink.listDescription = View logValueLineLink
vasc.entry.logValueLineLink.name = logValueLineLink
vasc.entry.logValueTypeAdmin.listDescription = View logValueTypeAdmin
vasc.entry.logValueTypeAdmin.name = logValueTypeAdmin
net.forwardfire.logstats.ejb.models.LogData.VascI18n.description = LogData
net.forwardfire.logstats.ejb.models.LogData.VascI18n.name = LogData
net.forwardfire.logstats.ejb.models.LogData.hostname.VascI18n.description = hostname
net.forwardfire.logstats.ejb.models.LogData.hostname.VascI18n.name = hostname
net.forwardfire.logstats.ejb.models.LogData.logDate.VascI18n.description = logDate
net.forwardfire.logstats.ejb.models.LogData.logDate.VascI18n.name = logDate
net.forwardfire.logstats.ejb.models.LogData.logLevel.VascI18n.description = logLevel
net.forwardfire.logstats.ejb.models.LogData.logLevel.VascI18n.name = logLevel
net.forwardfire.logstats.ejb.models.LogData.message.VascI18n.description = message
net.forwardfire.logstats.ejb.models.LogData.message.VascI18n.name = message
net.forwardfire.logstats.ejb.models.LogData.source.VascI18n.description = source
net.forwardfire.logstats.ejb.models.LogData.source.VascI18n.name = source
net.forwardfire.logstats.ejb.models.LogHost.VascI18n.description = LogHost
net.forwardfire.logstats.ejb.models.LogHost.VascI18n.name = LogHost
net.forwardfire.logstats.ejb.models.LogHost.hostname.VascI18n.description = hostname
net.forwardfire.logstats.ejb.models.LogHost.hostname.VascI18n.name = hostname
net.forwardfire.logstats.ejb.models.LogHostGroup.VascI18n.description = logHostGroup
net.forwardfire.logstats.ejb.models.LogHostGroup.VascI18n.name = logHostGroup
net.forwardfire.logstats.ejb.models.LogLevel.VascI18n.description = LogLevel
net.forwardfire.logstats.ejb.models.LogLevel.VascI18n.name = LogLevel
net.forwardfire.logstats.ejb.models.LogLevel.levelNumber.VascI18n.description = levelNumber
net.forwardfire.logstats.ejb.models.LogLevel.levelNumber.VascI18n.name = levelNumber
net.forwardfire.logstats.ejb.models.LogLevel.levelType.VascI18n.description = levelType
net.forwardfire.logstats.ejb.models.LogLevel.levelType.VascI18n.name = levelType
net.forwardfire.logstats.ejb.models.LogRightRole.VascI18n.description = LogRightRole
net.forwardfire.logstats.ejb.models.LogRightRole.VascI18n.name = LogRightRole
net.forwardfire.logstats.ejb.models.LogRightRole.roleKey.VascI18n.description = roleKey
net.forwardfire.logstats.ejb.models.LogRightRole.roleKey.VascI18n.name = roleKey
net.forwardfire.logstats.ejb.models.LogSource.VascI18n.description = LogSource
net.forwardfire.logstats.ejb.models.LogSource.VascI18n.name = LogSource
net.forwardfire.logstats.ejb.models.LogSource.source.VascI18n.description = source
net.forwardfire.logstats.ejb.models.LogSource.source.VascI18n.name = source
net.forwardfire.logstats.ejb.models.LogStats.VascI18n.description = LogStats
net.forwardfire.logstats.ejb.models.LogStats.VascI18n.name = LogStats
net.forwardfire.logstats.ejb.models.LogStats.logDay.VascI18n.description = logDay
net.forwardfire.logstats.ejb.models.LogStats.logDay.VascI18n.name = logDay
net.forwardfire.logstats.ejb.models.LogStats.logHost.VascI18n.description = logHost
net.forwardfire.logstats.ejb.models.LogStats.logHost.VascI18n.name = logHost
net.forwardfire.logstats.ejb.models.LogStats.logHostId.VascI18n.description = logHostId
net.forwardfire.logstats.ejb.models.LogStats.logHostId.VascI18n.name = logHostId
net.forwardfire.logstats.ejb.models.LogStats.logSource.VascI18n.description = logSource
net.forwardfire.logstats.ejb.models.LogStats.logSource.VascI18n.name = logSource
net.forwardfire.logstats.ejb.models.LogStats.logSourceId.VascI18n.description = logSourceId
net.forwardfire.logstats.ejb.models.LogStats.logSourceId.VascI18n.name = logSourceId
net.forwardfire.logstats.ejb.models.LogStats.logValue.VascI18n.description = logValue
net.forwardfire.logstats.ejb.models.LogStats.logValue.VascI18n.name = logValue
net.forwardfire.logstats.ejb.models.LogStats.logValueId.VascI18n.description = logValueId
net.forwardfire.logstats.ejb.models.LogStats.logValueId.VascI18n.name = logValueId
net.forwardfire.logstats.ejb.models.LogStats.timeAvg.VascI18n.description = timeAvg
net.forwardfire.logstats.ejb.models.LogStats.timeAvg.VascI18n.name = timeAvg
net.forwardfire.logstats.ejb.models.LogStats.timeMax.VascI18n.description = timeMax
net.forwardfire.logstats.ejb.models.LogStats.timeMax.VascI18n.name = timeMax
net.forwardfire.logstats.ejb.models.LogStats.timeMin.VascI18n.description = timeMin
net.forwardfire.logstats.ejb.models.LogStats.timeMin.VascI18n.name = timeMin
net.forwardfire.logstats.ejb.models.LogStats.valueCount.VascI18n.description = valueCount
net.forwardfire.logstats.ejb.models.LogStats.valueCount.VascI18n.name = valueCount
net.forwardfire.logstats.ejb.models.LogStats.valueText.VascI18n.description = valueText
net.forwardfire.logstats.ejb.models.LogStats.valueText.VascI18n.name = valueText
net.forwardfire.logstats.ejb.models.LogUser.VascI18n.description = LogUser
net.forwardfire.logstats.ejb.models.LogUser.VascI18n.name = LogUser
net.forwardfire.logstats.ejb.models.LogUser.i18nLocale.VascI18n.description = i18nLocale
net.forwardfire.logstats.ejb.models.LogUser.i18nLocale.VascI18n.name = i18nLocale
net.forwardfire.logstats.ejb.models.LogUser.password.VascI18n.description = password
net.forwardfire.logstats.ejb.models.LogUser.password.VascI18n.name = password
net.forwardfire.logstats.ejb.models.LogUser.username.VascI18n.description = username
net.forwardfire.logstats.ejb.models.LogUser.username.VascI18n.name = username
net.forwardfire.logstats.ejb.models.LogUserRightRole.VascI18n.description = LogUserRightRole
net.forwardfire.logstats.ejb.models.LogUserRightRole.VascI18n.name = LogUserRightRole
net.forwardfire.logstats.ejb.models.LogUserSetting.VascI18n.description = LogUserSetting
net.forwardfire.logstats.ejb.models.LogUserSetting.VascI18n.name = LogUserSetting
net.forwardfire.logstats.ejb.models.LogUserSetting.value.VascI18n.description = value
net.forwardfire.logstats.ejb.models.LogUserSetting.value.VascI18n.name = value
net.forwardfire.logstats.ejb.models.LogValue.VascI18n.description = LogValue
net.forwardfire.logstats.ejb.models.LogValue.VascI18n.name = LogValue
net.forwardfire.logstats.ejb.models.LogValueLine.VascI18n.description = LogValueLine
net.forwardfire.logstats.ejb.models.LogValueLine.VascI18n.name = LogValueLine
net.forwardfire.logstats.ejb.models.LogValueLine.splitRegex.VascI18n.description = splitRegex
net.forwardfire.logstats.ejb.models.LogValueLine.splitRegex.VascI18n.name = splitRegex
net.forwardfire.logstats.ejb.models.LogValueLine.startDate.VascI18n.description = startDate
net.forwardfire.logstats.ejb.models.LogValueLine.startDate.VascI18n.name = startDate
net.forwardfire.logstats.ejb.models.LogValueLine.stopDate.VascI18n.description = stopDate
net.forwardfire.logstats.ejb.models.LogValueLine.stopDate.VascI18n.name = stopDate
net.forwardfire.logstats.ejb.models.LogValueLine.timeIndexNumber.VascI18n.description = timeIndexNumber
net.forwardfire.logstats.ejb.models.LogValueLine.timeIndexNumber.VascI18n.name = timeIndexNumber
net.forwardfire.logstats.ejb.models.LogValueLine.valueIndexNumber.VascI18n.description = valueIndexNumber
net.forwardfire.logstats.ejb.models.LogValueLine.valueIndexNumber.VascI18n.name = valueIndexNumber
net.forwardfire.logstats.ejb.models.LogValueLine.valueMinimal.VascI18n.description = valueMinimal
net.forwardfire.logstats.ejb.models.LogValueLine.valueMinimal.VascI18n.name = valueMinimal
net.forwardfire.logstats.ejb.models.LogValueType.VascI18n.description = logValueType
net.forwardfire.logstats.ejb.models.LogValueType.VascI18n.name = logValueType
net.forwardfire.logstats.ejb.models.LogValueType.valueType.VascI18n.description = valueType
net.forwardfire.logstats.ejb.models.LogValueType.valueType.VascI18n.name = valueType

View File

@ -0,0 +1,174 @@
generic.active.labelText = active
generic.active.toolTipText = active
generic.createdDate.labelText = createdDate
generic.createdDate.toolTipText = createdDate
generic.description.labelText = description
generic.description.toolTipText = description
generic.id.labelText = id
generic.id.toolTipText = id
generic.modifiedDate.labelText = modifiedDate
generic.modifiedDate.toolTipText = modifiedDate
generic.name.labelText = name
generic.name.toolTipText = name
generic.orderNumber.labelText = orderNumber
generic.orderNumber.toolTipText = orderNumber
# hibernate validators
validator.assertFalse=assertion failed
validator.assertTrue=assertion failed
validator.future=Date must lie in the future
validator.length=Field must contain between {min} and {max} characters.
validator.max=Value must be equal to or lower than {value}
validator.min=Value must be equal to or higher than {value}
validator.notNull=A value must be entered
validator.past=Date must lie in the future
validator.pattern=Value must conform to "{regex}"
validator.range=Value must lie between {min} and {max}
validator.size=There must be between {min} and {max} characters
validator.email=The value must be a valid e-mail address
# vasc validators
vasc.validator.VascDateFutureValidator=The date must lie in the future.
vasc.validator.VascDatePastValidator=The date must lie in the past.
vasc.validator.VascIntSizeValidator=Value must lie between {0} and {1}
vasc.validator.VascLongSizeValidator=Value must lie between {0} and {1}
vasc.validator.VascObjectNotNullValidator=A value must be entered
vasc.validator.VascObjectNullValidator=No value may be entered
vasc.validator.VascStringEmailValidator=The value must be a valid e-mail address
vasc.validator.VascStringLengthValidator=There must be at least {0} and at most {1} items
vasc.validator.VascStringRegexValidator=Value must conform to "{0}"
vasc.validator.VascStringZipCodeValidator=Value must be a valid post code.
# Vasc actions labels
vasc.action.addRowAction.description = add a new record
vasc.action.addRowAction.name = Add
vasc.action.csvExportAction.description = CSV
vasc.action.csvExportAction.name = CSV
vasc.action.xmlExportAction.description = XML
vasc.action.xmlExportAction.name = XML
vasc.action.deleteRowAction.description = delete
vasc.action.deleteRowAction.name = delete
vasc.action.downloadAction.description = Select this record.
vasc.action.downloadAction.name = Select
vasc.action.editRowAction.description = edit
vasc.action.editRowAction.name = Edit
vasc.entry.logDataLastDay.listDescription = View logDataLastDay
vasc.entry.logDataLastDay.name = logDataLastDay
vasc.entry.logHostAdmin.listDescription = View logHostAdmin
vasc.entry.logHostAdmin.name = logHostAdmin
vasc.entry.logHostGroupAdmin.listDescription = View logHostGroupAdmin
vasc.entry.logHostGroupAdmin.name = logHostGroupAdmin
vasc.entry.logLevelAdmin.listDescription = View logLevelAdmin
vasc.entry.logLevelAdmin.name = logLevelAdmin
vasc.entry.logRightRoleAdmin.listDescription = View logRightRoleAdmin
vasc.entry.logRightRoleAdmin.name = logRightRoleAdmin
vasc.entry.logSourceAdmin.listDescription = View logSourceAdmin
vasc.entry.logSourceAdmin.name = logSourceAdmin
vasc.entry.logUserAdmin.listDescription = View logUserAdmin
vasc.entry.logUserAdmin.name = logUserAdmin
vasc.entry.logUserRightRoleLink.listDescription = View logUserRightRoleLink
vasc.entry.logUserRightRoleLink.name = logUserRightRoleLink
vasc.entry.logUserSettingLink.listDescription = View logUserSettingLink
vasc.entry.logUserSettingLink.name = logUserSettingLink
vasc.entry.logValueAdmin.listDescription = View logValueAdmin
vasc.entry.logValueAdmin.name = logValueAdmin
vasc.entry.logValueLineLink.listDescription = View logValueLineLink
vasc.entry.logValueLineLink.name = logValueLineLink
vasc.entry.logValueTypeAdmin.listDescription = View logValueTypeAdmin
vasc.entry.logValueTypeAdmin.name = logValueTypeAdmin
net.forwardfire.logstats.ejb.models.LogData.VascI18n.description = LogData
net.forwardfire.logstats.ejb.models.LogData.VascI18n.name = LogData
net.forwardfire.logstats.ejb.models.LogData.hostname.VascI18n.description = hostname
net.forwardfire.logstats.ejb.models.LogData.hostname.VascI18n.name = hostname
net.forwardfire.logstats.ejb.models.LogData.logDate.VascI18n.description = logDate
net.forwardfire.logstats.ejb.models.LogData.logDate.VascI18n.name = logDate
net.forwardfire.logstats.ejb.models.LogData.logLevel.VascI18n.description = logLevel
net.forwardfire.logstats.ejb.models.LogData.logLevel.VascI18n.name = logLevel
net.forwardfire.logstats.ejb.models.LogData.message.VascI18n.description = message
net.forwardfire.logstats.ejb.models.LogData.message.VascI18n.name = message
net.forwardfire.logstats.ejb.models.LogData.source.VascI18n.description = source
net.forwardfire.logstats.ejb.models.LogData.source.VascI18n.name = source
net.forwardfire.logstats.ejb.models.LogHost.VascI18n.description = LogHost
net.forwardfire.logstats.ejb.models.LogHost.VascI18n.name = LogHost
net.forwardfire.logstats.ejb.models.LogHost.hostname.VascI18n.description = hostname
net.forwardfire.logstats.ejb.models.LogHost.hostname.VascI18n.name = hostname
net.forwardfire.logstats.ejb.models.LogHostGroup.VascI18n.description = logHostGroup
net.forwardfire.logstats.ejb.models.LogHostGroup.VascI18n.name = logHostGroup
net.forwardfire.logstats.ejb.models.LogLevel.VascI18n.description = LogLevel
net.forwardfire.logstats.ejb.models.LogLevel.VascI18n.name = LogLevel
net.forwardfire.logstats.ejb.models.LogLevel.levelNumber.VascI18n.description = levelNumber
net.forwardfire.logstats.ejb.models.LogLevel.levelNumber.VascI18n.name = levelNumber
net.forwardfire.logstats.ejb.models.LogLevel.levelType.VascI18n.description = levelType
net.forwardfire.logstats.ejb.models.LogLevel.levelType.VascI18n.name = levelType
net.forwardfire.logstats.ejb.models.LogRightRole.VascI18n.description = LogRightRole
net.forwardfire.logstats.ejb.models.LogRightRole.VascI18n.name = LogRightRole
net.forwardfire.logstats.ejb.models.LogRightRole.roleKey.VascI18n.description = roleKey
net.forwardfire.logstats.ejb.models.LogRightRole.roleKey.VascI18n.name = roleKey
net.forwardfire.logstats.ejb.models.LogSource.VascI18n.description = LogSource
net.forwardfire.logstats.ejb.models.LogSource.VascI18n.name = LogSource
net.forwardfire.logstats.ejb.models.LogSource.source.VascI18n.description = source
net.forwardfire.logstats.ejb.models.LogSource.source.VascI18n.name = source
net.forwardfire.logstats.ejb.models.LogStats.VascI18n.description = LogStats
net.forwardfire.logstats.ejb.models.LogStats.VascI18n.name = LogStats
net.forwardfire.logstats.ejb.models.LogStats.logDay.VascI18n.description = logDay
net.forwardfire.logstats.ejb.models.LogStats.logDay.VascI18n.name = logDay
net.forwardfire.logstats.ejb.models.LogStats.logHost.VascI18n.description = logHost
net.forwardfire.logstats.ejb.models.LogStats.logHost.VascI18n.name = logHost
net.forwardfire.logstats.ejb.models.LogStats.logHostId.VascI18n.description = logHostId
net.forwardfire.logstats.ejb.models.LogStats.logHostId.VascI18n.name = logHostId
net.forwardfire.logstats.ejb.models.LogStats.logSource.VascI18n.description = logSource
net.forwardfire.logstats.ejb.models.LogStats.logSource.VascI18n.name = logSource
net.forwardfire.logstats.ejb.models.LogStats.logSourceId.VascI18n.description = logSourceId
net.forwardfire.logstats.ejb.models.LogStats.logSourceId.VascI18n.name = logSourceId
net.forwardfire.logstats.ejb.models.LogStats.logValue.VascI18n.description = logValue
net.forwardfire.logstats.ejb.models.LogStats.logValue.VascI18n.name = logValue
net.forwardfire.logstats.ejb.models.LogStats.logValueId.VascI18n.description = logValueId
net.forwardfire.logstats.ejb.models.LogStats.logValueId.VascI18n.name = logValueId
net.forwardfire.logstats.ejb.models.LogStats.timeAvg.VascI18n.description = timeAvg
net.forwardfire.logstats.ejb.models.LogStats.timeAvg.VascI18n.name = timeAvg
net.forwardfire.logstats.ejb.models.LogStats.timeMax.VascI18n.description = timeMax
net.forwardfire.logstats.ejb.models.LogStats.timeMax.VascI18n.name = timeMax
net.forwardfire.logstats.ejb.models.LogStats.timeMin.VascI18n.description = timeMin
net.forwardfire.logstats.ejb.models.LogStats.timeMin.VascI18n.name = timeMin
net.forwardfire.logstats.ejb.models.LogStats.valueCount.VascI18n.description = valueCount
net.forwardfire.logstats.ejb.models.LogStats.valueCount.VascI18n.name = valueCount
net.forwardfire.logstats.ejb.models.LogStats.valueText.VascI18n.description = valueText
net.forwardfire.logstats.ejb.models.LogStats.valueText.VascI18n.name = valueText
net.forwardfire.logstats.ejb.models.LogUser.VascI18n.description = LogUser
net.forwardfire.logstats.ejb.models.LogUser.VascI18n.name = LogUser
net.forwardfire.logstats.ejb.models.LogUser.i18nLocale.VascI18n.description = i18nLocale
net.forwardfire.logstats.ejb.models.LogUser.i18nLocale.VascI18n.name = i18nLocale
net.forwardfire.logstats.ejb.models.LogUser.password.VascI18n.description = password
net.forwardfire.logstats.ejb.models.LogUser.password.VascI18n.name = password
net.forwardfire.logstats.ejb.models.LogUser.username.VascI18n.description = username
net.forwardfire.logstats.ejb.models.LogUser.username.VascI18n.name = username
net.forwardfire.logstats.ejb.models.LogUserRightRole.VascI18n.description = LogUserRightRole
net.forwardfire.logstats.ejb.models.LogUserRightRole.VascI18n.name = LogUserRightRole
net.forwardfire.logstats.ejb.models.LogUserSetting.VascI18n.description = LogUserSetting
net.forwardfire.logstats.ejb.models.LogUserSetting.VascI18n.name = LogUserSetting
net.forwardfire.logstats.ejb.models.LogUserSetting.value.VascI18n.description = value
net.forwardfire.logstats.ejb.models.LogUserSetting.value.VascI18n.name = value
net.forwardfire.logstats.ejb.models.LogValue.VascI18n.description = LogValue
net.forwardfire.logstats.ejb.models.LogValue.VascI18n.name = LogValue
net.forwardfire.logstats.ejb.models.LogValueLine.VascI18n.description = LogValueLine
net.forwardfire.logstats.ejb.models.LogValueLine.VascI18n.name = LogValueLine
net.forwardfire.logstats.ejb.models.LogValueLine.splitRegex.VascI18n.description = splitRegex
net.forwardfire.logstats.ejb.models.LogValueLine.splitRegex.VascI18n.name = splitRegex
net.forwardfire.logstats.ejb.models.LogValueLine.startDate.VascI18n.description = startDate
net.forwardfire.logstats.ejb.models.LogValueLine.startDate.VascI18n.name = startDate
net.forwardfire.logstats.ejb.models.LogValueLine.stopDate.VascI18n.description = stopDate
net.forwardfire.logstats.ejb.models.LogValueLine.stopDate.VascI18n.name = stopDate
net.forwardfire.logstats.ejb.models.LogValueLine.timeIndexNumber.VascI18n.description = timeIndexNumber
net.forwardfire.logstats.ejb.models.LogValueLine.timeIndexNumber.VascI18n.name = timeIndexNumber
net.forwardfire.logstats.ejb.models.LogValueLine.valueIndexNumber.VascI18n.description = valueIndexNumber
net.forwardfire.logstats.ejb.models.LogValueLine.valueIndexNumber.VascI18n.name = valueIndexNumber
net.forwardfire.logstats.ejb.models.LogValueLine.valueMinimal.VascI18n.description = valueMinimal
net.forwardfire.logstats.ejb.models.LogValueLine.valueMinimal.VascI18n.name = valueMinimal
net.forwardfire.logstats.ejb.models.LogValueType.VascI18n.description = logValueType
net.forwardfire.logstats.ejb.models.LogValueType.VascI18n.name = logValueType
net.forwardfire.logstats.ejb.models.LogValueType.valueType.VascI18n.description = valueType
net.forwardfire.logstats.ejb.models.LogValueType.valueType.VascI18n.name = valueType

View File

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8"?>
<x4o:root xmlns:v="http://vasc.forwardfire.net/eld/vasc-lang.eld"
xmlns:x4o="http://eld.x4o.org/eld/x4o-lang.eld"
>
<v:xpqlPersistanceBackend id="logUserAdminBackend" entityManagerProvider="${entityManagerProvider}"
resultClass="net.forwardfire.logstats.ejb.models.LogUser"
query="${xpqlController['LogUser.getAll']}">
</v:xpqlPersistanceBackend>
<v:entry id="logUserAdmin" backendId="logUserAdminBackend">
<v:annotationParser className="net.forwardfire.logstats.ejb.models.LogUser"/>
<v:link id="logUserSetting" vascEntryId="logUserSettingLink">
<v:linkEntryCreateFieldValue valueFieldId="logUser"/>
<v:linkEntryParameter name="log_user_id" valueFieldId="id"/>
</v:link>
<v:link id="logUserRightRole" vascEntryId="logUserRightRoleLink">
<v:linkEntryCreateFieldValue valueFieldId="logUser"/>
<v:linkEntryParameter name="log_user_id" valueFieldId="id"/>
</v:link>
</v:entry>
<v:xpqlPersistanceBackend id="logRightRoleAdminBackend" entityManagerProvider="${entityManagerProvider}"
resultClass="net.forwardfire.logstats.ejb.models.LogRightRole"
query="${xpqlController['LogRightRole.getAll']}">
</v:xpqlPersistanceBackend>
<v:entry id="logRightRoleAdmin" backendId="logRightRoleAdminBackend" vascDisplayOnly="true">
<v:annotationParser className="net.forwardfire.logstats.ejb.models.LogRightRole"/>
</v:entry>
<v:xpqlPersistanceBackend id="logHostGroupAdminBackend" entityManagerProvider="${entityManagerProvider}"
resultClass="net.forwardfire.logstats.ejb.models.LogHostGroup"
query="${xpqlController['LogHostGroup.getAll']}">
</v:xpqlPersistanceBackend>
<v:entry id="logHostGroupAdmin" backendId="logHostGroupAdminBackend">
<v:annotationParser className="net.forwardfire.logstats.ejb.models.LogHostGroup"/>
</v:entry>
<v:xpqlPersistanceBackend id="logHostAdminBackend" entityManagerProvider="${entityManagerProvider}"
resultClass="net.forwardfire.logstats.ejb.models.LogHost"
query="${xpqlController['LogHost.getAll']}">
</v:xpqlPersistanceBackend>
<v:entry id="logHostAdmin" backendId="logHostAdminBackend">
<v:annotationParser className="net.forwardfire.logstats.ejb.models.LogHost"/>
<v:field id="logHostGroup" vascEntryFieldType="ListField">
<v:vascSelectItemModel entryId="logHostGroupAdmin" nullLabel="generic.all" nullKeyValue="-1"/>
</v:field>
</v:entry>
<v:xpqlPersistanceBackend id="logSourceAdminBackend" entityManagerProvider="${entityManagerProvider}"
resultClass="net.forwardfire.logstats.ejb.models.LogSource"
query="${xpqlController['LogSource.getAll']}">
</v:xpqlPersistanceBackend>
<v:entry id="logSourceAdmin" backendId="logSourceAdminBackend">
<v:annotationParser className="net.forwardfire.logstats.ejb.models.LogSource"/>
</v:entry>
<v:xpqlPersistanceBackend id="logValueTypeAdminBackend" entityManagerProvider="${entityManagerProvider}"
resultClass="net.forwardfire.logstats.ejb.models.LogValueType"
query="${xpqlController['LogValueType.getAll']}">
</v:xpqlPersistanceBackend>
<v:entry id="logValueTypeAdmin" backendId="logValueTypeAdminBackend" vascDisplayOnly="true">
<v:annotationParser className="net.forwardfire.logstats.ejb.models.LogValueType"/>
</v:entry>
<v:xpqlPersistanceBackend id="logLevelAdminBackend" entityManagerProvider="${entityManagerProvider}"
resultClass="net.forwardfire.logstats.ejb.models.LogLevel"
query="${xpqlController['LogLevel.getAll']}">
</v:xpqlPersistanceBackend>
<v:entry id="logLevelAdmin" backendId="logLevelAdminBackend" vascDisplayOnly="true">
<v:annotationParser className="net.forwardfire.logstats.ejb.models.LogLevel"/>
</v:entry>
<v:xpqlPersistanceBackend id="logValueAdminBackend" entityManagerProvider="${entityManagerProvider}"
resultClass="net.forwardfire.logstats.ejb.models.LogValue"
query="${xpqlController['LogValue.getAll']}">
</v:xpqlPersistanceBackend>
<v:entry id="logValueAdmin" backendId="logValueAdminBackend">
<v:annotationParser className="net.forwardfire.logstats.ejb.models.LogValue"/>
<v:field id="logValueType" vascEntryFieldType="ListField">
<v:vascSelectItemModel entryId="logValueTypeAdmin"/>
</v:field>
<v:link id="logValueLine" vascEntryId="logValueLineLink">
<v:linkEntryCreateFieldValue valueFieldId="logValue"/>
<v:linkEntryParameter name="log_value_id" valueFieldId="id"/>
</v:link>
</v:entry>
<v:xpqlPersistanceBackend id="logDataLastDayBackend" entityManagerProvider="${entityManagerProvider}"
resultClass="net.forwardfire.logstats.ejb.models.LogData"
query="${xpqlController['LogData.getLastDay']}">
</v:xpqlPersistanceBackend>
<v:entry id="logDataLastDay" backendId="logDataLastDayBackend" vascDisplayOnly="true">
<v:annotationParser className="net.forwardfire.logstats.ejb.models.LogData"/>
</v:entry>
<v:xpqlPersistanceBackend id="logServerRunLastDayBackend" entityManagerProvider="${entityManagerProvider}"
resultClass="net.forwardfire.logstats.ejb.models.LogServerRun"
query="${xpqlController['LogServerRun.getLastDay']}">
</v:xpqlPersistanceBackend>
<v:entry id="logServerRunLastDay" backendId="logServerRunLastDayBackend" vascDisplayOnly="true">
<v:annotationParser className="net.forwardfire.logstats.ejb.models.LogServerRun"/>
</v:entry>
<!-- LINKED -->
<v:xpqlPersistanceBackend id="logUserSettingLinkBackend" entityManagerProvider="${entityManagerProvider}"
resultClass="net.forwardfire.logstats.ejb.models.LogUserSetting"
query="${xpqlController['LogUserSetting.getByLogUserId']}">
</v:xpqlPersistanceBackend>
<v:entry id="logUserSettingLink" backendId="logUserSettingLinkBackend">
<v:annotationParser className="net.forwardfire.logstats.ejb.models.LogUserSetting"/>
</v:entry>
<v:xpqlPersistanceBackend id="logUserRightRoleLinkBackend" entityManagerProvider="${entityManagerProvider}"
resultClass="net.forwardfire.logstats.ejb.models.LogUserRightRole"
query="${xpqlController['LogUserRightRole.getByLogUserId']}">
</v:xpqlPersistanceBackend>
<v:entry id="logUserRightRoleLink" backendId="logUserRightRoleLinkBackend">
<v:annotationParser className="net.forwardfire.logstats.ejb.models.LogUserRightRole"/>
<v:field id="logRightRole" vascEntryFieldType="ListField">
<v:vascSelectItemModel entryId="logRightRoleAdmin"/>
</v:field>
</v:entry>
<v:xpqlPersistanceBackend id="logValueLineLinkBackend" entityManagerProvider="${entityManagerProvider}"
resultClass="net.forwardfire.logstats.ejb.models.LogValueLine"
query="${xpqlController['LogValueLine.getAllByLogValueId']}">
</v:xpqlPersistanceBackend>
<v:entry id="logValueLineLink" backendId="logValueLineLinkBackend">
<v:annotationParser className="net.forwardfire.logstats.ejb.models.LogValueLine"/>
<v:field id="logHost" vascEntryFieldType="ListField">
<v:vascSelectItemModel entryId="logHostAdmin" nullLabel="generic.all" nullKeyValue="-1"/>
</v:field>
<v:field id="logLevel" vascEntryFieldType="ListField">
<v:vascSelectItemModel entryId="logLevelAdmin" nullLabel="generic.all" nullKeyValue="-1"/>
</v:field>
<v:field id="logSource" vascEntryFieldType="ListField">
<v:vascSelectItemModel entryId="logSourceAdmin" nullLabel="generic.all" nullKeyValue="-1"/>
</v:field>
</v:entry>
</x4o:root>

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<xtes xmlns="http://xpql.vasc.forwardfire.net/eld/xpql-lang.eld"
xmlns:x4o="http://eld.x4o.org/eld/x4o-lang.eld"
>
<query name="LogUser.getAll" type="hql">
<sql>SELECT lu FROM LogUser AS lu</sql>
</query>
<query name="LogUser.getByUsername" type="hql">
<sql>
SELECT lu FROM LogUser AS lu
WHERE lu.username=<parameter name="username"/>
</sql>
<parameterValue name="username" value="1"/>
</query>
<query name="LogRightRole.getAll" type="hql">
<sql>SELECT lrr FROM LogRightRole AS lrr</sql>
</query>
<query name="LogRightRole.getAllByUsername" type="hql">
<sql>
SELECT lrr FROM LogRightRole AS lrr
WHERE lrr.id IN (SELECT lurr.logRightRole.id FROM LogUserRightRole AS lurr WHERE lurr.logUser.username=<parameter name="username"/>)
</sql>
<parameterValue name="username" value="1"/>
</query>
<query name="LogUserSetting.getByLogUserId" type="hql">
<sql>
SELECT lus FROM LogUserSetting AS lus
WHERE lus.logUser.id=<parameter name="log_user_id"/>
</sql>
<parameterValue name="log_user_id" value="1"/>
</query>
<query name="LogUserRightRole.getByLogUserId" type="hql">
<sql>
SELECT lurr FROM LogUserRightRole AS lurr
WHERE lurr.logUser.id=<parameter name="log_user_id"/>
</sql>
<parameterValue name="log_user_id" value="1"/>
</query>
<query name="LogHostGroup.getAll" type="hql">
<sql>SELECT lhg FROM LogHostGroup AS lhg</sql>
</query>
<query name="LogHost.getAll" type="hql">
<sql>SELECT lh FROM LogHost AS lh INNER JOIN FETCH lh.logHostGroup</sql>
</query>
<query name="LogSource.getAll" type="hql">
<sql>SELECT ls FROM LogSource AS ls</sql>
</query>
<query name="LogValueType.getAll" type="hql">
<sql>SELECT lvt FROM LogValueType AS lvt</sql>
</query>
<query name="LogLevel.getAll" type="hql">
<sql>SELECT ll FROM LogLevel AS ll</sql>
</query>
<query name="LogServerRun.getLastDay" type="hql">
<sql>SELECT lsr FROM LogServerRun AS lsr WHERE (extract(doy FROM now()) - extract(doy FROM lsr.startDate)) &lt; 1 ORDER BY lsr.startDate</sql>
</query>
<query name="LogServerRun.getLast" type="hql">
<sql>SELECT lsr FROM LogServerRun AS lsr WHERE lsr.id = (SELECT MAX(lsr2.id) FROM LogServerRun AS lsr2)</sql>
</query>
<query name="LogValue.getAll" type="hql">
<sql>SELECT lv FROM LogValue AS lv INNER JOIN FETCH lv.logValueType AS lvt</sql>
</query>
<query name="LogValueLine.getAllIndexActive" type="hql">
<sql>
SELECT lvl FROM LogValueLine AS lvl
INNER JOIN FETCH lvl.logLevel
LEFT JOIN FETCH lvl.logHost
LEFT JOIN FETCH lvl.logSource
LEFT JOIN FETCH lvl.logValue AS lv
LEFT JOIN FETCH lv.logValueType
WHERE lvl.active=true
</sql>
</query>
<query name="LogValueLine.getAllByLogValueId" type="hql">
<sql>
SELECT lvl FROM LogValueLine AS lvl
INNER JOIN FETCH lvl.logLevel
LEFT JOIN FETCH lvl.logHost
LEFT JOIN FETCH lvl.logSource
LEFT JOIN FETCH lvl.logValue
WHERE lvl.logValue.id=<parameter name="log_value_id"/>
</sql>
<parameterValue name="log_value_id" value="1"/>
</query>
<query name="LogData.getLastDay" type="hql">
<sql>SELECT ld FROM LogData AS ld WHERE (extract(doy FROM now()) - extract(doy FROM ld.logDate)) &lt; 1 ORDER BY ld.logDate</sql>
</query>
<query name="LogData.getFromId" type="hql">
<sql>SELECT ld FROM LogData AS ld WHERE ld.id &gt; <parameter name="log_data_id"/> AND (extract(doy FROM now()) - extract(doy FROM ld.logDate)) = 0</sql>
<parameterValue name="log_data_id" value="1"/>
</query>
<query name="LogData.getLastDayCount" type="hql">
<sql>SELECT count(ld.id) FROM LogData AS ld WHERE (extract(doy FROM now()) - extract(doy FROM ld.logDate)) &lt; 1</sql>
</query>
<query name="LogStats.getLastDay" type="hql">
<sql>SELECT ls FROM LogStats AS ls WHERE (extract(doy FROM now()) - extract(doy FROM ls.logDay)) = 0 </sql>
</query>
</xtes>

View File

@ -0,0 +1,222 @@
package net.forwardfire.logstats.ejb.models;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
import net.forwardfire.logstats.ejb.models.LogData;
import net.forwardfire.logstats.ejb.models.LogHost;
import net.forwardfire.logstats.ejb.models.LogHostGroup;
import net.forwardfire.logstats.ejb.models.LogLevel;
import net.forwardfire.logstats.ejb.models.LogRightRole;
import net.forwardfire.logstats.ejb.models.LogSource;
import net.forwardfire.logstats.ejb.models.LogStats;
import net.forwardfire.logstats.ejb.models.LogUser;
import net.forwardfire.logstats.ejb.models.LogUserRightRole;
import net.forwardfire.logstats.ejb.models.LogUserSetting;
import net.forwardfire.logstats.ejb.models.LogValue;
import net.forwardfire.logstats.ejb.models.LogValueLine;
import net.forwardfire.logstats.ejb.models.LogValueType;
import net.forwardfire.vasc.annotations.VascBundleKeyGenerator;
import net.forwardfire.vasc.core.VascEntry;
import net.forwardfire.vasc.core.VascEntryField;
import net.forwardfire.vasc.core.actions.VascAction;
import junit.framework.TestCase;
public class I18nTests extends TestCase {
public void testI18nKeys() throws Exception {
VascBundleKeyGenerator gen = new VascBundleKeyGenerator();
gen.setGenerateImage(false);
gen.setGenerateHelpId(false);
gen.addModelClass(LogData.class);
gen.addModelClass(LogHost.class);
gen.addModelClass(LogHostGroup.class);
gen.addModelClass(LogLevel.class);
gen.addModelClass(LogRightRole.class);
gen.addModelClass(LogSource.class);
gen.addModelClass(LogStats.class);
gen.addModelClass(LogUser.class);
gen.addModelClass(LogUserRightRole.class);
gen.addModelClass(LogUserSetting.class);
gen.addModelClass(LogValue.class);
gen.addModelClass(LogValueLine.class);
gen.addModelClass(LogValueType.class);
// print stuff
StringBuffer buf = new StringBuffer(2000);
int totalModels = gen.getModelClasses().size();
buf.append("\n===Model classes: "+totalModels);
//buf.append("\n======== START ALL =========\n");
//gen.generateKeys(buf);
//buf.append("\n======== END ALL =========\n");
buf.append("\n======== START MISSING =========\n");
gen.generateMissingKeys(buf, ResourceBundle.getBundle("net/forwardfire/logstats/resources/i18n/LogstatsBundleEJB"));
buf.append("\n======== END MISSING =========\n");
buf.append("\n======== START REMOVE =========\n");
gen.generateRemoveKeys(buf, ResourceBundle.getBundle("net/forwardfire/logstats/resources/i18n/LogstatsBundleEJB"),"vasc(.*)|validator(.*)|generic(.*)");
buf.append("\n======== END REMOVE =========\n");
buf.append("\n======== START DUPS =========\n");
for (String dup:gen.getDubIdNameKeys()) {
buf.append(dup);
buf.append('\n');
}
buf.append("\n======== END DUPS =========\n");
System.out.println(buf);
}
private Map<String,String> keys = new HashMap<String,String>(300);
public void testVascI18nKeys() throws Exception {
// load sql
//XtesManager xtes = new XtesManager();
//xtes.loadAll();
// load vasc xml
/*
VascManager vasc = new VascManager();
vasc.xtesManager = xtes;
VascController controller = vasc.getVascController();
StringBuffer buf = new StringBuffer(2000);
if (keys.isEmpty()==false) {
keys.clear();
}
for (String id:controller.getVascEntryController().getVascEntryIds()) {
VascEntry entry = controller.getVascEntryController().getVascEntryById(id);
generateKeys(entry);
}
//buf.append("\n======== START ALL =========\n");
//printKeys(buf);
//buf.append("\n======== END ALL =========\n");
buf.append("\n======== START MISSING =========\n");
generateMissingKeys(buf, ResourceBundle.getBundle("net/forwardfire/logstats/resources/i18n/LogstatsBundleEJB"));
buf.append("\n======== END MISSING =========\n");
buf.append("\n======== START REMOVE =========\n");
generateRemoveKeys(buf, ResourceBundle.getBundle("net/forwardfire/logstats/resources/i18n/LogstatsBundleEJB"),"vasc.validator(.*)|validator(.*)|generic(.*)");
buf.append("\n======== END REMOVE =========\n");
// So stats
buf.append("Total entries: "+controller.getVascEntryController().getVascEntryIds().size()+"\n");
int lists = 0;
int edits = 0;
int links = 0;
int fields = 0;
int rowActions = 0;
for (String id:controller.getVascEntryController().getVascEntryIds()) {
VascEntry entry = controller.getVascEntryController().getVascEntryById(id);
if (entry.isVascAdminList()) {
lists++;
}
if (entry.isVascAdminEdit()) {
edits++;
}
links+=entry.getVascLinkEntries().size();
fields+=entry.getVascEntryFields().size();
rowActions+=entry.getRowActions().size();
}
buf.append("Total lists: "+lists+"\n");
buf.append("Total edits: "+edits+"\n");
buf.append("Total links: "+links+"\n");
buf.append("Total fields: "+fields+"\n");
buf.append("Total rowActions: "+rowActions+"\n");
System.out.println(buf);
*/
}
public void generateKeys(VascEntry entry) {
appendKey(entry.getName(),entry.getId());
appendKey(entry.getListDescription(),"View "+entry.getId());
appendKey(entry.getEditDescription(),"Edit "+entry.getId());
appendKey(entry.getDeleteDescription(),"Delete "+entry.getId());
for (VascAction action:entry.getGlobalActions()) {
appendKey(action.getName(),action.getId());
appendKey(action.getDescription(),action.getId());
}
for (VascAction action:entry.getRowActions()) {
appendKey(action.getName(),action.getId());
appendKey(action.getDescription(),action.getId());
}
for (VascAction action:entry.getColumnActions()) {
appendKey(action.getName(),action.getId());
appendKey(action.getDescription(),action.getId());
}
for (VascEntryField option:entry.getListOptions()) {
appendKey(option.getName(),option.getId());
}
}
public void printKeys(StringBuffer buffer) {
List<String> keys2 = new ArrayList<String>(keys.keySet());
Collections.sort(keys2);
for (String key:keys2) {
String value = keys.get(key);
buffer.append(key);
buffer.append(" = ");
buffer.append(value);
buffer.append('\n');
}
}
public void generateMissingKeys(StringBuffer buffer,ResourceBundle bundle) {
List<String> keys2 = new ArrayList<String>(keys.keySet());
keys2.removeAll(bundle.keySet());
Collections.sort(keys2);
for (String key:keys2) {
String value = keys.get(key);
buffer.append(key);
buffer.append(" = ");
buffer.append(value);
buffer.append('\n');
}
}
public void generateRemoveKeys(StringBuffer buffer,ResourceBundle bundle,String excludeRegex) {
List<String> keys2 = new ArrayList<String>(bundle.keySet());
keys2.removeAll(keys.keySet());
Collections.sort(keys2);
for (String key:keys2) {
// exlude code and user keys
if (excludeRegex!=null && key.matches(excludeRegex)) {
continue;
}
buffer.append(key);
buffer.append('\n');
}
}
private void appendKey(String key,String value) {
if (key==null) {
return; // hackje untill we have x4o templating
}
if (keys.containsKey(key)) {
return;
}
keys.put(key, value);
}
}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>logstats-jboss-sar</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,7 @@
#Mon Jan 02 23:18:49 CET 2012
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8

View File

@ -0,0 +1,6 @@
#Sat Jun 12 01:12:26 CEST 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5

View File

@ -0,0 +1,5 @@
#Mon Jan 02 23:18:47 CET 2012
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -0,0 +1,9 @@
#Sat Jun 12 01:12:25 CEST 2010
activeProfiles=
eclipse.preferences.version=1
fullBuildGoals=process-test-resources
includeModules=false
resolveWorkspaceProjects=true
resourceFilterGoals=process-resources resources\:testResources
skipCompilerPlugin=true
version=1

View File

@ -0,0 +1,27 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>logstats</artifactId>
<groupId>net.forwardfire.logstats</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>logstats-jboss-sar</artifactId>
<packaging>jboss-sar</packaging>
<name>logstats-jboss-sar</name>
<description>logstats-jboss-sar</description>
<!--
<properties>
<version.org.jboss.mx>6.0.0.Beta5</version.org.jboss.mx>
<version.org.jboss.naming>5.0.5.Final</version.org.jboss.naming>
<version.org.jboss.logging>3.0.0.Beta2</version.org.jboss.logging>
</properties>
-->
<dependencies>
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-system-jmx</artifactId>
<version>5.1.0.GA</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,67 @@
package net.forwardfire.logstats.jboss.log4j;
import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.spi.LoggingEvent;
import org.jboss.logging.Logger;
/**
* Appends log4j messages to the logService MBean
*
* @author Willem Cazander
* @version 1.0 Jun 09, 2010
*/
public class DataSourceLog4jAppender extends AppenderSkeleton {
private DataSourceLogService logService = null;
private Logger logger = Logger.getLogger(DataSourceLog4jAppender.class.getName());
/**
* constructor
* @throws Exception
*/
public DataSourceLog4jAppender(DataSourceLogService logService) {
super();
if (logService==null) {
throw new NullPointerException("Can't start with null logService.");
}
this.logService=logService;
setName(logService.getLog4jAppenderName());
logger.info("Created DataSourceLog4jAppender with name: "+getName());
}
/**
* Closes this appender privately.
*/
public void shutdown() {
logService = null;
logger.info("Closed DataSourceLog4jAppender with name: "+getName());
}
/**
* Closes this appender but is left empty because of fake call.
*/
public void close() {
}
/**
* Put LoggingEvent in queue for processing.
*/
public void append(LoggingEvent event) {
if (logService==null) {
return;
}
try {
logService.putLoggingEvent(event);
} catch (InterruptedException e) {
// we don't log in appender, in case of loop.
}
}
/**
* DataSourceLog4jAppender don't require a layout.
*/
public boolean requiresLayout() {
return false;
}
}

View File

@ -0,0 +1,222 @@
package net.forwardfire.logstats.jboss.log4j;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import org.apache.log4j.Level;
import org.apache.log4j.spi.LoggingEvent;
import org.jboss.logging.Logger;
/**
* Perists the messages of the queue
*
* @author Willem Cazander
* @version 1.0 Jun 09, 2010
*/
public class DataSourceLogPersistThread extends Thread {
private DataSourceLogService logService = null;
private Logger logger = Logger.getLogger(DataSourceLogPersistThread.class.getName());
/**
* Constructor with the LogService
* @param logService
*/
public DataSourceLogPersistThread(DataSourceLogService logService) {
this.logService = logService;
}
/**
* Perists the messages of the queue
*
* @see java.lang.Thread#run()
*/
@Override
public void run() {
long idleTimer = System.currentTimeMillis();
// setup DB connection from datasource
Connection conn = null;
try {
conn = getConnection();
} catch (SQLException e) {
logger.error("init getConnection failed, error: "+e.getMessage(),e);
return;
} catch (NamingException e) {
logger.error("init getConnection datasource lookup failed, error: "+e.getMessage(),e);
return;
}
// Get hostname setup
String hostname = null;
try {
hostname = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
logger.error("init getLocalHost failed, error: "+e.getMessage(),e);
try {
conn.close();
} catch (SQLException se) {
logger.warn("init connection close failed, SQLException: "+se.getMessage(),e);
}
return;
}
if (logService.getBackendHostname()!=null && logService.getBackendHostname().isEmpty()==false) {
hostname = logService.getBackendHostname();
}
// Test and record out one thread
try {
storeLogData(conn,hostname,System.currentTimeMillis(),Level.DEBUG.toInt(),this.getClass().getName(),"Startup and connection of thread: "+getName());
} catch (SQLException e) {
logger.error("test connection message error: "+e.getMessage(),e);
try {
if (conn!=null && conn.isClosed()==false) {
conn.close();
}
} catch (SQLException se) {
logger.warn("test connection close failed, SQLException: "+se.getMessage(),se);
}
return;
}
// main loop
int errorCount = 0;
while (isInterrupted()==false) {
LoggingEvent logMessage = null;
try {
logMessage = logService.pollLoggingEvent();
} catch (InterruptedException e) {
break;
}
if (logMessage!=null) {
try {
// convert
String message = convertMessage(logMessage.getMessage());
// persist message
storeLogData( conn,hostname,logMessage.timeStamp,logMessage.getLevel().toInt(),logMessage.getLoggerName(),message );
} catch (SQLException se) {
if (errorCount==0) {
logger.error("storeLogData() failed, error: "+se.getMessage());
}
errorCount++;
if (errorCount>1000) {
logger.error("storeLogData() failed 1000 times, last error: "+se.getMessage());
errorCount=0;
}
}
} else {
if (checkConnection(conn) == false) {
try {
if (conn!=null && conn.isClosed()==false) {
conn.close();
}
} catch (SQLException se) {
logger.warn("connection close failed, SQLException: "+se.getMessage(),se);
}
try {
conn = getConnection();
} catch (Exception ee) {
logger.error("failure in getConnection() error:"+ee.getMessage(),ee);
break;
}
} else {
if (logService.getBackendIdleMarkerTime()>0) {
// check for update of idle timer
if ((System.currentTimeMillis()-idleTimer) > logService.getBackendIdleMarkerTime()*1000) {
idleTimer = System.currentTimeMillis();
logger.info(logService.getBackendIdleMarkerMessage()+" thread: "+getName());
}
}
}
}
}
// exit thread
logger.info("shutdown thread: "+getName());
try {
if (conn!=null && conn.isClosed()==false) {
conn.close();
}
} catch (SQLException e) {
logger.warn("connection close failed, SQLException: "+e.getMessage());
}
}
private Connection getConnection() throws SQLException,NamingException {
String dataSourceName = logService.getBackendDataSource();
logger.debug("Getting connection from datasource: "+dataSourceName+" for thread: "+getName());
Context naming = new InitialContext();
DataSource dataSource = (DataSource) naming.lookup(dataSourceName);
return dataSource.getConnection();
}
public boolean checkConnection(Connection connection) {
if (connection==null) {
return false;
}
try {
return connection.prepareStatement(logService.getBackendKeepAliveQuery()).execute();
} catch (SQLException e) {
logger.error("checkConnection: SQLException: "+e.getMessage(),e);
return false;
}
}
/**
* Message is not always a string so check for some types we can handle.
*
* @param messageObj
* @return
*/
private String convertMessage(Object messageObj) {
String message = null;
if (messageObj == null ) {
message = "NULL";
} else if (messageObj instanceof String) {
message = (String)messageObj;
} else if (messageObj instanceof Exception) {
message = ((Exception)messageObj).getMessage();
} else {
message = messageObj.toString();
}
return message;
}
private void storeLogData(Connection connection,String host,long time, int level, String source, String message) throws SQLException {
PreparedStatement stmt = null;
Timestamp timeStamp = new Timestamp(time);
stmt = connection.prepareStatement(logService.getBackendLogQuery());
String para = logService.getBackendLogQueryParameters();
String[] paras = para.split(",");
for (int i=1;i<=paras.length;i++) {
String col = paras[i-1];
if ("time".equals(col)) {
stmt.setTimestamp(i, timeStamp);
} else if ("level".equals(col)) {
stmt.setInt(i, level);
} else if ("host".equals(col)) {
stmt.setString(i, host);
} else if ("source".equals(col)) {
stmt.setString(i, source);
} else if ("message".equals(col)) {
stmt.setString(i, message);
} else {
throw new IllegalArgumentException("Unknow column: "+col+" on index: "+i);
}
}
stmt.execute();
}
}

View File

@ -0,0 +1,433 @@
package net.forwardfire.logstats.jboss.log4j;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import javax.xml.parsers.FactoryConfigurationError;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.spi.LoggingEvent;
import org.apache.log4j.xml.DOMConfigurator;
import org.jboss.logging.util.OnlyOnceErrorHandler;
import org.jboss.system.ServiceMBeanSupport;
/**
* Jboss MBean which hooks DB logger to log4j and depends on a datasource for db access.
*
* Orginal idea was made by Edward Pilipczuk <exedx@aster.pl>
*
* @author Willem Cazander
* @version 1.0 Jun 09, 2010
*/
public class DataSourceLogService extends ServiceMBeanSupport implements DataSourceLogServiceMBean {
// backend config options
private String backendDataSource = null;
private String backendLogQuery = "INSERT INTO log_data (log_date, log_level,hostname, source, message) VALUES (?,?,?,?,?)";
private String backendLogQueryParameters = "time,level,host,source,message";
private String backendHostname = null;
private int backendThreads = 3;
private int backendMaxQueueSize = 1500;
private int backendKeepAliveTimeout = 300;
private String backendKeepAliveQuery = "SELECT 1";
private int backendIdleMarkerTime = 3600;
private String backendIdleMarkerMessage = "--- Mark ---";
private boolean backendStatisticsLog = true;
private int backendStatisticsLogTime = 300;
// log4j config options
private String log4jParseConfigResource = "META-INF/logstats-log4j.xml";
private String log4jAppenderName = "LOGSTATS";
private boolean log4jAppenderAutoAdd = true;
private boolean log4jAppenderAutoAddOnlyOnceError = true;
private boolean log4jAppenderToRoot = true;
// stats counters
private int statsMessagesTotal = 0;
private int statsMessagesDropped = 0;
// Internal state objects
volatile private boolean running = false;
private BlockingQueue<LoggingEvent> messageQueue = null;
private DataSourceLog4jAppender appender = null;
private List<DataSourceLogPersistThread> persistThreads = null;
// ===== Override ServiceMBeanSupport methods
@Override
protected void startService() throws Exception {
messageQueue = new LinkedBlockingQueue<LoggingEvent>(backendMaxQueueSize);
startLog4j();
startBackend();
running = true;
log.info("DataSourceLogService started; queueSize: "+backendMaxQueueSize+" threads: "+backendThreads);
}
@Override
protected void stopService() throws Exception {
running = false;
try {
stopLog4j();
} catch (Exception e) {
log.warn("Error in stopLog4j: "+e.getMessage());
} finally {
try {
stopBackend();
} catch (Exception e) {
log.warn("Error in stopBackend: "+e.getMessage());
} finally {
log.info("DataSourceLogService stopped.");
}
}
}
// =========== Private methods
private void startBackend() {
persistThreads = new ArrayList<DataSourceLogPersistThread>(backendThreads);
for (int i=0;i<backendThreads;i++) {
DataSourceLogPersistThread worker = new DataSourceLogPersistThread(this);
worker.start();
persistThreads.add(worker);
}
}
private void stopBackend() {
for (DataSourceLogPersistThread worker:persistThreads) {
worker.interrupt();
}
try {
Thread.sleep(500);
} catch (InterruptedException e) {
log.warn("Interrupted while wait until backend threads are done.");
}
persistThreads.clear();
messageQueue.clear();
}
private void startLog4j() {
appender = new DataSourceLog4jAppender(this);
if (log4jAppenderAutoAddOnlyOnceError) {
appender.setErrorHandler(new OnlyOnceErrorHandler());
log.debug("Added OnlyOnceErrorHandler to appender: "+appender.getName());
}
if (log4jAppenderAutoAdd) {
Logger.getRootLogger().addAppender(appender);
log.debug("Added appender: "+appender.getName()+" to root logger.");
}
if (log4jParseConfigResource!=null && log4jParseConfigResource.isEmpty()==false) {
try {
InputStream lis = Thread.currentThread().getContextClassLoader().getResourceAsStream(log4jParseConfigResource);
new DOMConfigurator().doConfigure(lis,LogManager.getLoggerRepository());
log.debug("Loaded config for log4j: "+log4jParseConfigResource);
} catch (FactoryConfigurationError e) {
log.warn("Error while configing log4j from "+log4jParseConfigResource+" error: "+e.getMessage());
}
}
}
private void stopLog4j() {
Logger.getRootLogger().removeAppender(appender);
appender.shutdown();
appender = null;
}
// ============== Protected methods
protected boolean isRunning() {
return running;
}
protected void putLoggingEvent(LoggingEvent event) throws InterruptedException {
if (running==false) {
return;
}
if (messageQueue==null) {
throw new IllegalStateException("LogService is not started");
}
statsMessagesTotal++;
if (messageQueue.remainingCapacity()>0) {
messageQueue.put(event);
} else {
statsMessagesDropped++;
}
}
protected LoggingEvent pollLoggingEvent() throws InterruptedException {
if (messageQueue==null) {
throw new IllegalStateException("LogService is not started");
}
return messageQueue.poll(backendKeepAliveTimeout, TimeUnit.SECONDS);
}
// ============== MBean methods
/**
* Resets the stats counters
*/
public void resetStatsCounters() {
statsMessagesTotal = 0;
statsMessagesDropped = 0;
}
/**
* @return the statsMessagesTotal
*/
public int getStatsMessagesTotal() {
return statsMessagesTotal;
}
/**
* @return the statsMessagesDropped
*/
public int getStatsMessagesDropped() {
return statsMessagesDropped;
}
/**
* @return the backendDataSource
*/
public String getBackendDataSource() {
return backendDataSource;
}
/**
* @param backendDataSource the backendDataSource to set
*/
public void setBackendDataSource(String backendDataSource) {
this.backendDataSource = backendDataSource;
}
/**
* @return the backendLogQuery
*/
public String getBackendLogQuery() {
return backendLogQuery;
}
/**
* @param backendLogQuery the backendLogQuery to set
*/
public void setBackendLogQuery(String backendLogQuery) {
this.backendLogQuery = backendLogQuery;
}
/**
* @return the backendLogQueryParameters
*/
public String getBackendLogQueryParameters() {
return backendLogQueryParameters;
}
/**
* @param backendLogQueryParameters the backendLogQueryParameters to set
*/
public void setBackendLogQueryParameters(String backendLogQueryParameters) {
this.backendLogQueryParameters = backendLogQueryParameters;
}
/**
* @return the backendHostname
*/
public String getBackendHostname() {
return backendHostname;
}
/**
* @param backendHostname the backendHostname to set
*/
public void setBackendHostname(String backendHostname) {
this.backendHostname = backendHostname;
}
/**
* @return the backendKeepAliveTimeout
*/
public int getBackendKeepAliveTimeout() {
return backendKeepAliveTimeout;
}
/**
* @param backendKeepAliveTimeout the backendKeepAliveTimeout to set
*/
public void setBackendKeepAliveTimeout(int backendKeepAliveTimeout) {
this.backendKeepAliveTimeout = backendKeepAliveTimeout;
}
/**
* @return the backendKeepAliveQuery
*/
public String getBackendKeepAliveQuery() {
return backendKeepAliveQuery;
}
/**
* @param backendKeepAliveQuery the backendKeepAliveQuery to set
*/
public void setBackendKeepAliveQuery(String backendKeepAliveQuery) {
this.backendKeepAliveQuery = backendKeepAliveQuery;
}
/**
* @return the backendThreads
*/
public int getBackendThreads() {
return backendThreads;
}
/**
* @param backendThreads the backendThreads to set
*/
public void setBackendThreads(int backendThreads) {
this.backendThreads = backendThreads;
}
/**
* @return the backendMaxQueueSize
*/
public int getBackendMaxQueueSize() {
return backendMaxQueueSize;
}
/**
* @param backendMaxQueueSize the backendMaxQueueSize to set
*/
public void setBackendMaxQueueSize(int backendMaxQueueSize) {
this.backendMaxQueueSize = backendMaxQueueSize;
}
/**
* @return the backendIdleMarkerTime
*/
public int getBackendIdleMarkerTime() {
return backendIdleMarkerTime;
}
/**
* @param backendIdleMarkerTime the backendIdleMarkerTime to set
*/
public void setBackendIdleMarkerTime(int backendIdleMarkerTime) {
this.backendIdleMarkerTime = backendIdleMarkerTime;
}
/**
* @return the backendIdleMarkerMessage
*/
public String getBackendIdleMarkerMessage() {
return backendIdleMarkerMessage;
}
/**
* @param backendIdleMarkerMessage the backendIdleMarkerMessage to set
*/
public void setBackendIdleMarkerMessage(String backendIdleMarkerMessage) {
this.backendIdleMarkerMessage = backendIdleMarkerMessage;
}
/**
* @return the backendStatisticsLog
*/
public boolean isBackendStatisticsLog() {
return backendStatisticsLog;
}
/**
* @param backendStatisticsLog the backendStatisticsLog to set
*/
public void setBackendStatisticsLog(boolean backendStatisticsLog) {
this.backendStatisticsLog = backendStatisticsLog;
}
/**
* @return the backendStatisticsLogTime
*/
public int getBackendStatisticsLogTime() {
return backendStatisticsLogTime;
}
/**
* @param backendStatisticsLogTime the backendStatisticsLogTime to set
*/
public void setBackendStatisticsLogTime(int backendStatisticsLogTime) {
this.backendStatisticsLogTime = backendStatisticsLogTime;
}
/**
* @return the log4jParseConfigResource
*/
public String getLog4jParseConfigResource() {
return log4jParseConfigResource;
}
/**
* @param log4jParseConfigResource the log4jParseConfigResource to set
*/
public void setLog4jParseConfigResource(String log4jParseConfigResource) {
this.log4jParseConfigResource = log4jParseConfigResource;
}
/**
* @return the log4jAppenderName
*/
public String getLog4jAppenderName() {
return log4jAppenderName;
}
/**
* @param log4jAppenderName the log4jAppenderName to set
*/
public void setLog4jAppenderName(String log4jAppenderName) {
this.log4jAppenderName = log4jAppenderName;
}
/**
* @return the log4jAppenderAutoAdd
*/
public boolean isLog4jAppenderAutoAdd() {
return log4jAppenderAutoAdd;
}
/**
* @param log4jAppenderAutoAdd the log4jAppenderAutoAdd to set
*/
public void setLog4jAppenderAutoAdd(boolean log4jAppenderAutoAdd) {
this.log4jAppenderAutoAdd = log4jAppenderAutoAdd;
}
/**
* @return the log4jAppenderAutoAddOnlyOnceError
*/
public boolean isLog4jAppenderAutoAddOnlyOnceError() {
return log4jAppenderAutoAddOnlyOnceError;
}
/**
* @param log4jAppenderAutoAddOnlyOnceError the log4jAppenderAutoAddOnlyOnceError to set
*/
public void setLog4jAppenderAutoAddOnlyOnceError(
boolean log4jAppenderAutoAddOnlyOnceError) {
this.log4jAppenderAutoAddOnlyOnceError = log4jAppenderAutoAddOnlyOnceError;
}
/**
* @return the log4jAppenderToRoot
*/
public boolean isLog4jAppenderToRoot() {
return log4jAppenderToRoot;
}
/**
* @param log4jAppenderToRoot the log4jAppenderToRoot to set
*/
public void setLog4jAppenderToRoot(boolean log4jAppenderToRoot) {
this.log4jAppenderToRoot = log4jAppenderToRoot;
}
}

View File

@ -0,0 +1,198 @@
package net.forwardfire.logstats.jboss.log4j;
import org.jboss.system.ServiceMBean;
/**
* Defines all configable options of the log service MBean
*
* @author Willem Cazander
* @version 1.0 Jun 09, 2010
*/
public interface DataSourceLogServiceMBean extends ServiceMBean {
/**
* Resets the stats counters
*/
public void resetStatsCounters();
/**
* @return the statsMessagesTotal
*/
public int getStatsMessagesTotal();
/**
* @return the statsMessagesDropped
*/
public int getStatsMessagesDropped();
/**
* @return the backendDataSource
*/
public String getBackendDataSource();
/**
* @param backendDataSource the backendDataSource to set
*/
public void setBackendDataSource(String backendDataSource);
/**
* @return the backendLogQuery
*/
public String getBackendLogQuery();
/**
* @param backendLogQuery the backendLogQuery to set
*/
public void setBackendLogQuery(String backendLogQuery);
/**
* @return the backendLogQueryParameters
*/
public String getBackendLogQueryParameters();
/**
* @param backendLogQueryParameters the backendLogQueryParameters to set
*/
public void setBackendLogQueryParameters(String backendLogQueryParameters);
/**
* @return the backendHostname
*/
public String getBackendHostname();
/**
* @param backendHostname the backendHostname to set
*/
public void setBackendHostname(String backendHostname);
/**
* @return the backendKeepAliveTimeout
*/
public int getBackendKeepAliveTimeout();
/**
* @param backendKeepAliveTimeout the backendKeepAliveTimeout to set
*/
public void setBackendKeepAliveTimeout(int backendKeepAliveTimeout);
/**
* @return the backendKeepAliveQuery
*/
public String getBackendKeepAliveQuery();
/**
* @param backendKeepAliveQuery the backendKeepAliveQuery to set
*/
public void setBackendKeepAliveQuery(String backendKeepAliveQuery);
/**
* @return the backendThreads
*/
public int getBackendThreads();
/**
* @param backendThreads the backendThreads to set
*/
public void setBackendThreads(int backendThreads);
/**
* @return the backendMaxQueueSize
*/
public int getBackendMaxQueueSize();
/**
* @param backendMaxQueueSize the backendMaxQueueSize to set
*/
public void setBackendMaxQueueSize(int backendMaxQueueSize);
/**
* @return the backendIdleMarkerTime
*/
public int getBackendIdleMarkerTime();
/**
* @param backendIdleMarkerTime the backendIdleMarkerTime to set
*/
public void setBackendIdleMarkerTime(int backendIdleMarkerTime);
/**
* @return the backendIdleMarkerMessage
*/
public String getBackendIdleMarkerMessage();
/**
* @param backendIdleMarkerMessage the backendIdleMarkerMessage to set
*/
public void setBackendIdleMarkerMessage(String backendIdleMarkerMessage);
/**
* @return the backendStatisticsLog
*/
public boolean isBackendStatisticsLog();
/**
* @param backendStatisticsLog the backendStatisticsLog to set
*/
public void setBackendStatisticsLog(boolean backendStatisticsLog);
/**
* @return the backendStatisticsLogTime
*/
public int getBackendStatisticsLogTime();
/**
* @param backendStatisticsLogTime the backendStatisticsLogTime to set
*/
public void setBackendStatisticsLogTime(int backendStatisticsLogTime);
/**
* @return the log4jParseConfigResource
*/
public String getLog4jParseConfigResource();
/**
* @param log4jParseConfigResource the log4jParseConfigResource to set
*/
public void setLog4jParseConfigResource(String log4jParseConfigResource);
/**
* @return the log4jAppenderName
*/
public String getLog4jAppenderName();
/**
* @param log4jAppenderName the log4jAppenderName to set
*/
public void setLog4jAppenderName(String log4jAppenderName);
/**
* @return the log4jAppenderAutoAdd
*/
public boolean isLog4jAppenderAutoAdd();
/**
* @param log4jAppenderAutoAdd the log4jAppenderAutoAdd to set
*/
public void setLog4jAppenderAutoAdd(boolean log4jAppenderAutoAdd);
/**
* @return the log4jAppenderAutoAddOnlyOnceError
*/
public boolean isLog4jAppenderAutoAddOnlyOnceError();
/**
* @param log4jAppenderAutoAddOnlyOnceError the log4jAppenderAutoAddOnlyOnceError to set
*/
public void setLog4jAppenderAutoAddOnlyOnceError(boolean log4jAppenderAutoAddOnlyOnceError);
/**
* @return the log4jAppenderToRoot
*/
public boolean isLog4jAppenderToRoot();
/**
* @param log4jAppenderToRoot the log4jAppenderToRoot to set
*/
public void setLog4jAppenderToRoot(boolean log4jAppenderToRoot);
}

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE server PUBLIC "-//JBoss//DTD MBean Service 4.2//EN" "jboss-service_4_2.dtd">
<server>
<mbean name="jboss.system:service=Logging,type=DataSourceLogService"
code="net.forwardfire.logstats.jboss.log4j.DataSourceLogService"
interface="net.forwardfire.logstats.jboss.log4j.DataSourceLogServiceMBean">
<attribute name="BackendDataSource">java:DataSourceLogServiceDS</attribute>
<depends>jboss.jca:service=DataSourceBinding,name=DataSourceLogServiceDS</depends>
</mbean>
<!-- Minimal config
<mbean code="net.forwardfire.logstats.jboss.log4j.DataSourceLogService"
name="logging:service=DataSourceLogService,type=Private"
interface="net.forwardfire.logstats.jboss.log4j.DataSourceLogServiceMBean">
<attribute name="BackendDataSource">java:DataSourceLogServiceDS</attribute>
<depends>jboss.jca:service=DataSourceBinding,name=DataSourceLogServiceDS</depends>
</mbean>
-->
<!-- Maximal config
<mbean code="net.forwardfire.logstats.jboss.log4j.DataSourceLogService"
name="logging:service=DataSourceLogService,type=Private"
interface="net.forwardfire.logstats.jboss.log4j.DataSourceLogServiceMBean">
<attribute name="BackendDataSource">java:DataSourceLogServiceDS</attribute>
<attribute name="BackendLogQuery">INSERT INTO log_data (log_date, log_level,hostname, source, message, text_search_vector) VALUES (?,?,?,?,?,to_tsvector('pg_catalog.english',?))</attribute>
<attribute name="BackendLogQueryParameters">time,level,host,source,message,message</attribute>
<attribute name="BackendThreads">5</attribute>
<attribute name="BackendMaxQueueSize">5000</attribute>
<attribute name="BackendHostname">myhost-jboss-extra5</attribute>
<attribute name="BackendKeepAliveTimeout">3600</attribute>
<attribute name="BackendKeepAliveQuery">SELECT 1</attribute>
<attribute name="BackendIdleMarkerTime">10000</attribute>
<attribute name="BackendIdleMarkerMessage">** Mark **</attribute>
<attribute name="BackendStatisticsLog">true</attribute>
<attribute name="BackendStatisticsLogTime">300</attribute>
<attribute name="Log4jParseConfigResource">META-INF/logstats-log4j.xml</attribute>
<attribute name="Log4jAppenderName">LOGSTATS</attribute>
<attribute name="Log4jAppenderAutoAdd">true</attribute>
<attribute name="Log4jAppenderAutoAddOnlyOnceError">true</attribute>
<attribute name="Log4jAppenderToRoot">true</attribute>
<depends>jboss.jca:service=DataSourceBinding,name=DataSourceLogServiceDS</depends>
</mbean>
-->
</server>

View File

@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Authors: Chris Taylor, Ceki Gulcu. -->
<!-- Version: 1.2 -->
<!-- A configuration element consists of optional renderer
elements,appender elements, categories and an optional root
element. -->
<!ELEMENT log4j:configuration (renderer*, appender*,(category|logger)*,root?,
categoryFactory?)>
<!-- The "threshold" attribute takes a level value such that all -->
<!-- logging statements with a level equal or below this value are -->
<!-- disabled. -->
<!-- Setting the "debug" enable the printing of internal log4j logging -->
<!-- statements. -->
<!-- By default, debug attribute is "null", meaning that we not do touch -->
<!-- internal log4j logging settings. The "null" value for the threshold -->
<!-- attribute can be misleading. The threshold field of a repository -->
<!-- cannot be set to null. The "null" value for the threshold attribute -->
<!-- simply means don't touch the threshold field, the threshold field -->
<!-- keeps its old value. -->
<!ATTLIST log4j:configuration
xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/"
threshold (all|debug|info|warn|error|fatal|off|null) "null"
debug (true|false|null) "null"
>
<!-- renderer elements allow the user to customize the conversion of -->
<!-- message objects to String. -->
<!ELEMENT renderer EMPTY>
<!ATTLIST renderer
renderedClass CDATA #REQUIRED
renderingClass CDATA #REQUIRED
>
<!-- Appenders must have a name and a class. -->
<!-- Appenders may contain an error handler, a layout, optional parameters -->
<!-- and filters. They may also reference (or include) other appenders. -->
<!ELEMENT appender (errorHandler?, param*, layout?, filter*, appender-ref*)>
<!ATTLIST appender
name ID #REQUIRED
class CDATA #REQUIRED
>
<!ELEMENT layout (param*)>
<!ATTLIST layout
class CDATA #REQUIRED
>
<!ELEMENT filter (param*)>
<!ATTLIST filter
class CDATA #REQUIRED
>
<!-- ErrorHandlers can be of any class. They can admit any number of -->
<!-- parameters. -->
<!ELEMENT errorHandler (param*, root-ref?, logger-ref*, appender-ref?)>
<!ATTLIST errorHandler
class CDATA #REQUIRED
>
<!ELEMENT root-ref EMPTY>
<!ELEMENT logger-ref EMPTY>
<!ATTLIST logger-ref
ref IDREF #REQUIRED
>
<!ELEMENT param EMPTY>
<!ATTLIST param
name CDATA #REQUIRED
value CDATA #REQUIRED
>
<!-- The priority class is org.apache.log4j.Level by default -->
<!ELEMENT priority (param*)>
<!ATTLIST priority
class CDATA #IMPLIED
value CDATA #REQUIRED
>
<!-- The level class is org.apache.log4j.Level by default -->
<!ELEMENT level (param*)>
<!ATTLIST level
class CDATA #IMPLIED
value CDATA #REQUIRED
>
<!-- If no level element is specified, then the configurator MUST not -->
<!-- touch the level of the named category. -->
<!ELEMENT category (param*,(priority|level)?,appender-ref*)>
<!ATTLIST category
class CDATA #IMPLIED
name CDATA #REQUIRED
additivity (true|false) "true"
>
<!-- If no level element is specified, then the configurator MUST not -->
<!-- touch the level of the named logger. -->
<!ELEMENT logger (level?,appender-ref*)>
<!ATTLIST logger
name ID #REQUIRED
additivity (true|false) "true"
>
<!ELEMENT categoryFactory (param*)>
<!ATTLIST categoryFactory
class CDATA #REQUIRED>
<!ELEMENT appender-ref EMPTY>
<!ATTLIST appender-ref
ref IDREF #REQUIRED
>
<!-- If no priority element is specified, then the configurator MUST not -->
<!-- touch the priority of root. -->
<!-- The root category always exists and cannot be subclassed. -->
<!ELEMENT root (param*, (priority|level)?, appender-ref*)>
<!-- ==================================================================== -->
<!-- A logging event -->
<!-- ==================================================================== -->
<!ELEMENT log4j:eventSet (log4j:event*)>
<!ATTLIST log4j:eventSet
xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/"
version (1.1|1.2) "1.2"
includesLocationInfo (true|false) "true"
>
<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?,
log4j:locationInfo?) >
<!-- The timestamp format is application dependent. -->
<!ATTLIST log4j:event
logger CDATA #REQUIRED
level CDATA #REQUIRED
thread CDATA #REQUIRED
timestamp CDATA #REQUIRED
>
<!ELEMENT log4j:message (#PCDATA)>
<!ELEMENT log4j:NDC (#PCDATA)>
<!ELEMENT log4j:throwable (#PCDATA)>
<!ELEMENT log4j:locationInfo EMPTY>
<!ATTLIST log4j:locationInfo
class CDATA #REQUIRED
method CDATA #REQUIRED
file CDATA #REQUIRED
line CDATA #REQUIRED
>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "META-INF/log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">
<!-- Lets create a category so we log ourselfs automaticly -->
<category name="net.forwardfire.logstats.jboss.log4j">
<priority value="DEBUG"/>
<appender-ref ref="LOGSTATS"/>
</category>
<!-- Optinaly add other category here to add appender dynamicly -->
</log4j:configuration>

16
logstats-war/.classpath Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/main/webapp"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

42
logstats-war/.project Normal file
View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>logstats-war</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/webapp"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>

View File

@ -0,0 +1,8 @@
#Mon Jan 02 23:18:50 CET 2012
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/main/webapp=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8

View File

@ -0,0 +1,13 @@
#Mon Jan 02 23:18:50 CET 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5

View File

@ -0,0 +1,5 @@
#Mon Jan 02 23:18:47 CET 2012
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -0,0 +1 @@
org.eclipse.wst.jsdt.launching.baseBrowserLibrary

View File

@ -0,0 +1 @@
Window

View File

@ -0,0 +1,9 @@
#Wed Jun 09 21:37:03 CEST 2010
activeProfiles=
eclipse.preferences.version=1
fullBuildGoals=process-test-resources
includeModules=false
resolveWorkspaceProjects=true
resourceFilterGoals=process-resources resources\:testResources
skipCompilerPlugin=true
version=1

158
logstats-war/pom.xml Normal file
View File

@ -0,0 +1,158 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>logstats</artifactId>
<groupId>net.forwardfire.logstats</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>logstats-war</artifactId>
<packaging>war</packaging>
<name>logstats-war</name>
<description>logstats-war</description>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
<testResource>
<directory>src/main/webapp</directory>
<includes>
<include>**/*.xml</include>
</includes>
</testResource>
</testResources>
</build>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>ejb-api</artifactId>
<version>3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>1.2_12</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>1.2_12</version>
<scope>provided</scope>
</dependency>
<!-- Vasc depency -->
<dependency>
<groupId>net.forwardfire.vasc</groupId>
<artifactId>vasc-frontend-web-jsf</artifactId>
<version>${vasc.version}</version>
</dependency>
<dependency>
<groupId>net.forwardfire.vasc</groupId>
<artifactId>vasc-ejb3</artifactId>
<version>${vasc.version}</version>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-ri</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
<version>1.1.15.B1</version>
</dependency>
<!-- RichFaces libraries -->
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-api</artifactId>
<version>3.3.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
<version>3.3.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
<version>3.3.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>info.bliki.wiki</groupId>
<artifactId>bliki-core</artifactId>
<version>3.0.13</version>
</dependency>
<dependency>
<groupId>net.forwardfire.logstats</groupId>
<artifactId>logstats-ejb</artifactId>
<version>${project.version}</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,235 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.web.beans;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import javax.ejb.EJB;
import javax.faces.model.SelectItem;
import net.forwardfire.logstats.ejb.models.LogData;
import net.forwardfire.logstats.ejb.services.LoginManagerRemote;
import net.forwardfire.logstats.ejb.services.ServerManagerRemote;
/**
*
* @author Willem Cazander
* @version 1.0 Jul 06, 2010
*/
public class RealTimeController implements Serializable {
private static final long serialVersionUID = 1L;
private boolean pollEnabled = true;
private boolean reversedTail = false;
private String filterHostname = null;
private Integer filterLevel = null;
private String filterRegex = null;
private Pattern filterRegexPattern = null;
private int messageRows = 40;
private int messageCols = 260;
@EJB()
LoginManagerRemote loginManager;
@EJB()
ServerManagerRemote serverManager;
private StringBuilder getStartBuffer(List<LogData> data) {
StringBuilder buf = new StringBuilder();
int size = data.size();
for (int i=0;i<size;i++) {
LogData d = data.get(i);
if (filterLevel!=null && filterLevel.equals(d.getLogLevel())==false) {
continue;
}
if (filterHostname!=null && filterHostname.equals(d.getLogLevel())==false) {
continue;
}
if (filterRegexPattern!=null && filterRegexPattern.matcher(d.getMessage()).matches()==false) {
continue;
}
buf.append(d.getLogDate());
buf.append(' ');
buf.append(d.getHostname());
buf.append(' ');
buf.append(d.getLogLevel());
buf.append(' ');
buf.append(d.getSource());
buf.append(' ');
buf.append(d.getMessage());
buf.append('\n');
}
return buf;
}
public String getMessageLogData() {
List<LogData> data = serverManager.getRealTimeLogData();
if (reversedTail) {
Collections.reverse(data);
}
StringBuilder buf = getStartBuffer(data);
return buf.toString();
}
public void setMessageLogData(String voidData) {
// method so jsf is oke.
}
/**
* @return the pollEnabled
*/
public boolean isPollEnabled() {
return pollEnabled;
}
/**
* @param pollEnabled the pollEnabled to set
*/
public void setPollEnabled(boolean pollEnabled) {
this.pollEnabled = pollEnabled;
}
/**
* @return the reversedTail
*/
public boolean isReversedTail() {
return reversedTail;
}
/**
* @param reversedTail the reversedTail to set
*/
public void setReversedTail(boolean reversedTail) {
this.reversedTail = reversedTail;
}
/**
* @return the filterHostname
*/
public String getFilterHostname() {
return filterHostname;
}
/**
* @param filterHostname the filterHostname to set
*/
public void setFilterHostname(String filterHostname) {
this.filterHostname = filterHostname;
}
/**
* @return the filterLevel
*/
public Integer getFilterLevel() {
return filterLevel;
}
/**
* @param filterLevel the filterLevel to set
*/
public void setFilterLevel(Integer filterLevel) {
this.filterLevel = filterLevel;
}
/**
* @return the filterRegex
*/
public String getFilterRegex() {
return filterRegex;
}
/**
* @param filterRegex the filterRegex to set
*/
public void setFilterRegex(String filterRegex) {
this.filterRegex = filterRegex;
if (filterRegex!=null && filterRegex.isEmpty()==false) {
try {
filterRegexPattern = Pattern.compile(filterRegex);
} catch (PatternSyntaxException pse) {
filterRegexPattern = null; // remove old regex
pse.printStackTrace();
}
} else {
filterRegexPattern = null;
}
}
/**
* @return the messageRows
*/
public int getMessageRows() {
return messageRows;
}
/**
* @param messageRows the messageRows to set
*/
public void setMessageRows(int messageRows) {
this.messageRows = messageRows;
}
/**
* @return the messageCols
*/
public int getMessageCols() {
return messageCols;
}
/**
* @param messageCols the messageCols to set
*/
public void setMessageCols(int messageCols) {
this.messageCols = messageCols;
}
public List<SelectItem> getMessageRowsSelectItems() {
List<SelectItem> result = new ArrayList<SelectItem>(5);
result.add(new SelectItem(10, "10"));
result.add(new SelectItem(20, "20"));
result.add(new SelectItem(40, "40"));
result.add(new SelectItem(60, "60"));
result.add(new SelectItem(80, "80"));
result.add(new SelectItem(102, "100")); // to remove scroll bar 102, buf is 100
return result;
}
public List<SelectItem> getMessageColsSelectItems() {
List<SelectItem> result = new ArrayList<SelectItem>(5);
result.add(new SelectItem(80, "80"));
result.add(new SelectItem(120, "120"));
result.add(new SelectItem(150, "150"));
result.add(new SelectItem(200, "200"));
result.add(new SelectItem(240, "240"));
result.add(new SelectItem(260, "260"));
result.add(new SelectItem(280, "280"));
result.add(new SelectItem(300, "300"));
return result;
}
}

View File

@ -0,0 +1,76 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.web.beans;
import java.io.Serializable;
import java.util.List;
import javax.ejb.EJB;
import net.forwardfire.logstats.ejb.models.LogRightRole;
import net.forwardfire.logstats.ejb.models.LogUser;
import net.forwardfire.logstats.ejb.services.LoginManagerRemote;
/**
*
* @author Willem Cazander
* @version 1.0 Nov 1, 2009
*/
public class UserController implements Serializable {
private static final long serialVersionUID = 1L;
private LogUser logUser = null;
private List<LogRightRole> logRightRoles = null;
@EJB()
LoginManagerRemote loginManager;
public void loginFilter() {
try {
logUser = loginManager.getUser();
logRightRoles = loginManager.getClientRoles();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public void logoutFilter() {
logUser = null;
logRightRoles = null;
}
public boolean isUserLoggedin() {
if (logUser==null) {
return false;
}
return true;
}
public LogUser getUser() {
return logUser;
}
public List<LogRightRole> getRightRoles() {
return logRightRoles;
}
}

View File

@ -0,0 +1,62 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.web.beans;
import java.util.ArrayList;
import java.util.List;
import net.forwardfire.vasc.core.VascController;
import net.forwardfire.vasc.frontends.web.jsf.AbstractJSFVascFacesController;
/**
*
* @author Willem Cazander
* @version 1.0 Nov 1, 2009
*/
public class VascFacesController extends AbstractJSFVascFacesController {
public String getVascSericeManagerJNDI() {
return "logstats-jboss/ejb/vascSericeManager/remote";
}
public String getResourceBundleWEB() {
return "net/forwardfire/logstats/resources/i18n/LogstatsBundleWAR";
}
public boolean getDisableI18N() {
return false;
}
public VascUserInfo getVascUserInfo() {
VascUserInfo vui = new VascUserInfo(new Long(34l),"s", new String[] {"rol1"});
return vui;
}
public List<String> getVascAdminEntries() {
List<String> result = new ArrayList<String>(50);
VascController v = getVascController();
for (String e:v.getVascEntryController().getVascEntryIds()) {
if (e.endsWith("Link")==false) {
result.add(e);
}
}
return result;
}
}

View File

@ -0,0 +1,104 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.logstats.web.filters;
import java.io.IOException;
import java.util.logging.Logger;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.forwardfire.logstats.web.beans.UserController;
/**
* Filter in and out logs of users.
*
* @author Willem Cazander
* @version 1.0 Nov 12, 2009
*/
public class UserFilter implements Filter {
private static final long serialVersionUID = 10l;
private Logger logger = null;
/**
* @see javax.servlet.Filter#destroy()
*/
public void destroy() {
logger = null;
}
/**
* @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
*/
public void init(FilterConfig config) throws ServletException {
logger = Logger.getLogger(UserFilter.class.getName());
}
/**
* @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
*/
public void doFilter(ServletRequest servletRequest,ServletResponse servletResponse,FilterChain chain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest)servletRequest;
HttpServletResponse response = (HttpServletResponse)servletResponse;
// Let all anymous user to next filter
if (request.getUserPrincipal()==null) {
chain.doFilter(request, response);
return;
}
UserController userController = (UserController)request.getSession().getAttribute("userController");
if (userController==null) {
logger.info("Can't create userController for first request auth: "+request.getUserPrincipal());
chain.doFilter(request, response);
return;
}
if (userController.isUserLoggedin()==false) {
userController.loginFilter();
// size session time to 20min
request.getSession().setMaxInactiveInterval(20*60*1000);
}
// Check for logout
String path = request.getRequestURI();
if (path.endsWith("login/logout.jsf")) {
userController.logoutFilter();
request.getSession().invalidate();
}
// do rest of chain.
chain.doFilter(request, response);
}
}

View File

@ -0,0 +1,73 @@
#Colors
headerBackgroundColor=\#EAEAEA
headerGradientColor=\#E0E0E0
headerTextColor=#282828
headerWeightFont=bold
generalBackgroundColor=#FFFFFF
generalTextColor=#282828
generalSizeFont=11px
generalFamilyFont=Arial, Helvetica, sans-serif
controlTextColor=#282828
controlBackgroundColor=#ffffff
additionalBackgroundColor=#ffffff
shadowBackgroundColor=#000000
shadowOpacity=1
panelBorderColor=#BED6F8
subBorderColor=#ffffff
tabBackgroundColor=#C6DEFF
tabDisabledTextColor=#ffffff
trimColor=#D6E6FB
tipBackgroundColor=\#FAE6B0
tipBorderColor=\#E5973E
selectControlColor=#E79A00
generalLinkColor=#004DEB
hoverLinkColor=#004DEB
visitedLinkColor=#004DEB
# Fonts
headerSizeFont=11px
headerFamilyFont=Arial, Helvetica, sans-serif
tabSizeFont=11
tabFamilyFont=Arial, Helvetica, sans-serif
buttonSizeFont=11
buttonFamilyFont=Arial, Verdana, sans-serif
tableBackgroundColor=#FFFFFF
tableFooterBackgroundColor=#FFFFFF
tableSubfooterBackgroundColor=#FFFFFF
#Calendar colors
calendarWeekBackgroundColor=#F5F5F5
calendarHolidaysBackgroundColor=#FFEBDA
calendarHolidaysTextColor=#FF7800
calendarCurrentBackgroundColor=#FF7800
calendarCurrentTextColor=#FFEBDA
calendarSpecBackgroundColor=#E4F5E2
calendarSpecTextColor=#000000
warningColor=#282828
warningBackgroundColor=##EE0000
editorBackgroundColor=#F1F1F1
editBackgroundColor=#FEFFDA
#Gradients
gradientType=plain

View File

@ -0,0 +1,82 @@
generic.active.labelText = active
generic.active.toolTipText = active
generic.createdDate.labelText = createdDate
generic.createdDate.toolTipText = createdDate
generic.description.labelText = description
generic.description.toolTipText = description
generic.id.labelText = id
generic.id.toolTipText = id
generic.modifiedDate.labelText = modifiedDate
generic.modifiedDate.toolTipText = modifiedDate
generic.name.labelText = name
generic.name.toolTipText = name
# hibernate validators
validator.assertFalse=assertion failed
validator.assertTrue=assertion failed
validator.future=Date must lie in the future
validator.length=Field must contain between {min} and {max} characters.
validator.max=Value must be equal to or lower than {value}
validator.min=Value must be equal to or higher than {value}
validator.notNull=A value must be entered
validator.past=Date must lie in the future
validator.pattern=Value must conform to "{regex}"
validator.range=Value must lie between {min} and {max}
validator.size=There must be between {min} and {max} characters
validator.email=The value must be a valid e-mail address
# vasc validators
vasc.validator.VascDateFutureValidator=The date must lie in the future.
vasc.validator.VascDatePastValidator=The date must lie in the past.
vasc.validator.VascIntSizeValidator=Value must lie between {0} and {1}
vasc.validator.VascLongSizeValidator=Value must lie between {0} and {1}
vasc.validator.VascObjectNotNullValidator=A value must be entered
vasc.validator.VascObjectNullValidator=No value may be entered
vasc.validator.VascStringEmailValidator=The value must be a valid e-mail address
vasc.validator.VascStringLengthValidator=There must be at least {0} and at most {1} items
vasc.validator.VascStringRegexValidator=Value must conform to "{0}"
vasc.validator.VascStringZipCodeValidator=Value must be a valid post code.
# Vasc actions labels
vasc.action.addRowAction.description = add a new record
vasc.action.addRowAction.name = Add
vasc.action.csvExportAction.description = CSV
vasc.action.csvExportAction.name = CSV
vasc.action.xmlExportAction.description = XML
vasc.action.xmlExportAction.name = XML
vasc.action.deleteRowAction.description = delete
vasc.action.deleteRowAction.name = delete
vasc.action.downloadAction.description = Select this record.
vasc.action.downloadAction.name = Select
vasc.action.editRowAction.description = edit
vasc.action.editRowAction.name = Edit
# Temp jsf
generic.vasc.jsf.listOption.header = Searchoptions
generic.vasc.jsf.listOption.search = Searh\:
generic.vasc.jsf.listOption.sumbit = Search
generic.vasc.jsf.pager.previous = Previous
generic.vasc.jsf.pager.next = Next
generic.vasc.jsf.table.rows = Row Numbers\:
generic.vasc.jsf.table.pagerDirect = Go to\:
generic.vasc.jsf.table.downloadDirect = Download\:
generic.vasc.jsf.table.resultText = Results {0}-{1} from {2} rows
generic.vasc.jsf.table.download.img = Save table data.
generic.vasc.jsf.table.printer.img = Shows the table in printer friendly format.
generic.vasc.jsf.table.export.select = ...
generic.vasc.jsf.table.export.select.alt = Select Export
generic.vasc.jsf.table.page.select = ...
generic.vasc.jsf.table.page.select.alt = Select Page
generic.vasc.jsf.table.page.name = Page:
generic.vasc.jsf.table.page.description = Goto page:
generic.vasc.jsf.tableHeader.fields = Fields
generic.vasc.jsf.tableHeader.links = Links
generic.vasc.jsf.tableHeader.actions = Actions
generic.vasc.jsf.multiAction.selectAll = Select all:
generic.vasc.jsf.multiAction.name = ...
generic.vasc.jsf.multiAction.description = Select Action
generic.vasc.jsf.action.save = Save
generic.vasc.jsf.action.cancel = Cancel
generic.vasc.jsf.action.back = Back
generic.vasc.jsf.parentSelected = Selected:

View File

@ -0,0 +1,82 @@
generic.active.labelText = active
generic.active.toolTipText = active
generic.createdDate.labelText = createdDate
generic.createdDate.toolTipText = createdDate
generic.description.labelText = description
generic.description.toolTipText = description
generic.id.labelText = id
generic.id.toolTipText = id
generic.modifiedDate.labelText = modifiedDate
generic.modifiedDate.toolTipText = modifiedDate
generic.name.labelText = name
generic.name.toolTipText = name
# hibernate validators
validator.assertFalse=assertion failed
validator.assertTrue=assertion failed
validator.future=Date must lie in the future
validator.length=Field must contain between {min} and {max} characters.
validator.max=Value must be equal to or lower than {value}
validator.min=Value must be equal to or higher than {value}
validator.notNull=A value must be entered
validator.past=Date must lie in the future
validator.pattern=Value must conform to "{regex}"
validator.range=Value must lie between {min} and {max}
validator.size=There must be between {min} and {max} characters
validator.email=The value must be a valid e-mail address
# vasc validators
vasc.validator.VascDateFutureValidator=The date must lie in the future.
vasc.validator.VascDatePastValidator=The date must lie in the past.
vasc.validator.VascIntSizeValidator=Value must lie between {0} and {1}
vasc.validator.VascLongSizeValidator=Value must lie between {0} and {1}
vasc.validator.VascObjectNotNullValidator=A value must be entered
vasc.validator.VascObjectNullValidator=No value may be entered
vasc.validator.VascStringEmailValidator=The value must be a valid e-mail address
vasc.validator.VascStringLengthValidator=There must be at least {0} and at most {1} items
vasc.validator.VascStringRegexValidator=Value must conform to "{0}"
vasc.validator.VascStringZipCodeValidator=Value must be a valid post code.
# Vasc actions labels
vasc.action.addRowAction.description = add a new record
vasc.action.addRowAction.name = Add
vasc.action.csvExportAction.description = CSV
vasc.action.csvExportAction.name = CSV
vasc.action.xmlExportAction.description = XML
vasc.action.xmlExportAction.name = XML
vasc.action.deleteRowAction.description = delete
vasc.action.deleteRowAction.name = delete
vasc.action.downloadAction.description = Select this record.
vasc.action.downloadAction.name = Select
vasc.action.editRowAction.description = edit
vasc.action.editRowAction.name = Edit
# Temp jsf
generic.vasc.jsf.listOption.header = Searchoptions
generic.vasc.jsf.listOption.search = Searh\:
generic.vasc.jsf.listOption.sumbit = Search
generic.vasc.jsf.pager.previous = Previous
generic.vasc.jsf.pager.next = Next
generic.vasc.jsf.table.rows = Row Numbers\:
generic.vasc.jsf.table.pagerDirect = Go to\:
generic.vasc.jsf.table.downloadDirect = Download\:
generic.vasc.jsf.table.resultText = Results {0}-{1} from {2} rows
generic.vasc.jsf.table.download.img = Save table data.
generic.vasc.jsf.table.printer.img = Shows the table in printer friendly format.
generic.vasc.jsf.table.export.select = ...
generic.vasc.jsf.table.export.select.alt = Select Export
generic.vasc.jsf.table.page.select = ...
generic.vasc.jsf.table.page.select.alt = Select Page
generic.vasc.jsf.table.page.name = Page:
generic.vasc.jsf.table.page.description = Goto page:
generic.vasc.jsf.tableHeader.fields = Fields
generic.vasc.jsf.tableHeader.links = Links
generic.vasc.jsf.tableHeader.actions = Actions
generic.vasc.jsf.multiAction.selectAll = Select all:
generic.vasc.jsf.multiAction.name = ...
generic.vasc.jsf.multiAction.description = Select Action
generic.vasc.jsf.action.save = Save
generic.vasc.jsf.action.cancel = Cancel
generic.vasc.jsf.action.back = Back
generic.vasc.jsf.parentSelected = Selected:

View File

@ -0,0 +1,47 @@
<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<application>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
<managed-bean>
<description>Controls the Users</description>
<managed-bean-name>realTimeController</managed-bean-name>
<managed-bean-class>net.forwardfire.logstats.web.beans.RealTimeController</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<description>Controls the Users</description>
<managed-bean-name>userController</managed-bean-name>
<managed-bean-class>net.forwardfire.logstats.web.beans.UserController</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<!--
<managed-bean>
<description>Controls the Wiki</description>
<managed-bean-name>wikiPageController</managed-bean-name>
<managed-bean-class>net.forwardfire.one.laig.web.beans.WikiPageController</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>requestWikiPage</property-name>
<value>#{requestScopeWikiName}</value>
</managed-property>
</managed-bean>
-->
<managed-bean>
<description>Controls Vasc Faces</description>
<managed-bean-name>vascFacesController</managed-bean-name>
<managed-bean-class>net.forwardfire.logstats.web.beans.VascFacesController</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>

View File

@ -0,0 +1,9 @@
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
<jboss-web>
<class-loading>
<loader-repository>net.forwardfire.logstats:archive=logstats-war</loader-repository>
</class-loading>
<!--
<security-domain>java:/jaas/LogStatsSecurity</security-domain>
-->
</jboss-web>

View File

@ -0,0 +1,203 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>Logstats Web Application</display-name>
<welcome-file-list>
<welcome-file>/jsp/index_jsp.jsp</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>4</session-timeout>
<!-- An 4min session, we increase it after login to 20min. -->
</session-config>
<security-constraint>
<web-resource-collection>
<web-resource-name>XHTML</web-resource-name>
<url-pattern>*.xhtml</url-pattern>
</web-resource-collection>
<web-resource-collection>
<web-resource-name>Include files</web-resource-name>
<description>No direct access to include files.</description>
<url-pattern>/jsp/includes/*</url-pattern>
<http-method>POST</http-method>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<description>No direct browser access to include files.</description>
<role-name>inaccessible</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<!--
<security-constraint>
<display-name>User Required</display-name>
<web-resource-collection>
<web-resource-name>User pages</web-resource-name>
<url-pattern>/jsp/user/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<display-name>Admin User Required</display-name>
<web-resource-collection>
<web-resource-name>Admin pages</web-resource-name>
<url-pattern>/jsp/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin-company</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<display-name>Sytem User Required</display-name>
<web-resource-collection>
<web-resource-name>System pages</web-resource-name>
<url-pattern>/jsp/system/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin-system</role-name>
</auth-constraint>
</security-constraint>
-->
<login-config>
<auth-method>FORM</auth-method>
<realm-name>LogstatsSecurity</realm-name>
<form-login-config>
<form-login-page>/jsp/login/login.jsf</form-login-page>
<form-error-page>/jsp/login/login-error.jsf</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>user</role-name>
</security-role>
<security-role>
<role-name>admin-company</role-name>
</security-role>
<security-role>
<role-name>admin-system</role-name>
</security-role>
<security-role>
<role-name>inaccessible</role-name>
</security-role>
<!-- =============== USER CONFIG =================================== -->
<filter>
<display-name>User Filter</display-name>
<filter-name>userFilter</filter-name>
<filter-class>net.forwardfire.logstats.web.filters.UserFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>userFilter</filter-name>
<servlet-name>facesServlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<!-- =============== JSF CONFIG =================================== -->
<context-param>
<description>
Comma separated list of URIs of (additional) faces
config files.(e.g./WEB-INF/my-config.xml) See JSF1.0 PRD 2,10.3.2
</description>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces.xml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>facelets.REFRESH_PERIOD</param-name>
<param-value>2</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<!--
<context-param>
<param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
<param-value>true</param-value>
</context-param>
-->
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<servlet>
<description>The JSF Servlet</description>
<servlet-name>facesServlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>facesServlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<!-- Plugin our own richfaces skin -->
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>logstats</param-value>
</context-param>
<!-- Making the RichFaces skin spread to standard HTML controls -->
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING</param-name>
<param-value>enable</param-value>
</context-param>
<!-- Defining and mapping the RichFaces filter -->
<filter>
<display-name>RichFaces Filter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>facesServlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<!-- =============== VASC CONFIG =================================== -->
<filter>
<display-name>VASC Filter</display-name>
<filter-name>vascFilter</filter-name>
<filter-class>net.forwardfire.vasc.frontends.web.jsf.VascRequestFacesFilter</filter-class>
<init-param>
<param-name>templateFile</param-name>
<param-value>/jsp/includes/vasc-template.jsf</param-value>
</init-param>
<init-param>
<param-name>resourceBundle</param-name>
<param-value>/net/forwardfire/logstats/resources/i18n/LogstatsBundleEJB</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>vascFilter</filter-name>
<url-pattern>/vasc/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
</web-app>

View File

@ -0,0 +1,8 @@
/* CSS fixes for IE6 */
/*
#page_menu_left {
overflow: visible;
}
*/

View File

@ -0,0 +1,8 @@
/* CSS fixes for IE7 */
/*
#page_menu_left {
overflow: visible;
}
*/

View File

@ -0,0 +1,4 @@
/* CSS fixes for IE8 */
/* Yet to come */

View File

@ -0,0 +1,538 @@
/* HTML STYLES */
* {
margin:0px;
padding:0px;
}
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
color: #000000;
margin: 0px;
padding: 0px;
background-color:white;
}
h1 {
font-size:1.2em;
font-weight:bold;
padding-bottom:10px;
}
h2 {
-moz-border-radius:3px;
-webkit-border-radius:3px;
-khtml-border-radius:3px;
display:block;
font-size:1.0em;
font-weight:bold;
padding:10px 10px 10px 10px;
}
a {
color:#004DEB;
text-decoration:underline;
}
p {
margin:10px 10px 10px 10px;
}
img {
border: none;
vertical-align: middle;
}
ul {
margin-left:10px;
}
/* DIVS */
#page_wrap{
margin:10px;
margin-top:0px;
float:none;
}
#page_header{
height:80px;
font-size:18px;
border-bottom:1px solid #DDCCCC;
position:relative;
}
#page_header a img{
border:none;
padding-right:10px;
vertical-align:middle;
}
#page_content {
margin-top:5px;
}
#page_footer {
margin-top:35px;
padding: 5px;
font-size: 12px;
border-color:#e5e5e5;
border-style:solid;
border-width:1px 1px 1px 1px;
-moz-border-radius:3px;
-webkit-border-radius:3px;
-khtml-border-radius:3px;
}
/* MENU */
#page_menu_left,#page_menu_right {
border-color:#DDCCCC;
border-style:solid;
border-width:0 0 1px 0;
vertical-align:bottom;
display:inline;
}
#page_menu_right {
position:absolute;
bottom:0;
right:0;
}
#page_menu_left a,#page_menu_right a {
border:1px solid #e0e0e0;
background-color:#DDCCCC;
border-bottom-width:0px;
text-align:center;
-moz-border-radius-topleft:3xp;
-moz-border-radius-topright:3xp;
-webkit-border-top-left-radius:3px;
-webkit-border-top-right-radius:3px;
-khtml-border-radius-topleft:3px;
-khtml-border-radius-topright:3px;
color:#000;
margin:0px 5px 0px 0px;
padding:3px 15px 2px 15px;
text-decoration:none;
}
#page_menu_left a:hover,#page_menu_right a:hover {
text-decoration:none;
background-color:#fff;
border-color:#e0e0e0;
}
#page_menu_left a.active,#page_menu_left a.active {
background-color:#fff;
font-weight:700;
}
#page_user_info {
padding:5px;
position:absolute;
right:0;
top:0;
font-size:11px;
}
.actionbox{
background-color:#DDCCCC;
-moz-border-radius:3px;
-webkit-border-radius:3px;
-khtml-border-radius:3px;
border:none;
-moz-border-radius-topleft:0;
-webkit-border-top-left-radius:0;
-khtml-border-radius-topleft:0;
clear:both;
padding:3px 0 3px 3px;
display:block;
}
.actionbox label{display:inline;}
ul.actionboxtab{margin:0;padding:0;}
ul.actionboxtab li{list-style-type:none;float:left;margin:0;padding:0;}
ul.actionboxtab li a {
border:solid 1px #ddd;
border-bottom-width:0;
-moz-border-radius-topleft:3px;
-moz-border-radius-topright:3px;
-khtml-border-radius-topright:3px;
-webkit-border-top-left-radius:3px;
-webkit-border-top-right-radius:3px;
-khtml-border-radius-topleft:3px;
font-weight:700;
display:block;
margin-right:5px;color:#000;
padding:3px 15px;
}
ul.actionboxtab li a.active{background-color:#DDCCCC;border:solid 1px #DDCCCC;text-decoration:none;}
ul.actionboxtab li a:hover{background-color:#DDCCCC;border:solid 1px #DDCCCC;text-decoration:none;}
td.tableactions{border-bottom-color:#bbb;text-align:left;}
ul.paging{
clear:both;
margin-bottom:5px;
margin-top:5px;
display:block;
float:left;
padding-top:3px;
padding-bottom:3px;
width:100%;
list-style:none;
}
ul.paging li,ul.paging span{float:left;margin:0 2px 0 2px;}
.paging_thispage{font-weight:700;padding:0 6px;}
ul.paging .paging_atstart{margin-right:10px;}ul.paging .paging_atend{margin-left:10px;}
ul.paging .paging_atstart a,ul.paging .nolink.paging_atstart{
padding-left:15px;
}
ul.paging .paging_atend a,ul.paging .nolink.paging_atend{
padding-right:15px;
}
ul.paging .paging_next{
margin-left:20px;
border:1px solid #DDD;
-moz-border-radius:3px;
-webkit-border-radius:3px;
-khtml-border-radius:3px;
padding:2px 6px;
}
ul.paging .paging_prev{
margin-right:20px;
border:1px solid #DDD;
-moz-border-radius:3px;
-webkit-border-radius:3px;
-khtml-border-radius:3px;
padding:2px 6px;
}
ul.paging a,ul.paging .paging_link{
border:1px solid #DDD;
-moz-border-radius:3px;
-webkit-border-radius:3px;
-khtml-border-radius:3px;
padding:2px 6px;
}
ul.paging .paging_break{
font-weight:700;padding:2px 6px;
}
/* TABLES */
/*
#m_content table {
text-align: left;
}
*/
table.table5, table.rating_table {
border-collapse:collapse;
font-size:11px;
width:100%;
margin-bottom: 30px;
}
table.table5 th, table.rating_table th {
padding-top:5px;
padding-bottom:5px;
font-weight:700;
text-align:left;
vertical-align:top;
padding-left: 3px;
}
table.table5 td, table.rating_table td {
vertical-align:top;
padding-top:5px;
padding-bottom:5px;
padding-left: 3px;
}
.dataTableHeaderRow {
border:1px solid #e0e0e0;
background-color:#e4e4e4;
border-bottom-width:0;
}
.dataTableHeaderRow th, td {
padding-right: 5px;
}
table input,table select {
font-size: 11px;
margin-left:6px;
margin-right:6px;
}
table.table5 tr:nth-child(even) {
background-color:#f0f0f0;
}
.table_options_top {
-moz-border-radius-topleft:3px;
-moz-border-radius-topright:3px;
background-color:#DDCCCC;
font-size:12px;
font-weight:700;
padding:6px 15px;
display: block;
}
.table_options_bottom {
-moz-border-radius-bottomleft:3px;
-moz-border-radius-bottomright:3px;
background-color:#DDCCCC;
font-size:12px;
font-weight:700;
padding:6px 15px;
display: block;
margin-top:5px;
}
.table_sub_header {
-moz-border-radius-topleft:5px;
-moz-border-radius-topright:5px;
background-color:#EEEEEE;
border:1px solid #BBBBBB;
display:block;
font-size:14px;
font-weight:700;
margin:0 2px;
padding:3px 6px;
text-align:center;
}
.rich-table-subheader {
background-color:#DDCCCC;
border-top: 1px solid #C0C0C0;
border-left: 1px solid #C0C0C0;
}
.rich-table {
border-top: none;
border-left: none;
}
.rich-table-row {
border-left: 1px solid #C0C0C0;
}
.rich-table-headercell,.rich-table-footercell {
background-color: #FFF;
border: none;
padding-left: 0px;
padding-right: 0px;
font-weight: none;
}
.rich-table-thead {
border: none;
}
.rich-table-header {
background: none;
}
.homepage_stats {
margin-top:10px;
margin-bottom:10px;
}
.homepage_stats_big {
color:#004DEB;
margin-top:5px;
margin-bottom:5px;
font-size: 20px;
display:block;
font-weight: normal;
}
/* MESSAGES */
.message_info,
.message_1 {
display:block;
font-size: 14px;
font-weight: bold;
border:solid 1px #a0ff7d;
-moz-border-radius:3px;
-webkit-border-radius:3px;
-khtml-border-radius:3px;
background-color: #a0ff7d;
padding: 15px 15px;
margin-bottom: 15px;
}
.message_warning,
.message_2 {
display:block;
font-size: 14px;
font-weight: bold;
border:solid 1px #ffae4c;
-moz-border-radius:3px;
-webkit-border-radius:3px;
-khtml-border-radius:3px;
background-color: #ffae4c;
padding: 15px 15px;
margin-bottom: 15px;
}
.message_error,
.message_3 {
display:block;
font-size: 14px;
font-weight: bold;
border:solid 1px #ff5b43;
-moz-border-radius:3px;
-webkit-border-radius:3px;
-khtml-border-radius:3px;
background-color: #ff5b43;
padding: 15px 15px;
margin-bottom: 15px;
}
.message_4 {
display:block;
font-size: 14px;
font-weight: bold;
border:solid 1px #fc9200;
background-color: #fc9200;
-moz-border-radius-topleft:3px;
-webkit-border-top-left-radius:3px;
-khtml-border-radius-topleft:3px;
-moz-border-radius-topright:3px;
-webkit-border-top-right-radius:3px;
-khtml-border-radius-topright:3px;
padding: 5px;
margin-bottom: 10px;
}
.message_1 input, .message_1 button, .message_2 input, .message_2 button, .message_3 input, .message_3 button {
margin:0px;
}
.message_4 h2 {
margin: 0px;
padding:5px;
}
.message_4 input {
margin: 0px;
font-weight: bold;
font-size: 14px;
padding: 2px 5px;
margin-right: 5px;
}
/* LOGINBOX */
/* Text styles */
.text_justify {
text-align:justify;
}
.text_left {
text-align:left;
}
.text_right {
text-align:right;
}
.text_center {
text-align:center;
}
.text_middle {
vertical-align:middle!important;
}
.text_top {
vertical-align:top;
}
/* OTHER STYLES */
.no_wrap {
white-space: nowrap;
}
.no_border {
border:none;
}
/*
** WIKI styles
*/
#toc,
.toc,
.mw-warning {
border: 1px solid #aaa;
background-color: #f9f9f9;
padding: 5px;
font-size: 95%;
}
#toc h2,
.toc h2 {
display: inline;
border: none;
padding: 0;
font-size: 100%;
font-weight: bold;
}
#toc #toctitle,
.toc #toctitle,
#toc .toctitle,
.toc .toctitle {
text-align: center;
}
#toc ul,
.toc ul {
list-style-type: none;
list-style-image: none;
margin-left: 0;
padding-left: 0;
text-align: left;
}
#toc ul ul,
.toc ul ul {
margin: 0 0 0 2em;
}
#toc .toctoggle,
.toc .toctoggle {
font-size: 94%;
}
.thumbcaption {
border: none;
text-align: left;
line-height: 1.4em;
padding: 3px !important;
font-size: 94%;
}
.location-right {
clear: right;
float: right;
border-width: .5em 0 .8em 1.4em;
}
.location-left {
float: left;
clear: left;
margin-right: .5em;
border-width: .5em 1.4em .8em 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,22 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
>
<ui:composition template="/jsp/includes/layout.xhtml">
<ui:define name="title">Vasc Admin</ui:define>
<ui:define name="content">
<rich:panel style="width:90%;margin-top:2em;">
<f:facet name="header">
<h:outputText value="Vasc Admin" />
</f:facet>
<rich:dataList var="info" value="#{vascFacesController.vascAdminEntries}">
<h:column>
<h:outputLink value="#{facesContext.externalContext.requestContextPath}/vasc/#{info}/list.jsf"><h:outputText value="#{info}"/></h:outputLink>
</h:column>
</rich:dataList>
</rich:panel>
</ui:define>
</ui:composition>
</html>

View File

@ -0,0 +1,10 @@
<ui:composition template="/jsp/includes/layout.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
>
<ui:define name="title">Help</ui:define>
<ui:define name="content"><h:outputText value="Help"/></ui:define>
</ui:composition>

View File

@ -0,0 +1,15 @@
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
>
<rich:panel header="User Greeter" style="width: 315px">
<h2><h:outputText value="Hello User" /></h2>
<h:outputLink value="user/index.jsf">
<h:outputText value="Login" />
</h:outputLink>
<h:outputText value="Already Loggedin."/>
</rich:panel>
</ui:composition>

View File

@ -0,0 +1,16 @@
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
>
<rich:panel header="User Greeter" style="width: 315px">
<h2><h:outputText value="Hello User" /></h2>
<h:outputText value="Name: " />
<h:outputText value="#{userController.flowUser.username}" />
<rich:dataList value="#{userController.rightRoles}" var="role">
<h:outputText value="#{role.roleKey}" />
</rich:dataList>
</rich:panel>
</ui:composition>

View File

@ -0,0 +1,71 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<meta name="robots" content="noodp"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta name="description" content="logstats"/>
<meta name="keywords" content="logstats,log,log4j,jboss,index,statistics,forwardfire,x4o,vasc,java"/>
<title><ui:insert name="title">Default title</ui:insert></title>
<link href="#{facesContext.externalContext.requestContextPath}/css/site.css" rel="stylesheet" type="text/css"/>
<!--[if IE 6]><link href="#{facesContext.externalContext.requestContextPath}/css/ie6_fixes.css" rel="stylesheet" type="text/css" /><![endif]-->
<!--[if IE 7]><link href="#{facesContext.externalContext.requestContextPath}/css/ie7_fixes.css" rel="stylesheet" type="text/css" /><![endif]-->
<!--[if IE 8]><link href="#{facesContext.externalContext.requestContextPath}/css/ie8_fixes.css" rel="stylesheet" type="text/css" /><![endif]-->
</head>
<body>
<f:view>
<div id="page_wrap">
<div id="page_header">
<a href="#{facesContext.externalContext.requestContextPath}/jsp/index.jsf"><img src="#{facesContext.externalContext.requestContextPath}/img/logstats-logo.png" alt="LogStats Logo" /></a>
<div id="page_menu_left">
</div>
<div id="page_menu_right">
<a href="#{facesContext.externalContext.requestContextPath}/jsp/index.jsf" class="active">Home</a>
<a href="#{facesContext.externalContext.requestContextPath}/jsp/reports.jsf">Reports</a>
<a href="#{facesContext.externalContext.requestContextPath}/jsp/realtime.jsf">Log</a>
<a href="#{facesContext.externalContext.requestContextPath}/jsp/help.jsf">Help</a>
<h:outputLink rendered="#{userController.userLoggedin}" value="#{facesContext.externalContext.requestContextPath}/jsp/admin/index.jsf">
<h:outputText value="Admin"/>
</h:outputLink>
</div>
<div id="page_user_info">
<h:outputLink rendered="#{userController.userLoggedin == false}" value="#{facesContext.externalContext.requestContextPath}/jsp/admin/index.jsf">
<h:outputText value="Login"/>
</h:outputLink>
<h:panelGroup rendered="#{userController.userLoggedin == true}">
<h:outputText value="#{userController.user.username}"/>
<h:outputText value=" - "/>
<h:outputLink value="#{facesContext.externalContext.requestContextPath}/jsp/login/logout.jsf">
<h:outputText value="Logout"/>
</h:outputLink>
</h:panelGroup>
</div>
</div>
<div id="page_content">
<h1><ui:insert name="title" /></h1>
<ui:insert name="content"/>
</div>
<div class="spacer">&nbsp;</div>
<div id="page_footer">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="4" class="text_center">LogStats for logging your stats.</td>
</tr>
<tr class="copyright">
<td colspan="2" class="text_left">Copyright &copy; none</td>
<td colspan="2" class="text_right">
Versie 0.8Beta -rXxx
<i>(2010-06-26 01:07)</i>
</td>
</tr>
</table>
</div>
</div>
</f:view>
</body>
</html>

View File

@ -0,0 +1,318 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:v="http://vasc.forwardfire.net/vasc.tld"
xmlns:rich="http://richfaces.org/rich"
>
<ui:composition template="/jsp/includes/layout.xhtml">
<ui:define name="title">
<h:outputText value="#{requestScopeVascEntityNameI18n}" />
</ui:define>
<ui:define name="content">
<script language="javascript" type="text/javascript">
<![CDATA[
function selectAllCheckboxes(x) {
for (var i=0,l=x.form.length; i<l; i++) {
if (x.form[i].type == 'checkbox' && (!x.form[i].disabled) && x!=x.form[i] ) {
x.form[i].checked=!x.form[i].checked;
}
}
}
]]>
</script>
<v:vascEntry vascController="#{vascFacesController.vascController}"
vascFrontendData="#{vascFacesController.newVascFrontendData}"
entryName="#{requestScopeVascEntityName}"
entrySupportVar="entrySupport"
tableRecordVar="tableRecord"
injectEditFieldsId="injectEditFieldsId"
injectTableOptionsId="injectTableOptionsId"
injectTableColumnsId="injectTableColumnsId"
disableLinkColumns="true"
>
<f:facet name="deleteView" >
<h:panelGroup>
<!-- <h1><h:outputText value="#{entrySupport.i18nMap[entrySupport.vascEntry.name]}"/></h1> -->
<p>
<h:outputFormat value="#{entrySupport.i18nMap[entrySupport.vascEntry.deleteDescription]}" escape="false">
<f:param value="#{entrySupport.selectedDisplayName}" />
</h:outputFormat>
</p>
<h:form>
<h:commandButton actionListener="#{entrySupport.deleteAction}" value="#{entrySupport.i18nMap['vasc.action.deleteRowAction.name']}"/>
<h:commandButton actionListener="#{entrySupport.cancelAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.action.cancel']}" />
</h:form>
</h:panelGroup>
</f:facet>
<f:facet name="exportView" >
<h:panelGroup>
<!-- <h1><h:outputText value="#{entrySupport.i18nMap[entrySupport.vascEntry.name]}"/></h1> -->
<p>
<h:outputFormat value="#{entrySupport.i18nMap[entrySupport.vascEntry.exportDescription]}" escape="false">
<f:param value="#{entrySupport.vascEntry.name}" />
</h:outputFormat>
</p>
<h:form>
<h:commandButton actionListener="#{entrySupport.cancelAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.action.cancel']}" />
</h:form>
</h:panelGroup>
</f:facet>
<f:facet name="editView" >
<h:panelGroup>
<!-- <h1><h:outputText value="#{entrySupport.i18nMap[entrySupport.vascEntry.name]}"/></h1> -->
<p>
<h:outputFormat value="#{entrySupport.i18nMap[entrySupport.vascEntry.editDescription]}" escape="false" rendered="#{!entrySupport.vascEntry.vascFrontendData.vascEntryState.editCreate}">
<f:param value="#{entrySupport.vascEntry.name}" />
</h:outputFormat>
<h:outputFormat value="#{entrySupport.i18nMap[entrySupport.vascEntry.createDescription]}" escape="false" rendered="#{entrySupport.vascEntry.vascFrontendData.vascEntryState.editCreate}">
<f:param value="#{entrySupport.vascEntry.name}" />
</h:outputFormat>
</p>
<h:form>
<ul class="actionboxtab">
<li><a class="active"><h:outputText value="#{entrySupport.i18nMap['vasc.action.editRowAction.name']}"/></a></li>
<ui:repeat var="link" value="#{entrySupport.vascLinkEntriesEditTab}" rendered="#{!entrySupport.vascEntry.vascFrontendData.vascEntryState.editCreate}">
<li><h:commandLink actionListener="#{entrySupport.linkEditAction}" value="#{entrySupport.i18nMap[link.name]}" type="#{link.id}"/></li>
</ui:repeat>
</ul>
<h:panelGrid columns="1" styleClass="actionbox" width="100%">
<h:outputText value="&amp;nbsp;&amp;nbsp;" escape="false"/>
</h:panelGrid>
</h:form>
<br/>
<h:form>
<h:panelGrid columns="3" id="injectEditFieldsId" styleClass="actionbox"/>
<p>
<h:commandButton actionListener="#{entrySupport.saveAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.action.save']}"/>
<h:commandButton actionListener="#{entrySupport.cancelAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.action.cancel']}" />
</p>
</h:form>
</h:panelGroup>
</f:facet>
<f:facet name="listView" >
<h:panelGroup>
<!-- <h1><h:outputText value="#{entrySupport.i18nMap[entrySupport.vascEntry.name]}"/></h1> -->
<p>
<h:outputFormat value="#{entrySupport.i18nMap[entrySupport.vascEntry.listDescription]}" escape="false">
<f:param value="#{entrySupport.vascEntry.name}" />
</h:outputFormat>
</p>
<h:form>
<p>
<h:commandButton actionListener="#{entrySupport.addAction}"
rendered="#{entrySupport.vascEntry.vascAdminCreate}"
value="#{entrySupport.i18nMap['vasc.action.addRowAction.name']}"
title="#{entrySupport.i18nMap['vasc.action.addRowAction.description']}"
/>
<h:commandButton actionListener="#{entrySupport.backAction}"
rendered="#{entrySupport.renderBackAction}"
value="#{entrySupport.i18nMap['generic.vasc.jsf.action.back']}"
/>
</p>
</h:form>
<h:form>
<rich:dataTable id="injectTableColumnsId" var="tableRecord" value="#{entrySupport.tableDataModel}" rowClasses="odd,even">
<f:facet name="header">
<rich:columnGroup>
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left">
<ul class="actionboxtab">
<li>
<h:panelGroup rendered="#{!entrySupport.renderBackAction}">
<a class="active"><h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.listOption.header']}"/></a>
</h:panelGroup>
<h:commandLink actionListener="#{entrySupport.backEditAction}" value="#{entrySupport.i18nMap['vasc.action.editRowAction.name']}" rendered="#{entrySupport.renderBackEditAction}"/>
</li>
<ui:repeat var="link" value="#{entrySupport.vascLinkEntriesEditTabParentState}">
<li><h:commandLink actionListener="#{entrySupport.linkListAction}" value="#{entrySupport.i18nMap[link.name]}" type="#{link.id}" styleClass="#{link.vascEntryId==entrySupport.vascEntry.id?'active':''}"/></li>
</ui:repeat>
</ul>
<h:panelGrid columns="1" styleClass="actionbox" width="100%">
<h:panelGrid columns="2" id="injectTableOptionsId"/>
<h:panelGroup>
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.listOption.search']}"/>
<h:inputText value="#{entrySupport.searchString}"/>
<h:commandButton actionListener="#{entrySupport.searchAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.listOption.sumbit']}"/>
</h:panelGroup>
</h:panelGrid>
</rich:column>
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left" breakBefore="true">
<ul class="paging">
<li class="paging_atstart">
<h:commandLink rendered="#{entrySupport.hasPagePreviousAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.previous']}"
actionListener="#{entrySupport.pagePreviousAction}"/>
<h:outputText rendered="#{!entrySupport.hasPagePreviousAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.previous']}" />
</li>
<ui:repeat var="page" value="#{entrySupport.tablePagesDataModel}" rendered="#{!entrySupport.hasExtendedPageMode}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
<h:panelGroup rendered="#{entrySupport.hasExtendedPageMode}">
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedBegin}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
<h:panelGroup rendered="#{entrySupport.hasExtendedPageModeCenter}">
<li><span class="text">...</span></li>
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedCenter}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
</h:panelGroup>
<li><span class="text">...</span></li>
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedEnd}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
</h:panelGroup>
<li class="paging_atend">
<h:commandLink rendered="#{entrySupport.hasPageNextAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.next']}"
actionListener="#{entrySupport.pageNextAction}"/>
<h:outputText rendered="#{!entrySupport.hasPageNextAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.next']}" />
</li>
</ul>
</rich:column>
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left" breakBefore="true">
<h:panelGroup styleClass="table_options_top">
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.rows']}" />
<h:inputText required="false" value="#{entrySupport.vascEntry.vascFrontendData.vascEntryState.vascBackendState.pageSize}" size="4"/>
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.pagerDirect']}" />
<h:selectOneMenu onchange="javascript:this.form.submit(); return false;" value="#{entrySupport.selectedDirectPage}" valueChangeListener="#{entrySupport.processDirectPageChange}">
<f:selectItems value="#{entrySupport.directPageItems}" />
</h:selectOneMenu>
<img src="#{facesContext.externalContext.requestContextPath}/img/icon_download.png" alt="#{entrySupport.i18nMap['generic.vasc.jsf.table.download.img']}" width="15" height="15" /><h:outputText value="&amp;nbsp;&amp;nbsp;" escape="false"/>
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.downloadDirect']}" />
<h:selectOneMenu onchange="javascript:this.form.submit(); return false;" value="#{entrySupport.selectedExporterAction}" valueChangeListener="#{entrySupport.processDirectDownloadChange}">
<f:selectItems value="#{entrySupport.globalExportItems}" />
</h:selectOneMenu>
<img src="#{facesContext.externalContext.requestContextPath}/img/icon_print.png" alt="#{entrySupport.i18nMap['generic.vasc.jsf.table.printer.img']}" width="15" height="15" /><h:outputText value="&amp;nbsp;&amp;nbsp;" escape="false"/>
<h:outputFormat value="#{entrySupport.i18nMap['generic.vasc.jsf.table.resultText']}">
<f:param value="#{entrySupport.pageStartCount}" />
<f:param value="#{entrySupport.pageStopCount}" />
<f:param value="#{entrySupport.pageTotalRecordCount}" />
</h:outputFormat>
</h:panelGroup>
</rich:column>
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left" breakBefore="true" rendered="#{entrySupport.hasMultiRowActions}">
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.multiAction.selectAll']}"/>
<h:selectBooleanCheckbox id="selectAllBox" required="false" onchange="javascript:selectAllCheckboxes(this);return false;" value="#{entrySupport.selectAllValue}"/>
<h:outputText value="&amp;nbsp;&amp;nbsp;" escape="false"/>
<h:selectOneMenu id="multiAction" required="false" value="#{entrySupport.selectedMultiRowAction}" onchange="javascript:this.form.submit(); return false;" valueChangeListener="#{entrySupport.processMultiRowActionChange}">
<f:selectItems value="#{entrySupport.multiRowActionItems}" />
</h:selectOneMenu>
</rich:column>
<rich:column colspan="#{entrySupport.totalFieldColumnCount}" breakBefore="true">
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.tableHeader.fields']}" styleClass="table_sub_header"/>
</rich:column>
<rich:column colspan="#{entrySupport.totalLinkColumnCount}" rendered="#{entrySupport.totalLinkColumnCount != 0}">
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.tableHeader.links']}" styleClass="table_sub_header"/>
</rich:column>
<rich:column colspan="#{entrySupport.totalActionColumnCount}" rendered="#{entrySupport.totalActionColumnCount != 0}">
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.tableHeader.actions']}" styleClass="table_sub_header"/>
</rich:column>
</rich:columnGroup>
</f:facet>
<f:facet name="footer">
<rich:columnGroup>
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left">
<h:panelGroup styleClass="table_options_bottom">
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.rows']}" />
<h:inputText required="false" value="#{entrySupport.vascEntry.vascFrontendData.vascEntryState.vascBackendState.pageSize}" size="4"/>
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.pagerDirect']}" />
<h:selectOneMenu onchange="javascript:this.form.submit(); return false;" value="#{entrySupport.selectedDirectPage}" valueChangeListener="#{entrySupport.processDirectPageChange}">
<f:selectItems value="#{entrySupport.directPageItems}" />
</h:selectOneMenu>
<img src="#{facesContext.externalContext.requestContextPath}/img/icon_download.png" alt="#{entrySupport.i18nMap['generic.vasc.jsf.table.download.img']}" width="15" height="15" /><h:outputText value="&amp;nbsp;&amp;nbsp;" escape="false"/>
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.downloadDirect']}" />
<h:selectOneMenu onchange="javascript:this.form.submit(); return false;" value="#{entrySupport.selectedExporterAction}" valueChangeListener="#{entrySupport.processDirectDownloadChange}">
<f:selectItems value="#{entrySupport.globalExportItems}" />
</h:selectOneMenu>
<img src="#{facesContext.externalContext.requestContextPath}/img/icon_print.png" alt="#{entrySupport.i18nMap['generic.vasc.jsf.table.printer.img']}" width="15" height="15" /><h:outputText value="&amp;nbsp;&amp;nbsp;" escape="false"/>
<h:outputFormat value="#{entrySupport.i18nMap['generic.vasc.jsf.table.resultText']}">
<f:param value="#{entrySupport.pageStartCount}" />
<f:param value="#{entrySupport.pageStopCount}" />
<f:param value="#{entrySupport.pageTotalRecordCount}" />
</h:outputFormat>
</h:panelGroup>
</rich:column>
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left" breakBefore="true">
<ul class="paging">
<li class="paging_atstart">
<h:commandLink rendered="#{entrySupport.hasPagePreviousAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.previous']}"
actionListener="#{entrySupport.pagePreviousAction}"/>
<h:outputText rendered="#{!entrySupport.hasPagePreviousAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.previous']}" />
</li>
<ui:repeat var="page" value="#{entrySupport.tablePagesDataModel}" rendered="#{!entrySupport.hasExtendedPageMode}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
<h:panelGroup rendered="#{entrySupport.hasExtendedPageMode}">
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedBegin}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
<h:panelGroup rendered="#{entrySupport.hasExtendedPageModeCenter}">
<li><span class="text">...</span></li>
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedCenter}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
</h:panelGroup>
<li><span class="text">...</span></li>
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedEnd}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
</h:panelGroup>
<li class="paging_atend">
<h:commandLink rendered="#{entrySupport.hasPageNextAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.next']}"
actionListener="#{entrySupport.pageNextAction}"/>
<h:outputText rendered="#{!entrySupport.hasPageNextAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.next']}" />
</li>
</ul>
</rich:column>
</rich:columnGroup>
</f:facet>
</rich:dataTable>
</h:form>
<h:form>
<p>
<h:commandButton actionListener="#{entrySupport.addAction}"
rendered="#{entrySupport.vascEntry.vascAdminCreate}"
value="#{entrySupport.i18nMap['vasc.action.addRowAction.name']}"
title="#{entrySupport.i18nMap['vasc.action.addRowAction.description']}"/>
</p>
</h:form>
</h:panelGroup>
</f:facet>
</v:vascEntry>
</ui:define>
</ui:composition>
</html>

View File

@ -0,0 +1,10 @@
<ui:composition template="/jsp/includes/layout.xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
<ui:define name="title">
<h:outputText value="#{wikiPageController.wikiTitle}" />
</ui:define>
<ui:define name="content">
<h:outputText value="#{wikiPageController.wikiContent}" escape="false"/>
</ui:define>
</ui:composition>

View File

@ -0,0 +1,20 @@
<ui:composition template="/jsp/includes/layout.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
>
<ui:define name="title">Index</ui:define>
<ui:define name="content">
<h:outputText value="Test etsdfjs "/>
<!--
<h:panelGroup rendered="#{userController.userLoggedin == false}">
<ui:include src="/jsp/includes/index-public.xhtml"/>
</h:panelGroup>
<h:panelGroup rendered="#{userController.userLoggedin == true}">
<ui:include src="/jsp/includes/index-user.xhtml"/>
</h:panelGroup
-->
</ui:define>
</ui:composition>

View File

@ -0,0 +1,2 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:redirect url="jsp/index.jsf"/>

View File

@ -0,0 +1,11 @@
<ui:composition template="/jsp/includes/layout.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
>
<ui:define name="title">Error</ui:define>
<ui:define name="content">
<h:outputText value="Could not login" />
</ui:define>
</ui:composition>

View File

@ -0,0 +1,11 @@
<ui:composition template="/jsp/includes/layout.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
>
<ui:define name="title">Forgot</ui:define>
<ui:define name="content">
<h:outputText value="Could forgot my login, send it to me" />
</ui:define>
</ui:composition>

Some files were not shown because too many files have changed in this diff Show More