Compare commits

...

28 Commits

Author SHA1 Message Date
Brian Rosenberger 6d85158246 Allow logging via SLF4J and logback-classic. Fixes #5 2023-09-28 10:49:47 +02:00
Brian Rosenberger b2cd9fbda7 Initial release of lock/ unlock operation in MiscService 2023-09-28 09:09:36 +02:00
Brian Rosenberger 485dae7bb1 Bump version 2.0.2-SNAPSHOT 2023-09-28 09:08:47 +02:00
Brian Rosenberger 4c3a1c575c Bump version 2.0.1-SNAPSHOT 2023-09-27 11:49:48 +02:00
Brian Rosenberger 4777c132d4 Allow init_delay and configurable alf_event filters. This closes #4 and closes #2 2023-09-27 11:42:38 +02:00
Brian Rosenberger 39855ae8ba Synchronising MERGE INTO alf event inbound queue. This fixes #1 2023-09-26 15:07:42 +02:00
Brian Rosenberger adcefa1bba First version 2.0.0 release.
git-svn-id: https://brutex.net/svn/xservices/trunk@203 e7e49efb-446e-492e-b9ec-fcafc1997a86
2023-09-26 08:43:16 +00:00
Brian Rosenberger d37d23b253 New Gerenation against ALFEventManagerDocLit.xsd instead of ALFEventManagerSOAP.xsd
git-svn-id: https://brutex.net/svn/xservices/trunk@202 e7e49efb-446e-492e-b9ec-fcafc1997a86
2023-09-22 11:40:57 +00:00
Brian Rosenberger 076e78afe2 Initial version 2.0.0-SNAPHSOT, now includes preview of event manager service and lock service (both within MiscServices
git-svn-id: https://brutex.net/svn/xservices/trunk@201 e7e49efb-446e-492e-b9ec-fcafc1997a86
2023-09-21 13:02:06 +00:00
Brian Rosenberger 5cc829df49 Remove log4j/ log4j2 config files.
git-svn-id: https://brutex.net/svn/xservices/trunk@200 e7e49efb-446e-492e-b9ec-fcafc1997a86
2023-09-19 12:51:25 +00:00
Brian Rosenberger f7c18a86fe Use SLF4J instead of log4j/ log4j2. Introduce lombok.
git-svn-id: https://brutex.net/svn/xservices/trunk@199 e7e49efb-446e-492e-b9ec-fcafc1997a86
2023-09-19 12:50:19 +00:00
Brian Rosenberger 3395c35ad0 Update build system to use gradle and update dependency versions. Compatible up to Tomcat 9.x
git-svn-id: https://brutex.net/svn/xservices/trunk@198 e7e49efb-446e-492e-b9ec-fcafc1997a86
2023-09-13 14:27:58 +00:00
Brian Rosenberger 9d95f5194a Update Log4j2 dependency to 2.17.1 to resolve log4jshell vulnerability
git-svn-id: https://brutex.net/svn/xservices/trunk@197 e7e49efb-446e-492e-b9ec-fcafc1997a86
2022-01-14 14:35:55 +00:00
Brian Rosenberger 7ee16eb26c Klaus Scherbach: Add handleStringList web service operation
git-svn-id: https://brutex.net/svn/xservices/trunk@195 e7e49efb-446e-492e-b9ec-fcafc1997a86
2019-02-11 17:02:11 +00:00
Brian Rosenberger 4895c0b265 Fix missing jar for MiscServices:Sleep function
git-svn-id: https://brutex.net/svn/xservices/trunk@194 e7e49efb-446e-492e-b9ec-fcafc1997a86
2019-01-21 14:51:38 +00:00
Brian Rosenberger a8e5987e75 Fix new version of commons-configurations usage
git-svn-id: https://brutex.net/svn/xservices/trunk@193 e7e49efb-446e-492e-b9ec-fcafc1997a86
2018-08-22 09:11:19 +00:00
Brian Rosenberger f0c1dce235 Moving OA Soap Wrapper into current trunk version
git-svn-id: https://brutex.net/svn/xservices/trunk@192 e7e49efb-446e-492e-b9ec-fcafc1997a86
2018-08-22 09:08:28 +00:00
Brian Rosenberger d24bd44218 Fix new version of commons-configurations usage
git-svn-id: https://brutex.net/svn/xservices/trunk@191 e7e49efb-446e-492e-b9ec-fcafc1997a86
2018-08-22 08:52:06 +00:00
Brian Rosenberger 9a0d90a4b4 Moving OA Soap Wrapper into current trunk version
git-svn-id: https://brutex.net/svn/xservices/trunk@190 e7e49efb-446e-492e-b9ec-fcafc1997a86
2018-08-22 08:44:57 +00:00
Brian Rosenberger a59bd05fde Moving OA Soap Wrapper into current trunk version
git-svn-id: https://brutex.net/svn/xservices/trunk@189 e7e49efb-446e-492e-b9ec-fcafc1997a86
2018-08-22 07:39:06 +00:00
Brian Rosenberger 5aba84c316 Moving OA Soap Wrapper into current trunk version
git-svn-id: https://brutex.net/svn/xservices/trunk@188 e7e49efb-446e-492e-b9ec-fcafc1997a86
2018-08-22 07:36:37 +00:00
Brian Rosenberger 1acb30d0ed Moving OA Soap Wrapper into current trunk version
git-svn-id: https://brutex.net/svn/xservices/trunk@187 e7e49efb-446e-492e-b9ec-fcafc1997a86
2018-08-22 07:36:16 +00:00
Brian Rosenberger 8db4a1a60a Updated JCS from 1.3 to version 2.2
git-svn-id: https://brutex.net/svn/xservices/trunk@186 e7e49efb-446e-492e-b9ec-fcafc1997a86
2018-08-21 07:33:23 +00:00
Brian Rosenberger a4446afac0 Updating underlying libraries to current, major versions. Also updating source level to Java 8 and runtime to Tomcat 8.5. See ivy.xml for details.
git-svn-id: https://brutex.net/svn/xservices/trunk@185 e7e49efb-446e-492e-b9ec-fcafc1997a86
2018-05-03 05:24:04 +00:00
Brian Rosenberger bba63ca750 Properly shut down worker threads to avoid leak
git-svn-id: https://brutex.net/svn/xservices/trunk@184 e7e49efb-446e-492e-b9ec-fcafc1997a86
2016-06-01 05:50:19 +00:00
Brian Rosenberger 98f2419840 Update Mail WS to include underlying ant-mail library
git-svn-id: https://brutex.net/svn/xservices/trunk@183 e7e49efb-446e-492e-b9ec-fcafc1997a86
2016-05-31 14:25:26 +00:00
Brian Rosenberger fcd20c27a7 Update Mail WS to include underlying ant-mail library
git-svn-id: https://brutex.net/svn/xservices/trunk@182 e7e49efb-446e-492e-b9ec-fcafc1997a86
2016-05-31 13:49:11 +00:00
Brian Rosenberger dbe899c014 Updated Ant with minor adjustments
git-svn-id: https://brutex.net/svn/xservices/trunk@181 e7e49efb-446e-492e-b9ec-fcafc1997a86
2015-09-04 08:40:50 +00:00
173 changed files with 8036 additions and 1125 deletions

132
build.gradle Normal file
View File

@ -0,0 +1,132 @@
apply plugin: 'war'
apply plugin: "maven-publish"
apply plugin: "signing"
repositories {
mavenCentral()
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}
project.version "2.0.2-SNAPSHOT"
group "net.brutex.xservices"
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
maven {
name = 'LocalRemote'
def releasesRepoUrl = 'https://archiva.brutex.net/repository/internal/'
def snapshotsRepoUrl = 'https://archiva.brutex.net/repository/snapshots/'
url = project.version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
allowInsecureProtocol = false
credentials {
username = mavenuser
password = mavenpass
}
}
maven {
name = 'OSSRH'
def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
url = project.version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
maven {
name = 'brutexGitea'
def releasesRepoUrl = 'https://source.brutex.net/api/packages/brutex/maven'
def snapshotsRepoUrl = 'https://source.brutex.net/api/packages/brutex/maven'
url = project.version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
allowInsecureProtocol = false
credentials {
username = mavenuser
password = mavenpass
}
}
}
}
tasks.register('createDist', Zip) {Zip t ->
archiveBaseName = project.name
archiveVersion = version
archiveExtension = "zip"
destinationDirectory = new File(project.buildDir, "/distribution/")
from war.outputs.files
}
dependencies {
compileOnly "javax.servlet:javax.servlet-api:4.0.1"
compileOnly "javax.ws.rs:javax.ws.rs-api:2.1.1"
implementation "org.apache.commons:commons-configuration2:2.9.0"
implementation "org.apache.commons:commons-lang3:3.12.0"
implementation "commons-net:commons-net:3.9.0"
implementation "commons-beanutils:commons-beanutils:1.9.4"
implementation "org.apache.httpcomponents:httpclient:4.5.14"
implementation "org.apache.httpcomponents:fluent-hc:4.5.14"
implementation "commons-io:commons-io:2.11.0"
implementation "org.apache.ant:ant:1.10.13"
implementation "org.apache.ant:ant-nodeps:1.8.1"
implementation "org.apache.ant:ant-jsch:1.10.13"
implementation "org.apache.ant:ant-commons-net:1.10.13"
implementation "org.apache.ant:ant-javamail:1.10.13"
implementation "org.apache.ant:ant-launcher:1.10.13"
implementation "org.apache.commons:commons-jcs-core:2.2.1"
implementation "org.quartz-scheduler:quartz:2.3.2"
implementation "org.slf4j:slf4j-api:2.0.7"
runtimeOnly "ch.qos.logback:logback-core:1.3.8"
runtimeOnly "ch.qos.logback:logback-classic:1.3.8"
//runtimeOnly "org.slf4j:slf4j-simple:2.0.7"
implementation "org.apache.ws.commons.axiom:axiom:1.2.22"
implementation "org.apache.ws.commons.axiom:axiom-impl:1.2.22"
implementation "org.apache.shiro:shiro-core:1.12.0"
implementation "org.apache.shiro:shiro-root:1.12.0"
implementation "org.apache.shiro:shiro-web:1.12.0"
implementation "org.apache.cxf:cxf:3.4.10"
implementation "org.apache.cxf:cxf-rt-databinding-aegis:3.2.14"
runtimeOnly "org.apache.cxf:cxf-rt-transports-http:3.2.14"
runtimeOnly "org.apache.cxf:cxf-rt-frontend-jaxrs:3.2.14"
runtimeOnly "org.apache.cxf:cxf-rt-frontend-jaxws:3.2.14"
runtimeOnly "org.apache.cxf:cxf-rt-security:3.2.14"
implementation "rhino:js:1.7R2"
implementation "org.springframework:spring-core:5.3.29"
implementation "org.springframework:spring-context:5.3.29"
implementation "org.springframework:spring-web:5.3.29"
implementation "com.h2database:h2:2.2.222"
implementation "com.sun.xml.bind:jaxb-impl:2.3.0.1"
implementation "com.sun.xml.bind:jaxb-core:2.3.0.1"
implementation fileTree(dir: "lib/", includes: ["*.jar"], excludes: ["serena.*.jar"])
compileOnly fileTree(dir: "lib/", includes: ["serena.*.jar"])
annotationProcessor "org.projectlombok:lombok:1.18.28"
compileOnly "org.projectlombok:lombok:1.18.28"
}

View File

@ -1,11 +1,14 @@
<?xml version="1.0"?>
<project default="create-doc" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="toolsdir" location="C:/JAVA-DEV/" />
<!-- C:\JAVA-DEV\apache-fop-1.1 -->
<taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop">
<classpath>
<fileset dir="C:\\JAVA-DEV\\apache-fop-1.1">
<fileset dir="${toolsdir}/fop-2.2/fop">
<include name="build/*.jar" />
<include name="lib/*.jar" />
</fileset>
@ -14,19 +17,20 @@
<!-- External Syntax Higlighter for docbook xsl -->
<path id="xslthl.path">
<pathelement location="C:\\JAVA-DEV\\xslthl-2.1.0\\xslthl-2.1.0.jar" />
<pathelement location="${toolsdir}/xslthl-2.1.3/xslthl-2.1.3.jar" />
</path>
<property name="current-loc" location="." />
<property name="workspace" location=".." />
<property name="htmldir" value="${current-loc}/doc/html" />
<property name="docbookdir" value="D:/DATA/JAVA-DEV/docbook-xsl-1.78.1/" />
<property name="docbookdir" value="${toolsdir}/docbook-xsl-1.79.1/" />
<property name="fo.stylesheet" value="${docbookdir}/fo/docbook.xsl" />
<property name="fo.stylesheet.hl" value="${docbookdir}/fo/docbook.xsl" />
<property name="html.stylesheet.hl" value="${docbookdir}/html/docbook-with-highlighting.xsl" />
<property name="html.chunked.stylesheet.hl" value="${docbookdir}/html/docbook-chunked-with-highlighting.xsl" />
<property name="html.stylesheet.hl" value="${docbookdir}/html/docbook.xsl" />
<property name="html.chunked.stylesheet.hl" value="${docbookdir}/html/docbook.xsl" />
<property name="eclipse.stylesheet" value="${docbookdir}/eclipse/eclipse.xsl" />
<property name="html.stylesheet" value="${docbookdir}/html/docbook.xsl" />
<property name="javahelp.stylesheet" value="${docbookdir}/javahelp/javahelp.xsl" />
@ -35,8 +39,9 @@
<property name="docbooksource" value="${current-loc}/doc" />
<property name="xalan" value="org.apache.xalan.processor.TransformerFactoryImpl" />
<property name="web.dir" value="${current-loc}/web" />
<property name="build.dir" value="${current-loc}/bin" />
<property name="delivery.dir" value="c:\\TEMP\\_DELIVERY_AREA" />
<property name="build.dir" value="${current-loc}/build/classes" />
<property name="bin.dir" value="${current-loc}/bin" />
<property name="delivery.dir" value="c:/TEMP/_DELIVERY_AREA" />
<property name="name" value="XServices" />
@ -61,7 +66,7 @@
<xslt force="true" style="${html.stylesheet.hl}" in="${docbooksource}/BruteXServices_User_Guide.dbk" out="${htmldir}/index.html">
<factory name="${xalan}" />
<classpath refid="xslthl.path" />
<param name="highlight.xslthl.config" expression="file:///C:/JAVA-DEV/docbook-xsl-1.78.1/highlighting/xslthl-config.xml" />
<param name="highlight.xslthl.config" expression="file:///${docbookdir}/highlighting/xslthl-config.xml" />
<param name="highlight.source" expression="1" />
<param name="html.stylesheet" expression="style.css" />
</xslt>
@ -85,7 +90,7 @@
<param name="html.cleanup" expression="1" />
<param name="chunk.first.selection" expression="1" />
<param name="navig.showtitles" expression="1" />
<param name="highlight.xslthl.config" expression="file:///C:/JAVA-DEV/docbook-xsl-1.78.1/highlighting/xslthl-config.xml" />
<param name="highlight.xslthl.config" expression="file:///${docbookdir}/highlighting/xslthl-config.xml" />
<param name="highlight.source" expression="1" />
</xslt>
<copy file="${docbooksource}/style.css" overwrite="true" tofile="${htmldir}/style.css" />
@ -102,7 +107,7 @@
<param name="chapter.autolabel" expression="1" />
<param name="appendix.autolabel" expression="1" />
<param name="section.label.includes.component.label" expression="1" />
<param name="highlight.xslthl.config" expression="file:///C:/JAVA-DEV/docbook-xsl-1.78.1/highlighting/xslthl-config.xml" />
<param name="highlight.xslthl.config" expression="file:///${docbookdir}/highlighting/xslthl-config.xml" />
<param name="highlight.source" expression="1" />
<param name="paper.type" expression="A4" />
</xslt>
@ -158,7 +163,12 @@
</target>
<target name="build-war">
<ivy:retrieve pattern="c://TEMP/lib/default/[artifact]-[revision].[ext]" conf="default" />
<ivy:retrieve pattern="c://TEMP/lib/default/[artifact]-[revision].[ext]" conf="master" />
<jar destfile="${bin.dir}/XServices.jar"
basedir="${build.dir}"
includes="net/**/*"/>
<war destfile="${delivery.dir}\\${name}.war" webxml="${web.dir}/WEB-INF/web.xml">
<fileset dir="${web.dir}/">
<include name="**/*.*" />
@ -166,7 +176,14 @@
<lib dir="c://TEMP/lib/default">
<!--<exclude name="portlet.jar"/>-->
</lib>
<classes dir="${build.dir}" />
<lib dir="${bin.dir}" />
<classes dir="${build.dir}">
<!--We already packed all classes into a jar,
so put only remaining config files into
classes
-->
<exclude name="net/**/*"/>
</classes>
</war>
<tstamp>
<format property="build.version" pattern="yyyyMMddhhmmss" />
@ -179,5 +196,8 @@
</copy>
<echo>Distribution: ${delivery.dir}\\${name}\\${name}-${build.version} </echo>
</target>
<target name="hot-deploy" depends="build-war">
<copy file="${delivery.dir}\\${name}\\${name}-${build.version}\\${name}.war" toFile="C://JAVA-DEV//Tomcat//apache-tomcat-8.5.30 -localtest//webapps//XServices.war" />
</target>
</project>

View File

@ -6,7 +6,8 @@
<title>Installation</title>
<para>As of February 2013, XServices require Java 7. Older builds run against Java 5.</para>
<para>Apache Tomcat 7</para>
<para>As of April 2018, XServices require Java 8 and Tomcat 8.5.</para>
<para>tbd.</para>
<para>In short: Deploy .WAR file to Apache Tomcat</para>
<section>

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

248
gradlew vendored Normal file
View File

@ -0,0 +1,248 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

92
gradlew.bat vendored Normal file
View File

@ -0,0 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

119
ivy.xml
View File

