diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dc955ab --- /dev/null +++ b/.gitignore @@ -0,0 +1,42 @@ +# +# Ignore some files in the logstats project. +# + +# Ignore all maven target directories +/target +*/target +*/*/target +*/*/*/target + +# Ignore leftovers of really failed release build +release.properties +pom.xml.next +pom.xml.releaseBackup +pom.xml.backup +pom.xml.branch +pom.xml.tag +# Ignore version plugin backup +pom.xml.versionsBackup + + +# Ignore C/java/images binary files +*.o +*.hex +*.dat +*.bmp +*.gif +*.pdf + +# Ignore netbeans directory +nbproject + +# Ignore mac finder files +.DS_Store + +# Ignore windows files. +Thumbs.db +Desktop.ini + +# Ignore auto eclipse plugins settings +org.eclipse.wst.common.component +org.eclipse.wst.common.project.facet.core.xml diff --git a/.project b/.project index fbec084..e76b6dc 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - logstats-base + logstats diff --git a/logstats-ear/.classpath b/logstats-ear/.classpath new file mode 100644 index 0000000..3f62785 --- /dev/null +++ b/logstats-ear/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/logstats-ear/.project b/logstats-ear/.project new file mode 100644 index 0000000..9dd2202 --- /dev/null +++ b/logstats-ear/.project @@ -0,0 +1,29 @@ + + + logstats-ear + + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.common.modulecore.ModuleCoreNature + + diff --git a/logstats-ear/.settings/org.eclipse.core.resources.prefs b/logstats-ear/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..a28d758 --- /dev/null +++ b/logstats-ear/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Mon Jan 02 23:18:50 CET 2012 +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/logstats-ear/.settings/org.eclipse.jdt.core.prefs b/logstats-ear/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..657554d --- /dev/null +++ b/logstats-ear/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,13 @@ +#Thu Jun 10 02:50:42 CEST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.4 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.4 diff --git a/logstats-ear/.settings/org.eclipse.m2e.core.prefs b/logstats-ear/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..bf4333d --- /dev/null +++ b/logstats-ear/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,5 @@ +#Mon Jan 02 23:18:47 CET 2012 +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/logstats-ear/.settings/org.maven.ide.eclipse.prefs b/logstats-ear/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 0000000..6903895 --- /dev/null +++ b/logstats-ear/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Wed Jun 09 21:35:29 CEST 2010 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/logstats-ear/.settings/org.maven.ide.eclipse.wtp.prefs b/logstats-ear/.settings/org.maven.ide.eclipse.wtp.prefs new file mode 100644 index 0000000..013bc07 --- /dev/null +++ b/logstats-ear/.settings/org.maven.ide.eclipse.wtp.prefs @@ -0,0 +1,3 @@ +#Tue Jan 03 00:48:11 CET 2012 +eclipse.preferences.version=1 +org.maven.ide.eclipse.wtp.enabledProjectSpecificPrefs=false diff --git a/logstats-ear/pom.xml b/logstats-ear/pom.xml new file mode 100644 index 0000000..f291646 --- /dev/null +++ b/logstats-ear/pom.xml @@ -0,0 +1,185 @@ + + 4.0.0 + + logstats + net.forwardfire.logstats + 0.0.1-SNAPSHOT + + logstats-ear + ear + logstats-ear + logstats-ear + + logstats-jboss + + + maven-ear-plugin + + true + + + + + + com.sun.facelets + jsf-facelets + true + + + net.forwardfire.logstats + logstats-ejb + + + net.forwardfire.logstats + logstats-war + /logstats + + + + org.x4o + x4o-core + true + + + net.forwardfire.vasc + vasc-core + true + + + net.forwardfire.vasc + vasc-backend-jpa + true + + + net.forwardfire.vasc + vasc-xpql-ejb3 + + + net.forwardfire.vasc + vasc-ejb3 + + + net.forwardfire.vasc + vasc-xpql + true + + + + + + + + + + + + + net.forwardfire.logstats + logstats-ejb + ejb + ${project.version} + + + net.forwardfire.logstats + logstats-war + war + ${project.version} + + + + com.sun.facelets + jsf-facelets + 1.1.11 + + + + + org.x4o + x4o-core + ${x4o-core.version} + + + + + net.forwardfire.vasc + vasc-backend-jpa + ${vasc.version} + + + + + net.forwardfire.vasc + vasc-xpql-ejb3 + ${vasc.version} + ejb + + + net.forwardfire.vasc + vasc-ejb3 + ${vasc.version} + ejb + + + + + + + javax.el + el-ri + 1.2 + provided + + + + javax.el + el-api + 1.2 + provided + + + + \ No newline at end of file diff --git a/logstats-ejb/.classpath b/logstats-ejb/.classpath new file mode 100644 index 0000000..0b58ddc --- /dev/null +++ b/logstats-ejb/.classpath @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/logstats-ejb/.project b/logstats-ejb/.project new file mode 100644 index 0000000..a1b1928 --- /dev/null +++ b/logstats-ejb/.project @@ -0,0 +1,36 @@ + + + logstats-ejb + + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.common.project.facet.core.nature + + diff --git a/logstats-ejb/.settings/org.eclipse.core.resources.prefs b/logstats-ejb/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..9d17326 --- /dev/null +++ b/logstats-ejb/.settings/org.eclipse.core.resources.prefs @@ -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/=UTF-8 diff --git a/logstats-ejb/.settings/org.eclipse.jdt.core.prefs b/logstats-ejb/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..3d0c4d7 --- /dev/null +++ b/logstats-ejb/.settings/org.eclipse.jdt.core.prefs @@ -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 diff --git a/logstats-ejb/.settings/org.eclipse.m2e.core.prefs b/logstats-ejb/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..bf4333d --- /dev/null +++ b/logstats-ejb/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,5 @@ +#Mon Jan 02 23:18:47 CET 2012 +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/logstats-ejb/.settings/org.maven.ide.eclipse.prefs b/logstats-ejb/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 0000000..e3484c2 --- /dev/null +++ b/logstats-ejb/.settings/org.maven.ide.eclipse.prefs @@ -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 diff --git a/logstats-ejb/pom.xml b/logstats-ejb/pom.xml new file mode 100644 index 0000000..3a9fb51 --- /dev/null +++ b/logstats-ejb/pom.xml @@ -0,0 +1,92 @@ + + 4.0.0 + + logstats + net.forwardfire.logstats + 0.0.1-SNAPSHOT + + logstats-ejb + ejb + logstats-ejb + logstats-ejb + + + + org.apache.maven.plugins + maven-ejb-plugin + + 3.0 + + + + + + + javax.ejb + ejb-api + 3.0 + provided + + + javax.persistence + persistence-api + 1.0 + provided + + + org.hibernate + hibernate-annotations + 3.4.0.GA + provided + + + + + org.x4o + x4o-core + ${x4o-core.version} + provided + + + + javax.el + el-ri + 1.2 + provided + + + + javax.el + el-api + 1.2 + provided + + + + + net.forwardfire.vasc + vasc-backend-jpa + ${vasc.version} + provided + + + net.forwardfire.vasc + vasc-xpql-ejb3 + ${vasc.version} + + + net.forwardfire.vasc + vasc-ejb3 + ${vasc.version} + + + + + opensymphony + quartz + 1.6.3 + provided + + + + \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/jobs/UpdateIndexJob.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/jobs/UpdateIndexJob.java new file mode 100644 index 0000000..90a291c --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/jobs/UpdateIndexJob.java @@ -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 logDataRealtime = new LinkedBlockingQueue(); + + /** + * @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 logValueLines = (List)xtesManager.execute("LogValueLine.getAllIndexActive",null); + List logHosts = (List)xtesManager.execute("LogHost.getAll",null); + List logSources = (List)xtesManager.execute("LogSource.getAll",null); + List 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 = 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 prepareData(List logValueLines) throws Exception { + // create logValueLine List + List lines = new ArrayList(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(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 = (List)xtesManager.execute("LogStats.getLastDay",null); + for (int i=0;i logData,List lines,List logHosts,List logSources) throws Exception { + + logger.info("parseLogData size: "+logData.size()+" lines: "+lines.size()); + // process the raw log data + Long lastId = null; + for (int i=0;itimeNumber) { + stats.setTimeMin(timeNumber); + } + if (stats.getTimeMax()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 logHosts,String hostname) throws Exception { + for (int i=0;i logSources,String source) throws Exception { + for (int i=0;i0) { + 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 logStats = null; + } +} diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/AbstractEntityBase.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/AbstractEntityBase.java new file mode 100644 index 0000000..83c134d --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/AbstractEntityBase.java @@ -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,Method> cachedEntityId = new HashMap,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; + } +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/AbstractFieldTemplates.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/AbstractFieldTemplates.java new file mode 100644 index 0000000..fb8dd27 --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/AbstractFieldTemplates.java @@ -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(); +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogData.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogData.java new file mode 100644 index 0000000..8b6feee --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogData.java @@ -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; + } +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogHost.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogHost.java new file mode 100644 index 0000000..f352c83 --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogHost.java @@ -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; + } +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogHostGroup.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogHostGroup.java new file mode 100644 index 0000000..29b6978 --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogHostGroup.java @@ -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; + } +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogLevel.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogLevel.java new file mode 100644 index 0000000..7510299 --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogLevel.java @@ -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; + } +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogRightRole.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogRightRole.java new file mode 100644 index 0000000..8dc7937 --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogRightRole.java @@ -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; + } +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogServerRun.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogServerRun.java new file mode 100644 index 0000000..f857a69 --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogServerRun.java @@ -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; + } +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogSource.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogSource.java new file mode 100644 index 0000000..c38eb80 --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogSource.java @@ -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; + } +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogStats.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogStats.java new file mode 100644 index 0000000..078ec1f --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogStats.java @@ -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; + } +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogUser.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogUser.java new file mode 100644 index 0000000..2b76e38 --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogUser.java @@ -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; + } +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogUserRightRole.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogUserRightRole.java new file mode 100644 index 0000000..d6008b2 --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogUserRightRole.java @@ -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; + } +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogUserSetting.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogUserSetting.java new file mode 100644 index 0000000..c9a339d --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogUserSetting.java @@ -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; + } +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogValue.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogValue.java new file mode 100644 index 0000000..cc119e1 --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogValue.java @@ -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; + } +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogValueLine.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogValueLine.java new file mode 100644 index 0000000..57881d5 --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogValueLine.java @@ -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; + } +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogValueType.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogValueType.java new file mode 100644 index 0000000..3f16c41 --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/models/LogValueType.java @@ -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; + } +} \ No newline at end of file diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/services/LoginManager.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/services/LoginManager.java new file mode 100644 index 0000000..24f9fb5 --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/services/LoginManager.java @@ -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 getClientRoles() throws Exception { + List result = new ArrayList(5); + Query q = xtesManager.getQuery("LogRightRole.getAllByUsername"); + q.setQueryParameter("username", session.getCallerPrincipal().getName()); + List list = xtesManager.execute(q); + for (Object o:list) { + LogRightRole rr = ((LogRightRole)o); + result.add(rr); + } + return result; + } +} diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/services/LoginManagerRemote.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/services/LoginManagerRemote.java new file mode 100644 index 0000000..2779818 --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/services/LoginManagerRemote.java @@ -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 getClientRoles() throws Exception; +} diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/services/ServerManager.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/services/ServerManager.java new file mode 100644 index 0000000..80e2fea --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/services/ServerManager.java @@ -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 getRealTimeLogData() { + List result = new ArrayList(200); + result.addAll(UpdateIndexJob.logDataRealtime); + return result; + } + + + /* + public ServerWikiPage getWikiPage(String name) { + Map para = new HashMap(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 getWikiPageHistory(Integer serverWikiPageId) { + List result = new ArrayList(1); + return result; + } + + */ +} diff --git a/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/services/ServerManagerRemote.java b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/services/ServerManagerRemote.java new file mode 100644 index 0000000..e811e2c --- /dev/null +++ b/logstats-ejb/src/main/java/net/forwardfire/logstats/ejb/services/ServerManagerRemote.java @@ -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 getRealTimeLogData(); + + /* + public ServerWikiPage getWikiPage(String name); + + public List getWikiPageHistory(Integer serverWikiPageId); + */ +} diff --git a/logstats-ejb/src/main/resources/META-INF/ejb-jar.xml b/logstats-ejb/src/main/resources/META-INF/ejb-jar.xml new file mode 100644 index 0000000..4cab75b --- /dev/null +++ b/logstats-ejb/src/main/resources/META-INF/ejb-jar.xml @@ -0,0 +1,5 @@ + + + logstats-ejb + logstats-ejb + \ No newline at end of file diff --git a/logstats-ejb/src/main/resources/META-INF/jboss.xml b/logstats-ejb/src/main/resources/META-INF/jboss.xml new file mode 100644 index 0000000..9f4725f --- /dev/null +++ b/logstats-ejb/src/main/resources/META-INF/jboss.xml @@ -0,0 +1,26 @@ + + + + + UpdateIndexJob + quartz-ra.rar + + + + \ No newline at end of file diff --git a/logstats-ejb/src/main/resources/META-INF/persistence.xml b/logstats-ejb/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..f0a7065 --- /dev/null +++ b/logstats-ejb/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,23 @@ + + + + + + java:logstats_dba + + + + + + + + + + + + + + \ No newline at end of file diff --git a/logstats-ejb/src/main/resources/META-INF/vasc-ejb3.xml b/logstats-ejb/src/main/resources/META-INF/vasc-ejb3.xml new file mode 100644 index 0000000..a76f41a --- /dev/null +++ b/logstats-ejb/src/main/resources/META-INF/vasc-ejb3.xml @@ -0,0 +1,11 @@ + + + + + Files to load + + net/forwardfire/logstats/resources/vasc/logstats.xml + java:/logstats_pu + logstats-jboss/ejb/xpqlQueryManager/local + net/forwardfire/logstats/resources/i18n/LogstatsBundleEJB + \ No newline at end of file diff --git a/logstats-ejb/src/main/resources/META-INF/xtes-xpql-ejb3.xml b/logstats-ejb/src/main/resources/META-INF/xtes-xpql-ejb3.xml new file mode 100644 index 0000000..8d262d7 --- /dev/null +++ b/logstats-ejb/src/main/resources/META-INF/xtes-xpql-ejb3.xml @@ -0,0 +1,9 @@ + + + + + Files to load + + net/forwardfire/logstats/resources/xpql/logstats.xml + java:/logstats_pu + \ No newline at end of file diff --git a/logstats-ejb/src/main/resources/net/forwardfire/logstats/resources/i18n/LogstatsBundleEJB_en.properties b/logstats-ejb/src/main/resources/net/forwardfire/logstats/resources/i18n/LogstatsBundleEJB_en.properties new file mode 100644 index 0000000..f26668f --- /dev/null +++ b/logstats-ejb/src/main/resources/net/forwardfire/logstats/resources/i18n/LogstatsBundleEJB_en.properties @@ -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 diff --git a/logstats-ejb/src/main/resources/net/forwardfire/logstats/resources/i18n/LogstatsBundleEJB_nl.properties b/logstats-ejb/src/main/resources/net/forwardfire/logstats/resources/i18n/LogstatsBundleEJB_nl.properties new file mode 100644 index 0000000..dd65487 --- /dev/null +++ b/logstats-ejb/src/main/resources/net/forwardfire/logstats/resources/i18n/LogstatsBundleEJB_nl.properties @@ -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 diff --git a/logstats-ejb/src/main/resources/net/forwardfire/logstats/resources/vasc/logstats.xml b/logstats-ejb/src/main/resources/net/forwardfire/logstats/resources/vasc/logstats.xml new file mode 100644 index 0000000..ca80e08 --- /dev/null +++ b/logstats-ejb/src/main/resources/net/forwardfire/logstats/resources/vasc/logstats.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/logstats-ejb/src/main/resources/net/forwardfire/logstats/resources/xpql/logstats.xml b/logstats-ejb/src/main/resources/net/forwardfire/logstats/resources/xpql/logstats.xml new file mode 100644 index 0000000..df44cca --- /dev/null +++ b/logstats-ejb/src/main/resources/net/forwardfire/logstats/resources/xpql/logstats.xml @@ -0,0 +1,117 @@ + + + + + SELECT lu FROM LogUser AS lu + + + + SELECT lu FROM LogUser AS lu + WHERE lu.username= + + + + + + SELECT lrr FROM LogRightRole AS lrr + + + + SELECT lrr FROM LogRightRole AS lrr + WHERE lrr.id IN (SELECT lurr.logRightRole.id FROM LogUserRightRole AS lurr WHERE lurr.logUser.username=) + + + + + + + SELECT lus FROM LogUserSetting AS lus + WHERE lus.logUser.id= + + + + + + + SELECT lurr FROM LogUserRightRole AS lurr + WHERE lurr.logUser.id= + + + + + + SELECT lhg FROM LogHostGroup AS lhg + + + + SELECT lh FROM LogHost AS lh INNER JOIN FETCH lh.logHostGroup + + + + SELECT ls FROM LogSource AS ls + + + + SELECT lvt FROM LogValueType AS lvt + + + + SELECT ll FROM LogLevel AS ll + + + + SELECT lsr FROM LogServerRun AS lsr WHERE (extract(doy FROM now()) - extract(doy FROM lsr.startDate)) < 1 ORDER BY lsr.startDate + + + + SELECT lsr FROM LogServerRun AS lsr WHERE lsr.id = (SELECT MAX(lsr2.id) FROM LogServerRun AS lsr2) + + + + SELECT lv FROM LogValue AS lv INNER JOIN FETCH lv.logValueType AS lvt + + + + + 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 + + + + + + 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= + + + + + + SELECT ld FROM LogData AS ld WHERE (extract(doy FROM now()) - extract(doy FROM ld.logDate)) < 1 ORDER BY ld.logDate + + + + SELECT ld FROM LogData AS ld WHERE ld.id > AND (extract(doy FROM now()) - extract(doy FROM ld.logDate)) = 0 + + + + + SELECT count(ld.id) FROM LogData AS ld WHERE (extract(doy FROM now()) - extract(doy FROM ld.logDate)) < 1 + + + + SELECT ls FROM LogStats AS ls WHERE (extract(doy FROM now()) - extract(doy FROM ls.logDay)) = 0 + + + \ No newline at end of file diff --git a/logstats-ejb/src/test/java/net/forwardfire/logstats/ejb/models/I18nTests.java b/logstats-ejb/src/test/java/net/forwardfire/logstats/ejb/models/I18nTests.java new file mode 100644 index 0000000..426dd46 --- /dev/null +++ b/logstats-ejb/src/test/java/net/forwardfire/logstats/ejb/models/I18nTests.java @@ -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 keys = new HashMap(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 keys2 = new ArrayList(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 keys2 = new ArrayList(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 keys2 = new ArrayList(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); + } +} diff --git a/logstats-jboss-sar/.classpath b/logstats-jboss-sar/.classpath new file mode 100644 index 0000000..7106942 --- /dev/null +++ b/logstats-jboss-sar/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/logstats-jboss-sar/.project b/logstats-jboss-sar/.project new file mode 100644 index 0000000..1e5c745 --- /dev/null +++ b/logstats-jboss-sar/.project @@ -0,0 +1,23 @@ + + + logstats-jboss-sar + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + + diff --git a/logstats-jboss-sar/.settings/org.eclipse.core.resources.prefs b/logstats-jboss-sar/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..36025ca --- /dev/null +++ b/logstats-jboss-sar/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,7 @@ +#Mon Jan 02 23:18:49 CET 2012 +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 diff --git a/logstats-jboss-sar/.settings/org.eclipse.jdt.core.prefs b/logstats-jboss-sar/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..9b09027 --- /dev/null +++ b/logstats-jboss-sar/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,6 @@ +#Sat Jun 12 01:12:26 CEST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/logstats-jboss-sar/.settings/org.eclipse.m2e.core.prefs b/logstats-jboss-sar/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..bf4333d --- /dev/null +++ b/logstats-jboss-sar/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,5 @@ +#Mon Jan 02 23:18:47 CET 2012 +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/logstats-jboss-sar/.settings/org.maven.ide.eclipse.prefs b/logstats-jboss-sar/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 0000000..0cef1b3 --- /dev/null +++ b/logstats-jboss-sar/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Sat Jun 12 01:12:25 CEST 2010 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/logstats-jboss-sar/pom.xml b/logstats-jboss-sar/pom.xml new file mode 100644 index 0000000..74b7920 --- /dev/null +++ b/logstats-jboss-sar/pom.xml @@ -0,0 +1,27 @@ + + 4.0.0 + + logstats + net.forwardfire.logstats + 0.0.1-SNAPSHOT + + logstats-jboss-sar + jboss-sar + logstats-jboss-sar + logstats-jboss-sar + + + + org.jboss.jbossas + jboss-as-system-jmx + 5.1.0.GA + provided + + + \ No newline at end of file diff --git a/logstats-jboss-sar/src/main/java/net/forwardfire/logstats/jboss/log4j/DataSourceLog4jAppender.java b/logstats-jboss-sar/src/main/java/net/forwardfire/logstats/jboss/log4j/DataSourceLog4jAppender.java new file mode 100644 index 0000000..a4489af --- /dev/null +++ b/logstats-jboss-sar/src/main/java/net/forwardfire/logstats/jboss/log4j/DataSourceLog4jAppender.java @@ -0,0 +1,67 @@ +package net.forwardfire.logstats.jboss.log4j; + +import org.apache.log4j.AppenderSkeleton; +import org.apache.log4j.spi.LoggingEvent; +import org.jboss.logging.Logger; + +/** + * Appends log4j messages to the logService MBean + * + * @author Willem Cazander + * @version 1.0 Jun 09, 2010 + */ +public class DataSourceLog4jAppender extends AppenderSkeleton { + + private DataSourceLogService logService = null; + private Logger logger = Logger.getLogger(DataSourceLog4jAppender.class.getName()); + + /** + * constructor + * @throws Exception + */ + public DataSourceLog4jAppender(DataSourceLogService logService) { + super(); + if (logService==null) { + throw new NullPointerException("Can't start with null logService."); + } + this.logService=logService; + setName(logService.getLog4jAppenderName()); + logger.info("Created DataSourceLog4jAppender with name: "+getName()); + } + + + /** + * Closes this appender privately. + */ + public void shutdown() { + logService = null; + logger.info("Closed DataSourceLog4jAppender with name: "+getName()); + } + + /** + * Closes this appender but is left empty because of fake call. + */ + public void close() { + } + + /** + * Put LoggingEvent in queue for processing. + */ + public void append(LoggingEvent event) { + if (logService==null) { + return; + } + try { + logService.putLoggingEvent(event); + } catch (InterruptedException e) { + // we don't log in appender, in case of loop. + } + } + + /** + * DataSourceLog4jAppender don't require a layout. + */ + public boolean requiresLayout() { + return false; + } +} \ No newline at end of file diff --git a/logstats-jboss-sar/src/main/java/net/forwardfire/logstats/jboss/log4j/DataSourceLogPersistThread.java b/logstats-jboss-sar/src/main/java/net/forwardfire/logstats/jboss/log4j/DataSourceLogPersistThread.java new file mode 100644 index 0000000..5f871c8 --- /dev/null +++ b/logstats-jboss-sar/src/main/java/net/forwardfire/logstats/jboss/log4j/DataSourceLogPersistThread.java @@ -0,0 +1,222 @@ + + +package net.forwardfire.logstats.jboss.log4j; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Timestamp; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.sql.DataSource; + +import org.apache.log4j.Level; +import org.apache.log4j.spi.LoggingEvent; +import org.jboss.logging.Logger; + +/** + * Perists the messages of the queue + * + * @author Willem Cazander + * @version 1.0 Jun 09, 2010 + */ +public class DataSourceLogPersistThread extends Thread { + + private DataSourceLogService logService = null; + private Logger logger = Logger.getLogger(DataSourceLogPersistThread.class.getName()); + + /** + * Constructor with the LogService + * @param logService + */ + public DataSourceLogPersistThread(DataSourceLogService logService) { + this.logService = logService; + } + + /** + * Perists the messages of the queue + * + * @see java.lang.Thread#run() + */ + @Override + public void run() { + long idleTimer = System.currentTimeMillis(); + + // setup DB connection from datasource + Connection conn = null; + try { + conn = getConnection(); + } catch (SQLException e) { + logger.error("init getConnection failed, error: "+e.getMessage(),e); + return; + } catch (NamingException e) { + logger.error("init getConnection datasource lookup failed, error: "+e.getMessage(),e); + return; + } + + // Get hostname setup + String hostname = null; + try { + hostname = InetAddress.getLocalHost().getHostName(); + } catch (UnknownHostException e) { + logger.error("init getLocalHost failed, error: "+e.getMessage(),e); + try { + conn.close(); + } catch (SQLException se) { + logger.warn("init connection close failed, SQLException: "+se.getMessage(),e); + } + return; + } + if (logService.getBackendHostname()!=null && logService.getBackendHostname().isEmpty()==false) { + hostname = logService.getBackendHostname(); + } + + // Test and record out one thread + try { + storeLogData(conn,hostname,System.currentTimeMillis(),Level.DEBUG.toInt(),this.getClass().getName(),"Startup and connection of thread: "+getName()); + } catch (SQLException e) { + logger.error("test connection message error: "+e.getMessage(),e); + try { + if (conn!=null && conn.isClosed()==false) { + conn.close(); + } + } catch (SQLException se) { + logger.warn("test connection close failed, SQLException: "+se.getMessage(),se); + } + return; + } + + // main loop + int errorCount = 0; + while (isInterrupted()==false) { + LoggingEvent logMessage = null; + try { + logMessage = logService.pollLoggingEvent(); + } catch (InterruptedException e) { + break; + } + if (logMessage!=null) { + try { + // convert + String message = convertMessage(logMessage.getMessage()); + + // persist message + storeLogData( conn,hostname,logMessage.timeStamp,logMessage.getLevel().toInt(),logMessage.getLoggerName(),message ); + + } catch (SQLException se) { + if (errorCount==0) { + logger.error("storeLogData() failed, error: "+se.getMessage()); + } + errorCount++; + if (errorCount>1000) { + logger.error("storeLogData() failed 1000 times, last error: "+se.getMessage()); + errorCount=0; + } + } + } else { + if (checkConnection(conn) == false) { + try { + if (conn!=null && conn.isClosed()==false) { + conn.close(); + } + } catch (SQLException se) { + logger.warn("connection close failed, SQLException: "+se.getMessage(),se); + } + try { + conn = getConnection(); + } catch (Exception ee) { + logger.error("failure in getConnection() error:"+ee.getMessage(),ee); + break; + } + } else { + if (logService.getBackendIdleMarkerTime()>0) { + // check for update of idle timer + if ((System.currentTimeMillis()-idleTimer) > logService.getBackendIdleMarkerTime()*1000) { + idleTimer = System.currentTimeMillis(); + logger.info(logService.getBackendIdleMarkerMessage()+" thread: "+getName()); + } + } + } + } + } + + // exit thread + logger.info("shutdown thread: "+getName()); + try { + if (conn!=null && conn.isClosed()==false) { + conn.close(); + } + } catch (SQLException e) { + logger.warn("connection close failed, SQLException: "+e.getMessage()); + } + } + + private Connection getConnection() throws SQLException,NamingException { + String dataSourceName = logService.getBackendDataSource(); + logger.debug("Getting connection from datasource: "+dataSourceName+" for thread: "+getName()); + Context naming = new InitialContext(); + DataSource dataSource = (DataSource) naming.lookup(dataSourceName); + return dataSource.getConnection(); + } + + public boolean checkConnection(Connection connection) { + if (connection==null) { + return false; + } + try { + return connection.prepareStatement(logService.getBackendKeepAliveQuery()).execute(); + } catch (SQLException e) { + logger.error("checkConnection: SQLException: "+e.getMessage(),e); + return false; + } + } + + /** + * Message is not always a string so check for some types we can handle. + * + * @param messageObj + * @return + */ + private String convertMessage(Object messageObj) { + String message = null; + if (messageObj == null ) { + message = "NULL"; + } else if (messageObj instanceof String) { + message = (String)messageObj; + } else if (messageObj instanceof Exception) { + message = ((Exception)messageObj).getMessage(); + } else { + message = messageObj.toString(); + } + return message; + } + + private void storeLogData(Connection connection,String host,long time, int level, String source, String message) throws SQLException { + PreparedStatement stmt = null; + Timestamp timeStamp = new Timestamp(time); + stmt = connection.prepareStatement(logService.getBackendLogQuery()); + String para = logService.getBackendLogQueryParameters(); + String[] paras = para.split(","); + for (int i=1;i<=paras.length;i++) { + String col = paras[i-1]; + if ("time".equals(col)) { + stmt.setTimestamp(i, timeStamp); + } else if ("level".equals(col)) { + stmt.setInt(i, level); + } else if ("host".equals(col)) { + stmt.setString(i, host); + } else if ("source".equals(col)) { + stmt.setString(i, source); + } else if ("message".equals(col)) { + stmt.setString(i, message); + } else { + throw new IllegalArgumentException("Unknow column: "+col+" on index: "+i); + } + } + stmt.execute(); + } +} \ No newline at end of file diff --git a/logstats-jboss-sar/src/main/java/net/forwardfire/logstats/jboss/log4j/DataSourceLogService.java b/logstats-jboss-sar/src/main/java/net/forwardfire/logstats/jboss/log4j/DataSourceLogService.java new file mode 100644 index 0000000..3db1740 --- /dev/null +++ b/logstats-jboss-sar/src/main/java/net/forwardfire/logstats/jboss/log4j/DataSourceLogService.java @@ -0,0 +1,433 @@ +package net.forwardfire.logstats.jboss.log4j; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; + +import javax.xml.parsers.FactoryConfigurationError; + +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; +import org.apache.log4j.spi.LoggingEvent; +import org.apache.log4j.xml.DOMConfigurator; + +import org.jboss.logging.util.OnlyOnceErrorHandler; +import org.jboss.system.ServiceMBeanSupport; + +/** + * Jboss MBean which hooks DB logger to log4j and depends on a datasource for db access. + * + * Orginal idea was made by Edward Pilipczuk + * + * @author Willem Cazander + * @version 1.0 Jun 09, 2010 + */ +public class DataSourceLogService extends ServiceMBeanSupport implements DataSourceLogServiceMBean { + + // backend config options + private String backendDataSource = null; + private String backendLogQuery = "INSERT INTO log_data (log_date, log_level,hostname, source, message) VALUES (?,?,?,?,?)"; + private String backendLogQueryParameters = "time,level,host,source,message"; + private String backendHostname = null; + private int backendThreads = 3; + private int backendMaxQueueSize = 1500; + private int backendKeepAliveTimeout = 300; + private String backendKeepAliveQuery = "SELECT 1"; + private int backendIdleMarkerTime = 3600; + private String backendIdleMarkerMessage = "--- Mark ---"; + private boolean backendStatisticsLog = true; + private int backendStatisticsLogTime = 300; + + // log4j config options + private String log4jParseConfigResource = "META-INF/logstats-log4j.xml"; + private String log4jAppenderName = "LOGSTATS"; + private boolean log4jAppenderAutoAdd = true; + private boolean log4jAppenderAutoAddOnlyOnceError = true; + private boolean log4jAppenderToRoot = true; + + // stats counters + private int statsMessagesTotal = 0; + private int statsMessagesDropped = 0; + + // Internal state objects + volatile private boolean running = false; + private BlockingQueue messageQueue = null; + private DataSourceLog4jAppender appender = null; + private List persistThreads = null; + + // ===== Override ServiceMBeanSupport methods + + @Override + protected void startService() throws Exception { + messageQueue = new LinkedBlockingQueue(backendMaxQueueSize); + startLog4j(); + startBackend(); + running = true; + log.info("DataSourceLogService started; queueSize: "+backendMaxQueueSize+" threads: "+backendThreads); + } + + @Override + protected void stopService() throws Exception { + running = false; + try { + stopLog4j(); + } catch (Exception e) { + log.warn("Error in stopLog4j: "+e.getMessage()); + } finally { + try { + stopBackend(); + } catch (Exception e) { + log.warn("Error in stopBackend: "+e.getMessage()); + } finally { + log.info("DataSourceLogService stopped."); + } + } + } + + // =========== Private methods + + private void startBackend() { + persistThreads = new ArrayList(backendThreads); + for (int i=0;i0) { + messageQueue.put(event); + } else { + statsMessagesDropped++; + } + } + + protected LoggingEvent pollLoggingEvent() throws InterruptedException { + if (messageQueue==null) { + throw new IllegalStateException("LogService is not started"); + } + return messageQueue.poll(backendKeepAliveTimeout, TimeUnit.SECONDS); + } + + // ============== MBean methods + + /** + * Resets the stats counters + */ + public void resetStatsCounters() { + statsMessagesTotal = 0; + statsMessagesDropped = 0; + } + + /** + * @return the statsMessagesTotal + */ + public int getStatsMessagesTotal() { + return statsMessagesTotal; + } + + /** + * @return the statsMessagesDropped + */ + public int getStatsMessagesDropped() { + return statsMessagesDropped; + } + + /** + * @return the backendDataSource + */ + public String getBackendDataSource() { + return backendDataSource; + } + + /** + * @param backendDataSource the backendDataSource to set + */ + public void setBackendDataSource(String backendDataSource) { + this.backendDataSource = backendDataSource; + } + + /** + * @return the backendLogQuery + */ + public String getBackendLogQuery() { + return backendLogQuery; + } + + /** + * @param backendLogQuery the backendLogQuery to set + */ + public void setBackendLogQuery(String backendLogQuery) { + this.backendLogQuery = backendLogQuery; + } + + /** + * @return the backendLogQueryParameters + */ + public String getBackendLogQueryParameters() { + return backendLogQueryParameters; + } + + /** + * @param backendLogQueryParameters the backendLogQueryParameters to set + */ + public void setBackendLogQueryParameters(String backendLogQueryParameters) { + this.backendLogQueryParameters = backendLogQueryParameters; + } + + /** + * @return the backendHostname + */ + public String getBackendHostname() { + return backendHostname; + } + + /** + * @param backendHostname the backendHostname to set + */ + public void setBackendHostname(String backendHostname) { + this.backendHostname = backendHostname; + } + + /** + * @return the backendKeepAliveTimeout + */ + public int getBackendKeepAliveTimeout() { + return backendKeepAliveTimeout; + } + + /** + * @param backendKeepAliveTimeout the backendKeepAliveTimeout to set + */ + public void setBackendKeepAliveTimeout(int backendKeepAliveTimeout) { + this.backendKeepAliveTimeout = backendKeepAliveTimeout; + } + + /** + * @return the backendKeepAliveQuery + */ + public String getBackendKeepAliveQuery() { + return backendKeepAliveQuery; + } + + /** + * @param backendKeepAliveQuery the backendKeepAliveQuery to set + */ + public void setBackendKeepAliveQuery(String backendKeepAliveQuery) { + this.backendKeepAliveQuery = backendKeepAliveQuery; + } + + /** + * @return the backendThreads + */ + public int getBackendThreads() { + return backendThreads; + } + + /** + * @param backendThreads the backendThreads to set + */ + public void setBackendThreads(int backendThreads) { + this.backendThreads = backendThreads; + } + + /** + * @return the backendMaxQueueSize + */ + public int getBackendMaxQueueSize() { + return backendMaxQueueSize; + } + + /** + * @param backendMaxQueueSize the backendMaxQueueSize to set + */ + public void setBackendMaxQueueSize(int backendMaxQueueSize) { + this.backendMaxQueueSize = backendMaxQueueSize; + } + + /** + * @return the backendIdleMarkerTime + */ + public int getBackendIdleMarkerTime() { + return backendIdleMarkerTime; + } + + /** + * @param backendIdleMarkerTime the backendIdleMarkerTime to set + */ + public void setBackendIdleMarkerTime(int backendIdleMarkerTime) { + this.backendIdleMarkerTime = backendIdleMarkerTime; + } + + /** + * @return the backendIdleMarkerMessage + */ + public String getBackendIdleMarkerMessage() { + return backendIdleMarkerMessage; + } + + /** + * @param backendIdleMarkerMessage the backendIdleMarkerMessage to set + */ + public void setBackendIdleMarkerMessage(String backendIdleMarkerMessage) { + this.backendIdleMarkerMessage = backendIdleMarkerMessage; + } + + /** + * @return the backendStatisticsLog + */ + public boolean isBackendStatisticsLog() { + return backendStatisticsLog; + } + + /** + * @param backendStatisticsLog the backendStatisticsLog to set + */ + public void setBackendStatisticsLog(boolean backendStatisticsLog) { + this.backendStatisticsLog = backendStatisticsLog; + } + + /** + * @return the backendStatisticsLogTime + */ + public int getBackendStatisticsLogTime() { + return backendStatisticsLogTime; + } + + /** + * @param backendStatisticsLogTime the backendStatisticsLogTime to set + */ + public void setBackendStatisticsLogTime(int backendStatisticsLogTime) { + this.backendStatisticsLogTime = backendStatisticsLogTime; + } + + /** + * @return the log4jParseConfigResource + */ + public String getLog4jParseConfigResource() { + return log4jParseConfigResource; + } + + /** + * @param log4jParseConfigResource the log4jParseConfigResource to set + */ + public void setLog4jParseConfigResource(String log4jParseConfigResource) { + this.log4jParseConfigResource = log4jParseConfigResource; + } + + /** + * @return the log4jAppenderName + */ + public String getLog4jAppenderName() { + return log4jAppenderName; + } + + /** + * @param log4jAppenderName the log4jAppenderName to set + */ + public void setLog4jAppenderName(String log4jAppenderName) { + this.log4jAppenderName = log4jAppenderName; + } + + /** + * @return the log4jAppenderAutoAdd + */ + public boolean isLog4jAppenderAutoAdd() { + return log4jAppenderAutoAdd; + } + + /** + * @param log4jAppenderAutoAdd the log4jAppenderAutoAdd to set + */ + public void setLog4jAppenderAutoAdd(boolean log4jAppenderAutoAdd) { + this.log4jAppenderAutoAdd = log4jAppenderAutoAdd; + } + + /** + * @return the log4jAppenderAutoAddOnlyOnceError + */ + public boolean isLog4jAppenderAutoAddOnlyOnceError() { + return log4jAppenderAutoAddOnlyOnceError; + } + + /** + * @param log4jAppenderAutoAddOnlyOnceError the log4jAppenderAutoAddOnlyOnceError to set + */ + public void setLog4jAppenderAutoAddOnlyOnceError( + boolean log4jAppenderAutoAddOnlyOnceError) { + this.log4jAppenderAutoAddOnlyOnceError = log4jAppenderAutoAddOnlyOnceError; + } + + /** + * @return the log4jAppenderToRoot + */ + public boolean isLog4jAppenderToRoot() { + return log4jAppenderToRoot; + } + + /** + * @param log4jAppenderToRoot the log4jAppenderToRoot to set + */ + public void setLog4jAppenderToRoot(boolean log4jAppenderToRoot) { + this.log4jAppenderToRoot = log4jAppenderToRoot; + } +} \ No newline at end of file diff --git a/logstats-jboss-sar/src/main/java/net/forwardfire/logstats/jboss/log4j/DataSourceLogServiceMBean.java b/logstats-jboss-sar/src/main/java/net/forwardfire/logstats/jboss/log4j/DataSourceLogServiceMBean.java new file mode 100644 index 0000000..afeaf4b --- /dev/null +++ b/logstats-jboss-sar/src/main/java/net/forwardfire/logstats/jboss/log4j/DataSourceLogServiceMBean.java @@ -0,0 +1,198 @@ + +package net.forwardfire.logstats.jboss.log4j; + +import org.jboss.system.ServiceMBean; + +/** + * Defines all configable options of the log service MBean + * + * @author Willem Cazander + * @version 1.0 Jun 09, 2010 + */ +public interface DataSourceLogServiceMBean extends ServiceMBean { + + /** + * Resets the stats counters + */ + public void resetStatsCounters(); + + /** + * @return the statsMessagesTotal + */ + public int getStatsMessagesTotal(); + + /** + * @return the statsMessagesDropped + */ + public int getStatsMessagesDropped(); + + /** + * @return the backendDataSource + */ + public String getBackendDataSource(); + + /** + * @param backendDataSource the backendDataSource to set + */ + public void setBackendDataSource(String backendDataSource); + + /** + * @return the backendLogQuery + */ + public String getBackendLogQuery(); + + /** + * @param backendLogQuery the backendLogQuery to set + */ + public void setBackendLogQuery(String backendLogQuery); + + /** + * @return the backendLogQueryParameters + */ + public String getBackendLogQueryParameters(); + + /** + * @param backendLogQueryParameters the backendLogQueryParameters to set + */ + public void setBackendLogQueryParameters(String backendLogQueryParameters); + + /** + * @return the backendHostname + */ + public String getBackendHostname(); + + /** + * @param backendHostname the backendHostname to set + */ + public void setBackendHostname(String backendHostname); + + /** + * @return the backendKeepAliveTimeout + */ + public int getBackendKeepAliveTimeout(); + + /** + * @param backendKeepAliveTimeout the backendKeepAliveTimeout to set + */ + public void setBackendKeepAliveTimeout(int backendKeepAliveTimeout); + + /** + * @return the backendKeepAliveQuery + */ + public String getBackendKeepAliveQuery(); + + /** + * @param backendKeepAliveQuery the backendKeepAliveQuery to set + */ + public void setBackendKeepAliveQuery(String backendKeepAliveQuery); + + /** + * @return the backendThreads + */ + public int getBackendThreads(); + + /** + * @param backendThreads the backendThreads to set + */ + public void setBackendThreads(int backendThreads); + + /** + * @return the backendMaxQueueSize + */ + public int getBackendMaxQueueSize(); + + /** + * @param backendMaxQueueSize the backendMaxQueueSize to set + */ + public void setBackendMaxQueueSize(int backendMaxQueueSize); + + /** + * @return the backendIdleMarkerTime + */ + public int getBackendIdleMarkerTime(); + + /** + * @param backendIdleMarkerTime the backendIdleMarkerTime to set + */ + public void setBackendIdleMarkerTime(int backendIdleMarkerTime); + + /** + * @return the backendIdleMarkerMessage + */ + public String getBackendIdleMarkerMessage(); + + /** + * @param backendIdleMarkerMessage the backendIdleMarkerMessage to set + */ + public void setBackendIdleMarkerMessage(String backendIdleMarkerMessage); + + /** + * @return the backendStatisticsLog + */ + public boolean isBackendStatisticsLog(); + + /** + * @param backendStatisticsLog the backendStatisticsLog to set + */ + public void setBackendStatisticsLog(boolean backendStatisticsLog); + + /** + * @return the backendStatisticsLogTime + */ + public int getBackendStatisticsLogTime(); + + /** + * @param backendStatisticsLogTime the backendStatisticsLogTime to set + */ + public void setBackendStatisticsLogTime(int backendStatisticsLogTime); + + /** + * @return the log4jParseConfigResource + */ + public String getLog4jParseConfigResource(); + + /** + * @param log4jParseConfigResource the log4jParseConfigResource to set + */ + public void setLog4jParseConfigResource(String log4jParseConfigResource); + + /** + * @return the log4jAppenderName + */ + public String getLog4jAppenderName(); + + /** + * @param log4jAppenderName the log4jAppenderName to set + */ + public void setLog4jAppenderName(String log4jAppenderName); + + /** + * @return the log4jAppenderAutoAdd + */ + public boolean isLog4jAppenderAutoAdd(); + + /** + * @param log4jAppenderAutoAdd the log4jAppenderAutoAdd to set + */ + public void setLog4jAppenderAutoAdd(boolean log4jAppenderAutoAdd); + + /** + * @return the log4jAppenderAutoAddOnlyOnceError + */ + public boolean isLog4jAppenderAutoAddOnlyOnceError(); + + /** + * @param log4jAppenderAutoAddOnlyOnceError the log4jAppenderAutoAddOnlyOnceError to set + */ + public void setLog4jAppenderAutoAddOnlyOnceError(boolean log4jAppenderAutoAddOnlyOnceError); + + /** + * @return the log4jAppenderToRoot + */ + public boolean isLog4jAppenderToRoot(); + + /** + * @param log4jAppenderToRoot the log4jAppenderToRoot to set + */ + public void setLog4jAppenderToRoot(boolean log4jAppenderToRoot); +} diff --git a/logstats-jboss-sar/src/main/resources/META-INF/jboss-service.xml b/logstats-jboss-sar/src/main/resources/META-INF/jboss-service.xml new file mode 100644 index 0000000..403174d --- /dev/null +++ b/logstats-jboss-sar/src/main/resources/META-INF/jboss-service.xml @@ -0,0 +1,54 @@ + + + + + java:DataSourceLogServiceDS + + jboss.jca:service=DataSourceBinding,name=DataSourceLogServiceDS + + + + + + + \ No newline at end of file diff --git a/logstats-jboss-sar/src/main/resources/META-INF/log4j.dtd b/logstats-jboss-sar/src/main/resources/META-INF/log4j.dtd new file mode 100644 index 0000000..cfc8a5d --- /dev/null +++ b/logstats-jboss-sar/src/main/resources/META-INF/log4j.dtd @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/logstats-jboss-sar/src/main/resources/META-INF/logstats-log4j.xml b/logstats-jboss-sar/src/main/resources/META-INF/logstats-log4j.xml new file mode 100644 index 0000000..ac057b5 --- /dev/null +++ b/logstats-jboss-sar/src/main/resources/META-INF/logstats-log4j.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/logstats-war/.classpath b/logstats-war/.classpath new file mode 100644 index 0000000..ada8f32 --- /dev/null +++ b/logstats-war/.classpath @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/logstats-war/.project b/logstats-war/.project new file mode 100644 index 0000000..4fba2a8 --- /dev/null +++ b/logstats-war/.project @@ -0,0 +1,42 @@ + + + logstats-war + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/logstats-war/.settings/.jsdtscope b/logstats-war/.settings/.jsdtscope new file mode 100644 index 0000000..b46b920 --- /dev/null +++ b/logstats-war/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/logstats-war/.settings/org.eclipse.core.resources.prefs b/logstats-war/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..d74830a --- /dev/null +++ b/logstats-war/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,8 @@ +#Mon Jan 02 23:18:50 CET 2012 +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/main/webapp=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 diff --git a/logstats-war/.settings/org.eclipse.jdt.core.prefs b/logstats-war/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..8702f72 --- /dev/null +++ b/logstats-war/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,13 @@ +#Mon Jan 02 23:18:50 CET 2012 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/logstats-war/.settings/org.eclipse.m2e.core.prefs b/logstats-war/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..bf4333d --- /dev/null +++ b/logstats-war/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,5 @@ +#Mon Jan 02 23:18:47 CET 2012 +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/logstats-war/.settings/org.eclipse.wst.jsdt.ui.superType.container b/logstats-war/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/logstats-war/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/logstats-war/.settings/org.eclipse.wst.jsdt.ui.superType.name b/logstats-war/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/logstats-war/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/logstats-war/.settings/org.maven.ide.eclipse.prefs b/logstats-war/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 0000000..fcb3b16 --- /dev/null +++ b/logstats-war/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Wed Jun 09 21:37:03 CEST 2010 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/logstats-war/pom.xml b/logstats-war/pom.xml new file mode 100644 index 0000000..e7c570e --- /dev/null +++ b/logstats-war/pom.xml @@ -0,0 +1,158 @@ + + 4.0.0 + + logstats + net.forwardfire.logstats + 0.0.1-SNAPSHOT + + logstats-war + war + logstats-war + logstats-war + + + + src/main/resources + + + src/main/java + + **/*.xml + + + + + + src/test/resources + + + src/main/webapp + + **/*.xml + + + + + + + javax.servlet + servlet-api + 2.4 + provided + + + javax.servlet + jstl + 1.2 + provided + + + javax.servlet.jsp + jsp-api + 2.1 + provided + + + taglibs + standard + 1.1.2 + provided + + + javax.ejb + ejb-api + 3.0 + provided + + + javax.persistence + persistence-api + 1.0 + provided + + + + javax.faces + jsf-api + 1.2_12 + provided + + + javax.faces + jsf-impl + 1.2_12 + provided + + + + + net.forwardfire.vasc + vasc-frontend-web-jsf + ${vasc.version} + + + net.forwardfire.vasc + vasc-ejb3 + ${vasc.version} + + + + javax.el + el-ri + 1.2 + provided + + + + javax.el + el-api + 1.2 + provided + + + + com.sun.facelets + jsf-facelets + 1.1.15.B1 + + + + + org.richfaces.framework + richfaces-api + 3.3.3-SNAPSHOT + + + + org.richfaces.framework + richfaces-impl + 3.3.3-SNAPSHOT + + + + org.richfaces.ui + richfaces-ui + 3.3.3-SNAPSHOT + + + + info.bliki.wiki + bliki-core + 3.0.13 + + + net.forwardfire.logstats + logstats-ejb + ${project.version} + ejb + + + org.hibernate + hibernate-annotations + 3.4.0.GA + provided + + + + + \ No newline at end of file diff --git a/logstats-war/src/main/java/net/forwardfire/logstats/web/beans/RealTimeController.java b/logstats-war/src/main/java/net/forwardfire/logstats/web/beans/RealTimeController.java new file mode 100644 index 0000000..16292c2 --- /dev/null +++ b/logstats-war/src/main/java/net/forwardfire/logstats/web/beans/RealTimeController.java @@ -0,0 +1,235 @@ +/* + * Copyright 2009-2012 forwardfire.net All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.forwardfire.logstats.web.beans; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; + +import javax.ejb.EJB; +import javax.faces.model.SelectItem; + +import net.forwardfire.logstats.ejb.models.LogData; +import net.forwardfire.logstats.ejb.services.LoginManagerRemote; +import net.forwardfire.logstats.ejb.services.ServerManagerRemote; + +/** + * + * @author Willem Cazander + * @version 1.0 Jul 06, 2010 + */ +public class RealTimeController implements Serializable { + + private static final long serialVersionUID = 1L; + + private boolean pollEnabled = true; + private boolean reversedTail = false; + private String filterHostname = null; + private Integer filterLevel = null; + private String filterRegex = null; + private Pattern filterRegexPattern = null; + private int messageRows = 40; + private int messageCols = 260; + + @EJB() + LoginManagerRemote loginManager; + + @EJB() + ServerManagerRemote serverManager; + + private StringBuilder getStartBuffer(List data) { + StringBuilder buf = new StringBuilder(); + int size = data.size(); + for (int i=0;i data = serverManager.getRealTimeLogData(); + if (reversedTail) { + Collections.reverse(data); + } + StringBuilder buf = getStartBuffer(data); + return buf.toString(); + } + + public void setMessageLogData(String voidData) { + // method so jsf is oke. + } + + /** + * @return the pollEnabled + */ + public boolean isPollEnabled() { + return pollEnabled; + } + + /** + * @param pollEnabled the pollEnabled to set + */ + public void setPollEnabled(boolean pollEnabled) { + this.pollEnabled = pollEnabled; + } + + /** + * @return the reversedTail + */ + public boolean isReversedTail() { + return reversedTail; + } + + /** + * @param reversedTail the reversedTail to set + */ + public void setReversedTail(boolean reversedTail) { + this.reversedTail = reversedTail; + } + + /** + * @return the filterHostname + */ + public String getFilterHostname() { + return filterHostname; + } + + /** + * @param filterHostname the filterHostname to set + */ + public void setFilterHostname(String filterHostname) { + this.filterHostname = filterHostname; + } + + /** + * @return the filterLevel + */ + public Integer getFilterLevel() { + return filterLevel; + } + + /** + * @param filterLevel the filterLevel to set + */ + public void setFilterLevel(Integer filterLevel) { + this.filterLevel = filterLevel; + } + + /** + * @return the filterRegex + */ + public String getFilterRegex() { + return filterRegex; + } + + /** + * @param filterRegex the filterRegex to set + */ + public void setFilterRegex(String filterRegex) { + this.filterRegex = filterRegex; + if (filterRegex!=null && filterRegex.isEmpty()==false) { + try { + filterRegexPattern = Pattern.compile(filterRegex); + } catch (PatternSyntaxException pse) { + filterRegexPattern = null; // remove old regex + pse.printStackTrace(); + } + } else { + filterRegexPattern = null; + } + } + + /** + * @return the messageRows + */ + public int getMessageRows() { + return messageRows; + } + + /** + * @param messageRows the messageRows to set + */ + public void setMessageRows(int messageRows) { + this.messageRows = messageRows; + } + + /** + * @return the messageCols + */ + public int getMessageCols() { + return messageCols; + } + + /** + * @param messageCols the messageCols to set + */ + public void setMessageCols(int messageCols) { + this.messageCols = messageCols; + } + + public List getMessageRowsSelectItems() { + List result = new ArrayList(5); + result.add(new SelectItem(10, "10")); + result.add(new SelectItem(20, "20")); + result.add(new SelectItem(40, "40")); + result.add(new SelectItem(60, "60")); + result.add(new SelectItem(80, "80")); + result.add(new SelectItem(102, "100")); // to remove scroll bar 102, buf is 100 + return result; + } + + public List getMessageColsSelectItems() { + List result = new ArrayList(5); + result.add(new SelectItem(80, "80")); + result.add(new SelectItem(120, "120")); + result.add(new SelectItem(150, "150")); + result.add(new SelectItem(200, "200")); + result.add(new SelectItem(240, "240")); + result.add(new SelectItem(260, "260")); + result.add(new SelectItem(280, "280")); + result.add(new SelectItem(300, "300")); + return result; + } +} \ No newline at end of file diff --git a/logstats-war/src/main/java/net/forwardfire/logstats/web/beans/UserController.java b/logstats-war/src/main/java/net/forwardfire/logstats/web/beans/UserController.java new file mode 100644 index 0000000..92bdbd9 --- /dev/null +++ b/logstats-war/src/main/java/net/forwardfire/logstats/web/beans/UserController.java @@ -0,0 +1,76 @@ +/* + * Copyright 2009-2012 forwardfire.net All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.forwardfire.logstats.web.beans; + +import java.io.Serializable; +import java.util.List; + +import javax.ejb.EJB; + +import net.forwardfire.logstats.ejb.models.LogRightRole; +import net.forwardfire.logstats.ejb.models.LogUser; +import net.forwardfire.logstats.ejb.services.LoginManagerRemote; + +/** + * + * @author Willem Cazander + * @version 1.0 Nov 1, 2009 + */ +public class UserController implements Serializable { + + private static final long serialVersionUID = 1L; + private LogUser logUser = null; + private List logRightRoles = null; + + @EJB() + LoginManagerRemote loginManager; + + public void loginFilter() { + try { + logUser = loginManager.getUser(); + logRightRoles = loginManager.getClientRoles(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public void logoutFilter() { + logUser = null; + logRightRoles = null; + } + + public boolean isUserLoggedin() { + if (logUser==null) { + return false; + } + return true; + } + + public LogUser getUser() { + return logUser; + } + + public List getRightRoles() { + return logRightRoles; + } +} \ No newline at end of file diff --git a/logstats-war/src/main/java/net/forwardfire/logstats/web/beans/VascFacesController.java b/logstats-war/src/main/java/net/forwardfire/logstats/web/beans/VascFacesController.java new file mode 100644 index 0000000..6901fa7 --- /dev/null +++ b/logstats-war/src/main/java/net/forwardfire/logstats/web/beans/VascFacesController.java @@ -0,0 +1,62 @@ +/* + * Copyright 2009-2012 forwardfire.net All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.forwardfire.logstats.web.beans; + +import java.util.ArrayList; +import java.util.List; + +import net.forwardfire.vasc.core.VascController; +import net.forwardfire.vasc.frontends.web.jsf.AbstractJSFVascFacesController; + + +/** + * + * @author Willem Cazander + * @version 1.0 Nov 1, 2009 + */ +public class VascFacesController extends AbstractJSFVascFacesController { + + public String getVascSericeManagerJNDI() { + return "logstats-jboss/ejb/vascSericeManager/remote"; + } + public String getResourceBundleWEB() { + return "net/forwardfire/logstats/resources/i18n/LogstatsBundleWAR"; + } + public boolean getDisableI18N() { + return false; + } + public VascUserInfo getVascUserInfo() { + VascUserInfo vui = new VascUserInfo(new Long(34l),"s", new String[] {"rol1"}); + return vui; + } + public List getVascAdminEntries() { + List result = new ArrayList(50); + VascController v = getVascController(); + for (String e:v.getVascEntryController().getVascEntryIds()) { + if (e.endsWith("Link")==false) { + result.add(e); + } + } + return result; + } +} \ No newline at end of file diff --git a/logstats-war/src/main/java/net/forwardfire/logstats/web/filters/UserFilter.java b/logstats-war/src/main/java/net/forwardfire/logstats/web/filters/UserFilter.java new file mode 100644 index 0000000..c4609ab --- /dev/null +++ b/logstats-war/src/main/java/net/forwardfire/logstats/web/filters/UserFilter.java @@ -0,0 +1,104 @@ +/* + * Copyright 2009-2012 forwardfire.net All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.forwardfire.logstats.web.filters; + +import java.io.IOException; +import java.util.logging.Logger; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import net.forwardfire.logstats.web.beans.UserController; + + + +/** + * Filter in and out logs of users. + * + * @author Willem Cazander + * @version 1.0 Nov 12, 2009 + */ +public class UserFilter implements Filter { + + private static final long serialVersionUID = 10l; + private Logger logger = null; + + /** + * @see javax.servlet.Filter#destroy() + */ + public void destroy() { + logger = null; + } + + /** + * @see javax.servlet.Filter#init(javax.servlet.FilterConfig) + */ + public void init(FilterConfig config) throws ServletException { + logger = Logger.getLogger(UserFilter.class.getName()); + } + + /** + * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) + */ + public void doFilter(ServletRequest servletRequest,ServletResponse servletResponse,FilterChain chain) throws IOException, ServletException { + + HttpServletRequest request = (HttpServletRequest)servletRequest; + HttpServletResponse response = (HttpServletResponse)servletResponse; + + // Let all anymous user to next filter + if (request.getUserPrincipal()==null) { + chain.doFilter(request, response); + return; + } + + UserController userController = (UserController)request.getSession().getAttribute("userController"); + if (userController==null) { + logger.info("Can't create userController for first request auth: "+request.getUserPrincipal()); + chain.doFilter(request, response); + return; + } + if (userController.isUserLoggedin()==false) { + userController.loginFilter(); + + // size session time to 20min + request.getSession().setMaxInactiveInterval(20*60*1000); + } + + // Check for logout + String path = request.getRequestURI(); + if (path.endsWith("login/logout.jsf")) { + userController.logoutFilter(); + request.getSession().invalidate(); + } + + // do rest of chain. + chain.doFilter(request, response); + } + +} \ No newline at end of file diff --git a/logstats-war/src/main/resources/META-INF/skins/logstats.skin.properties b/logstats-war/src/main/resources/META-INF/skins/logstats.skin.properties new file mode 100644 index 0000000..c993f8a --- /dev/null +++ b/logstats-war/src/main/resources/META-INF/skins/logstats.skin.properties @@ -0,0 +1,73 @@ +#Colors +headerBackgroundColor=\#EAEAEA +headerGradientColor=\#E0E0E0 +headerTextColor=#282828 +headerWeightFont=bold + +generalBackgroundColor=#FFFFFF +generalTextColor=#282828 +generalSizeFont=11px +generalFamilyFont=Arial, Helvetica, sans-serif + +controlTextColor=#282828 +controlBackgroundColor=#ffffff +additionalBackgroundColor=#ffffff + +shadowBackgroundColor=#000000 +shadowOpacity=1 + +panelBorderColor=#BED6F8 +subBorderColor=#ffffff + +tabBackgroundColor=#C6DEFF +tabDisabledTextColor=#ffffff + +trimColor=#D6E6FB + +tipBackgroundColor=\#FAE6B0 +tipBorderColor=\#E5973E + +selectControlColor=#E79A00 + + +generalLinkColor=#004DEB +hoverLinkColor=#004DEB +visitedLinkColor=#004DEB + +# Fonts +headerSizeFont=11px +headerFamilyFont=Arial, Helvetica, sans-serif + +tabSizeFont=11 +tabFamilyFont=Arial, Helvetica, sans-serif + +buttonSizeFont=11 +buttonFamilyFont=Arial, Verdana, sans-serif + + +tableBackgroundColor=#FFFFFF +tableFooterBackgroundColor=#FFFFFF +tableSubfooterBackgroundColor=#FFFFFF + + +#Calendar colors +calendarWeekBackgroundColor=#F5F5F5 + +calendarHolidaysBackgroundColor=#FFEBDA +calendarHolidaysTextColor=#FF7800 + +calendarCurrentBackgroundColor=#FF7800 +calendarCurrentTextColor=#FFEBDA + +calendarSpecBackgroundColor=#E4F5E2 +calendarSpecTextColor=#000000 + + +warningColor=#282828 +warningBackgroundColor=##EE0000 + +editorBackgroundColor=#F1F1F1 +editBackgroundColor=#FEFFDA + +#Gradients +gradientType=plain diff --git a/logstats-war/src/main/resources/net/forwardfire/logstats/resources/i18n/LogstatsBundleWAR_en.properties b/logstats-war/src/main/resources/net/forwardfire/logstats/resources/i18n/LogstatsBundleWAR_en.properties new file mode 100644 index 0000000..0111f23 --- /dev/null +++ b/logstats-war/src/main/resources/net/forwardfire/logstats/resources/i18n/LogstatsBundleWAR_en.properties @@ -0,0 +1,82 @@ + +generic.active.labelText = active +generic.active.toolTipText = active +generic.createdDate.labelText = createdDate +generic.createdDate.toolTipText = createdDate +generic.description.labelText = description +generic.description.toolTipText = description +generic.id.labelText = id +generic.id.toolTipText = id +generic.modifiedDate.labelText = modifiedDate +generic.modifiedDate.toolTipText = modifiedDate +generic.name.labelText = name +generic.name.toolTipText = name + +# hibernate validators +validator.assertFalse=assertion failed +validator.assertTrue=assertion failed +validator.future=Date must lie in the future +validator.length=Field must contain between {min} and {max} characters. +validator.max=Value must be equal to or lower than {value} +validator.min=Value must be equal to or higher than {value} +validator.notNull=A value must be entered +validator.past=Date must lie in the future +validator.pattern=Value must conform to "{regex}" +validator.range=Value must lie between {min} and {max} +validator.size=There must be between {min} and {max} characters +validator.email=The value must be a valid e-mail address + +# vasc validators +vasc.validator.VascDateFutureValidator=The date must lie in the future. +vasc.validator.VascDatePastValidator=The date must lie in the past. +vasc.validator.VascIntSizeValidator=Value must lie between {0} and {1} +vasc.validator.VascLongSizeValidator=Value must lie between {0} and {1} +vasc.validator.VascObjectNotNullValidator=A value must be entered +vasc.validator.VascObjectNullValidator=No value may be entered +vasc.validator.VascStringEmailValidator=The value must be a valid e-mail address +vasc.validator.VascStringLengthValidator=There must be at least {0} and at most {1} items +vasc.validator.VascStringRegexValidator=Value must conform to "{0}" +vasc.validator.VascStringZipCodeValidator=Value must be a valid post code. + +# Vasc actions labels +vasc.action.addRowAction.description = add a new record +vasc.action.addRowAction.name = Add +vasc.action.csvExportAction.description = CSV +vasc.action.csvExportAction.name = CSV +vasc.action.xmlExportAction.description = XML +vasc.action.xmlExportAction.name = XML +vasc.action.deleteRowAction.description = delete +vasc.action.deleteRowAction.name = delete +vasc.action.downloadAction.description = Select this record. +vasc.action.downloadAction.name = Select +vasc.action.editRowAction.description = edit +vasc.action.editRowAction.name = Edit + +# Temp jsf +generic.vasc.jsf.listOption.header = Searchoptions +generic.vasc.jsf.listOption.search = Searh\: +generic.vasc.jsf.listOption.sumbit = Search +generic.vasc.jsf.pager.previous = Previous +generic.vasc.jsf.pager.next = Next +generic.vasc.jsf.table.rows = Row Numbers\: +generic.vasc.jsf.table.pagerDirect = Go to\: +generic.vasc.jsf.table.downloadDirect = Download\: +generic.vasc.jsf.table.resultText = Results {0}-{1} from {2} rows +generic.vasc.jsf.table.download.img = Save table data. +generic.vasc.jsf.table.printer.img = Shows the table in printer friendly format. +generic.vasc.jsf.table.export.select = ... +generic.vasc.jsf.table.export.select.alt = Select Export +generic.vasc.jsf.table.page.select = ... +generic.vasc.jsf.table.page.select.alt = Select Page +generic.vasc.jsf.table.page.name = Page: +generic.vasc.jsf.table.page.description = Goto page: +generic.vasc.jsf.tableHeader.fields = Fields +generic.vasc.jsf.tableHeader.links = Links +generic.vasc.jsf.tableHeader.actions = Actions +generic.vasc.jsf.multiAction.selectAll = Select all: +generic.vasc.jsf.multiAction.name = ... +generic.vasc.jsf.multiAction.description = Select Action +generic.vasc.jsf.action.save = Save +generic.vasc.jsf.action.cancel = Cancel +generic.vasc.jsf.action.back = Back +generic.vasc.jsf.parentSelected = Selected: \ No newline at end of file diff --git a/logstats-war/src/main/resources/net/forwardfire/logstats/resources/i18n/LogstatsBundleWAR_nl.properties b/logstats-war/src/main/resources/net/forwardfire/logstats/resources/i18n/LogstatsBundleWAR_nl.properties new file mode 100644 index 0000000..0111f23 --- /dev/null +++ b/logstats-war/src/main/resources/net/forwardfire/logstats/resources/i18n/LogstatsBundleWAR_nl.properties @@ -0,0 +1,82 @@ + +generic.active.labelText = active +generic.active.toolTipText = active +generic.createdDate.labelText = createdDate +generic.createdDate.toolTipText = createdDate +generic.description.labelText = description +generic.description.toolTipText = description +generic.id.labelText = id +generic.id.toolTipText = id +generic.modifiedDate.labelText = modifiedDate +generic.modifiedDate.toolTipText = modifiedDate +generic.name.labelText = name +generic.name.toolTipText = name + +# hibernate validators +validator.assertFalse=assertion failed +validator.assertTrue=assertion failed +validator.future=Date must lie in the future +validator.length=Field must contain between {min} and {max} characters. +validator.max=Value must be equal to or lower than {value} +validator.min=Value must be equal to or higher than {value} +validator.notNull=A value must be entered +validator.past=Date must lie in the future +validator.pattern=Value must conform to "{regex}" +validator.range=Value must lie between {min} and {max} +validator.size=There must be between {min} and {max} characters +validator.email=The value must be a valid e-mail address + +# vasc validators +vasc.validator.VascDateFutureValidator=The date must lie in the future. +vasc.validator.VascDatePastValidator=The date must lie in the past. +vasc.validator.VascIntSizeValidator=Value must lie between {0} and {1} +vasc.validator.VascLongSizeValidator=Value must lie between {0} and {1} +vasc.validator.VascObjectNotNullValidator=A value must be entered +vasc.validator.VascObjectNullValidator=No value may be entered +vasc.validator.VascStringEmailValidator=The value must be a valid e-mail address +vasc.validator.VascStringLengthValidator=There must be at least {0} and at most {1} items +vasc.validator.VascStringRegexValidator=Value must conform to "{0}" +vasc.validator.VascStringZipCodeValidator=Value must be a valid post code. + +# Vasc actions labels +vasc.action.addRowAction.description = add a new record +vasc.action.addRowAction.name = Add +vasc.action.csvExportAction.description = CSV +vasc.action.csvExportAction.name = CSV +vasc.action.xmlExportAction.description = XML +vasc.action.xmlExportAction.name = XML +vasc.action.deleteRowAction.description = delete +vasc.action.deleteRowAction.name = delete +vasc.action.downloadAction.description = Select this record. +vasc.action.downloadAction.name = Select +vasc.action.editRowAction.description = edit +vasc.action.editRowAction.name = Edit + +# Temp jsf +generic.vasc.jsf.listOption.header = Searchoptions +generic.vasc.jsf.listOption.search = Searh\: +generic.vasc.jsf.listOption.sumbit = Search +generic.vasc.jsf.pager.previous = Previous +generic.vasc.jsf.pager.next = Next +generic.vasc.jsf.table.rows = Row Numbers\: +generic.vasc.jsf.table.pagerDirect = Go to\: +generic.vasc.jsf.table.downloadDirect = Download\: +generic.vasc.jsf.table.resultText = Results {0}-{1} from {2} rows +generic.vasc.jsf.table.download.img = Save table data. +generic.vasc.jsf.table.printer.img = Shows the table in printer friendly format. +generic.vasc.jsf.table.export.select = ... +generic.vasc.jsf.table.export.select.alt = Select Export +generic.vasc.jsf.table.page.select = ... +generic.vasc.jsf.table.page.select.alt = Select Page +generic.vasc.jsf.table.page.name = Page: +generic.vasc.jsf.table.page.description = Goto page: +generic.vasc.jsf.tableHeader.fields = Fields +generic.vasc.jsf.tableHeader.links = Links +generic.vasc.jsf.tableHeader.actions = Actions +generic.vasc.jsf.multiAction.selectAll = Select all: +generic.vasc.jsf.multiAction.name = ... +generic.vasc.jsf.multiAction.description = Select Action +generic.vasc.jsf.action.save = Save +generic.vasc.jsf.action.cancel = Cancel +generic.vasc.jsf.action.back = Back +generic.vasc.jsf.parentSelected = Selected: \ No newline at end of file diff --git a/logstats-war/src/main/webapp/WEB-INF/faces.xml b/logstats-war/src/main/webapp/WEB-INF/faces.xml new file mode 100644 index 0000000..6080691 --- /dev/null +++ b/logstats-war/src/main/webapp/WEB-INF/faces.xml @@ -0,0 +1,47 @@ + + + + + + + en + + com.sun.facelets.FaceletViewHandler + + + + Controls the Users + realTimeController + net.forwardfire.logstats.web.beans.RealTimeController + session + + + + Controls the Users + userController + net.forwardfire.logstats.web.beans.UserController + session + + + + + + + Controls Vasc Faces + vascFacesController + net.forwardfire.logstats.web.beans.VascFacesController + session + + + \ No newline at end of file diff --git a/logstats-war/src/main/webapp/WEB-INF/jboss-web.xml b/logstats-war/src/main/webapp/WEB-INF/jboss-web.xml new file mode 100644 index 0000000..63f7a81 --- /dev/null +++ b/logstats-war/src/main/webapp/WEB-INF/jboss-web.xml @@ -0,0 +1,9 @@ + + + + net.forwardfire.logstats:archive=logstats-war + + + \ No newline at end of file diff --git a/logstats-war/src/main/webapp/WEB-INF/web.xml b/logstats-war/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..a4cd6a4 --- /dev/null +++ b/logstats-war/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,203 @@ + + + + Logstats Web Application + + /jsp/index_jsp.jsp + + + 4 + + + + + + XHTML + *.xhtml + + + Include files + No direct access to include files. + /jsp/includes/* + POST + GET + + + No direct browser access to include files. + inaccessible + + + NONE + + + + + + + FORM + LogstatsSecurity + + /jsp/login/login.jsf + /jsp/login/login-error.jsf + + + + + user + + + admin-company + + + admin-system + + + inaccessible + + + + + User Filter + userFilter + net.forwardfire.logstats.web.filters.UserFilter + + + + userFilter + facesServlet + REQUEST + + + + + + + Comma separated list of URIs of (additional) faces + config files.(e.g./WEB-INF/my-config.xml) See JSF1.0 PRD 2,10.3.2 + + javax.faces.CONFIG_FILES + /WEB-INF/faces.xml + + + javax.faces.STATE_SAVING_METHOD + server + + + javax.faces.DEFAULT_SUFFIX + .xhtml + + + facelets.REFRESH_PERIOD + 2 + + + facelets.DEVELOPMENT + true + + + + + com.sun.faces.config.ConfigureListener + + + + The JSF Servlet + facesServlet + javax.faces.webapp.FacesServlet + 1 + + + facesServlet + *.jsf + + + + + org.richfaces.SKIN + logstats + + + + + org.richfaces.CONTROL_SKINNING + enable + + + + + RichFaces Filter + richfaces + org.ajax4jsf.Filter + + + + richfaces + facesServlet + REQUEST + FORWARD + INCLUDE + + + + + VASC Filter + vascFilter + net.forwardfire.vasc.frontends.web.jsf.VascRequestFacesFilter + + templateFile + /jsp/includes/vasc-template.jsf + + + resourceBundle + /net/forwardfire/logstats/resources/i18n/LogstatsBundleEJB + + + + + vascFilter + /vasc/* + REQUEST + + + diff --git a/logstats-war/src/main/webapp/css/ie6_fixes.css b/logstats-war/src/main/webapp/css/ie6_fixes.css new file mode 100644 index 0000000..4d7a0af --- /dev/null +++ b/logstats-war/src/main/webapp/css/ie6_fixes.css @@ -0,0 +1,8 @@ + +/* CSS fixes for IE6 */ + +/* +#page_menu_left { + overflow: visible; +} +*/ \ No newline at end of file diff --git a/logstats-war/src/main/webapp/css/ie7_fixes.css b/logstats-war/src/main/webapp/css/ie7_fixes.css new file mode 100644 index 0000000..9001952 --- /dev/null +++ b/logstats-war/src/main/webapp/css/ie7_fixes.css @@ -0,0 +1,8 @@ + +/* CSS fixes for IE7 */ + +/* +#page_menu_left { + overflow: visible; +} +*/ \ No newline at end of file diff --git a/logstats-war/src/main/webapp/css/ie8_fixes.css b/logstats-war/src/main/webapp/css/ie8_fixes.css new file mode 100644 index 0000000..1acb363 --- /dev/null +++ b/logstats-war/src/main/webapp/css/ie8_fixes.css @@ -0,0 +1,4 @@ + +/* CSS fixes for IE8 */ + +/* Yet to come */ \ No newline at end of file diff --git a/logstats-war/src/main/webapp/css/site.css b/logstats-war/src/main/webapp/css/site.css new file mode 100644 index 0000000..2da186b --- /dev/null +++ b/logstats-war/src/main/webapp/css/site.css @@ -0,0 +1,538 @@ + +/* HTML STYLES */ + +* { + margin:0px; + padding:0px; +} + +body { + font-family: Arial, Helvetica, sans-serif; + font-size: 15px; + color: #000000; + margin: 0px; + padding: 0px; + background-color:white; +} + +h1 { + font-size:1.2em; + font-weight:bold; + padding-bottom:10px; +} + +h2 { + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + display:block; + font-size:1.0em; + font-weight:bold; + padding:10px 10px 10px 10px; +} + +a { + color:#004DEB; + text-decoration:underline; +} + +p { + margin:10px 10px 10px 10px; +} + +img { + border: none; + vertical-align: middle; +} + +ul { + margin-left:10px; +} + +/* DIVS */ + +#page_wrap{ + margin:10px; + margin-top:0px; + float:none; +} + +#page_header{ + height:80px; + font-size:18px; + border-bottom:1px solid #DDCCCC; + position:relative; +} + +#page_header a img{ + border:none; + padding-right:10px; + vertical-align:middle; +} + +#page_content { + margin-top:5px; +} + +#page_footer { + margin-top:35px; + padding: 5px; + font-size: 12px; + border-color:#e5e5e5; + border-style:solid; + border-width:1px 1px 1px 1px; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; +} + +/* MENU */ + +#page_menu_left,#page_menu_right { + border-color:#DDCCCC; + border-style:solid; + border-width:0 0 1px 0; + vertical-align:bottom; + display:inline; +} + +#page_menu_right { + position:absolute; + bottom:0; + right:0; +} + +#page_menu_left a,#page_menu_right a { + border:1px solid #e0e0e0; + background-color:#DDCCCC; + border-bottom-width:0px; + text-align:center; + -moz-border-radius-topleft:3xp; + -moz-border-radius-topright:3xp; + -webkit-border-top-left-radius:3px; + -webkit-border-top-right-radius:3px; + -khtml-border-radius-topleft:3px; + -khtml-border-radius-topright:3px; + color:#000; + margin:0px 5px 0px 0px; + padding:3px 15px 2px 15px; + text-decoration:none; +} + +#page_menu_left a:hover,#page_menu_right a:hover { + text-decoration:none; + background-color:#fff; + border-color:#e0e0e0; +} + +#page_menu_left a.active,#page_menu_left a.active { + background-color:#fff; + font-weight:700; +} + +#page_user_info { + padding:5px; + position:absolute; + right:0; + top:0; + font-size:11px; +} + + +.actionbox{ + background-color:#DDCCCC; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + border:none; + -moz-border-radius-topleft:0; + -webkit-border-top-left-radius:0; + -khtml-border-radius-topleft:0; + clear:both; + padding:3px 0 3px 3px; + display:block; +} +.actionbox label{display:inline;} +ul.actionboxtab{margin:0;padding:0;} +ul.actionboxtab li{list-style-type:none;float:left;margin:0;padding:0;} +ul.actionboxtab li a { + border:solid 1px #ddd; + border-bottom-width:0; + -moz-border-radius-topleft:3px; + -moz-border-radius-topright:3px; + -khtml-border-radius-topright:3px; + -webkit-border-top-left-radius:3px; + -webkit-border-top-right-radius:3px; + -khtml-border-radius-topleft:3px; + font-weight:700; + display:block; + margin-right:5px;color:#000; + padding:3px 15px; +} +ul.actionboxtab li a.active{background-color:#DDCCCC;border:solid 1px #DDCCCC;text-decoration:none;} +ul.actionboxtab li a:hover{background-color:#DDCCCC;border:solid 1px #DDCCCC;text-decoration:none;} +td.tableactions{border-bottom-color:#bbb;text-align:left;} + + +ul.paging{ + clear:both; + margin-bottom:5px; + margin-top:5px; + display:block; + float:left; + padding-top:3px; + padding-bottom:3px; + width:100%; + list-style:none; +} +ul.paging li,ul.paging span{float:left;margin:0 2px 0 2px;} +.paging_thispage{font-weight:700;padding:0 6px;} +ul.paging .paging_atstart{margin-right:10px;}ul.paging .paging_atend{margin-left:10px;} +ul.paging .paging_atstart a,ul.paging .nolink.paging_atstart{ + padding-left:15px; +} +ul.paging .paging_atend a,ul.paging .nolink.paging_atend{ + padding-right:15px; +} +ul.paging .paging_next{ + margin-left:20px; + border:1px solid #DDD; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + padding:2px 6px; +} + +ul.paging .paging_prev{ + margin-right:20px; + border:1px solid #DDD; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + padding:2px 6px; +} +ul.paging a,ul.paging .paging_link{ + border:1px solid #DDD; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + padding:2px 6px; +} +ul.paging .paging_break{ + font-weight:700;padding:2px 6px; +} + + + +/* TABLES */ +/* +#m_content table { + text-align: left; +} +*/ + +table.table5, table.rating_table { + border-collapse:collapse; + font-size:11px; + width:100%; + margin-bottom: 30px; +} + +table.table5 th, table.rating_table th { + padding-top:5px; + padding-bottom:5px; + font-weight:700; + text-align:left; + vertical-align:top; + padding-left: 3px; +} + +table.table5 td, table.rating_table td { + vertical-align:top; + padding-top:5px; + padding-bottom:5px; + padding-left: 3px; +} + +.dataTableHeaderRow { + border:1px solid #e0e0e0; + background-color:#e4e4e4; + border-bottom-width:0; +} + +.dataTableHeaderRow th, td { + padding-right: 5px; +} + +table input,table select { + font-size: 11px; + margin-left:6px; + margin-right:6px; +} + +table.table5 tr:nth-child(even) { + background-color:#f0f0f0; +} + +.table_options_top { + -moz-border-radius-topleft:3px; + -moz-border-radius-topright:3px; + background-color:#DDCCCC; + font-size:12px; + font-weight:700; + padding:6px 15px; + display: block; +} + +.table_options_bottom { + -moz-border-radius-bottomleft:3px; + -moz-border-radius-bottomright:3px; + background-color:#DDCCCC; + font-size:12px; + font-weight:700; + padding:6px 15px; + display: block; + + margin-top:5px; +} + + +.table_sub_header { + -moz-border-radius-topleft:5px; + -moz-border-radius-topright:5px; + background-color:#EEEEEE; + border:1px solid #BBBBBB; + display:block; + font-size:14px; + font-weight:700; + margin:0 2px; + padding:3px 6px; + text-align:center; +} + + +.rich-table-subheader { + background-color:#DDCCCC; + border-top: 1px solid #C0C0C0; + border-left: 1px solid #C0C0C0; +} + +.rich-table { + border-top: none; + border-left: none; +} + +.rich-table-row { + border-left: 1px solid #C0C0C0; +} + +.rich-table-headercell,.rich-table-footercell { + background-color: #FFF; + border: none; + padding-left: 0px; + padding-right: 0px; + font-weight: none; +} + +.rich-table-thead { + border: none; +} + +.rich-table-header { + background: none; +} + +.homepage_stats { + margin-top:10px; + margin-bottom:10px; +} + + .homepage_stats_big { + color:#004DEB; + margin-top:5px; + margin-bottom:5px; + font-size: 20px; + display:block; + font-weight: normal; + } + +/* MESSAGES */ + +.message_info, +.message_1 { + display:block; + font-size: 14px; + font-weight: bold; + border:solid 1px #a0ff7d; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + background-color: #a0ff7d; + padding: 15px 15px; + margin-bottom: 15px; +} + +.message_warning, +.message_2 { + display:block; + font-size: 14px; + font-weight: bold; + border:solid 1px #ffae4c; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + background-color: #ffae4c; + padding: 15px 15px; + margin-bottom: 15px; +} + +.message_error, +.message_3 { + display:block; + font-size: 14px; + font-weight: bold; + border:solid 1px #ff5b43; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + background-color: #ff5b43; + padding: 15px 15px; + margin-bottom: 15px; +} + +.message_4 { + display:block; + font-size: 14px; + font-weight: bold; + border:solid 1px #fc9200; + background-color: #fc9200; + -moz-border-radius-topleft:3px; + -webkit-border-top-left-radius:3px; + -khtml-border-radius-topleft:3px; + -moz-border-radius-topright:3px; + -webkit-border-top-right-radius:3px; + -khtml-border-radius-topright:3px; + padding: 5px; + margin-bottom: 10px; +} + +.message_1 input, .message_1 button, .message_2 input, .message_2 button, .message_3 input, .message_3 button { + margin:0px; +} + +.message_4 h2 { + margin: 0px; + padding:5px; +} + +.message_4 input { + margin: 0px; + font-weight: bold; + font-size: 14px; + padding: 2px 5px; + margin-right: 5px; +} + +/* LOGINBOX */ + + +/* Text styles */ + +.text_justify { + text-align:justify; +} + +.text_left { + text-align:left; +} + +.text_right { + text-align:right; +} + +.text_center { + text-align:center; +} + +.text_middle { + vertical-align:middle!important; +} + +.text_top { + vertical-align:top; +} + +/* OTHER STYLES */ + +.no_wrap { + white-space: nowrap; +} + +.no_border { + border:none; +} + + +/* +** WIKI styles +*/ + +#toc, +.toc, +.mw-warning { + border: 1px solid #aaa; + background-color: #f9f9f9; + padding: 5px; + font-size: 95%; +} +#toc h2, +.toc h2 { + display: inline; + border: none; + padding: 0; + font-size: 100%; + font-weight: bold; +} +#toc #toctitle, +.toc #toctitle, +#toc .toctitle, +.toc .toctitle { + text-align: center; +} +#toc ul, +.toc ul { + list-style-type: none; + list-style-image: none; + margin-left: 0; + padding-left: 0; + text-align: left; +} +#toc ul ul, +.toc ul ul { + margin: 0 0 0 2em; +} +#toc .toctoggle, +.toc .toctoggle { + font-size: 94%; +} + +.thumbcaption { + border: none; + text-align: left; + line-height: 1.4em; + padding: 3px !important; + font-size: 94%; +} + +.location-right { + clear: right; + float: right; + border-width: .5em 0 .8em 1.4em; +} +.location-left { + float: left; + clear: left; + margin-right: .5em; + border-width: .5em 1.4em .8em 0; +} + diff --git a/logstats-war/src/main/webapp/img/icon_download.png b/logstats-war/src/main/webapp/img/icon_download.png new file mode 100644 index 0000000..bbbb02f Binary files /dev/null and b/logstats-war/src/main/webapp/img/icon_download.png differ diff --git a/logstats-war/src/main/webapp/img/icon_print.png b/logstats-war/src/main/webapp/img/icon_print.png new file mode 100644 index 0000000..27b4ac6 Binary files /dev/null and b/logstats-war/src/main/webapp/img/icon_print.png differ diff --git a/logstats-war/src/main/webapp/img/logstats-logo.png b/logstats-war/src/main/webapp/img/logstats-logo.png new file mode 100644 index 0000000..0c6ee42 Binary files /dev/null and b/logstats-war/src/main/webapp/img/logstats-logo.png differ diff --git a/logstats-war/src/main/webapp/jsp/admin/index.xhtml b/logstats-war/src/main/webapp/jsp/admin/index.xhtml new file mode 100644 index 0000000..e139722 --- /dev/null +++ b/logstats-war/src/main/webapp/jsp/admin/index.xhtml @@ -0,0 +1,22 @@ + + + Vasc Admin + + + + + + + + + + + + + + diff --git a/logstats-war/src/main/webapp/jsp/help.xhtml b/logstats-war/src/main/webapp/jsp/help.xhtml new file mode 100644 index 0000000..8ed2f8f --- /dev/null +++ b/logstats-war/src/main/webapp/jsp/help.xhtml @@ -0,0 +1,10 @@ + + Help + + diff --git a/logstats-war/src/main/webapp/jsp/includes/index-pulic.xhtml b/logstats-war/src/main/webapp/jsp/includes/index-pulic.xhtml new file mode 100644 index 0000000..8026865 --- /dev/null +++ b/logstats-war/src/main/webapp/jsp/includes/index-pulic.xhtml @@ -0,0 +1,15 @@ + + +

