1
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

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);
}
}