@ -1,119 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
you under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
<ivy-module version="2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="Brutex Network" module="XServices" status="integration">
</info>
<configurations>
<conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/>
<conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/>
<conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths." extends="master"/>
<conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/>
<conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/>
<conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/>
<conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/>
<conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/>
<conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/>
<conf name="optional" visibility="public" description="contains all optional dependencies"/>
</configurations>
<dependencies defaultconf="*->#(master),master(*)">
<dependency org="com.sun.xml.bind" name="jaxb-impl" rev="2.2.7"/>
<dependency org="org.apache.commons" name="commons-lang3" rev="3.1"/>
<dependency org="commons-configuration" name="commons-configuration" rev="1.10"/>
<dependency org="commons-net" name="commons-net" rev="3.2"/>
<dependency org="org.apache.ant" name="ant" rev="1.8.4"/>
<dependency org="org.apache.ant" name="ant-nodeps" rev="1.8.1"/>
<dependency org="org.apache.ant" name="ant-jsch" rev="1.8.4"/>
<!--<dependency org="ant-contrib" name="ant-contrib" rev="20020829"/>-->
<dependency org="org.apache.ant" name="ant-commons-net" rev="1.8.4"/>
<!-- JCS does not define scopes in its pom.xml, thus map any configuration to default -->
<dependency org="org.apache.jcs" name="jcs" rev="1.3"/>
<!--<dependency org="concurrent" name="concurrent" rev="1.3.4"/> --><!-- needed for JCS -->
<dependency org="org.quartz-scheduler" name="quartz" rev="2.2.0"/>
<dependency org="log4j" name="log4j" rev="1.2.17"/>
<dependency org="org.apache.ws.commons.axiom" name="axiom-api" rev="1.2.14"/>
<dependency org="org.apache.ws.commons.axiom" name="axiom-impl" rev="1.2.14"/>
<dependency org="jaxen" name="jaxen" rev="1.1.4"/>
<dependency org="org.apache.shiro" name="shiro-core" rev="1.2.2"/>
<dependency org="org.apache.shiro" name="shiro-web" rev="1.2.2"/>
<dependency org="org.slf4j" name="slf4j-log4j12" rev="1.6.6"/> <!-- Binding to Log4J -->
<dependency org="org.apache.cxf" name="cxf-rt-core" rev="2.7.0"/>
<dependency org="org.apache.cxf" name="cxf-rt-transports-http" rev="2.7.0"/>
<dependency org="org.apache.cxf" name="cxf-rt-databinding-aegis" rev="2.7.0"/>
<dependency org="org.apache.cxf" name="cxf-rt-frontend-jaxrs" rev="2.7.0"/>
<dependency org="org.apache.cxf" name="cxf-rt-frontend-jaxws" rev="2.7.0"/>
<dependency org="org.apache.cxf" name="cxf-rt-rs-security-sso-saml" rev="2.7.0"/>
<dependency org="rhino" name="js" rev="1.7R2"/>
<!--
<dependency org="org.apache.cxf" name="cxf-rt-bindings-soap" rev="2.7.0"/>
<dependency org="org.apache.cxf" name="cxf-rt-databinding-jaxb" rev="2.7.0"/>
-->
<dependency org="org.springframework" name="spring-web" rev="3.0.7.RELEASE"/>
<!--
<dependency org="javax.transaction" name="jta" rev="1.0.1B" />
<dependency org="javax.sql" name="jdbc-stdext" rev="2.0" />
-->
<!--
Locally managed libraries
-->
<dependency org="lib" name="java-unrar" rev="0.3" conf="*->*">
<artifact name="java-unrar" type="jar" />
</dependency>
<dependency org="lib" name="lib.cvsclient" rev="20131001" conf="*->*">
<artifact name="lib.cvsclient" type="jar" />
</dependency>
<dependency org="lib" name="lib.xservices-scmtypes" rev="20131001" conf="*">
<artifact name="lib.xservices-scmtypes" type="jar" />
</dependency>
<!-- Serena Dimensions CM 14.1 -->
<dependency org="serena" name="serena.darius" rev="14.1" conf="*">
<artifact name="serena.darius" type="jar" />
</dependency>
<dependency org="serena" name="serena.dmclient" rev="14.1" conf="*">
<artifact name="serena.dmclient" type="jar" />
</dependency>
<dependency org="serena" name="serena.dmfile" rev="14.1" conf="*">
<artifact name="serena.dmfile" type="jar" />
</dependency>
<dependency org="serena" name="serena.dmnet" rev="14.1" conf="*">
<artifact name="serena.dmnet" type="jar" />
</dependency>
<dependency org="serena" name="serena.dmtpi" rev="14.1" conf="*">
<artifact name="serena.dmtpi" type="jar" />
</dependency>
</dependencies>
</ivy-module>

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ivysettings>
<settings defaultResolver="defaultchain" />
<resolvers>
<ibiblio name="apache-maven" m2compatible="true" usepoms="true" root="http://repo.maven.apache.org/maven2/" />
<ibiblio name="java" m2compatible="true" usepoms="true" root="http://download.java.net/maven/2/" />
<filesystem name="local-filesystem">
<!-- <ivy pattern="${ivy.settings.dir}/1/[organisation]/[module]/ivys/ivy-[revision].xml"/> -->
<artifact pattern="${ivy.settings.dir}/lib/[artifact]-[revision].[ext]" />
</filesystem>
<chain name="defaultchain">
<resolver ref="local-filesystem" />
<resolver ref="apache-maven" />
<resolver ref="java" />
</chain>
</resolvers>
<modules>
<module organisation="javax.transaction" resolver="java" />
<module organisation="javax.sql" resolver="java" />
</modules>
</ivysettings>

BIN
lib/DocBuilder-20131001.jar Normal file

Binary file not shown.

View File

@ -1,61 +0,0 @@
# DEFAULT CACHE REGION
jcs.default=DC
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=1000
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.default.cacheattributes.UseMemoryShrinker=false
jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600
jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.default.elementattributes.IsEternal=false
jcs.default.elementattributes.MaxLifeSeconds=21600
jcs.default.elementattributes.IdleTime=1800
jcs.default.elementattributes.IsSpool=true
jcs.default.elementattributes.IsRemote=true
jcs.default.elementattributes.IsLateral=true
# PRE-DEFINED CACHE REGIONS
jcs.region.FileCache=DC
jcs.region.FileCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.region.FileCache.cacheattributes.MaxObjects=1000
jcs.region.FileCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.FileCache.cacheattributes.UseMemoryShrinker=false
jcs.region.FileCache.cacheattributes.MaxMemoryIdleTimeSeconds=3600
jcs.region.FileCache.cacheattributes.ShrinkerIntervalSeconds=60
jcs.region.FileCache.cacheattributes.MaxSpoolPerRun=500
jcs.region.FileCache.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.region.FileCache.elementattributes.IsEternal=false
jcs.region.CVSCache=DC
jcs.region.CVSCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.region.CVSCache.cacheattributes.MaxObjects=50
jcs.region.CVSCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.CVSCache.cacheattributes.UseMemoryShrinker=true
jcs.region.CVSCache.cacheattributes.MaxMemoryIdleTimeSeconds=3600
jcs.region.CVSCache.cacheattributes.ShrinkerIntervalSeconds=60
jcs.region.CVSCache.cacheattributes.MaxSpoolPerRun=5
jcs.region.CVSCache.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.region.CVSCache.elementattributes.IsEternal=false
jcs.region.DIMCM=DC
jcs.region.DIMCM.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.region.DIMCM.cacheattributes.MaxObjects=50
jcs.region.DIMCM.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.DIMCM.cacheattributes.UseMemoryShrinker=true
jcs.region.DIMCM.cacheattributes.MaxMemoryIdleTimeSeconds=3600
jcs.region.DIMCM.cacheattributes.ShrinkerIntervalSeconds=60
jcs.region.DIMCM.cacheattributes.MaxSpoolPerRun=5
jcs.region.DIMCM.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.region.DIMCM.elementattributes.IsEternal=false
# AVAILABLE AUXILIARY CACHES
jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
jcs.auxiliary.DC.attributes.DiskPath=${user.dir}/jcs_swap
jcs.auxiliary.DC.attributes.MaxPurgatorySize=10000000
jcs.auxiliary.DC.attributes.MaxKeySize=1000000
jcs.auxiliary.DC.attributes.MaxRecycleBinSize=5000
jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000
jcs.auxiliary.DC.attributes.ShutdownSpoolTimeLimit=60

View File

@ -1,23 +0,0 @@
log4j.rootLogger=INFO, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
# Print the date in ISO 8601 format
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c{2} - %m%n
# Print only messages of level WARN or above in the package com.foo.
log4j.logger.net.brutex.xservices=INFO
log4j.logger.net.brutex.xservices.ws.rs=DEBUG
log4j.logger.net.brutex.xservices.security=DEBUG
log4j.logger.org.springframework=INFO
log4j.logger.org.apache.jcs=INFO
log4j.logger.org.apache.commons=INFO
log4j.logger.org.apache.axiom=INFO
log4j.logger.org.apache.shiro=INFO

View File

@ -1,60 +0,0 @@
/*
* Copyright 2013 Brian Rosenberger (Brutex Network)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.brutex.xservices.util.cache;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
/**
* @author Brian Rosenberger, bru(at)brutex.de
*
*/
public class CacheExecutorService
implements ServletContextListener
{
static final String EXECUTOR_NAME = "CACHE_EXECUTOR";
private ExecutorService executor;
public void contextInitialized(ServletContextEvent arg0)
{
ServletContext context = arg0.getServletContext();
int nr_executors = 5;
ThreadFactory daemonFactory = new DaemonThreadFactory();
try {
nr_executors = Integer.parseInt(context.getInitParameter("cache:thread-count"));
} catch (NumberFormatException localNumberFormatException) {
}
if (nr_executors <= 1)
this.executor = Executors.newSingleThreadExecutor(daemonFactory);
else {
this.executor = Executors.newFixedThreadPool(nr_executors, daemonFactory);
}
context.setAttribute("CACHE_EXECUTOR", this.executor);
}
public void contextDestroyed(ServletContextEvent arg0) {
ServletContext context = arg0.getServletContext();
this.executor.shutdownNow();
}
}

View File

@ -1,153 +0,0 @@
/*
* Copyright 2013 Brian Rosenberger (Brutex Network)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.brutex.xservices.ws.impl;
import java.util.Enumeration;
import java.util.Properties;
import java.util.UUID;
import javax.jws.WebService;
import net.brutex.xservices.types.HostConnection;
import net.brutex.xservices.types.HostinfoType;
import net.brutex.xservices.types.MailMimeType;
import net.brutex.xservices.types.ReturnCode;
import net.brutex.xservices.types.RuntimeInfoType;
import net.brutex.xservices.types.ant.FileSetResource;
import net.brutex.xservices.util.BrutexNamespaces;
import net.brutex.xservices.util.RunTask;
import net.brutex.xservices.ws.MiscService;
import org.apache.cxf.annotations.WSDLDocumentation;
import org.apache.cxf.annotations.WSDLDocumentationCollection;
import org.apache.tools.ant.taskdefs.HostInfo;
import org.apache.tools.ant.taskdefs.Sleep;
import org.apache.tools.ant.taskdefs.email.EmailTask;
/**
* Implements the web service
*
* @author Brian Rosenberger, bru@brutex.de
*/
@WebService(targetNamespace="http://ws.xservices.brutex.net", endpointInterface="net.brutex.xservices.ws.MiscService", serviceName="MiscService")
public class MiscServiceImpl
implements MiscService
{
public HostinfoType getHostinfo(String hostname)
{
HostInfo info = new HostInfo();
info.setTaskName("HostInfo");
RunTask runner = new RunTask(info);
info.setHost(hostname);
ReturnCode ret = runner.postTask();
HostinfoType infotype = new HostinfoType(
ret.getProperty("NAME"),
ret.getProperty("DOMAIN"),
ret.getProperty("ADDR4"),
ret.getProperty("ADDR6"));
return infotype;
}
public ReturnCode getInfo() {
ReturnCode r = new ReturnCode();
r.returnCode = 0;
Properties props = System.getProperties();
Enumeration e = props.propertyNames();
while (e.hasMoreElements())
{
String propName = (String)e.nextElement();
String propValue = (String)props.get(propName);
r.stdOut = (r.stdOut + propName + ": " + propValue + "\n");
}
return r;
}
public ReturnCode sendMailSimple(HostConnection mailhost, String from, String tolist, String subject, String message)
{
return sendMail(from, from, tolist, "", "", subject, message,
"text/plain", null, mailhost.hostname, mailhost.port,
mailhost.user, mailhost.password, "utf-8", false, false);
}
public ReturnCode sendMailSimpleWithAttachment(HostConnection mailhost, String from, String tolist, String subject, String message, FileSetResource res)
{
return sendMail(from, from, tolist, "", "", subject, message,
"text/plain", res, mailhost.hostname, mailhost.port,
mailhost.user, mailhost.password, "utf-8", false, false);
}
public ReturnCode sendMail(HostConnection mailhost, String from, String tolist, String cclist, String bcclist, String subject, MailMimeType mimetype, String charset, String message, FileSetResource res, boolean ssl, boolean tls)
{
return sendMail(from, from, tolist, cclist, bcclist, subject, message,
mimetype.value(), res, mailhost.hostname, mailhost.port,
mailhost.user, mailhost.password, charset, tls, ssl);
}
public ReturnCode sleep(int minutes, int seconds) {
return sleep(0, minutes, seconds, 0);
}
public String generateUUID() {
return UUID.randomUUID().toString();
}
private ReturnCode sendMail(String from, String replyto, String tolist, String cclist, String bcclist, String subject, String message, String messagemimetype, FileSetResource attachments, String mailhost, int mailport, String user, String password, String charset, boolean tls, boolean ssl)
{
EmailTask mail = new EmailTask();
mail.setTaskName("Mail");
RunTask runner = new RunTask(mail);
mail.setFrom(from);
mail.setReplyTo(replyto);
mail.setToList(tolist);
mail.setCcList(cclist);
mail.setBccList(bcclist);
mail.setSubject(subject);
mail.setMessage(message);
mail.setMessageMimeType(messagemimetype);
if (attachments != null) {
mail.addFileset(attachments.getAntResource(mail.getProject()));
}
mail.setMailhost(mailhost);
mail.setMailport(mailport);
mail.setUser(user);
mail.setPassword(password);
mail.setCharset(charset);
mail.setSSL(ssl);
mail.setEnableStartTLS(tls);
return runner.postTask();
}
private ReturnCode sleep(int hours, int minutes, int seconds, int milliseconds)
{
Sleep sleep = new Sleep();
sleep.setTaskName("Sleep");
RunTask runner = new RunTask(sleep);
sleep.setHours(hours);
sleep.setMinutes(minutes);
sleep.setSeconds(seconds);
sleep.setMilliseconds(milliseconds);
return runner.postTask();
}
public RuntimeInfoType getMemory() {
return new RuntimeInfoType();
}
}

View File