+ + + + +
+
diff --git a/logstats-war/src/main/webapp/jsp/includes/index-user.xhtml b/logstats-war/src/main/webapp/jsp/includes/index-user.xhtml new file mode 100644 index 0000000..3368e39 --- /dev/null +++ b/logstats-war/src/main/webapp/jsp/includes/index-user.xhtml @@ -0,0 +1,16 @@ + + +

+ + + + + +
+
diff --git a/logstats-war/src/main/webapp/jsp/includes/layout.xhtml b/logstats-war/src/main/webapp/jsp/includes/layout.xhtml new file mode 100644 index 0000000..a575624 --- /dev/null +++ b/logstats-war/src/main/webapp/jsp/includes/layout.xhtml @@ -0,0 +1,71 @@ + + + + + + + + + <ui:insert name="title">Default title</ui:insert> + + + + + + + +
+ +
+

+ +
+
 
+ +
+
+ + \ No newline at end of file diff --git a/logstats-war/src/main/webapp/jsp/includes/vasc-template.xhtml b/logstats-war/src/main/webapp/jsp/includes/vasc-template.xhtml new file mode 100644 index 0000000..3fb7f9b --- /dev/null +++ b/logstats-war/src/main/webapp/jsp/includes/vasc-template.xhtml @@ -0,0 +1,318 @@ + + + + + + + + + + + +