@ -16,7 +16,8 @@
package net.brutex.xservices.security;
import org.apache.log4j.Logger;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.Permission;
import org.apache.shiro.util.AntPathMatcher;
@ -24,13 +25,13 @@ import org.apache.shiro.util.AntPathMatcher;
* @author Brian Rosenberger, bru(at)brutex.de
*
*/
@Slf4j
public class DirectoryPermission implements Permission {
private final Logger logger = Logger.getLogger(DirectoryPermission.class);
private final String path;
public DirectoryPermission(String antlikepath) {
logger.debug(String.format("Creating permission for path '%s'", antlikepath));
log.debug(String.format("Creating permission for path '{}'", antlikepath));
path = antlikepath;
}
@ -40,13 +41,13 @@ public class DirectoryPermission implements Permission {
/* is of same type */
if(! (p instanceof DirectoryPermission)) {
logger.debug(String.format("Testing if permission of type '%s' implies permission of type '%s'. Result was '%s'" , this.getClass(), p.getClass(), result));
log.debug(String.format("Testing if permission of type '{}' implies permission of type '{}'. Result was '{}'" , this.getClass(), p.getClass(), result));
return result;
}
/* comparing to non null directory */
if( ((DirectoryPermission)p).getPath() == null) {
logger.debug(String.format("Testing if DirectoryPermission '%s' implies permission to 'null'. Result was '%s'" , this.getPath(), result));
log.debug(String.format("Testing if DirectoryPermission '{}' implies permission to 'null'. Result was '{}'" , this.getPath(), result));
return result;
}
@ -54,7 +55,7 @@ public class DirectoryPermission implements Permission {
if( (new AntPathMatcher()).matches(path, ((DirectoryPermission)p).getPath()) ) {
result = true;
}
logger.debug(String.format("Testing if DirectoryPermission '%s' implies permission to '%s'. Result was '%s'" , this.getPath(), ((DirectoryPermission) p).getPath(), result));
log.debug(String.format("Testing if DirectoryPermission '{}' implies permission to '{}'. Result was '{}'" , this.getPath(), ((DirectoryPermission) p).getPath(), result));
return result;
}

View File

@ -16,10 +16,11 @@
package net.brutex.xservices.security;
import lombok.extern.slf4j.Slf4j;
import net.brutex.xservices.ws.XmlService;
import net.brutex.xservices.ws.rs.FileInfo;
import org.apache.log4j.Logger;
import org.apache.shiro.authz.Permission;
import org.apache.shiro.authz.permission.InvalidPermissionStringException;
@ -27,33 +28,33 @@ import org.apache.shiro.authz.permission.InvalidPermissionStringException;
* @author Brian Rosenberger, bru(at)brutex.de
*
*/
@Slf4j
public class PermissionResolver implements org.apache.shiro.authz.permission.PermissionResolver {
final Logger logger = Logger.getLogger(PermissionResolver.class);
private final String DELIMITER = "||";
@Override
public Permission resolvePermission(String permissionString) {
logger.debug(String.format("Trying to examine new Permission '%s'", permissionString));
log.debug(String.format("Trying to examine new Permission '{}'", permissionString));
if(! permissionString.contains(DELIMITER)) {
logger.error(String.format("Permission '%s' is missing permission class.", permissionString));
throw new InvalidPermissionStringException(String.format("Permission '%s' is missing permission class.", permissionString), permissionString);
log.error(String.format("Permission '{}' is missing permission class.", permissionString));
throw new InvalidPermissionStringException(String.format("Permission '{}' is missing permission class.", permissionString), permissionString);
}
int delimiterIndex = permissionString.indexOf(DELIMITER);
String value = permissionString.substring(0, delimiterIndex);
delimiterIndex = delimiterIndex + DELIMITER.length();
switch (value) {
case XmlService.SERVICE_NAME:
logger.debug(String.format("Found '%s' as permission class.", value));
log.debug(String.format("Found '{}' as permission class.", value));
return new XmlServicePermission(permissionString.substring( delimiterIndex ));
case FileInfo.SERVICE_NAME:
logger.debug(String.format("Found '%s' as permission class.", value));
log.debug(String.format("Found '{}' as permission class.", value));
return new DirectoryPermission(permissionString.substring( delimiterIndex ));
default:
logger.warn(String.format("Permission class '%s' is not defined.", value));
log.warn(String.format("Permission class '{}' is not defined.", value));
throw new InvalidPermissionStringException(String.format("Permission class '%s' is not defined.", value), permissionString);
}
}

View File

@ -17,24 +17,14 @@
package net.brutex.xservices.security;
import java.text.ParseException;
import java.util.Collection;
import java.util.Map;
import org.apache.log4j.Logger;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.Permission;
import org.apache.shiro.authz.permission.PermissionResolver;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.config.Ini;
import org.apache.shiro.io.ResourceUtils;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.realm.text.IniRealm;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.util.Nameable;
import org.apache.shiro.util.PermissionUtils;
import java.net.URI;
import java.net.URISyntaxException;
// TODO: Auto-generated Javadoc
/*
@ -48,10 +38,9 @@ import org.apache.shiro.util.PermissionUtils;
/**
* The Class XServicesRealm.
*/
@Slf4j
public class XServicesRealm extends IniRealm implements Nameable {
/** The logger. */
private static Logger logger = Logger.getLogger(XServicesRealm.class);
/** The name. */
private String name;
@ -70,11 +59,25 @@ public class XServicesRealm extends IniRealm implements Nameable {
* 'shiro.ini' in classpath and {@link net.brutex.xservices.security.PermissionResolver PermissionResolver}.
*
*/
public XServicesRealm() {
super();
this.setIni(Ini.fromResourcePath(ResourceUtils.CLASSPATH_PREFIX+"shiro.ini"));
/* needs review */
URI classesRootDir;
try {
classesRootDir = getClass().getProtectionDomain().getCodeSource().getLocation().toURI();
String dir = classesRootDir.toString().replaceAll("%20", " ");
dir = dir.substring(0, dir.lastIndexOf("WEB-INF"));
this.setIni(Ini.fromResourcePath(dir+"/WEB-INF/shiro.ini"));
} catch (URISyntaxException e) {
log.error(e.getMessage(), e);
e.printStackTrace();
}
this.setPermissionResolver(new net.brutex.xservices.security.PermissionResolver());
//this.setRolePermissionResolver(new RolePermissionResolver());
init();
}
}
}

View File

@ -16,21 +16,20 @@
package net.brutex.xservices.security;
import org.apache.log4j.Logger;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.Permission;
import org.apache.shiro.util.AntPathMatcher;
/**
* @author Brian Rosenberger, bru(at)brutex.de
*
*/
@Slf4j
public class XmlServicePermission implements Permission {
private final Logger logger = Logger.getLogger(XmlServicePermission.class);
private final String permissionString;
public XmlServicePermission(String permissionString) {
logger.debug(String.format("Creating permission for '%s'", permissionString));
log.debug(String.format("Creating permission for '{}'", permissionString));
this.permissionString = permissionString;
}
@ -40,13 +39,13 @@ public class XmlServicePermission implements Permission {
/* is of same type */
if(! (p instanceof XmlServicePermission)) {
logger.debug(String.format("Testing if permission of type '%s' implies permission of type '%s'. Result was '%s'" , this.getClass(), p.getClass(), result));
log.debug(String.format("Testing if permission of type '{}' implies permission of type '{}'. Result was '{}'" , this.getClass(), p.getClass(), result));
return result;
}
/* comparing to non null directory */
if( ((XmlServicePermission)p).getPermissionString() == null) {
logger.debug(String.format("Testing if DirectoryPermission '%s' implies permission to 'null'. Result was '%s'" , permissionString, result));
log.debug(String.format("Testing if DirectoryPermission '{}' implies permission to 'null'. Result was '{}'" , permissionString, result));
return result;
}

View File

@ -41,8 +41,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.sun.xml.bind.XmlAccessorFactory;
/**
* @author Brian Rosenberger, bru(at)brutex.de
*

View File

@ -29,7 +29,7 @@ import javax.xml.bind.annotation.XmlType;
@XmlType
public class StringMatchType
{
public final List<StringMatchDetails> stringlist = new ArrayList();
public final List<StringMatchDetails> stringlist = new ArrayList<StringMatchDetails>();
public int size = 0;
public synchronized void addStringMatch(StringMatchDetails match)

View File

@ -0,0 +1,339 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.eclipse.org/alf/schema/EventBase/1"
targetNamespace="http://www.eclipse.org/alf/schema/EventBase/1"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<xs:annotation>
<xs:documentation>
WARNING: PRELIMINARY VERSION SUBJECT TO CHANGE
</xs:documentation>
</xs:annotation>
<xs:annotation>
<xs:documentation>
Copyright Notice The material in this document is Copyright
(c) Serena Software, Inc. and others, 2005, 2006 Terms and
Conditions: The Eclipse Foundation makes available all
content in this document ("Content"). Unless otherwise
indicated below, the Content is provided to you under the
terms and conditions of the Eclipse Public License Version
1.0 ("EPL"). A copy of the EPL is available at
http://www.eclipse.org/legal/epl-v10.html. For purposes of
the EPL, "Program" will mean the Content. If you did not
receive this Content directly from the Eclipse Foundation,
the Content is being redistributed by another party
("Redistributor") and different terms and conditions may
apply to your use of any object code in the Content. Check
the Redistributor's license that was provided with the
Content. If you did not receive any such license, contact
the Redistributor. Unless otherwise indicated below, the
terms and conditions of the EPL still apply to the Content.
</xs:documentation>
</xs:annotation>
<!-- Begin EventBaseTypes -->
<xs:complexType name="EventBaseType">
<xs:annotation>
<xs:documentation>
EventBaseType is a container for that portion of an ALF
Event that is generally set by the Tool that raises the
event.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="EventId" type="EventIdType"/>
<xs:element name="Timestamp" type="TimestampType"/>
<xs:element name="EventType" type="EventTypeType"/>
<xs:element name="ObjectType" type="ObjectTypeType"/>
<xs:element name="ObjectId" type="ObjectIdType"/>
<xs:element name="Source" type="SourceType"/>
<xs:element name="User" type="CredentialsType"/>
<xs:element name="EventControl" type="EmBaseType" minOccurs="0"/>
<xs:element name="BaseExtension" type="BaseExtensionType" minOccurs="0"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
<xs:complexType name="EmBaseType">
<xs:annotation>
<xs:documentation>
EventControlType is a container for that portion of an
ALF Event that is generally set by the ALF EventManager.
In some cases, ALF compliant tools may set some fields,
in particular when the event is a result of an ALF
service call to that tool from a ServiceFlow.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="EmEventId" type="xs:string"/>
<xs:element name="EmTimestamp" type="TimestampType"/>
<xs:element name="PrecedingEmEventId" type="EventIdType"/>
<xs:element name="ApplicationName" type="ApplicationNameType"/>
<xs:element name="EventMatchName" type="EventMatchNameType"/>
<xs:element name="ServiceFlowName" type="ServiceFlowNameType"/>
<xs:element name="ServiceFlowId" type="ServiceFlowIdType"/>
<xs:element name="Callback" type="xs:boolean"/>
<xs:element name="Environment" type="EnvironmentType"/>
<xs:element name="EmUser" type="CredentialsType"/>
<xs:element name="EmExtension" type="EmExtensionType" minOccurs="0"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
<xs:simpleType name="EventIdType">
<xs:annotation>
<xs:documentation>
A UUID that uniquely identifies the Event instance.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:maxLength value="36"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ServiceFlowIdType">
<xs:annotation>
<xs:documentation>
A UUID that uniquely identifies the ServiceFlow
instance.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:maxLength value="36"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="TimestampType">
<xs:annotation>
<xs:documentation>
The date and timestamp when the EventManager received
the Event. This element may be left empty by the event
emitter, in which case, the Event Manager will supply a
value.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:dateTime"/>
</xs:simpleType>
<xs:simpleType name="EventTypeType">
<xs:annotation>
<xs:documentation>
A string indicating the type of event. EventType
designates the verb. That is what action happened to the
Objects that triggered the event.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<!-- ============= Object that triggered the event ============= -->
<xs:simpleType name="ObjectIdType">
<xs:annotation>
<xs:documentation>
An ObjectId identifies the entity or relationship that
changed within a tool. The identifier must be unique for
a particular instance of the source tool. The format of
this element will not be standardized by ALF. The
primary purpose is to allow subsequent ServiceFlows to
uniquely identify (and perhaps access) the object that
triggered the event.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="ObjectTypeType">
<xs:annotation>
<xs:documentation>
The type of entity involved. Note that the word entity
is taken in its broadest sense, referring to whatever
artifact a tool was operating on. For example, for a
data modeling tool, an E-R relationship is a type of
entity (i.e., and ObjectType) to ALF.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<!-- ============= The source (i.e, tool or product) that emitted the event ============= -->
<xs:complexType name="SourceType">
<xs:annotation>
<xs:documentation>
A Source element is a container type that describes the
source of the event. ProductCallbackURI is optional for
tools that don't provide a listener to accept the
callback from a tool or serviceflow at a later time.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Product" type="ProductType"/>
<xs:element name="ProductVersion" type="ProductVersionType"/>
<xs:element name="ProductInstance" type="ProductInstanceType"/>
<xs:element name="ProductCallbackURI" type="ProductCallbackURIType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="ProductType">
<xs:annotation>
<xs:documentation>
A descriptive name for the tool (i.e., program) that
emitted the Event. Note that this is a datatype for a
Product element.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="ProductCallbackURIType">
<xs:annotation>
<xs:documentation>
The web service endpoint for tools that support
callbacks from ServiceFlows for additional information.
The element content is optional for transient tools that
may not be running at a later time, and so cannot accept
a callback. Constantly running (server) tools that
support callbacks should supply a URI.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:anyURI"/>
</xs:simpleType>
<xs:simpleType name="ProductInstanceType">
<xs:annotation>
<xs:documentation>
A unique string identifying the instance of the tool.
This is useful when there may be multiple instances of a
product working within an instance of ALF.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="ProductVersionType">
<xs:annotation>
<xs:documentation>
The release version of the product, such as 5.06
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<!-- ====== User information identifying the security context of the request ======= -->
<xs:complexType name="CredentialsType">
<xs:annotation>
<xs:documentation>
A structure to hold security authentication-relevant data.
If present the data within may be encrypted.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
<xs:simpleType name="ApplicationNameType">
<xs:annotation>
<xs:documentation>
The name of the ALF application to which this event
belongs. Depending on the emitting tool, events may or
may not be associated with an ALF application. If the
emitting tool has the information available then it can
provide the ALF ApplicationName as an additional
information to distinguish the event.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="EventMatchNameType">
<xs:annotation>
<xs:documentation>
The name of the event match within the ALF Application
that matches this event. This fields is set by the Event Manager
when it dispatches the event.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="ServiceFlowNameType">
<xs:annotation>
<xs:documentation>
The name of the service flow withing the event match that
matches this event. This field is set by the Event Manager
when it dispatches the event.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="EnvironmentType">
<xs:annotation>
<xs:documentation>
The name of the environment in which this event is being
raised. This element will be set by the ALF Event
manager from its installation configuration.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="ALFSchemaVersionType">
<xs:restriction base="xs:string">
<xs:enumeration value="1.0"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="BaseExtensionType">
<xs:annotation>
<xs:documentation>
Place holder type for future extensions of
BaseExtensionType
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any namespace="targetnamespace" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
<xs:complexType name="EmExtensionType">
<xs:annotation>
<xs:documentation>
Place holder type for future extensions of EmBaseType
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any namespace="targetnamespace" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
<xs:complexType name="DetailExtensionType">
<xs:annotation>
<xs:documentation>
Place holder type for vocabulary based Event payload "details"
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any namespace="##other" processContents="lax" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
<xs:complexType name="CustomExtensionType">
<xs:annotation>
<xs:documentation>
Place holder type for custom Event payload "extensions"
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any namespace="##other" processContents="lax" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
<!-- End EventBaseTypes -->
<!-- BEGIN ALFEvent -->
<xs:complexType name="ALFEventType">
<xs:sequence>
<xs:element name="Base" type="EventBaseType"/>
<xs:element name="Detail" type="DetailExtensionType" minOccurs="0"/>
<xs:element name="Extension" type="CustomExtensionType" minOccurs="0"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="version" type="ALFSchemaVersionType" default="1.0"/>
</xs:complexType>
<xs:complexType name="ALFEventResponseType">
<xs:sequence>
<xs:any minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ALFEventWithReplyResponseType">
<xs:sequence>
<xs:any minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- END ALFEvent -->
<!-- Event Notice -->
<!-- Element declaration for creating documents -->
<xs:element name="EventNotice" type="ALFEventType"/>
</xs:schema>

View File

@ -0,0 +1,354 @@
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.eclipse.org/alf/schema/EventBase/1"
attributeFormDefault="unqualified" elementFormDefault="qualified"
targetNamespace="http://www.eclipse.org/alf/schema/EventBase/1">
<xs:annotation>
<xs:documentation>
Copyright Notice The material in this document is Copyright
(c) Serena Software, Inc. and others, 2005, 2006, 2007 Terms and
Conditions: The Eclipse Foundation makes available all
content in this document ("Content"). Unless otherwise
indicated below, the Content is provided to you under the
terms and conditions of the Eclipse Public License Version
1.0 ("EPL"). A copy of the EPL is available at
http://www.eclipse.org/legal/epl-v10.html. For purposes of
the EPL, "Program" will mean the Content. If you did not
receive this Content directly from the Eclipse Foundation,
the Content is being redistributed by another party
("Redistributor") and different terms and conditions may
apply to your use of any object code in the Content. Check
the Redistributor's license that was provided with the
Content. If you did not receive any such license, contact
the Redistributor. Unless otherwise indicated below, the
terms and conditions of the EPL still apply to the Content.
</xs:documentation>
</xs:annotation>
<xs:complexType name="EventBaseType">
<xs:annotation>
<xs:documentation>
EventBaseType is a container for that portion of an ALF
Event that is generally set by the Tool that raises the
event.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="EventId" type="SourceEventIdType"/>
<xs:element name="Timestamp" nillable="true" type="TimestampType"/>
<xs:element name="EventType" type="EventTypeType"/>
<xs:element name="ObjectType" type="ObjectTypeType"/>
<xs:element name="ObjectId" type="ObjectIdType"/>
<xs:element name="Source" type="SourceType"/>
<xs:element name="User" type="CredentialsType"/>
<xs:element minOccurs="0" name="EventControl" type="EmBaseType"/>
<xs:element minOccurs="0" name="BaseExtension" type="BaseExtensionType"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
<xs:complexType name="EmBaseType">
<xs:annotation>
<xs:documentation>
EventControlType is a container for that portion of an
ALF Event that is generally set by the ALF EventManager.
In some cases, ALF compliant tools may set some fields,
in particular when the event is a result of an ALF
service call to that tool from a ServiceFlow.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="EmEventId" type="EventIdType"/>
<xs:element name="EmTimestamp" type="TimestampType"/>
<xs:element name="PrecedingEmEventId" type="EventIdType"/>
<xs:element name="ApplicationName" type="ApplicationNameType"/>
<xs:element name="EventMatchName" type="EventMatchNameType"/>
<xs:element name="ServiceFlowName" type="ServiceFlowNameType"/>
<xs:element name="ServiceFlowId" type="ServiceFlowIdType"/>
<xs:element name="Callback" type="xs:boolean"/>
<xs:element name="Environment" type="EnvironmentType"/>
<xs:element name="EmUser" type="CredentialsType"/>
<xs:element minOccurs="0" name="AttemptCount" type="xs:int"/>
<xs:element minOccurs="0" name="EmExtension" type="EmExtensionType"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
<xs:simpleType name="SourceEventIdType">
<xs:annotation>
<xs:documentation>
A id that uniquely identifies the Event instance at the source.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:maxLength value="36"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="EventIdType">
<xs:annotation>
<xs:documentation>
A UUID that uniquely identifies the Event instance.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:maxLength value="36"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ServiceFlowIdType">
<xs:annotation>
<xs:documentation>
A UUID that uniquely identifies the ServiceFlow
instance.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:maxLength value="36"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="TimestampType">
<xs:annotation>
<xs:documentation>
The date and timestamp when the EventManager received
the Event. This element may be left empty by the event
emitter, in which case, the Event Manager will supply a
value.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:dateTime"/>
</xs:simpleType>
<xs:simpleType name="EventTypeType">
<xs:annotation>
<xs:documentation>
A string indicating the type of event. EventType
designates the verb. That is what action happened to the
Objects that triggered the event.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="ObjectIdType">
<xs:annotation>
<xs:documentation>
An ObjectId identifies the entity or relationship that
changed within a tool. The identifier must be unique for
a particular instance of the source tool. The format of
this element will not be standardized by ALF. The
primary purpose is to allow subsequent ServiceFlows to
uniquely identify (and perhaps access) the object that
triggered the event.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="ObjectTypeType">
<xs:annotation>
<xs:documentation>
The type of entity involved. Note that the word entity
is taken in its broadest sense, referring to whatever
artifact a tool was operating on. For example, for a
data modeling tool, an E-R relationship is a type of
entity (i.e., and ObjectType) to ALF.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:complexType name="SourceType">
<xs:annotation>
<xs:documentation>
A Source element is a container type that describes the
source of the event. ProductCallbackURI is optional for
tools that don't provide a listener to accept the
callback from a tool or serviceflow at a later time.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Product" type="ProductType"/>
<xs:element name="ProductVersion" type="ProductVersionType"/>
<xs:element name="ProductInstance" type="ProductInstanceType"/>
<xs:element minOccurs="0" name="ProductCallbackURI" type="ProductCallbackURIType"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="ProductType">
<xs:annotation>
<xs:documentation>
A descriptive name for the tool (i.e., program) that
emitted the Event. Note that this is a datatype for a
Product element.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="ProductCallbackURIType">
<xs:annotation>
<xs:documentation>
The web service endpoint for tools that support
callbacks from ServiceFlows for additional information.
The element content is optional for transient tools that
may not be running at a later time, and so cannot accept
a callback. Constantly running (server) tools that
support callbacks should supply a URI.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:anyURI"/>
</xs:simpleType>
<xs:simpleType name="ProductInstanceType">
<xs:annotation>
<xs:documentation>
A unique string identifying the instance of the tool.
This is useful when there may be multiple instances of a
product working within an instance of ALF.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="ProductVersionType">
<xs:annotation>
<xs:documentation>
The release version of the product, such as 5.06
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:complexType name="ALFSecurityType">
<xs:sequence>
<xs:element name="UsernameToken">
<xs:complexType>
<xs:sequence>
<xs:element name="Username" type="xs:string"/>
<xs:element name="Password" type="xs:string"/>
<xs:any maxOccurs="unbounded" minOccurs="0" processContents="lax"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
</xs:element>
<xs:any maxOccurs="unbounded" minOccurs="0" processContents="lax"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CredentialsType">
<xs:annotation>
<xs:documentation>
A structure to hold security
authentication-relevant data. If present the
data within may be encrypted.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element minOccurs="0" name="ALFSecurity" type="ALFSecurityType"/>
<xs:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="lax"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
<xs:simpleType name="ApplicationNameType">
<xs:annotation>
<xs:documentation>
The name of the ALF application to which this event
belongs. Depending on the emitting tool, events may or
may not be associated with an ALF application. If the
emitting tool has the information available then it can
provide the ALF ApplicationName as an additional
information to distinguish the event.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="EventMatchNameType">
<xs:annotation>
<xs:documentation>
The name of the event match within the ALF Application
that matches this event. This fields is set by the Event
Manager when it dispatches the event.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="ServiceFlowNameType">
<xs:annotation>
<xs:documentation>
The name of the service flow withing the event match
that matches this event. This field is set by the Event
Manager when it dispatches the event.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="EnvironmentType">
<xs:annotation>
<xs:documentation>
The name of the environment in which this event is being
raised. This element will be set by the ALF Event
manager from its installation configuration.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="ALFSchemaVersionType">
<xs:restriction base="xs:string">
<xs:enumeration value="1.0"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="BaseExtensionType">
<xs:annotation>
<xs:documentation>
Place holder type for future extensions of
BaseExtensionType
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any maxOccurs="unbounded" namespace="##targetNamespace" processContents="lax"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
<xs:complexType name="EmExtensionType">
<xs:annotation>
<xs:documentation>
Place holder type for future extensions of EmBaseType
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any maxOccurs="unbounded" namespace="##targetNamespace" processContents="lax"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
<xs:complexType name="DetailExtensionType">
<xs:annotation>
<xs:documentation>
Place holder type for vocabulary based Event payload
"details"
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any maxOccurs="unbounded" namespace="##other" processContents="lax"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
<xs:complexType name="CustomExtensionType">
<xs:annotation>
<xs:documentation>
Place holder type for custom Event payload "extensions"
##other namespace is recommended but ##any is specified allowing more primitive sources
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any maxOccurs="unbounded" namespace="##any" processContents="lax"/>
</xs:sequence>
<xs:anyAttribute/>
</xs:complexType>
<xs:complexType name="ALFEventType">
<xs:sequence>
<xs:element name="Base" type="EventBaseType"/>
<xs:element minOccurs="0" name="Detail" type="DetailExtensionType"/>
<xs:element minOccurs="0" name="Extension" type="CustomExtensionType"/>
<xs:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="lax"/>
</xs:sequence>
<xs:attribute default="1.0" name="version" type="ALFSchemaVersionType"/>
</xs:complexType>
<xs:complexType name="ALFEventResponseType">
<xs:sequence>
<xs:any maxOccurs="unbounded" minOccurs="0" processContents="lax"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ALFEventWithReplyResponseType">
<xs:sequence>
<xs:any maxOccurs="unbounded" minOccurs="0" processContents="lax"/>
</xs:sequence>
</xs:complexType>
<!-- Element declaration for creating documents -->
<xs:element name="ALFEventNoticeDoc" type="ALFEventType"/>
</xs:schema>

View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="ALFEventManager" targetNamespace="http://www.eclipse.org/alf/schema/EventBase/1" xmlns="http://www.eclipse.org/alf/schema/EventBase/1" xmlns:evt="http://www.eclipse.org/alf/schema/EventBase/1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:tns="http://www.eclipse.org/alf/schema/EventBase/1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:documentation>
WARNING: PRELIMINARY VERSION SUBJECT TO CHANGE
Copyright Notice The material in this document is Copyright (c)
Serena Software, Inc. and others, 2005, 2006, 2007, 2008 Terms and
Conditions: The Eclipse Foundation makes available all content
in this document (&quot;Content&quot;). Unless otherwise indicated below,
the Content is provided to you under the terms and conditions of
the Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the
EPL is available at http://www.eclipse.org/legal/epl-v10.html.
For purposes of the EPL, &quot;Program&quot; will mean the Content. If you
did not receive this Content directly from the Eclipse
Foundation, the Content is being redistributed by another party
(&quot;Redistributor&quot;) and different terms and conditions may apply
to your use of any object code in the Content. Check the
Redistributor's license that was provided with the Content. If
you did not receive any such license, contact the Redistributor.
Unless otherwise indicated below, the terms and conditions of
the EPL still apply to the Content.
</wsdl:documentation>
<wsdl:types>
<xsd:schema elementFormDefault="qualified" targetNamespace="http://www.eclipse.org/alf/schema/EventBase/1" xmlns="http://www.eclipse.org/alf/schema/EventBase/1" xmlns:evt="http://www.eclipse.org/alf/schema/EventBase/1">
<xsd:include schemaLocation="ALFEventBase_1.xsd"/>
<!-- Document Literal EventNotice service document elements -->
<xsd:element name="ALFEventNoticeDoc" type="evt:ALFEventType">
</xsd:element>
<xsd:element name="ALFEventNoticeDocResponse" type="evt:ALFEventResponseType">
</xsd:element>
<xsd:element name="ALFEventNoticeWithReplyDoc" type="evt:ALFEventType">
</xsd:element>
<xsd:element name="ALFEventNoticeWithReplyDocResponse" type="evt:ALFEventWithReplyResponseType">
</xsd:element>
<!-- EventNoticeWithReply exceptions -->
<xsd:complexType name="NoEventActionMatchFaultType">
<xsd:sequence>
<xsd:any maxOccurs="unbounded" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="NoEventActionMatchFault" type="evt:NoEventActionMatchFaultType">
</xsd:element>
<xsd:complexType name="ServiceFlowNotAvailableFaultType">
<xsd:sequence>
<xsd:any maxOccurs="unbounded" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="ServiceFlowNotAvailableFault" type="evt:ServiceFlowNotAvailableFaultType">
</xsd:element>
<xsd:complexType name="ServiceFlowFaultType">
<xsd:sequence>
<xsd:any maxOccurs="unbounded" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="ServiceFlowFault" type="evt:ServiceFlowFaultType">
</xsd:element>
<xsd:complexType name="UnexpectedFaultType">
<xsd:sequence>
<xsd:any maxOccurs="unbounded" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="UnexpectedFault" type="evt:UnexpectedFaultType">
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="EventNoticeWithReplyDocResponse">
<wsdl:part name="EventNoticeWithReplyDocResponse" element="ALFEventNoticeWithReplyDocResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="EventNotice">
<wsdl:part name="EventNotice" type="ALFEventType">
</wsdl:part>
</wsdl:message>
<wsdl:message name="EventNoticeDocResponse">
<wsdl:part name="EventNoticeDocResponse" element="ALFEventNoticeDocResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="EventNoticeWithReplyResponse">
<wsdl:part name="EventNoticeWithReplyResponse" type="ALFEventWithReplyResponseType">
</wsdl:part>
</wsdl:message>
<wsdl:message name="EventNoticeDoc">
<wsdl:part name="EventNoticeDoc" element="ALFEventNoticeDoc">
</wsdl:part>
</wsdl:message>
<wsdl:message name="EventNoticeWithReplyDoc">
<wsdl:part name="EventNoticeWithReplyDoc" element="ALFEventNoticeWithReplyDoc">
</wsdl:part>
</wsdl:message>
<wsdl:message name="UnexpectedFault">
<wsdl:part name="UnexpectedFault" element="UnexpectedFault">
</wsdl:part>
</wsdl:message>
<wsdl:message name="EventNoticeResponse">
<wsdl:part name="EventNoticeResponse" type="ALFEventResponseType">
</wsdl:part>
</wsdl:message>
<wsdl:message name="NoEventActionMatchFault">
<wsdl:part name="NoEventActionMatchFault" element="NoEventActionMatchFault">
</wsdl:part>
</wsdl:message>
<wsdl:message name="ServiceFlowNotAvailableFault">
<wsdl:part name="ServiceFlowNotAvailableFault" element="ServiceFlowNotAvailableFault">
</wsdl:part>
</wsdl:message>
<wsdl:message name="ServiceFlowFault">
<wsdl:part name="ServiceFlowFault" element="ServiceFlowFault">
</wsdl:part>
</wsdl:message>
<wsdl:message name="EventNoticeWithReply">
<wsdl:part name="EventNoticeWithReply" type="ALFEventType">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="ALFEventManagerDocLit">
<wsdl:operation name="EventNotice">
<wsdl:input message="EventNoticeDoc" wsaw:Action="urn:EventNotice">
</wsdl:input>
<wsdl:output message="EventNoticeDocResponse" wsaw:Action="urn:EventNotice">
</wsdl:output>
<wsdl:fault name="UnexpectedFault" message="UnexpectedFault">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="EventNoticeWithReply">
<wsdl:input message="EventNoticeWithReplyDoc" wsaw:Action="urn:EventNoticeWithReply">
</wsdl:input>
<wsdl:output message="EventNoticeWithReplyDocResponse" wsaw:Action="urn:EventNoticeWithReply">
</wsdl:output>
<wsdl:fault name="ServiceFlowNotAvailableFault" message="ServiceFlowNotAvailableFault">
</wsdl:fault>
<wsdl:fault name="ServiceFlowFault" message="ServiceFlowFault">
</wsdl:fault>
<wsdl:fault name="NoEventActionMatchFault" message="NoEventActionMatchFault">
</wsdl:fault>
<wsdl:fault name="UnexpectedFault" message="UnexpectedFault">
</wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ALFEventManagerDocLitSOAP" type="ALFEventManagerDocLit">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="EventNotice">
<soap:operation soapAction="urn:EventNotice" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="UnexpectedFault">
<soap:fault name="UnexpectedFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="EventNoticeWithReply">
<soap:operation soapAction="urn:EventNoticeWithReply" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="ServiceFlowNotAvailableFault">
<soap:fault name="ServiceFlowNotAvailableFault" use="literal"/>
</wsdl:fault>
<wsdl:fault name="ServiceFlowFault">
<soap:fault name="ServiceFlowFault" use="literal"/>
</wsdl:fault>
<wsdl:fault name="NoEventActionMatchFault">
<soap:fault name="NoEventActionMatchFault" use="literal"/>
</wsdl:fault>
<wsdl:fault name="UnexpectedFault">
<soap:fault name="UnexpectedFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ALFEventManagerDocLit">
<wsdl:port name="ALFEventManagerDocLitSOAP" binding="ALFEventManagerDocLitSOAP">
<soap:address location="http://localhost:8085/eventmanager/services/ALFEventManagerDocLit/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:evt="http://www.eclipse.org/alf/schema/EventBase/1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.eclipse.org/alf/schema/EventBase/1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ALFEventManager" targetNamespace="http://www.eclipse.org/alf/schema/EventBase/1">
<wsdl:documentation>
WARNING: PRELIMINARY VERSION SUBJECT TO CHANGE
Copyright Notice
The material in this document is Copyright (c) Serena Software, Inc. and others, 2005, 2006
Terms and Conditions:
The Eclipse Foundation makes available all content in this document ("Content").
Unless otherwise indicated below, the Content is provided to you under the terms
and conditions of the Eclipse Public License Version 1.0 ("EPL").
A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html.
For purposes of the EPL, "Program" will mean the Content.
If you did not receive this Content directly from the Eclipse Foundation, the
Content is being redistributed by another party ("Redistributor") and different
terms and conditions may apply to your use of any object code in the Content.
Check the Redistributor's license that was provided with the Content.
If you did not receive any such license, contact the Redistributor.
Unless otherwise indicated below, the terms and conditions of the EPL still apply to the Content.
</wsdl:documentation>
<!-- ALF EventManager WSDL -->
<wsdl:types>
<xsd:schema xmlns="http://www.eclipse.org/alf/schema/EventBase/1" elementFormDefault="qualified" targetNamespace="http://www.eclipse.org/alf/schema/EventBase/1">
<xsd:include schemaLocation="ALFEventBase_1-Composer.xsd"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="EventNotice">
<wsdl:part type="evt:ALFEventType" name="EventNotice"/>
</wsdl:message>
<wsdl:message name="EventNoticeResponse">
<wsdl:part type="evt:ALFEventResponseType" name="EventNoticeResponse"/>
</wsdl:message>
<wsdl:message name="EventNoticeWithReply">
<wsdl:part type="evt:ALFEventType" name="EventNoticeWithReply"/>
</wsdl:message>
<wsdl:message name="EventNoticeWithReplyResponse">
<wsdl:part type="evt:ALFEventWithReplyResponseType" name="EventNoticeWithReplyResponse"/>
</wsdl:message>
<wsdl:portType name="ALFEventManager">
<wsdl:operation name="EventNotice">
<wsdl:input message="tns:EventNotice"/>
<wsdl:output message="tns:EventNoticeResponse"/>
</wsdl:operation>
<wsdl:operation name="EventNoticeWithReply">
<wsdl:input message="tns:EventNoticeWithReply"/>
<wsdl:output message="tns:EventNoticeWithReplyResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="ALFServiceFlow">
<wsdl:operation name="TEMPEventNotice">
<wsdl:input message="tns:EventNotice"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="ALFServiceFlowWithReply">
<wsdl:operation name="EventNotice">
<wsdl:input message="tns:EventNotice"/>
<wsdl:output message="tns:EventNoticeWithReplyResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ALFEventManagerSOAP" type="tns:ALFEventManager">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="EventNotice">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal" namespace="http://www.eclipse.org/alf/schema/EventBase/1"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" namespace="http://www.eclipse.org/alf/schema/EventBase/1"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="EventNoticeWithReply">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal" namespace="http://www.eclipse.org/alf/schema/EventBase/1"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" namespace="http://www.eclipse.org/alf/schema/EventBase/1"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="ALFServiceFlowSOAP" type="tns:ALFServiceFlow">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="TEMPEventNotice">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal" namespace="http://www.eclipse.org/alf/schema/EventBase/1"/>
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="ALFServiceFlowWithReplySOAP" type="tns:ALFServiceFlowWithReply">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="EventNotice">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal" namespace="http://www.eclipse.org/alf/schema/EventBase/1"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" namespace="http://www.eclipse.org/alf/schema/EventBase/1"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<!-- Example services -->
<wsdl:service name="ALFEventManager">
<wsdl:port binding="tns:ALFEventManagerSOAP" name="ALFEventManagerSOAP">
<soap:address location="http://localhost:8080/ALFEventManager/services/ALFEventManagerSOAP"/>
</wsdl:port>
</wsdl:service>
<wsdl:service name="ALFServiceFlow">
<wsdl:port binding="tns:ALFServiceFlowSOAP" name="ALFServiceFlowSOAP">
<soap:address location="http://localhost:8080/ALFServiceFlow/services/ALFServiceFlowSOAP"/>
</wsdl:port>
</wsdl:service>
<wsdl:service name="ALFServiceFlowWithReply">
<wsdl:port binding="tns:ALFServiceFlowWithReplySOAP" name="ALFServiceFlowWithReplySOAP">
<soap:address location="http://localhost:8080/ALFServiceFlow/services/ALFServiceFlowWithReplySOAP"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@ -0,0 +1,71 @@
package net.brutex.xservices.types.alfevent;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
/**
* <p>Java-Klasse für ALFEventResponseType complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* &lt;complexType name="ALFEventResponseType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ALFEventResponseType", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", propOrder = {
"any"
})
public class ALFEventResponseType {
@XmlAnyElement(lax = true)
protected List<Object> any;
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link Object }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
}

View File

@ -0,0 +1,188 @@
package net.brutex.xservices.types.alfevent;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
/**
* <p>Java-Klasse für ALFEventType complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* &lt;complexType name="ALFEventType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Base" type="{http://www.eclipse.org/alf/schema/EventBase/1}EventBaseType"/>
* &lt;element name="Detail" type="{http://www.eclipse.org/alf/schema/EventBase/1}DetailExtensionType" minOccurs="0"/>
* &lt;element name="Extension" type="{http://www.eclipse.org/alf/schema/EventBase/1}CustomExtensionType" minOccurs="0"/>
* &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="version" type="{http://www.eclipse.org/alf/schema/EventBase/1}ALFSchemaVersionType" default="1.0" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ALFEventType", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", propOrder = {
"base",
"detail",
"extension",
"any"
})
public class ALFEventType {
@XmlElement(name = "Base", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected EventBaseType base;
@XmlElement(name = "Detail", namespace = "http://www.eclipse.org/alf/schema/EventBase/1")
protected DetailExtensionType detail;
@XmlElement(name = "Extension", namespace = "http://www.eclipse.org/alf/schema/EventBase/1")
protected CustomExtensionType extension;
@XmlAnyElement(lax = true)
protected List<Object> any;
@XmlAttribute(name = "version")
protected String version;
/**
* Ruft den Wert der base-Eigenschaft ab.
*
* @return
* possible object is
* {@link EventBaseType }
*
*/
public EventBaseType getBase() {
return base;
}
/**
* Legt den Wert der base-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link EventBaseType }
*
*/
public void setBase(EventBaseType value) {
this.base = value;
}
/**
* Ruft den Wert der detail-Eigenschaft ab.
*
* @return
* possible object is
* {@link DetailExtensionType }
*
*/
public DetailExtensionType getDetail() {
return detail;
}
/**
* Legt den Wert der detail-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link DetailExtensionType }
*
*/
public void setDetail(DetailExtensionType value) {
this.detail = value;
}
/**
* Ruft den Wert der extension-Eigenschaft ab.
*
* @return
* possible object is
* {@link CustomExtensionType }
*
*/
public CustomExtensionType getExtension() {
return extension;
}
/**
* Legt den Wert der extension-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link CustomExtensionType }
*
*/
public void setExtension(CustomExtensionType value) {
this.extension = value;
}
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link Object }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
/**
* Ruft den Wert der version-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVersion() {
if (version == null) {
return "1.0";
} else {
return version;
}
}
/**
* Legt den Wert der version-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVersion(String value) {
this.version = value;
}
}

View File

@ -0,0 +1,71 @@
package net.brutex.xservices.types.alfevent;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
/**
* <p>Java-Klasse für ALFEventWithReplyResponseType complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* &lt;complexType name="ALFEventWithReplyResponseType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ALFEventWithReplyResponseType", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", propOrder = {
"any"
})
public class ALFEventWithReplyResponseType {
@XmlAnyElement(lax = true)
protected List<Object> any;
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link Object }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
}

View File

@ -0,0 +1,255 @@
package net.brutex.xservices.types.alfevent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
import org.w3c.dom.Element;
/**
* <p>Java-Klasse für ALFSecurityType complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* &lt;complexType name="ALFSecurityType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="UsernameToken">
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Username" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Password" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute/>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;/element>
* &lt;any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ALFSecurityType", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", propOrder = {
"usernameToken",
"any"
})
public class ALFSecurityType {
@XmlElement(name = "UsernameToken", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected ALFSecurityType.UsernameToken usernameToken;
@XmlAnyElement(lax = true)
protected List<Object> any;
/**
* Ruft den Wert der usernameToken-Eigenschaft ab.
*
* @return
* possible object is
* {@link ALFSecurityType.UsernameToken }
*
*/
public ALFSecurityType.UsernameToken getUsernameToken() {
return usernameToken;
}
/**
* Legt den Wert der usernameToken-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link ALFSecurityType.UsernameToken }
*
*/
public void setUsernameToken(ALFSecurityType.UsernameToken value) {
this.usernameToken = value;
}
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link Object }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
/**
* <p>Java-Klasse für anonymous complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Username" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Password" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute/>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"username",
"password",
"any"
})
public static class UsernameToken {
@XmlElement(name = "Username", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String username;
@XmlElement(name = "Password", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String password;
@XmlAnyElement(lax = true)
protected List<Object> any;
@XmlAnyAttribute
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
/**
* Ruft den Wert der username-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getUsername() {
return username;
}
/**
* Legt den Wert der username-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setUsername(String value) {
this.username = value;
}
/**
* Ruft den Wert der password-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPassword() {
return password;
}
/**
* Legt den Wert der password-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPassword(String value) {
this.password = value;
}
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link Object }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
/**
* Gets a map that contains attributes that aren't bound to any typed property on this class.
*
* <p>
* the map is keyed by the name of the attribute and
* the value is the string value of the attribute.
*
* the map returned by this method is live, and you can add new attribute
* by updating the map directly. Because of this design, there's no setter.
*
*
* @return
* always non-null
*/
public Map<QName, String> getOtherAttributes() {
return otherAttributes;
}
}
}

View File

@ -0,0 +1,101 @@
package net.brutex.xservices.types.alfevent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
import org.w3c.dom.Element;
/**
*
* Place holder type for future extensions of
* BaseExtensionType
*
*
* <p>Java-Klasse für BaseExtensionType complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* &lt;complexType name="BaseExtensionType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;any processContents='lax' namespace='http://www.eclipse.org/alf/schema/EventBase/1' maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;anyAttribute/>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "BaseExtensionType", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", propOrder = {
"any"
})
public class BaseExtensionType {
@XmlAnyElement(lax = true)
protected List<Object> any;
@XmlAnyAttribute
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link Object }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
/**
* Gets a map that contains attributes that aren't bound to any typed property on this class.
*
* <p>
* the map is keyed by the name of the attribute and
* the value is the string value of the attribute.
*
* the map returned by this method is live, and you can add new attribute
* by updating the map directly. Because of this design, there's no setter.
*
*
* @return
* always non-null
*/
public Map<QName, String> getOtherAttributes() {
return otherAttributes;
}
}

View File

@ -0,0 +1,131 @@
package net.brutex.xservices.types.alfevent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
import org.w3c.dom.Element;
/**
*
* A structure to hold security
* authentication-relevant data. If present the
* data within may be encrypted.
*
*
* <p>Java-Klasse für CredentialsType complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* &lt;complexType name="CredentialsType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="ALFSecurity" type="{http://www.eclipse.org/alf/schema/EventBase/1}ALFSecurityType" minOccurs="0"/>
* &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute/>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CredentialsType", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", propOrder = {
"alfSecurity",
"any"
})
public class CredentialsType {
@XmlElement(name = "ALFSecurity", namespace = "http://www.eclipse.org/alf/schema/EventBase/1")
protected ALFSecurityType alfSecurity;
@XmlAnyElement(lax = true)
protected List<Object> any;
@XmlAnyAttribute
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
/**
* Ruft den Wert der alfSecurity-Eigenschaft ab.
*
* @return
* possible object is
* {@link ALFSecurityType }
*
*/
public ALFSecurityType getALFSecurity() {
return alfSecurity;
}
/**
* Legt den Wert der alfSecurity-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link ALFSecurityType }
*
*/
public void setALFSecurity(ALFSecurityType value) {
this.alfSecurity = value;
}
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link Object }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
/**
* Gets a map that contains attributes that aren't bound to any typed property on this class.
*
* <p>
* the map is keyed by the name of the attribute and
* the value is the string value of the attribute.
*
* the map returned by this method is live, and you can add new attribute
* by updating the map directly. Because of this design, there's no setter.
*
*
* @return
* always non-null
*/
public Map<QName, String> getOtherAttributes() {
return otherAttributes;
}
}