+ + + +

+ + + + +
+
+ + + + +

+ + + +

+ + + +
+
+ + + + +

+ + + + + + +

+ +
    +
  • + +
  • +
    +
+ + + +
+
+ + +

+ + +

+
+
+
+ + + + +

+ + + +

+ +

+ + + +

+
+ + + + + +
    +
  • + + + + +
  • + +
  • +
    +
+ + + + + + + + +
+ +
    +
  • + + +
  • + +
  • + + +
  • +
    + + +
  • + + +
  • +
    + +
  • ...
  • + +
  • + + +
  • +
    +
    +
  • ...
  • + +
  • + + +
  • +
    +
    +
  • + + +
  • +
+
+ + + + + + + + + + + #{entrySupport.i18nMap['generic.vasc.jsf.table.download.img']} + + + + + + #{entrySupport.i18nMap['generic.vasc.jsf.table.printer.img']} + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + #{entrySupport.i18nMap['generic.vasc.jsf.table.download.img']} + + + + + + #{entrySupport.i18nMap['generic.vasc.jsf.table.printer.img']} + + + + + + + + +
    +
  • + + +
  • + +
  • + + +
  • +
    + + +
  • + + +
  • +
    + +
  • ...
  • + +
  • + + +
  • +
    +
    +
  • ...
  • + +
  • + + +
  • +
    +
    +
  • + + +
  • +