View File

@ -0,0 +1,101 @@
package net.brutex.xservices.types.alfevent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
import org.w3c.dom.Element;
/**
*
* Place holder type for custom Event payload "extensions"
* ##other namespace is recommended but ##any is specified allowing more primitive sources
*
*
* <p>Java-Klasse für CustomExtensionType complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* &lt;complexType name="CustomExtensionType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;any processContents='lax' maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;anyAttribute/>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CustomExtensionType", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", propOrder = {
"any"
})
public class CustomExtensionType {
@XmlAnyElement(lax = true)
protected List<Object> any;
@XmlAnyAttribute
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link Object }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
/**
* Gets a map that contains attributes that aren't bound to any typed property on this class.
*
* <p>
* the map is keyed by the name of the attribute and
* the value is the string value of the attribute.
*
* the map returned by this method is live, and you can add new attribute
* by updating the map directly. Because of this design, there's no setter.
*
*
* @return
* always non-null
*/
public Map<QName, String> getOtherAttributes() {
return otherAttributes;
}
}

View File

@ -0,0 +1,101 @@
package net.brutex.xservices.types.alfevent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
import org.w3c.dom.Element;
/**
*
* Place holder type for vocabulary based Event payload
* "details"
*
*
* <p>Java-Klasse für DetailExtensionType complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* &lt;complexType name="DetailExtensionType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;anyAttribute/>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DetailExtensionType", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", propOrder = {
"any"
})
public class DetailExtensionType {
@XmlAnyElement(lax = true)
protected List<Object> any;
@XmlAnyAttribute
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link Object }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
/**
* Gets a map that contains attributes that aren't bound to any typed property on this class.
*
* <p>
* the map is keyed by the name of the attribute and
* the value is the string value of the attribute.
*
* the map returned by this method is live, and you can add new attribute
* by updating the map directly. Because of this design, there's no setter.
*
*
* @return
* always non-null
*/
public Map<QName, String> getOtherAttributes() {
return otherAttributes;
}
}

View File

@ -0,0 +1,398 @@
package net.brutex.xservices.types.alfevent;
import java.util.HashMap;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
/**
*
* EventControlType is a container for that portion of an
* ALF Event that is generally set by the ALF EventManager.
* In some cases, ALF compliant tools may set some fields,
* in particular when the event is a result of an ALF
* service call to that tool from a ServiceFlow.
*
*
* <p>Java-Klasse für EmBaseType complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* &lt;complexType name="EmBaseType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="EmEventId" type="{http://www.eclipse.org/alf/schema/EventBase/1}EventIdType"/>
* &lt;element name="EmTimestamp" type="{http://www.eclipse.org/alf/schema/EventBase/1}TimestampType"/>
* &lt;element name="PrecedingEmEventId" type="{http://www.eclipse.org/alf/schema/EventBase/1}EventIdType"/>
* &lt;element name="ApplicationName" type="{http://www.eclipse.org/alf/schema/EventBase/1}ApplicationNameType"/>
* &lt;element name="EventMatchName" type="{http://www.eclipse.org/alf/schema/EventBase/1}EventMatchNameType"/>
* &lt;element name="ServiceFlowName" type="{http://www.eclipse.org/alf/schema/EventBase/1}ServiceFlowNameType"/>
* &lt;element name="ServiceFlowId" type="{http://www.eclipse.org/alf/schema/EventBase/1}ServiceFlowIdType"/>
* &lt;element name="Callback" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="Environment" type="{http://www.eclipse.org/alf/schema/EventBase/1}EnvironmentType"/>
* &lt;element name="EmUser" type="{http://www.eclipse.org/alf/schema/EventBase/1}CredentialsType"/>
* &lt;element name="AttemptCount" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
* &lt;element name="EmExtension" type="{http://www.eclipse.org/alf/schema/EventBase/1}EmExtensionType" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute/>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "EmBaseType", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", propOrder = {
"emEventId",
"emTimestamp",
"precedingEmEventId",
"applicationName",
"eventMatchName",
"serviceFlowName",
"serviceFlowId",
"callback",
"environment",
"emUser",
"attemptCount",
"emExtension"
})
public class EmBaseType {
@XmlElement(name = "EmEventId", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String emEventId;
@XmlElement(name = "EmTimestamp", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar emTimestamp;
@XmlElement(name = "PrecedingEmEventId", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String precedingEmEventId;
@XmlElement(name = "ApplicationName", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String applicationName;
@XmlElement(name = "EventMatchName", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String eventMatchName;
@XmlElement(name = "ServiceFlowName", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String serviceFlowName;
@XmlElement(name = "ServiceFlowId", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String serviceFlowId;
@XmlElement(name = "Callback", namespace = "http://www.eclipse.org/alf/schema/EventBase/1")
protected boolean callback;
@XmlElement(name = "Environment", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String environment;
@XmlElement(name = "EmUser", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected CredentialsType emUser;
@XmlElement(name = "AttemptCount", namespace = "http://www.eclipse.org/alf/schema/EventBase/1")
protected Integer attemptCount;
@XmlElement(name = "EmExtension", namespace = "http://www.eclipse.org/alf/schema/EventBase/1")
protected EmExtensionType emExtension;
@XmlAnyAttribute
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
/**
* Ruft den Wert der emEventId-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEmEventId() {
return emEventId;
}
/**
* Legt den Wert der emEventId-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setEmEventId(String value) {
this.emEventId = value;
}
/**
* Ruft den Wert der emTimestamp-Eigenschaft ab.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getEmTimestamp() {
return emTimestamp;
}
/**
* Legt den Wert der emTimestamp-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setEmTimestamp(XMLGregorianCalendar value) {
this.emTimestamp = value;
}
/**
* Ruft den Wert der precedingEmEventId-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPrecedingEmEventId() {
return precedingEmEventId;
}
/**
* Legt den Wert der precedingEmEventId-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPrecedingEmEventId(String value) {
this.precedingEmEventId = value;
}
/**
* Ruft den Wert der applicationName-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getApplicationName() {
return applicationName;
}
/**
* Legt den Wert der applicationName-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setApplicationName(String value) {
this.applicationName = value;
}
/**
* Ruft den Wert der eventMatchName-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEventMatchName() {
return eventMatchName;
}
/**
* Legt den Wert der eventMatchName-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setEventMatchName(String value) {
this.eventMatchName = value;
}
/**
* Ruft den Wert der serviceFlowName-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getServiceFlowName() {
return serviceFlowName;
}
/**
* Legt den Wert der serviceFlowName-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setServiceFlowName(String value) {
this.serviceFlowName = value;
}
/**
* Ruft den Wert der serviceFlowId-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getServiceFlowId() {
return serviceFlowId;
}
/**
* Legt den Wert der serviceFlowId-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setServiceFlowId(String value) {
this.serviceFlowId = value;
}
/**
* Ruft den Wert der callback-Eigenschaft ab.
*
*/
public boolean isCallback() {
return callback;
}
/**
* Legt den Wert der callback-Eigenschaft fest.
*
*/
public void setCallback(boolean value) {
this.callback = value;
}
/**
* Ruft den Wert der environment-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEnvironment() {
return environment;
}
/**
* Legt den Wert der environment-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setEnvironment(String value) {
this.environment = value;
}
/**
* Ruft den Wert der emUser-Eigenschaft ab.
*
* @return
* possible object is
* {@link CredentialsType }
*
*/
public CredentialsType getEmUser() {
return emUser;
}
/**
* Legt den Wert der emUser-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link CredentialsType }
*
*/
public void setEmUser(CredentialsType value) {
this.emUser = value;
}
/**
* Ruft den Wert der attemptCount-Eigenschaft ab.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getAttemptCount() {
return attemptCount;
}
/**
* Legt den Wert der attemptCount-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setAttemptCount(Integer value) {
this.attemptCount = value;
}
/**
* Ruft den Wert der emExtension-Eigenschaft ab.
*
* @return
* possible object is
* {@link EmExtensionType }
*
*/
public EmExtensionType getEmExtension() {
return emExtension;
}
/**
* Legt den Wert der emExtension-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link EmExtensionType }
*
*/
public void setEmExtension(EmExtensionType value) {
this.emExtension = value;
}
/**
* Gets a map that contains attributes that aren't bound to any typed property on this class.
*
* <p>
* the map is keyed by the name of the attribute and
* the value is the string value of the attribute.
*
* the map returned by this method is live, and you can add new attribute
* by updating the map directly. Because of this design, there's no setter.
*
*
* @return
* always non-null
*/
public Map<QName, String> getOtherAttributes() {
return otherAttributes;
}
}

View File

@ -0,0 +1,100 @@
package net.brutex.xservices.types.alfevent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
import org.w3c.dom.Element;
/**
*
* Place holder type for future extensions of EmBaseType
*
*
* <p>Java-Klasse für EmExtensionType complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* &lt;complexType name="EmExtensionType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;any processContents='lax' namespace='http://www.eclipse.org/alf/schema/EventBase/1' maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;anyAttribute/>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "EmExtensionType", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", propOrder = {
"any"
})
public class EmExtensionType {
@XmlAnyElement(lax = true)
protected List<Object> any;
@XmlAnyAttribute
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link Object }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
/**
* Gets a map that contains attributes that aren't bound to any typed property on this class.
*
* <p>
* the map is keyed by the name of the attribute and
* the value is the string value of the attribute.
*
* the map returned by this method is live, and you can add new attribute
* by updating the map directly. Because of this design, there's no setter.
*
*
* @return
* always non-null
*/
public Map<QName, String> getOtherAttributes() {
return otherAttributes;
}
}

View File

@ -0,0 +1,320 @@
package net.brutex.xservices.types.alfevent;
import java.util.HashMap;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
/**
*
* EventBaseType is a container for that portion of an ALF
* Event that is generally set by the Tool that raises the
* event.
*
*
* <p>Java-Klasse für EventBaseType complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* &lt;complexType name="EventBaseType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="EventId" type="{http://www.eclipse.org/alf/schema/EventBase/1}SourceEventIdType"/>
* &lt;element name="Timestamp" type="{http://www.eclipse.org/alf/schema/EventBase/1}TimestampType"/>
* &lt;element name="EventType" type="{http://www.eclipse.org/alf/schema/EventBase/1}EventTypeType"/>
* &lt;element name="ObjectType" type="{http://www.eclipse.org/alf/schema/EventBase/1}ObjectTypeType"/>
* &lt;element name="ObjectId" type="{http://www.eclipse.org/alf/schema/EventBase/1}ObjectIdType"/>
* &lt;element name="Source" type="{http://www.eclipse.org/alf/schema/EventBase/1}SourceType"/>
* &lt;element name="User" type="{http://www.eclipse.org/alf/schema/EventBase/1}CredentialsType"/>
* &lt;element name="EventControl" type="{http://www.eclipse.org/alf/schema/EventBase/1}EmBaseType" minOccurs="0"/>
* &lt;element name="BaseExtension" type="{http://www.eclipse.org/alf/schema/EventBase/1}BaseExtensionType" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute/>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "EventBaseType", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", propOrder = {
"eventId",
"timestamp",
"eventType",
"objectType",
"objectId",
"source",
"user",
"eventControl",
"baseExtension"
})
public class EventBaseType {
@XmlElement(name = "EventId", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String eventId;
@XmlElement(name = "Timestamp", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true, nillable = true)
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar timestamp;
@XmlElement(name = "EventType", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String eventType;
@XmlElement(name = "ObjectType", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String objectType;
@XmlElement(name = "ObjectId", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String objectId;
@XmlElement(name = "Source", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected SourceType source;
@XmlElement(name = "User", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected CredentialsType user;
@XmlElement(name = "EventControl", namespace = "http://www.eclipse.org/alf/schema/EventBase/1")
protected EmBaseType eventControl;
@XmlElement(name = "BaseExtension", namespace = "http://www.eclipse.org/alf/schema/EventBase/1")
protected BaseExtensionType baseExtension;
@XmlAnyAttribute
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
/**
* Ruft den Wert der eventId-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEventId() {
return eventId;
}
/**
* Legt den Wert der eventId-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setEventId(String value) {
this.eventId = value;
}
/**
* Ruft den Wert der timestamp-Eigenschaft ab.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getTimestamp() {
return timestamp;
}
/**
* Legt den Wert der timestamp-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setTimestamp(XMLGregorianCalendar value) {
this.timestamp = value;
}
/**
* Ruft den Wert der eventType-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEventType() {
return eventType;
}
/**
* Legt den Wert der eventType-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setEventType(String value) {
this.eventType = value;
}
/**
* Ruft den Wert der objectType-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getObjectType() {
return objectType;
}
/**
* Legt den Wert der objectType-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setObjectType(String value) {
this.objectType = value;
}
/**
* Ruft den Wert der objectId-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getObjectId() {
return objectId;
}
/**
* Legt den Wert der objectId-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setObjectId(String value) {
this.objectId = value;
}
/**
* Ruft den Wert der source-Eigenschaft ab.
*
* @return
* possible object is
* {@link SourceType }
*
*/
public SourceType getSource() {
return source;
}
/**
* Legt den Wert der source-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link SourceType }
*
*/
public void setSource(SourceType value) {
this.source = value;
}
/**
* Ruft den Wert der user-Eigenschaft ab.
*
* @return
* possible object is
* {@link CredentialsType }
*
*/
public CredentialsType getUser() {
return user;
}
/**
* Legt den Wert der user-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link CredentialsType }
*
*/
public void setUser(CredentialsType value) {
this.user = value;
}
/**
* Ruft den Wert der eventControl-Eigenschaft ab.
*
* @return
* possible object is
* {@link EmBaseType }
*
*/
public EmBaseType getEventControl() {
return eventControl;
}
/**
* Legt den Wert der eventControl-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link EmBaseType }
*
*/
public void setEventControl(EmBaseType value) {
this.eventControl = value;
}
/**
* Ruft den Wert der baseExtension-Eigenschaft ab.
*
* @return
* possible object is
* {@link BaseExtensionType }
*
*/
public BaseExtensionType getBaseExtension() {
return baseExtension;
}
/**
* Legt den Wert der baseExtension-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link BaseExtensionType }
*
*/
public void setBaseExtension(BaseExtensionType value) {
this.baseExtension = value;
}
/**
* Gets a map that contains attributes that aren't bound to any typed property on this class.
*
* <p>
* the map is keyed by the name of the attribute and
* the value is the string value of the attribute.
*
* the map returned by this method is live, and you can add new attribute
* by updating the map directly. Because of this design, there's no setter.
*
*
* @return
* always non-null
*/
public Map<QName, String> getOtherAttributes() {
return otherAttributes;
}
}

View File

@ -0,0 +1,149 @@
package net.brutex.xservices.types.alfevent;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the net.brutex.xservices.types.alfevent package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
private final static QName _ALFEventNoticeDoc_QNAME = new QName("http://www.eclipse.org/alf/schema/EventBase/1", "ALFEventNoticeDoc");
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: net.brutex.xservices.types.alfevent
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link ALFSecurityType }
*
*/
public ALFSecurityType createALFSecurityType() {
return new ALFSecurityType();
}
/**
* Create an instance of {@link ALFEventType }
*
*/
public ALFEventType createALFEventType() {
return new ALFEventType();
}
/**
* Create an instance of {@link DetailExtensionType }
*
*/
public DetailExtensionType createDetailExtensionType() {
return new DetailExtensionType();
}
/**
* Create an instance of {@link CustomExtensionType }
*
*/
public CustomExtensionType createCustomExtensionType() {
return new CustomExtensionType();
}
/**
* Create an instance of {@link CredentialsType }
*
*/
public CredentialsType createCredentialsType() {
return new CredentialsType();
}
/**
* Create an instance of {@link SourceType }
*
*/
public SourceType createSourceType() {
return new SourceType();
}
/**
* Create an instance of {@link BaseExtensionType }
*
*/
public BaseExtensionType createBaseExtensionType() {
return new BaseExtensionType();
}
/**
* Create an instance of {@link EmExtensionType }
*
*/
public EmExtensionType createEmExtensionType() {
return new EmExtensionType();
}
/**
* Create an instance of {@link ALFEventWithReplyResponseType }
*
*/
public ALFEventWithReplyResponseType createALFEventWithReplyResponseType() {
return new ALFEventWithReplyResponseType();
}
/**
* Create an instance of {@link EventBaseType }
*
*/
public EventBaseType createEventBaseType() {
return new EventBaseType();
}
/**
* Create an instance of {@link ALFEventResponseType }
*
*/
public ALFEventResponseType createALFEventResponseType() {
return new ALFEventResponseType();
}
/**
* Create an instance of {@link EmBaseType }
*
*/
public EmBaseType createEmBaseType() {
return new EmBaseType();
}
/**
* Create an instance of {@link ALFSecurityType.UsernameToken }
*
*/
public ALFSecurityType.UsernameToken createALFSecurityTypeUsernameToken() {
return new ALFSecurityType.UsernameToken();
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link ALFEventType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.eclipse.org/alf/schema/EventBase/1", name = "ALFEventNoticeDoc")
public JAXBElement<ALFEventType> createALFEventNoticeDoc(ALFEventType value) {
return new JAXBElement<ALFEventType>(_ALFEventNoticeDoc_QNAME, ALFEventType.class, null, value);
}
}

View File