+
+
+
+
+
+ +

+ +

+
+
+
+
+ +
+
+ diff --git a/logstats-war/src/main/webapp/jsp/includes/wiki-template.xhtml b/logstats-war/src/main/webapp/jsp/includes/wiki-template.xhtml new file mode 100644 index 0000000..98c0209 --- /dev/null +++ b/logstats-war/src/main/webapp/jsp/includes/wiki-template.xhtml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/logstats-war/src/main/webapp/jsp/index.xhtml b/logstats-war/src/main/webapp/jsp/index.xhtml new file mode 100644 index 0000000..9559078 --- /dev/null +++ b/logstats-war/src/main/webapp/jsp/index.xhtml @@ -0,0 +1,20 @@ + + Index + + + + + diff --git a/logstats-war/src/main/webapp/jsp/index_jsp.jsp b/logstats-war/src/main/webapp/jsp/index_jsp.jsp new file mode 100644 index 0000000..3255ad0 --- /dev/null +++ b/logstats-war/src/main/webapp/jsp/index_jsp.jsp @@ -0,0 +1,2 @@ +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + diff --git a/logstats-war/src/main/webapp/jsp/login/login-error.xhtml b/logstats-war/src/main/webapp/jsp/login/login-error.xhtml new file mode 100644 index 0000000..be05e55 --- /dev/null +++ b/logstats-war/src/main/webapp/jsp/login/login-error.xhtml @@ -0,0 +1,11 @@ + + Error + + + + \ No newline at end of file diff --git a/logstats-war/src/main/webapp/jsp/login/login-forgot.xhtml b/logstats-war/src/main/webapp/jsp/login/login-forgot.xhtml new file mode 100644 index 0000000..fa5efcf --- /dev/null +++ b/logstats-war/src/main/webapp/jsp/login/login-forgot.xhtml @@ -0,0 +1,11 @@ + + Forgot + + + + diff --git a/logstats-war/src/main/webapp/jsp/login/login.xhtml b/logstats-war/src/main/webapp/jsp/login/login.xhtml new file mode 100644 index 0000000..6ac57df --- /dev/null +++ b/logstats-war/src/main/webapp/jsp/login/login.xhtml @@ -0,0 +1,23 @@ + + + Login + +
+ + + + + + + + +
+ + + +
+
+ \ No newline at end of file diff --git a/logstats-war/src/main/webapp/jsp/login/logout.xhtml b/logstats-war/src/main/webapp/jsp/login/logout.xhtml new file mode 100644 index 0000000..5ef22f0 --- /dev/null +++ b/logstats-war/src/main/webapp/jsp/login/logout.xhtml @@ -0,0 +1,11 @@ + + Logout + + + + diff --git a/logstats-war/src/main/webapp/jsp/realtime.xhtml b/logstats-war/src/main/webapp/jsp/realtime.xhtml new file mode 100644 index 0000000..a50e795 --- /dev/null +++ b/logstats-war/src/main/webapp/jsp/realtime.xhtml @@ -0,0 +1,56 @@ + + Realtime Logs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/logstats-war/src/main/webapp/jsp/reports.xhtml b/logstats-war/src/main/webapp/jsp/reports.xhtml new file mode 100644 index 0000000..4ebdd1f --- /dev/null +++ b/logstats-war/src/main/webapp/jsp/reports.xhtml @@ -0,0 +1,10 @@ + + Reports + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..7942e1b --- /dev/null +++ b/pom.xml @@ -0,0 +1,206 @@ + + 4.0.0 + net.forwardfire.logstats + logstats + 0.0.1-SNAPSHOT + pom + logstats-base + + logstats-ear + logstats-ejb + logstats-war + logstats-jboss-sar + + + UTF-8 + 5.8 + 0.8.2-SNAPSHOT + 0.3.5-SNAPSHOT + + + + + + ${project.groupId} + logstats-jboss-sar + ${project.version} + sar + + + + + + + + org.apache.maven.plugins + maven-ear-plugin + 2.3.1 + + + org.codehaus.mojo + jboss-packaging-maven-plugin + + + + + + maven-compiler-plugin + + UTF-8 + 1.5 + 1.5 + true + true + true + + + + org.codehaus.mojo + jboss-packaging-maven-plugin + + true + + + + maven-site-plugin + 2.1 + + UTF-8 + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.4 + + + + + + + + + local + http://localhost:8081/nexus/content/groups/public/ + true + true + + + + + + + local + http://localhost:8081/nexus/content/groups/public/ + true + true + + + + + + + releases + Internal Releases + http://localhost:8081/nexus/content/repositories/releases + + + snapshots + Internal Snapshots + http://localhost:8081/nexus/content/repositories/snapshots + + + + + + true + + + org.apache.maven.plugins + maven-surefire-report-plugin + + true + + + + maven-jxr-plugin + + true + + + + org.apache.maven.plugins + maven-pmd-plugin + 2.5 + + true + utf-8 + 100 + 1.5 + true + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 2.2 + + + org.codehaus.mojo + taglist-maven-plugin + + + TODO + @todo + @deprecated + FIXME + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + 128m + 1g + + + + + aggregate + test-aggregate + fix + test-fix + + + + + + org.codehaus.mojo + findbugs-maven-plugin + + + org.codehaus.mojo + cobertura-maven-plugin + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + + + + + + org.testng + testng + ${testng.version} + jdk15 + test + + + \ No newline at end of file