@ -0,0 +1,155 @@
package net.brutex.xservices.types.alfevent;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
*
* A Source element is a container type that describes the
* source of the event. ProductCallbackURI is optional for
* tools that don't provide a listener to accept the
* callback from a tool or serviceflow at a later time.
*
*
* <p>Java-Klasse für SourceType complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* &lt;complexType name="SourceType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Product" type="{http://www.eclipse.org/alf/schema/EventBase/1}ProductType"/>
* &lt;element name="ProductVersion" type="{http://www.eclipse.org/alf/schema/EventBase/1}ProductVersionType"/>
* &lt;element name="ProductInstance" type="{http://www.eclipse.org/alf/schema/EventBase/1}ProductInstanceType"/>
* &lt;element name="ProductCallbackURI" type="{http://www.eclipse.org/alf/schema/EventBase/1}ProductCallbackURIType" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SourceType", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", propOrder = {
"product",
"productVersion",
"productInstance",
"productCallbackURI"
})
public class SourceType {
@XmlElement(name = "Product", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String product;
@XmlElement(name = "ProductVersion", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String productVersion;
@XmlElement(name = "ProductInstance", namespace = "http://www.eclipse.org/alf/schema/EventBase/1", required = true)
protected String productInstance;
@XmlElement(name = "ProductCallbackURI", namespace = "http://www.eclipse.org/alf/schema/EventBase/1")
@XmlSchemaType(name = "anyURI")
protected String productCallbackURI;
/**
* Ruft den Wert der product-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getProduct() {
return product;
}
/**
* Legt den Wert der product-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setProduct(String value) {
this.product = value;
}
/**
* Ruft den Wert der productVersion-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getProductVersion() {
return productVersion;
}
/**
* Legt den Wert der productVersion-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setProductVersion(String value) {
this.productVersion = value;
}
/**
* Ruft den Wert der productInstance-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getProductInstance() {
return productInstance;
}
/**
* Legt den Wert der productInstance-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setProductInstance(String value) {
this.productInstance = value;
}
/**
* Ruft den Wert der productCallbackURI-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getProductCallbackURI() {
return productCallbackURI;
}
/**
* Legt den Wert der productCallbackURI-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setProductCallbackURI(String value) {
this.productCallbackURI = value;
}
}

View File

@ -18,6 +18,7 @@ package net.brutex.xservices.types.ant;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@ -44,13 +45,13 @@ public class AntProperty {
/**
* Converts a Map&lt;String, String&gt; into a list of
* AntProperties.
* @param map The map to convert
* @param newMap The map to convert
* @return A list of key/value pairs
*/
public static List<AntProperty> createAntPropertyList(Map<String, String> map) {
public static List<AntProperty> createAntPropertyList(Map<String, Object> newMap) {
List<AntProperty> list = new ArrayList<AntProperty>();
for(Map.Entry<String, String> e : map.entrySet()) {
list.add(new AntProperty(e.getKey(), e.getValue()));
for(Map.Entry<String, Object> e : newMap.entrySet()) {
list.add(new AntProperty(e.getKey(), (String)e.getValue()));
}
return list;
}

View File

@ -0,0 +1,18 @@
package net.brutex.xservices.util;
import lombok.NonNull;
import net.brutex.xservices.types.alfevent.ALFEventType;
/**
* Provides filtering and modification of ALF Events
*/
public interface ALFEventFilter {
/**
* Modify or filter the alf event.
*
* @param event
* @return modified event or null if it should be filtered out
*/
ALFEventType filter(@NonNull ALFEventType event);
}

View File

@ -31,23 +31,23 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import lombok.extern.slf4j.Slf4j;
import org.quartz.utils.ConnectionProvider;
/**
* @author Brian Rosenberger
*
*/
@Slf4j
public class BrutexHSQLQuartzConnectionProvider implements ConnectionProvider {
private Connection conn = null;
private final Logger logger = Logger.getLogger(this.getClass().getCanonicalName());
public Connection getConnection() throws SQLException {
if( conn!= null ) { // Todo: && conn.conn.isValid(5)) {
logger.debug("Checking tables on pre-exisiting database connection.");
log.debug("Checking tables on pre-exisiting database connection.");
checkTables();
return conn;
}
@ -55,7 +55,7 @@ public class BrutexHSQLQuartzConnectionProvider implements ConnectionProvider {
// Class.forName("org.hsqldb.jdbc.JDBCDriver" );
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
} catch (Exception e) {
logger.fatal("Failed to load Derby JDBC driver.");
log.error("Failed to load Derby JDBC driver.");
e.printStackTrace();
return null;
}
@ -87,6 +87,11 @@ public class BrutexHSQLQuartzConnectionProvider implements ConnectionProvider {
}
@Override
public void initialize() throws SQLException {
}
private synchronized void recursiveDelete(File dbDir) {
File[] files = dbDir.listFiles();
for (int i = 0; i < files.length; i++) {
@ -101,9 +106,9 @@ public class BrutexHSQLQuartzConnectionProvider implements ConnectionProvider {
}
private synchronized void checkTables() throws SQLException {
logger.debug("Checking QUARTZ database schema.");
log.debug("Checking QUARTZ database schema.");
if(!isConnected(false)) {
logger.error("Failed to validate QUARTZ database schema.");
log.error("Failed to validate QUARTZ database schema.");
return;
}
List<String> ddl_list = new ArrayList<String>(11);
@ -126,7 +131,7 @@ public class BrutexHSQLQuartzConnectionProvider implements ConnectionProvider {
for (String tbl : ddl_list) {
ResultSet rs = dmd.getTables(null, "APP", tbl, null);
if (!rs.next()) {
logger.log(Level.INFO, "Adding DDL for table "+ tbl);
log.debug("Adding DDL for table {}", tbl);
Statement st = conn.createStatement();
File ddlFile = new File(ddl + tbl + ".ddl");
String create = "";
@ -137,18 +142,15 @@ public class BrutexHSQLQuartzConnectionProvider implements ConnectionProvider {
}
create.trim();
if( st.execute(create)) {
logger.log(Level.INFO, "Table " + tbl + " created.");
log.debug("Table {} created.", tbl);
}
} catch (FileNotFoundException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
} catch (SQLException ex) {
logger.log(Level.ERROR, "Error executing statement "+ create );
System.out.println(ex.getMessage());
log.error("Error executing statement {}.",create, ex );
}
} else {
logger.trace("Table "+tbl+" exists.");
log.trace("Table {} exists.", tbl);
}
}
}
@ -159,15 +161,15 @@ public class BrutexHSQLQuartzConnectionProvider implements ConnectionProvider {
} else {
String t = this.getClass().getClassLoader().getResource("/").toString().substring(6); // WEB-INF/classes
t += "../data/db";
logger.debug("Database directory is set to '" + t + "'");
log.debug("Database directory is set to '{}", t);
try {
this.conn = DriverManager.getConnection("jdbc:derby:" + t + ";create=true;");
} catch (SQLException ex) {
logger.error(ex.getMessage(), ex);
log.error(ex.getMessage(), ex);
if(!fail) {
logger.warn("Deleting database directory.");
log.warn("Deleting database directory.");
recursiveDelete(new File(t));
logger.warn("Retrying to connect to database.");
log.warn("Retrying to connect to database.");
return isConnected(true);
} else {
return false;
@ -177,11 +179,7 @@ public class BrutexHSQLQuartzConnectionProvider implements ConnectionProvider {
return false;
}
@Override
public void initialize() throws SQLException {
// TODO Auto-generated method stub
}
}

View File

@ -31,23 +31,22 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import lombok.extern.slf4j.Slf4j;
import org.quartz.utils.ConnectionProvider;
/**
* @author Brian Rosenberger
*
*/
@Slf4j
public class BrutexQuartzConnectionProvider implements ConnectionProvider {
private Connection conn = null;
private final Logger logger = Logger.getLogger(this.getClass().getCanonicalName());
public Connection getConnection() throws SQLException {
if( conn!= null) { // Todo: && conn.conn.isValid(5)) {) {
logger.debug("Checking tables on pre-exisiting database connection.");
log.debug("Checking tables on pre-exisiting database connection.");
checkTables();
return conn;
}
@ -55,7 +54,7 @@ public class BrutexQuartzConnectionProvider implements ConnectionProvider {
// Class.forName("org.hsqldb.jdbc.JDBCDriver" );
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
} catch (Exception e) {
logger.fatal("Failed to load Derby JDBC driver.");
log.error("Failed to load Derby JDBC driver.");
e.printStackTrace();
return null;
}
@ -87,6 +86,11 @@ public class BrutexQuartzConnectionProvider implements ConnectionProvider {
}
@Override
public void initialize() throws SQLException {
}
private synchronized void recursiveDelete(File dbDir) {
File[] files = dbDir.listFiles();
for (int i = 0; i < files.length; i++) {
@ -101,9 +105,9 @@ public class BrutexQuartzConnectionProvider implements ConnectionProvider {
}
private synchronized void checkTables() throws SQLException {
logger.debug("Checking QUARTZ database schema.");
log.debug("Checking QUARTZ database schema.");
if(!isConnected(false)) {
logger.error("Failed to validate QUARTZ database schema.");
log.error("Failed to validate QUARTZ database schema.");
return;
}
List<String> ddl_list = new ArrayList<String>(11);
@ -126,7 +130,7 @@ public class BrutexQuartzConnectionProvider implements ConnectionProvider {
for (String tbl : ddl_list) {
ResultSet rs = dmd.getTables(null, "APP", tbl, null);
if (!rs.next()) {
logger.log(Level.INFO, "Adding DDL for table "+ tbl);
log.debug("Adding DDL for table {}.", tbl);
Statement st = conn.createStatement();
File ddlFile = new File(ddl + tbl + ".ddl");
String create = "";
@ -137,18 +141,16 @@ public class BrutexQuartzConnectionProvider implements ConnectionProvider {
}
create.trim();
if( st.execute(create)) {
logger.log(Level.INFO, "Table " + tbl + " created.");
log.debug("Table {} created.", tbl);
}
} catch (FileNotFoundException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
} catch (SQLException ex) {
logger.log(Level.ERROR, "Error executing statement "+ create );
log.error("Error executing statement {}", create, ex );
System.out.println(ex.getMessage());
}
} else {
logger.trace("Table "+tbl+" exists.");
log.trace("Table {} exists.", tbl);
}
}
}
@ -159,15 +161,15 @@ public class BrutexQuartzConnectionProvider implements ConnectionProvider {
} else {
String t = this.getClass().getClassLoader().getResource("/").toString().substring(6); // WEB-INF/classes
t += "../data/db";
logger.debug("Database directory is set to '" + t + "'");
log.debug("Database directory is set to '{}'", t);
try {
this.conn = DriverManager.getConnection("jdbc:derby:" + t + ";create=true;");
} catch (SQLException ex) {
logger.error(ex.getMessage(), ex);
log.error(ex.getMessage(), ex);
if(!fail) {
logger.warn("Deleting database directory.");
log.warn("Deleting database directory.");
recursiveDelete(new File(t));
logger.warn("Retrying to connect to database.");
log.warn("Retrying to connect to database.");
return isConnected(true);
} else {
return false;
@ -176,12 +178,6 @@ public class BrutexQuartzConnectionProvider implements ConnectionProvider {
}
return false;
}
@Override
public void initialize() throws SQLException {
// TODO Auto-generated method stub
}
}

View File

@ -1,26 +1,28 @@
/* */ package net.brutex.xservices.util;
/* */
/* */ import java.io.File;
/* */ import net.brutex.xservices.types.scm.ItemType;
/* */ import net.brutex.xservices.ws.rs.CVSInfoImpl;
/* */ import org.apache.commons.configuration.Configuration;
/* */ import org.apache.commons.configuration.ConfigurationException;
/* */ import org.apache.commons.configuration.PropertiesConfiguration;
/* */ import org.apache.log4j.Logger;
/* */ import lombok.extern.slf4j.Slf4j;
import net.brutex.xservices.types.scm.ItemType;
import net.brutex.xservices.util.CVSRoot;
import org.apache.commons.configuration2.PropertiesConfiguration;
import org.apache.commons.configuration2.builder.fluent.Configurations;
import org.apache.commons.configuration2.ex.ConfigurationException;
/* */ import org.netbeans.lib.cvsclient.Client;
/* */ import org.netbeans.lib.cvsclient.admin.StandardAdminHandler;
/* */ import org.netbeans.lib.cvsclient.command.CommandAbortedException;
/* */ import org.netbeans.lib.cvsclient.command.GlobalOptions;
/* */ import org.netbeans.lib.cvsclient.connection.AuthenticationException;
/* */ import org.netbeans.lib.cvsclient.connection.PServerConnection;
/* */
/* */
@Slf4j
/* */ public class CVSClient
/* */ {
/* */ private final File configfile;
/* */ private final PServerConnection connection;
/* */ private final CVSRoot root;
/* */ private final GlobalOptions globalOptions;
/* 41 */ final Logger logger = Logger.getLogger(CVSInfoImpl.class);
/* */ public final Client client;
/* */
/* */ public Client getClient()
@ -34,7 +36,9 @@
/* 55 */ throw new ConfigurationException("Config file not found");
/* */ }
/* 57 */ this.configfile = config;
/* 58 */ Configuration configuration = new PropertiesConfiguration(this.configfile);
Configurations configs = new Configurations();
/* 58 */ PropertiesConfiguration configuration = configs.properties(this.configfile);
/* */
/* 60 */ String cvsroot = configuration.getString("CVSROOT");
/* 61 */ String workdir = configuration.getString("WORKDIR");
@ -57,7 +61,7 @@
/* */ try {
/* 79 */ this.connection.open();
/* */ } catch (AuthenticationException ex) {
/* 81 */ this.logger.error(ex.getMessage());
/* 81 */ log.error(ex.getMessage());
/* */ }
/* */
/* 84 */ this.client = new Client(this.connection, new StandardAdminHandler());

View File

@ -0,0 +1,174 @@
package net.brutex.xservices.util;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.h2.jdbcx.JdbcConnectionPool;
import org.quartz.*;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.sql.*;
import java.time.Instant;
import java.util.Date;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import static org.quartz.TriggerBuilder.newTrigger;
@Slf4j
public class EventEmitter implements Job, InterruptableJob {
private final AtomicBoolean isInterrupted = new AtomicBoolean(false);
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
final Instant d = Instant.now();
final long ts = d.toEpochMilli();
final EventmanagerConfiguration conf = (EventmanagerConfiguration) context.getMergedJobDataMap()
.get(EventmanagerConfiguration.KEY);
final String url = conf.getTargeturl();
final JdbcConnectionPool pool = (JdbcConnectionPool) context.getMergedJobDataMap().get("mdbConnection");
final JdbcConnectionPool fpool = (JdbcConnectionPool) context.getMergedJobDataMap().get("fdbConnection");
final long run_key = context.getMergedJobDataMap().getLong("run_key");
final AtomicLong egres_counter = (AtomicLong) context.getMergedJobDataMap().get("egres_counter");
final String querySQL = "SELECT btx_id, btx_event, btx_obj_id, btx_event_type, btx_obj_type, btx_timestamp FROM brutex.tbl_events_snap ORDER BY btx_timestamp asc FOR UPDATE;";
final String deleteSQL = "DELETE FROM brutex.tbl_events_snap where btx_id=?";
final String deleteTable = "TRUNCATE TABLE brutex.tbl_events;";
final String moveSQL = "INSERT INTO brutex.tbl_events_snap DIRECT SELECT " +
" btx_event_type, btx_id, btx_obj_type, btx_obj_id, btx_timestamp, ?, btx_event FROM brutex.tbl_events; ";
final String moveErrorSQL = "MERGE INTO brutex.tbl_events_errors " +
"KEY (btx_event_type, btx_obj_type, btx_obj_id) " +
"VALUES (?,?,?,?,?,?,?,?);";
/**
* Move event table data to snapshot
*/
try( Connection con = pool.getConnection();
Connection fcon = fpool.getConnection();
) {
con.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
con.setAutoCommit(false);
Statement stmt = con.createStatement();
PreparedStatement moveprep= con.prepareStatement(moveSQL);
moveprep.setLong(1, run_key);
moveprep.execute();
stmt.execute(deleteTable);
con.commit(); //all events moved from tbl_events to tbl_events_snap at this point
PreparedStatement errorPrepSql = fcon.prepareStatement(moveErrorSQL);
PreparedStatement del = con.prepareStatement(deleteSQL);
ResultSet rs = stmt.executeQuery(querySQL);
while(rs.next() && !isInterrupted.get()) {
/* btx_id, btx_event, btx_obj_id, btx_event_type, btx_obj_typ */
String id = rs.getString(1);
Clob c = rs.getClob(2);
String obj_id = rs.getString(3);
String event_type = rs.getString(4);
String obj_type = rs.getString(5);
long event_ts = rs.getLong(6);
boolean bretry = false;
//SimpleSoap ss = new SimpleSoap( url, id, IOUtils.toString(c.getAsciiStream()c.getCharacterStream()));
SimpleSoap ss = new SimpleSoap(url, id, c.getSubString(1L, (int) c.length()));
int retry = 0;
Reader response = null;
String rsp = "";
boolean succeeded = false;
while(retry < 3 && !succeeded && !isInterrupted.get()) {
retry++;
response = ss.sendSoap(false);
succeeded = true;
if(response!=null) {
rsp = IOUtils.toString(response);
}
if (rsp.contains("<soap:Fault") || rsp.contains("<soapenv:Fault")) { succeeded=false; bretry=false;};
if (! rsp.contains(":Envelope ")) { succeeded=false; bretry=true;};
if (succeeded) {
// Successfully send
del.setString(1, id);
del.execute();
con.commit();
egres_counter.incrementAndGet();
log.debug("Successfully sent event '{}' to target ALF Event Manager.", id);
} else {
// Error during sending
log.warn("Unable to send ALF Event '{}' to event manager. Will retry in 2 seconds. This is the {}. time.", id, retry);
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
log.error("Interrupted while waiting to retry: {}", e.getMessage());
}
}
}
if(! succeeded) {
log.error("Failed to send ALF Event '{}' to the event manager. Giving up. " +
"Moving event back to the queue unless there is a superseding event already queued.", id);
try {
//this is in file-based db
errorPrepSql.setString(1, event_type);
errorPrepSql.setString(2, id);
errorPrepSql.setString(3, obj_type);
errorPrepSql.setString(4, obj_id);
errorPrepSql.setLong(5, event_ts);
errorPrepSql.setBoolean(6, bretry);
errorPrepSql.setClob(7, new StringReader(rsp) );
errorPrepSql.setClob(8, c);
errorPrepSql.execute();
fcon.commit();
//this is in-memory
del.setString(1, id);
del.execute();
con.commit();
} catch (SQLException e) {
log.error("Exception in SQL execution during writing error events: {}", e.getMessage());
}
}
}
} catch (SQLException e) {
log.error("Exception in SQL execution: {}", e.getMessage());
throw new JobExecutionException(e);
} catch (IOException e) {
log.error("Exception in SQL execution: {}", e.getMessage());
throw new RuntimeException(e);
}
}
/**
* <p>
* Called by the <code>{@link Scheduler}</code> when a user
* interrupts the <code>Job</code>.
* </p>
*
* @throws UnableToInterruptJobException if there is an exception while interrupting the job.
*/
@Override
public synchronized void interrupt() throws UnableToInterruptJobException {
isInterrupted.set(true);
log.warn("ALFEmitter received and interrupt.");
}
}

View File

@ -0,0 +1,23 @@
package net.brutex.xservices.util;
import lombok.NonNull;
import net.brutex.xservices.types.alfevent.ALFEventType;
/**
* This example filter cuts the eventid to max of 32 characters
*/
public class EventIdTruncateFilter implements ALFEventFilter {
/**
* Modify or filter the alf event.
*
* @param event
* @return modified event or null if it should be filtered out
*/
@Override
public ALFEventType filter(@NonNull ALFEventType event) {
if (event.getBase().getEventId().length() > 32) {
event.getBase().setEventId(event.getBase().getEventId().substring(0, 32));
}
return event;
}
}

View File

@ -0,0 +1,83 @@
package net.brutex.xservices.util;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.h2.jdbcx.JdbcConnectionPool;
import org.quartz.*;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.sql.*;
import java.time.Instant;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
@Slf4j
@DisallowConcurrentExecution
public class EventLogCleanerJob implements Job, InterruptableJob {
private final AtomicBoolean isInterrupted = new AtomicBoolean(false);
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
final Instant d = Instant.now();
final long ts = d.toEpochMilli();
log.info("EventLogCleaner is executing now.");
final EventmanagerConfiguration conf = (EventmanagerConfiguration) context.getMergedJobDataMap()
.get(EventmanagerConfiguration.KEY);
final JdbcConnectionPool fpool = (JdbcConnectionPool) context.getMergedJobDataMap().get("fdbConnection");
final JdbcConnectionPool mpool = (JdbcConnectionPool) context.getMergedJobDataMap().get("mdbConnection");
final String moveSQL = "INSERT INTO brutex.tbl_events_all DIRECT SELECT * FROM MEM_ALL_EVENTS " +
"where btx_timestamp < " + (ts-5000) + " ";
final String deleteTable = "DELETE FROM MEM_ALL_EVENTS where btx_timestamp < " + (ts-5000);
final String deleteMemTable = "DELETE FROM brutex.tbl_events_all where btx_timestamp < " + (ts-5000);
/**
* Move event table data to all events log
*/
try (Connection fcon = fpool.getConnection();
Connection mcon = mpool.getConnection()){
fcon.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
fcon.setAutoCommit(false);
Statement stmt = fcon.createStatement();
stmt.execute(moveSQL);
int count = stmt.getUpdateCount();
fcon.commit();
Statement mstm = mcon.createStatement();
mstm.execute(deleteMemTable);
int count2 = mstm.getUpdateCount();
mcon.commit();
log.info("EventLogCleaner moved '{}/ deleted {}' events into the persistence space.", count, count2);
} catch (SQLException e) {
log.error("Exception in SQL execution: {}", e.getMessage());
throw new JobExecutionException(e);
}
}
/**
* <p>
* Called by the <code>{@link Scheduler}</code> when a user
* interrupts the <code>Job</code>.
* </p>
*
* @throws UnableToInterruptJobException if there is an exception while interrupting the job.
*/
@Override
public synchronized void interrupt() throws UnableToInterruptJobException {
isInterrupted.set(true);
log.warn("EventLogCleaner received and interrupt.");
Thread.currentThread().interrupt();
}
}

View File

@ -0,0 +1,92 @@
package net.brutex.xservices.util;
import lombok.Data;
import lombok.Singular;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.configuration2.Configuration;
import org.apache.commons.configuration2.FileBasedConfiguration;
import org.apache.commons.configuration2.PropertiesConfiguration;
import org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder;
import org.apache.commons.configuration2.builder.PropertiesBuilderParametersImpl;
import org.apache.commons.configuration2.event.ConfigurationEvent;
import org.apache.commons.configuration2.event.EventListener;
import org.apache.commons.configuration2.ex.ConfigurationException;
import javax.servlet.ServletContext;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
/**
* A configuration object for the MiscService -> Eventmanager. Implemented as singleton.
* @author Brian Rosenberger, bru@brutex.de
**/
@Data
@Slf4j
public class EventmanagerConfiguration {
public static final String KEY = "net.brutex.xservices.EventmanagerConfiguration";
private static class InstanceHolder {
public static final EventmanagerConfiguration instance = new EventmanagerConfiguration();
}
private EventmanagerConfiguration() {
refreshConfig();
}
public static EventmanagerConfiguration getInstance() {
return InstanceHolder.instance;
}
private String targeturl;
private int interval;
private String jdbc_memdb;
private String jdbc_filedb;
private boolean isEmitterActive = true;
private int cleaner_interval;
private List<ALFEventFilter> alf_filter = new ArrayList<>();
private int init_delay;
public synchronized EventmanagerConfiguration refreshConfig() {
log.trace("Reading EventmanagerConfiguration from file eventmanager.properties.");
FileBasedConfigurationBuilder<FileBasedConfiguration> builder =
new FileBasedConfigurationBuilder<FileBasedConfiguration>(PropertiesConfiguration.class)
.configure(new PropertiesBuilderParametersImpl().setFileName("../eventmanager.properties"));
try {
Configuration config = builder.getConfiguration();
/* Read from eventmanager.properties file */
this.targeturl = config.getString("target.url");
this.interval = config.getInt("interval", 10);
this.jdbc_memdb = config.getString("memdb", "jdbc:h2:mem:lockdb;DB_CLOSE_DELAY=-1;");
this.jdbc_filedb = config.getString("fdb", "jdbc:h2:mem:lockdb;DB_CLOSE_DELAY=-1;");
this.isEmitterActive = config.getBoolean("emitter_active", true);
this.cleaner_interval = config.getInt("cleaner_interval", 5);
List<String> lst = config.getList(String.class,"alf_filter", new ArrayList<String>());
for ( String c :lst ) {
try{
alf_filter.add( (ALFEventFilter) Class.forName(c).getDeclaredConstructor().newInstance());
} catch (ClassNotFoundException e) {
log.error("Cannot find class for alf filter with name '{}'.", c);
} catch (InvocationTargetException | InstantiationException | IllegalAccessException |
NoSuchMethodException e) {
log.error("Cannot instantiate class for alf filter with name '{}'.", c);
}
}
this.init_delay = config.getInt("init_delay", 15);
} catch (ConfigurationException e) {
log.error("Error loading configuration for event manager in XServices MiscServices: {}", e.getMessage());
throw new RuntimeException(e);
}
return this;
}
}

View File

@ -15,6 +15,8 @@
*/
package net.brutex.xservices.util;
import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.FileVisitResult;
@ -25,9 +27,7 @@ import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import net.brutex.xservices.types.FileInfoType;
// TODO: Auto-generated Javadoc
/**
@ -35,6 +35,7 @@ import net.brutex.xservices.types.FileInfoType;
*
* @author Brian Rosenberger, bru(at)brutex.de
*/
@Slf4j
public class FileWalker extends SimpleFileVisitor<Path> {
/** The matcher. */
@ -49,9 +50,6 @@ public class FileWalker extends SimpleFileVisitor<Path> {
/** The pattern. */
private final String pattern;
/** The logger. */
final Logger logger = Logger.getLogger(FileWalker.class);
List<Path> list;
/**
@ -76,11 +74,11 @@ public class FileWalker extends SimpleFileVisitor<Path> {
*/
void find(Path file) {
Path name = file.getFileName();
logger.trace("Compare file " + file.toString() + " against pattern '"+pattern+"'.");
log.debug("Compare file '{}' against pattern '{}'.", file, pattern);
total++;
if (name != null && matcher.matches(name)) {
list.add(file);
logger.debug("Added file " + file.toString() + " to the result set.");
log.debug("Added file '{}' to the result set.", file);
num++;
}
}
@ -116,7 +114,7 @@ public class FileWalker extends SimpleFileVisitor<Path> {
@Override
public FileVisitResult visitFileFailed(Path file,
IOException exc) {
logger.warn(String.format("Failed to include file '%s'.", file.toString()));
log.warn("Failed to include file '{}'.", file);
return FileVisitResult.CONTINUE;
}

View File

@ -0,0 +1,51 @@
package net.brutex.xservices.util;
import java.sql.*;
import java.time.Instant;
import java.util.concurrent.atomic.AtomicBoolean;
import lombok.extern.slf4j.Slf4j;
import org.h2.jdbcx.JdbcConnectionPool;
import org.quartz.*;
@Slf4j
@DisallowConcurrentExecution
public class LockCleanerJob implements Job, InterruptableJob {
private final AtomicBoolean isInterrupted = new AtomicBoolean(false);
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
log.debug("LockCleaner is executing now.");
final Instant d = Instant.now();
final long ts = d.toEpochMilli();
final JdbcConnectionPool mpool = (JdbcConnectionPool) context.getMergedJobDataMap().get("mdbConnection");
final String deleteMemTable = "DELETE FROM brutex.tbl_lock where btx_validity < " + (ts-5000);
try (Connection mcon = mpool.getConnection()){
Statement stmt = mcon.createStatement();
stmt.execute(deleteMemTable);
int count = stmt.getUpdateCount();
log.debug("LockCleaner deleted '{}' stale locks.", count);
} catch (SQLException e) {
log.error("Exception in SQL execution: {}", e.getMessage());
throw new JobExecutionException(e);
}
}
/**
* <p>
* Called by the <code>{@link Scheduler}</code> when a user
* interrupts the <code>Job</code>.
* </p>
*
* @throws UnableToInterruptJobException if there is an exception while interrupting the job.
*/
@Override
public synchronized void interrupt() throws UnableToInterruptJobException {
isInterrupted.set(true);
log.warn("LockCleanerJob received an interrupt.");
Thread.currentThread().interrupt();
}
}

View File

@ -0,0 +1,271 @@
package net.brutex.xservices.util;
import lombok.extern.slf4j.Slf4j;
import org.h2.jdbcx.JdbcConnectionPool;
import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Date;
import java.util.concurrent.atomic.AtomicLong;
import static org.quartz.TriggerBuilder.newTrigger;
//For Servlet container 3.x, you can annotate the listener with @WebListener, no need to declares in web.xml.
/**
* Handle servlet lifecycle actions for the MiscService servlet, such as
* initializing in-memory database, persist on shutdown etc.
*/
@WebListener
@Slf4j
public class MiscServiceServletContextListener implements ServletContextListener {
/**
* SQL initialization for in-memory database
* INIT=RUNSCRIPT FROM 'classpath:scripts/create.sql'"
*/
private final static String dbinit = "RUNSCRIPT FROM 'classpath:ddl/BRTX_schema.ddl';";
private final EventmanagerConfiguration configuration = EventmanagerConfiguration.getInstance().refreshConfig();
private final JdbcConnectionPool mempool = getDbPool(configuration.getJdbc_memdb());
private final JdbcConnectionPool fdbpool = getDbPool(configuration.getJdbc_filedb());
/**
* Create DB connection pool and initialize the in-memory database with schema.
*
* @return connection pool
*/
private static JdbcConnectionPool getDbPool(String dbConnectString) {
JdbcConnectionPool p = JdbcConnectionPool.create(dbConnectString, "", "");
p.setMaxConnections(256);
p.setLoginTimeout(20);
try (Connection c = p.getConnection();){
Statement s = c.createStatement();
s.execute(dbinit);
c.commit();
log.trace("Running SQL against database '{}': '{}'", dbConnectString, dbinit);
c.close();
log.debug("Successfully created schema for database 'Brutex' at '{}'.", dbConnectString);
} catch (SQLException e) {
log.error("Error creating the schema for database 'Brutex' using '{}': {}", dbConnectString, e.getMessage());
throw new RuntimeException(e);
}
return p;
}
@Override
public void contextDestroyed(ServletContextEvent arg0) {
log.trace("contextDestroyed called.");
try {
Scheduler scheduler = (Scheduler) arg0.getServletContext().getAttribute("scheduler");
log.debug("Active jobs to be terminated: {}", scheduler.getCurrentlyExecutingJobs());
JobKey key = JobKey.jobKey("ALFEmitter");
JobKey cleanerkey = JobKey.jobKey("EventLogCleaner");
synchronized (scheduler) {
if (!scheduler.isShutdown() && scheduler.checkExists(key) ) {
scheduler.interrupt(key);
scheduler.deleteJob(key);
log.info("Gracefully stopped the ALFEventEmitter job.");
}
if (!scheduler.isShutdown() && scheduler.checkExists(cleanerkey) ) {
scheduler.interrupt(cleanerkey);
scheduler.deleteJob(cleanerkey);
log.info("Gracefully stopped the ALFEventEmitter job.");
}
if (!scheduler.isShutdown()) {
scheduler.shutdown(true);
}
}
} catch (SchedulerException e) {
log.error("Failed to stop the ALFEmitter job: {}", e.getMessage());
throw new RuntimeException(e);
}
log.info("ServletContextListener destroyed. Saving in-memory database to file based database.");
int act_i = mempool.getActiveConnections();
if (act_i > 0) {
log.warn("There are still {} connections to the XServices in-memory database active.", act_i);
}
try {
log.info("Create/Re-open file based database to persist memory database.");
Connection con = fdbpool.getConnection();
Statement s = con.createStatement();
final String insert = "INSERT INTO brutex.tbl_events SELECT * from MEM_INBOUND UNION SELECT " + "btx_event_type, btx_id, btx_obj_type, btx_obj_id, btx_timestamp, btx_event from MEM_OUTBOUND;";
s.execute(insert);
int count = s.getUpdateCount();
log.info("Persisted {} active event rows in file-based database.", count);
final String save_all = "INSERT INTO brutex.tbl_events_all SELECT * from MEM_ALL_EVENTS;";
s.execute(save_all);
count = s.getUpdateCount();
log.info("Persisted {} event rows from all_events log in file-based database", count);
log.info("Shutting down in-memory database. Closing file-based database. Please wait ...");
s.execute("SHUTDOWN;");
con.close();
log.info("Shutting down databases complete.");
} catch (SQLException e) {
log.error("An error occurred during database persistence: {}", e.getMessage());
throw new RuntimeException(e);
}
log.debug("Handled {} egress events.", arg0.getServletContext().getAttribute("egres_counter"));
log.debug("Handled {} ingress events.", arg0.getServletContext().getAttribute("ingres_counter"));
}
//Run this before web application is started
@Override
public void contextInitialized(ServletContextEvent arg0) {
log.debug("ServletContextListener started");
ServletContext context = arg0.getServletContext();
readConfiguration(context);
context.setAttribute("mdbConnection", mempool);
context.setAttribute("fdbConnection", fdbpool);
context.setAttribute("ingres_counter", 0);
AtomicLong egres = new AtomicLong(0);
context.setAttribute("egres_counter", egres);
context.setAttribute("ingres_counter", new AtomicLong(0));
try {
StdSchedulerFactory fact = new StdSchedulerFactory();
fact.initialize("MiscServicesScheduler-quartz.properties");
Scheduler scheduler = fact.getScheduler();
scheduler.start();
context.setAttribute("scheduler", scheduler);
} catch (SchedulerException e) {
log.error("Error creating scheduler within ServletContext: {}", e.getMessage());
throw new RuntimeException(e);
}
//Load events from file based database into in-memory database
try {
log.info("Start recovery of previously unsend alf events. Trying to load them into in-memory database.");
final String link = getLinkSQL();
final String recoverSQL = "INSERT INTO MEM_INBOUND DIRECT SELECT * FROM brutex.tbl_events;";
final String truncate = "TRUNCATE TABLE brutex.tbl_events;";
int count = 0;
Connection con = fdbpool.getConnection();
con.setAutoCommit(false);
Statement statement = con.createStatement();
statement.execute(link);
con.commit();
ResultSet rs = statement.executeQuery("SELECT COUNT(1) FROM brutex.tbl_events");
if(rs.next()) count = rs.getInt(1);
statement.execute(recoverSQL);
log.info("Recovered {} events and loaded them into in-memory database.", count);
statement.execute(truncate);
con.commit();
con.close();
} catch (SQLException e) {
log.error("Exception during recovery of events from previous runs: {}", e.getMessage());
throw new RuntimeException(e);
}
//Start initial run of the emitter
if(configuration.isEmitterActive()) {
startEmitterImmediate(egres, (Scheduler) context.getAttribute("scheduler"));
}
//Start mem db log cleaner
if(configuration.getCleaner_interval()>0) {
startEventLogCleaner((Scheduler) context.getAttribute("scheduler"));
}
startLockCleaner((Scheduler) context.getAttribute("scheduler"));
}
private String getLinkSQL() {
final String dbDriverClass = "org.h2.Driver";
final String link = "CREATE LINKED TABLE IF NOT EXISTS MEM_INBOUND('"+dbDriverClass+"', '"+configuration.getJdbc_memdb()+"', '', '', 'brutex.tbl_events'); " +
"CREATE LINKED TABLE IF NOT EXISTS MEM_OUTBOUND('"+dbDriverClass+"', '"+configuration.getJdbc_memdb()+"', '', '', 'brutex.tbl_events_snap'); " +
"CREATE LINKED TABLE IF NOT EXISTS MEM_ALL_EVENTS('"+dbDriverClass+"', '"+configuration.getJdbc_memdb()+"', '', '', 'brutex.tbl_events_all') AUTOCOMMIT OFF; " +
"";
return link;
}
private synchronized void startEmitterImmediate(AtomicLong egres, Scheduler scheduler) {
try {
if (!scheduler.checkExists(JobKey.jobKey("ALFEmitter"))) {
JobDetail job2 = JobBuilder.newJob(EventEmitter.class).withIdentity("ALFEmitter").build();
job2.getJobDataMap().put("mdbConnection", mempool);
job2.getJobDataMap().put("fdbConnection", fdbpool);
job2.getJobDataMap().put("run_key", Instant.now().toEpochMilli());
job2.getJobDataMap().put("egres_counter", egres);
job2.getJobDataMap().put(EventmanagerConfiguration.KEY, EventmanagerConfiguration.getInstance());
SimpleTrigger t = (SimpleTrigger) newTrigger().withIdentity("ALFEmitter")
.startAt(Date.from(Instant.now().plusSeconds(configuration.getInit_delay()))).build();
scheduler.scheduleJob(job2, t);
}
} catch (SchedulerException ex) {
log.error("Could not start EventEmitter to process existing queue directly after startup: {}", ex.getMessage());
}
}
private void startEventLogCleaner(Scheduler scheduler) {
try {
if (!scheduler.checkExists(JobKey.jobKey("EventLogCleaner"))) {
JobDetail job2 = JobBuilder.newJob(EventLogCleanerJob.class).withIdentity("EventLogCleaner").build();
job2.getJobDataMap().put("mdbConnection", mempool);
job2.getJobDataMap().put("fdbConnection", fdbpool);
job2.getJobDataMap().put("run_key", Instant.now().toEpochMilli());
job2.getJobDataMap().put(EventmanagerConfiguration.KEY, EventmanagerConfiguration.getInstance());
SimpleTrigger t = (SimpleTrigger) newTrigger().withIdentity("EventLogCleaner")
.withSchedule(SimpleScheduleBuilder.simpleSchedule()
.withIntervalInMinutes(configuration.getCleaner_interval())
.repeatForever())
.startAt(Date.from(Instant.now().plus(configuration.getCleaner_interval(), ChronoUnit.MINUTES)))
.build();
scheduler.scheduleJob(job2, t);
}
} catch (SchedulerException ex) {
log.error("Could not start EventLogCleaner to process existing queue directly after startup: {}", ex.getMessage());
}
}
private void startLockCleaner(Scheduler scheduler) {
try {
if (!scheduler.checkExists(JobKey.jobKey("LockCleaner"))) {
JobDetail job2 = JobBuilder.newJob(LockCleanerJob.class).withIdentity("LockCleaner").build();
job2.getJobDataMap().put("mdbConnection", mempool);
SimpleTrigger t =
(SimpleTrigger)
newTrigger()
.withIdentity("LockCleaner")
.withSchedule(
SimpleScheduleBuilder.simpleSchedule()
.withIntervalInMinutes(2)
.repeatForever())
.startAt(
Date.from(
Instant.now()
.plus(2, ChronoUnit.MINUTES)))
.build();
scheduler.scheduleJob(job2, t);
}
} catch (SchedulerException ex) {
log.error("Could not start LockCleaner: {}", ex.getMessage());
}
}
private void readConfiguration(ServletContext ctx) {
/* Configure ServletContext attributes using configuration object*/
EventmanagerConfiguration c = EventmanagerConfiguration.getInstance().refreshConfig();
ctx.setAttribute(EventmanagerConfiguration.KEY, c);
}
}

View File

@ -0,0 +1,62 @@
/**
*
*/
package net.brutex.xservices.util;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.apache.commons.configuration2.PropertiesConfiguration;
import org.apache.commons.jcs.JCS;
import org.apache.commons.jcs.access.exception.CacheException;
import net.brutex.mgmt.openair.OpenAirRestConnection;
/**
* @author brosenberger
*
*/
@Slf4j
public final class OpenAirConnection {
public static OpenAirRestConnection getOpenAirConnection() {
final PropertiesConfiguration props;
try {
final String config = "../openair.properties";
log.info("Loading Open Air connection details from {}", config.toString());
final URL configloc = OpenAirConnection.class.getClassLoader().getResource(config);
log.debug("Loading Open Air connection details from {}", configloc.toString());
props = new PropertiesConfiguration();
props.read( new InputStreamReader( new BufferedInputStream(configloc.openStream())) );
final String user = props.getString("user");
final String password = props.getString("password");
final String company = props.getString("company");
final String apikey = props.getString("apikey", "_PUT_HERE_");
final String namespace = props.getString("namespace", "");
final OpenAirRestConnection con;
con = new OpenAirRestConnection(JCS.getInstance("OACache"), company, user, password);
return con;
} catch (CacheException | ConfigurationException e) {
log.error(e.getMessage(), e);
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
}
return null;
}
}

View File

@ -19,6 +19,7 @@ import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.Map;
import net.brutex.xservices.types.ReturnCode;
import net.brutex.xservices.types.ant.AntProperty;
@ -80,14 +81,14 @@ public class RunTask {
*/
public ReturnCode postTask() throws BuildException {
int returnCode = 0;
Map<String, String> origMap = new HashMap<String, String>();
Map<String, String> newMap = null;
Map<String, Object> origMap = new HashMap<String, Object>();
Map<String, Object> newMap = null;
origMap.putAll(antproject.getProperties());
antproject.executeTarget(anttarget.getName());
newMap = antproject.getProperties();
newMap.putAll(antproject.getUserProperties());
for (Map.Entry<String, String> e : origMap.entrySet()) {
for (Map.Entry<String, Object> e : origMap.entrySet()) {
newMap.remove(e.getKey());
}

View File

@ -0,0 +1,122 @@
/*
* Copyright 2013 Brian Rosenberger (Brutex Network)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.brutex.xservices.util;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpEntity;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.EntityBuilder;
import org.apache.http.client.fluent.Request;
import org.apache.http.client.fluent.Response;
import org.apache.http.entity.ContentType;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* Construct a HTTP POST and send it.
*
* @author Brian Rosenberger, bru(at)brutex.de
* @since 0.1
*/
@Slf4j
public class SimpleSoap {
private final String url;
private final String soapBody;
private final String id;
private long duration = 0;
final AtomicBoolean isInterrupted = new AtomicBoolean(false);
/**
* Instantiates a new simple http event.
*
* @param url the url
* @param soapBody the soap body
*/
public SimpleSoap(String url, String id, String soapBody) {
this.url = url;
this.id = id;
this.soapBody = soapBody;
}
/**
* Send soap.
*
* @param isDropResponse show interest in response or not
* @throws ClientProtocolException the client protocol exception
* @throws IOException Signals that an I/O exception has occurred.
*/
public Reader sendSoap(boolean isDropResponse) {
Reader response = null;
long start = System.currentTimeMillis();
HttpEntity entity = EntityBuilder.create()
.setText(soapBody)
.setContentType(ContentType.create("text/xml", StandardCharsets.UTF_8))
.setContentEncoding("UTF-8")
.build();
log.trace("Sending event '{}' to target ALF Event Manager.", id);
if(isInterrupted.get()) return null;
try {
Response resp = Request.Post(url)
.addHeader("Accept", "text/xml")
//.addHeader("Content-Type", "text/xml; charset=utf-8")
.addHeader("SOAPAction", "")
.body(entity).execute();
if (!isDropResponse) {
HttpEntity e = resp.returnResponse().getEntity();
response = new BufferedReader(new InputStreamReader(e.getContent()));
/*
StringBuilder sb = new StringBuilder();
BufferedReader in = new BufferedReader(new InputStreamReader(e.getContent()));
String s;
while ((s = in.readLine()) != null) {
sb.append(s);
}
log.trace("Response: \n {}", sb.toString());
if (sb.toString().contains("<soap:Fault>")) { return false;};
if (! sb.toString().contains(":Envelope ")) { return false;};
*/
} else {
log.debug("Response intentionally ignored.");
}
} catch (IOException e) {
log.error("Error sending ALF Event '{}'. Got IOException: {}", id, e.getMessage());
}
duration = System.currentTimeMillis() - start;
return response;
}
public void interrupt() {
this.isInterrupted.set(true);
}
}

View File

@ -0,0 +1,55 @@
/*
* Copyright 2013 Brian Rosenberger (Brutex Network)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.brutex.xservices.util.cache;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
/**
* @author Brian Rosenberger, bru(at)brutex.de
*
*/
public class CacheExecutorService implements ServletContextListener {
static final String EXECUTOR_NAME = "CACHE_EXECUTOR";
private ExecutorService executor;
public void contextInitialized(ServletContextEvent arg0) {
ServletContext context = arg0.getServletContext();
int nr_executors = 5;
ThreadFactory daemonFactory = new DaemonThreadFactory();
try {
nr_executors = Integer.parseInt(context.getInitParameter("cache:thread-count"));
} catch (NumberFormatException localNumberFormatException) {
}
if (nr_executors <= 1)
this.executor = Executors.newSingleThreadExecutor(daemonFactory);
else {
this.executor = Executors.newFixedThreadPool(nr_executors, daemonFactory);
}
context.setAttribute("CACHE_EXECUTOR", this.executor);
}
public void contextDestroyed(ServletContextEvent arg0) {
ServletContext context = arg0.getServletContext();
this.executor.shutdownNow();
}
}

View File

@ -21,22 +21,22 @@ import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.concurrent.ExecutorService;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import lombok.extern.slf4j.Slf4j;
import net.brutex.xservices.types.scm.ObjectFactory;
import org.apache.log4j.Logger;
/**
* @author Brian Rosenberger, bru(at)brutex.de
*
*/
@Slf4j
public class CacheServlet extends HttpServlet
{
private final Logger logger = Logger.getLogger(CacheServlet.class);
List<File> configfiles = new ArrayList();
List<File> configfiles = new ArrayList<File>();
int cacheinterval;
private final ObjectFactory FACTORY = new ObjectFactory();
@ -54,7 +54,7 @@ public class CacheServlet extends HttpServlet
if (name.startsWith("cvs-config-")) {
String configfile = getServletContext()
.getInitParameter(name);
this.logger.info("CVS configuration file: " + configfile);
log.info("CVS configuration file: {}", configfile);
this.configfiles.add(new File(configfile));
}
}
@ -63,8 +63,8 @@ public class CacheServlet extends HttpServlet
this.cacheinterval = Integer.parseInt(getServletContext()
.getInitParameter("cvs-cache-interval"));
} catch (NumberFormatException e) {
this.logger.debug("Could not read parameter 'cvs-cache-interval' from web.xml. Using default value '" + this.cacheinterval + "' minutes");
log.debug("Could not read parameter 'cvs-cache-interval' from web.xml. Using default value '{}' minutes", this.cacheinterval );
}
this.logger.info("CacheServlet set to " + this.cacheinterval + " minutes interval.");
log.info("CacheServlet set to '{}' minutes interval.", this.cacheinterval);
}
}

View File

@ -23,12 +23,15 @@ import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.ws.rs.core.Response;
import lombok.extern.slf4j.Slf4j;
import net.brutex.xservices.types.scm.ItemListType;
import net.brutex.xservices.types.scm.ItemType;
import net.brutex.xservices.types.scmfindings.FindingDetailsType;
@ -37,29 +40,29 @@ import net.brutex.xservices.types.scmfindings.FindingsListType;
import net.brutex.xservices.types.scmfindings.GroupMatchListType;
import net.brutex.xservices.types.scmfindings.ObjectFactory;
import net.brutex.xservices.ws.rs.CVSInfoImpl;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.jcs.JCS;
import org.apache.jcs.access.exception.CacheException;
import org.apache.log4j.Logger;
import org.apache.commons.configuration2.PropertiesConfiguration;
import org.apache.commons.configuration2.builder.fluent.Configurations;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.apache.commons.jcs.access.exception.CacheException;
/**
* @author Brian Rosenberger, bru(at)brutex.de
*
*/
@Slf4j
public class FindingsCacheServlet extends HttpServlet {
private static final long serialVersionUID = 4041338473949999960L;
private final static Logger logger = Logger
.getLogger(FindingsCacheServlet.class);
private final List<File> configfiles = new ArrayList<File>();
private final ObjectFactory FACTORY = new ObjectFactory();
private ExecutorService executor;
@Override
public void init() throws ServletException {
super.init();
ExecutorService executor = (ExecutorService) getServletContext()
executor = (ExecutorService) getServletContext()
.getAttribute("CACHE_EXECUTOR");
if(! this.initConfigList()) return;
@ -68,7 +71,7 @@ public class FindingsCacheServlet extends HttpServlet {
int i = 1;
for(File f: configfiles) {
//Initialise configuration bean using default values
FindingsConfigBean cbean = new FindingsConfigBean(i, Logger.getLogger("worker-"+i+ "." + this.getClass().getName()));
FindingsConfigBean cbean = new FindingsConfigBean(i);
i++;
@ -78,37 +81,38 @@ public class FindingsCacheServlet extends HttpServlet {
int cacheinterval = Integer.parseInt(getServletContext()
.getInitParameter("cvs-cache-interval"));
cbean.setCacheinterval(cacheinterval);
logger.info("FindingsCacheServlet set to "+ cacheinterval + " minutes interval.");
log.info("FindingsCacheServlet set to "+ cacheinterval + " minutes interval.");
} catch (NumberFormatException e) {
logger.warn("Could not read parameter 'cvs-cache-interval' from web.xml. Using default value '"
log.warn("Could not read parameter 'cvs-cache-interval' from web.xml. Using default value '"
+ cbean.getCacheinterval()+ "' minutes");
}
Configurations configs = new Configurations();
PropertiesConfiguration config = null;
try {
config = new PropertiesConfiguration(f);
config = configs.properties(f);
} catch (ConfigurationException e) {
logger.error("Could not read parameter file at '"+f.getAbsolutePath()+"'");
log.error("Could not read parameter file at '"+f.getAbsolutePath()+"'");
return;
}
File cvsconfig = new File(config.getString("CVSROOTCONFIGFILE"));
cbean.setCvsconfig(cvsconfig);
FindingsCacheServlet.logger.debug("Fetching list of files using '"
FindingsCacheServlet.log.debug("Fetching list of files using '"
+ cvsconfig.getAbsolutePath() + "' config file");
List<Object> filepatterns = config.getList("FILESEARCH");
cbean.setFilepatterns(filepatterns);
FindingsCacheServlet.logger.debug("Checking '"
FindingsCacheServlet.log.debug("Checking '"
+ filepatterns.size()
+ "' patterns for file name and path matching.");
List<Object> contentpatterns = config.getList("CONTENTSEARCH");
cbean.setContentpatterns(contentpatterns);
FindingsCacheServlet.logger.debug("Checking '"
FindingsCacheServlet.log.debug("Checking '"
+ contentpatterns.size()
+ "' patterns for content matching");
@ -116,8 +120,9 @@ public class FindingsCacheServlet extends HttpServlet {
executor.submit(new ThisRunnable(cbean));
}
logger.info("FindingsCacheServlet has been initialized.");
log.info("FindingsCacheServlet has been initialized.");
}
@ -128,14 +133,14 @@ public class FindingsCacheServlet extends HttpServlet {
String filename = getServletContext().getInitParameter(
"cvs-findings-configuration");
if (filename == null) {
logger.warn("'cvs-findings-configuration' init parameter is not specified.");
log.warn("'cvs-findings-configuration' init parameter is not specified.");
return false;
}
final File findingsconfig = new File(filename);
logger.info("CVS findings configuration file found at '"
log.info("CVS findings configuration file found at '"
+ findingsconfig.getAbsolutePath() + "'");
if ((!findingsconfig.canRead()) || (findingsconfig.isDirectory())) {
logger.info("CVS findings configuration file '"
log.info("CVS findings configuration file '"
+ findingsconfig.getAbsolutePath() + "' does not exist.");
return false;
}
@ -153,7 +158,7 @@ public class FindingsCacheServlet extends HttpServlet {
String name = (String) attributes.nextElement();
if (name.startsWith("cvs-config-")) {
String configfile = getServletContext().getInitParameter(name);
logger.info("Adding CVS configuration file: " + configfile);
log.info("Adding CVS configuration file: " + configfile);
this.configfiles.add(new File(configfile));
}
}
@ -163,12 +168,12 @@ public class FindingsCacheServlet extends HttpServlet {
List<File> removelist = new ArrayList<File>();
for (File f : configfiles) {
if (!f.exists()) {
logger.warn("CVS configuration file '"
log.warn("CVS configuration file '"
+ f.getAbsolutePath()
+ "' is specified, but does not exist. Removing from list.");
removelist.add(f);
} else if (!f.canRead()) {
logger.warn("CVS configuration file '"
log.warn("CVS configuration file '"
+ f.getAbsolutePath()
+ "' does exist, but is not readable. Removing from list.");
removelist.add(f);
@ -198,7 +203,7 @@ public class FindingsCacheServlet extends HttpServlet {
ObjectFactory FACTORY = new ObjectFactory();
FindingsListType findingsList = FACTORY.createFindingsListType();
FindingsCacheServlet.logger.info("Processing '"
FindingsCacheServlet.log.info("Processing '"
+ fileslist.getItems().size() + "' files and directories.");
while (!this.isInterrupted) {
@ -211,7 +216,7 @@ public class FindingsCacheServlet extends HttpServlet {
Object o = iterF.next();
if (this.isInterrupted)
break;
FindingsCacheServlet.logger.debug("Scanning filename '"
FindingsCacheServlet.log.debug("Scanning filename '"
+ i.getFullname() + "' for pattern '"
+ (String) o + "'");
p = Pattern.compile((String) o);
@ -226,17 +231,17 @@ public class FindingsCacheServlet extends HttpServlet {
finding.setData(it.getData());
finding = copyDetails(finding, i);
findingsList.getFindings().add(finding);
FindingsCacheServlet.logger
FindingsCacheServlet.log
.debug("Match found for '"
+ i.getFullname() + "'");
break;
}
FindingsCacheServlet.logger
FindingsCacheServlet.log
.debug("No match found for '" + i.getFullname()
+ "'");
}
}
FindingsCacheServlet.logger
FindingsCacheServlet.log
.debug("Processing file content for '"
+ findingsList.getFindings().size()
+ "' entries in the list.");
@ -252,7 +257,7 @@ public class FindingsCacheServlet extends HttpServlet {
Object o = iter.next();
if (this.isInterrupted)
break;
FindingsCacheServlet.logger
FindingsCacheServlet.log
.debug("Scanning file content for file '"
+ t.getFullname() + "' for pattern '"
+ (String) o + "'");
@ -288,7 +293,7 @@ public class FindingsCacheServlet extends HttpServlet {
fd.getMatchLists().add(gmg);
}
t.getFindingLists().add(fd);
FindingsCacheServlet.logger
FindingsCacheServlet.log
.debug("Found matching content at index '" + s
+ "' in file '" + t.getFullname()
+ "' with pattern '" + p1.toString()
@ -297,7 +302,7 @@ public class FindingsCacheServlet extends HttpServlet {
if (!isFound) {
findingsList.getFindings().remove(t);
FindingsCacheServlet.logger
FindingsCacheServlet.log
.debug("Found matching filename for '"
+ t.getFullname()
+ "' but content didn't match. Removing.");
@ -306,24 +311,24 @@ public class FindingsCacheServlet extends HttpServlet {
try {
instance.getCacheInstance().put(
"FINDINGS-" + t.getROOT(), findingsList);
FindingsCacheServlet.logger
FindingsCacheServlet.log
.info("FINDINGS for CVSROOT '" + t.getROOT()
+ "' have been updated in cache.");
} catch (CacheException e) {
FindingsCacheServlet.logger.error(e.getMessage(), e);
FindingsCacheServlet.log.error(e.getMessage(), e);
}
}
try {
int cacheinterval = configuration.getCacheinterval();
FindingsCacheServlet.logger.debug("Now sleeping for '"
FindingsCacheServlet.log.debug("Now sleeping for '"
+ cacheinterval + "' minutes");
Thread.currentThread();
Thread.sleep(cacheinterval * 60000);
FindingsCacheServlet.logger.debug("Waking up after '"
FindingsCacheServlet.log.debug("Waking up after '"
+ cacheinterval + "' minutes of sleep");
} catch (InterruptedException e) {
this.isInterrupted = true;
FindingsCacheServlet.logger
FindingsCacheServlet.log
.warn("FindingsCacheServlet cache was interrupted. Shutting down.");
}
}
@ -343,4 +348,24 @@ public class FindingsCacheServlet extends HttpServlet {
}
}
/* (non-Javadoc)
* @see javax.servlet.GenericServlet#destroy()
*/
@Override
public void destroy() {
// TODO Auto-generated method stub
executor.shutdown();
try {
executor.awaitTermination(3, TimeUnit.SECONDS);
log.info("Cache Worker Threads have shut down.");
} catch (InterruptedException e) {
log.error("Cache Worker Threads did not terminate within timeout.", e);
}
super.destroy();
}
}

View File

@ -16,32 +16,34 @@
package net.brutex.xservices.util.cache;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import java.io.File;
import java.util.List;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.log4j.Logger;
/**
* @author Brian Rosenberger, bru(at)brutex.de
*
*/
@Slf4j
public class FindingsConfigBean {
private final Logger logger;
private final int instanceid;
private File cvsconfig;
private int cacheinterval = 15;
private List<Object> filepatterns;
private List<Object> contentpatterns;
public FindingsConfigBean(int instanceid, Logger logger) {
public FindingsConfigBean(int instanceid) {
this.instanceid = instanceid;
this.logger = logger;
logger.debug("Initialise FindingsConfigBean instance '"+instanceid+"'");
log.debug("Initialise FindingsConfigBean instance '" + instanceid + "'");
}
/**
@ -52,12 +54,13 @@ public class FindingsConfigBean {
}
/**
* @param cacheinterval the cache interval to set
* @param cacheinterval
* the cache interval to set
*/
public void setCacheinterval(int cacheinterval) {
this.cacheinterval = cacheinterval;
}
/**
* @return the cvsconfig
*/
@ -66,7 +69,8 @@ public class FindingsConfigBean {
}
/**
* @param cvsconfig the cvsconfig to set
* @param cvsconfig
* the cvsconfig to set
*/
public void setCvsconfig(File cvsconfig) {
this.cvsconfig = cvsconfig;
@ -80,7 +84,8 @@ public class FindingsConfigBean {
}
/**
* @param filepatterns the filepatterns to set
* @param filepatterns
* the filepatterns to set
*/
public void setFilepatterns(List<Object> filepatterns) {
this.filepatterns = filepatterns;
@ -94,7 +99,8 @@ public class FindingsConfigBean {
}
/**
* @param contentpatterns the contentpatterns to set
* @param contentpatterns
* the contentpatterns to set
*/
public void setContentpatterns(List<Object> contentpatterns) {
this.contentpatterns = contentpatterns;
@ -103,5 +109,5 @@ public class FindingsConfigBean {
/**
* @param instanceid
*/
}

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