Subversion Repositories XServices

Compare Revisions

No changes between revisions

Ignore whitespace Rev 200 → Rev 201

/xservices/trunk/src/main/java/net/brutex/xservices/types/alfevent/ALFEventBase_1.xsd
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>
/xservices/trunk/src/main/java/net/brutex/xservices/types/alfevent/ALFEventManagerSOAP.xsd
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.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>
/xservices/trunk/src/main/java/net/brutex/xservices/types/alfevent/ALFEventResponseType.java
0,0 → 1,62
 
package net.brutex.xservices.types.alfevent;
 
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlType;
 
 
/**
* <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 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 Object any;
 
/**
* Ruft den Wert der any-Eigenschaft ab.
*
* @return
* possible object is
* {@link Object }
*
*/
public Object getAny() {
return any;
}
 
/**
* Legt den Wert der any-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link Object }
*
*/
public void setAny(Object value) {
this.any = value;
}
 
}
/xservices/trunk/src/main/java/net/brutex/xservices/types/alfevent/ALFEventType.java
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 Object }
* {@link Element }
*
*
*/
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;
}
 
}
/xservices/trunk/src/main/java/net/brutex/xservices/types/alfevent/ALFEventWithReplyResponseType.java
0,0 → 1,62
 
package net.brutex.xservices.types.alfevent;
 
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlType;
 
 
/**
* <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 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 Object any;
 
/**
* Ruft den Wert der any-Eigenschaft ab.
*
* @return
* possible object is
* {@link Object }
*
*/
public Object getAny() {
return any;
}
 
/**
* Legt den Wert der any-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link Object }
*
*/
public void setAny(Object value) {
this.any = value;
}
 
}
/xservices/trunk/src/main/java/net/brutex/xservices/types/alfevent/BaseExtensionType.java
0,0 → 1,99
 
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;
 
 
/**
*
* 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 namespace='targetnamespace' 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 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;
}
 
}
/xservices/trunk/src/main/java/net/brutex/xservices/types/alfevent/CredentialsType.java
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;
 
 
/**
*
* 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;any processContents='lax' 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 = {
"any"
})
public class CredentialsType {
 
@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 Object }
* {@link Element }
*
*
*/
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;
}
 
}
/xservices/trunk/src/main/java/net/brutex/xservices/types/alfevent/CustomExtensionType.java
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 custom Event payload "extensions"
*
*
* <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' namespace='##other' 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 Object }
* {@link Element }
*
*
*/
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;
}
 
}
/xservices/trunk/src/main/java/net/brutex/xservices/types/alfevent/DetailExtensionType.java
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 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 Object }
* {@link Element }
*
*
*/
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;
}
 
}
/xservices/trunk/src/main/java/net/brutex/xservices/types/alfevent/EmBaseType.java
0,0 → 1,370
 
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.w3.org/2001/XMLSchema}string"/>
* &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="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",
"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 = "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 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;
}
 
}
/xservices/trunk/src/main/java/net/brutex/xservices/types/alfevent/EmExtensionType.java
0,0 → 1,98
 
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;
 
 
/**
*
* 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 namespace='targetnamespace' 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 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;
}
 
}
/xservices/trunk/src/main/java/net/brutex/xservices/types/alfevent/EventBaseType.java
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}EventIdType"/>
* &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)
@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;
}
 
}
/xservices/trunk/src/main/java/net/brutex/xservices/types/alfevent/ObjectFactory.java
0,0 → 1,133
 
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 _EventNotice_QNAME = new QName("http://www.eclipse.org/alf/schema/EventBase/1", "EventNotice");
 
/**
* 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 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 JAXBElement }{@code <}{@link ALFEventType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.eclipse.org/alf/schema/EventBase/1", name = "EventNotice")
public JAXBElement<ALFEventType> createEventNotice(ALFEventType value) {
return new JAXBElement<ALFEventType>(_EventNotice_QNAME, ALFEventType.class, null, value);
}
 
}
/xservices/trunk/src/main/java/net/brutex/xservices/types/alfevent/SourceType.java
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;
}
 
}
/xservices/trunk/src/main/java/net/brutex/xservices/util/EventEmitter.java
0,0 → 1,180
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
*/
 
Connection con = null;
Connection fcon = null;
try {
con = pool.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
 
 
fcon = fpool.getConnection();
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.getCharacterStream()));
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);
} finally {
try {
if(fcon!=null) fcon.close();
if(con!=null) con.close();
} catch (SQLException e) {
log.error("Error closing the database connections: {}", 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.");
}
}
/xservices/trunk/src/main/java/net/brutex/xservices/util/EventmanagerConfiguration.java
0,0 → 1,68
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.ex.ConfigurationException;
 
import javax.servlet.ServletContext;
 
/**
* 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;
 
 
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;");
 
 
} catch (ConfigurationException e) {
log.error("Error loading configuration for event manager in XServices MiscServices: {}", e.getMessage());
throw new RuntimeException(e);
}
return this;
}
 
 
}
/xservices/trunk/src/main/java/net/brutex/xservices/util/MiscServiceServletContextListener.java
0,0 → 1,192
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.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(16);
p.setLoginTimeout(5);
try {
Connection c = p.getConnection();
Statement s = c.createStatement();
s.execute(dbinit);
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");
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.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 LINK UNION SELECT " + "btx_event_type, btx_id, btx_obj_type, btx_obj_id, btx_timestamp, btx_event from LINK2;";
s.execute(insert);
int count = s.getUpdateCount();
log.info("Persisted {} rows 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 = "CREATE LINKED TABLE IF NOT EXISTS LINK('org.h2.Driver', '"+configuration.getJdbc_memdb()+"', '', '', 'brutex.tbl_events'); " +
"CREATE LINKED TABLE IF NOT EXISTS LINK2('org.h2.Driver', '"+configuration.getJdbc_memdb()+"', '', '', 'brutex.tbl_events_snap');";
final String recoverSQL = "INSERT INTO LINK 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
startEmitterImmediate(egres, (Scheduler) context.getAttribute("scheduler"));
}
 
private synchronized void startEmitterImmediate(AtomicLong egres_counter, 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_counter);
job2.getJobDataMap().put(EventmanagerConfiguration.KEY, EventmanagerConfiguration.getInstance());
SimpleTrigger t = (SimpleTrigger) newTrigger().withIdentity("ALFEmitter").startNow().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 readConfiguration(ServletContext ctx) {
/* Configure ServletContext attributes using configuration object*/
EventmanagerConfiguration c = EventmanagerConfiguration.getInstance().refreshConfig();
ctx.setAttribute(EventmanagerConfiguration.KEY, c);
}
 
}
/xservices/trunk/src/main/java/net/brutex/xservices/util/SimpleSoap.java
0,0 → 1,117
/*
* 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 java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
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();
EntityBuilder entitybuilder = EntityBuilder.create();
entitybuilder.setContentEncoding("UTF-8");
entitybuilder.setText(soapBody);
HttpEntity entity = entitybuilder.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);
}
}
Property changes:
Added: svn:mime-type
+text/plain
\ No newline at end of property
/xservices/trunk/src/main/java/net/brutex/xservices/ws/impl/MiscServiceImpl.java
16,6 → 16,7
 
package net.brutex.xservices.ws.impl;
 
import lombok.extern.slf4j.Slf4j;
import net.brutex.xservices.types.*;
import net.brutex.xservices.types.alfevent.ALFEventResponseType;
import net.brutex.xservices.types.alfevent.ALFEventType;
22,6 → 23,7
import net.brutex.xservices.types.alfevent.ObjectFactory;
import net.brutex.xservices.types.ant.FileSetResource;
import net.brutex.xservices.util.EventEmitter;
import net.brutex.xservices.util.EventmanagerConfiguration;
import net.brutex.xservices.util.RunTask;
import net.brutex.xservices.ws.MiscService;
import net.brutex.xservices.ws.XServicesFault;
46,11 → 48,11
import java.math.BigInteger;
import java.sql.*;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Date;
import java.util.Enumeration;
import java.util.Properties;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicLong;
 
import static org.quartz.TriggerBuilder.newTrigger;
 
60,6 → 62,7
*
* @author Brian Rosenberger, bru@brutex.de
*/
@Slf4j
@WebService(targetNamespace="http://ws.xservices.brutex.net", endpointInterface="net.brutex.xservices.ws.MiscService", serviceName="MiscService")
public class MiscServiceImpl
implements MiscService {
66,24 → 69,6
 
@Resource
private WebServiceContext context;
 
// Grab the Scheduler instance from the Factory
private final Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
private final static String conStr = "jdbc:h2:mem:lockdb;DB_CLOSE_DELAY=-1;";
 
private final static String dbinit = "" +
"CREATE SCHEMA IF NOT EXISTS brutex;" +
"CREATE TABLE IF NOT EXISTS brutex.tbl_events (" +
"btx_event_type VARCHAR(128) NOT NULL," +
"btx_id VARCHAR(32) NOT NULL, " +
"btx_obj_type VARCHAR(32) NOT NULL, " +
"btx_obj_id VARCHAR(32) NOT NULL, " +
"btx_timestamp BIGINT NOT NULL," +
"btx_event CLOB" +
");" +
"CREATE INDEX IF NOT EXISTS brutex.btx_idx ON brutex.tbl_events (btx_obj_id, btx_obj_type, btx_event_type);" +
"CREATE INDEX IF NOT EXISTS brutex.IDX_TO_DESC ON brutex.tbl_events (btx_timestamp ASC);";
 
public MiscServiceImpl() throws SchedulerException {
}
 
241,11 → 226,21
public ALFEventResponseType mergeALFEvent(ALFEventType event) throws XServicesFault {
final Instant d = Instant.now();
final long ts = d.toEpochMilli();
//System.out.println("Step 1: " + ChronoUnit.MILLIS.between(Instant.now(), d));
 
//Get Parameters from the Servlet Context
final ServletContext servletContext =
(ServletContext) context.getMessageContext().get(MessageContext.SERVLET_CONTEXT);
final JdbcConnectionPool pool = (JdbcConnectionPool) servletContext.getAttribute("dbConnection");
final EventmanagerConfiguration conf = (EventmanagerConfiguration) servletContext
.getAttribute(EventmanagerConfiguration.KEY);
 
final JdbcConnectionPool pool = (JdbcConnectionPool) servletContext.getAttribute("mdbConnection");
final JdbcConnectionPool fpool = (JdbcConnectionPool) servletContext.getAttribute("fdbConnection");
final AtomicLong egres_counter = (AtomicLong) servletContext.getAttribute("egres_counter");
final AtomicLong ingres_counter = (AtomicLong) servletContext.getAttribute("ingres_counter");
final Scheduler scheduler = (Scheduler) servletContext.getAttribute("scheduler");
 
log.trace("Read dbConnection from servlet context: {}", pool);
 
//System.out.println("Step 2: " + ChronoUnit.MILLIS.between(Instant.now(), d));
final ObjectFactory of = new ObjectFactory();
 
253,16 → 248,15
final String eventId = event.getBase().getEventId();
final String objectType = event.getBase().getObjectType();
final String eventType = event.getBase().getEventType();
log.debug("Event id '{}', type '{}' received for object '{}' with object_id '{}'.",
eventId, eventType, objectType, objectId);
 
final String mergeStatememt = "MERGE INTO brutex.tbl_events " +
"KEY (btx_event_type, btx_obj_type, btx_obj_id) " +
"VALUES (?,?,?,?,?,?) " +
"";
"VALUES (?,?,?,?,?,?);";
 
long rows = 0L;
//System.out.println("Step 3: " + ChronoUnit.MILLIS.between(Instant.now(), d));
 
try {
//System.out.println("Step 4: " + ChronoUnit.MILLIS.between(Instant.now(), d));
Marshaller m = JAXBContext.newInstance(ALFEventType.class).createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
m.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
270,7 → 264,8
StringWriter sw = new StringWriter();
m.marshal(e, sw);
StringBuilder sb = new StringBuilder();
sb.append(" <soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://www.eclipse.org/alf/schema/EventBase/1\">\n");
sb.append(" <soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
"xmlns:ns=\"http://www.eclipse.org/alf/schema/EventBase/1\">\n");
sb.append("<soapenv:Body>\n");
sb.append("<ns:EventNotice>\n");
sb.append(sw);
277,9 → 272,8
sb.append("</ns:EventNotice>\n");
sb.append("</soapenv:Body>");
sb.append("</soapenv:Envelope>");
//System.out.println("Step 5: " + ChronoUnit.MILLIS.between(Instant.now(), d));
 
Connection con = pool.getConnection();
//System.out.println("Step 6: " + ChronoUnit.MILLIS.between(Instant.now(), d));
PreparedStatement prep = con.prepareStatement(mergeStatememt);
prep.setString(1, eventType);
prep.setString(2, eventId);
287,41 → 281,35
prep.setString(4, objectId);
prep.setLong(5, ts);
prep.setClob(6, new StringReader(sb.toString()));
//prep.setLong(7, ts-20000);
//System.out.println("Step 7 SQL START: " + ChronoUnit.MILLIS.between(Instant.now(), d));
prep.execute();
con.commit();
con.close();
//System.out.println("Step 8 SQL END: " + ChronoUnit.MILLIS.between(Instant.now(), d));
//SimpleSoap ss = new SimpleSoap("http://localhost:8099/ALFEventManager/services/ALFEventManagerSOAP", sb.toString());
//ss.sendSoap(false);
 
ingres_counter.incrementAndGet();
 
// and start it off
 
if (!scheduler.isStarted())
scheduler.start();
if (scheduler.isInStandbyMode())
scheduler.resumeAll();
//System.out.println("Step 9: " + ChronoUnit.MILLIS.between(Instant.now(), d));
synchronized (scheduler) {
if (!scheduler.checkExists(JobKey.jobKey("ALFEmitter"))) {
JobDetail job2 = JobBuilder.newJob(EventEmitter.class)
.withIdentity("ALFEmitter").build();
//job2.getJobDataMap().put("script", job.getScript());
//job2.getJobDataMap().put("description", job.getDescription());
//job2.getJobDataMap().put("date", job.getDate());
.withIdentity("ALFEmitter")
.build();
job2.getJobDataMap().put("mdbConnection", pool);
job2.getJobDataMap().put("fdbConnection", fpool);
job2.getJobDataMap().put("run_key", ts);
job2.getJobDataMap().put("egres_counter", egres_counter);
job2.getJobDataMap().put("ingres_counter", ingres_counter);
 
job2.getJobDataMap().put(EventmanagerConfiguration.KEY, conf);
 
SimpleTrigger t = (SimpleTrigger) newTrigger()
.withIdentity("ALFEmitter").startAt(Date.from(d.plusSeconds(20)))
.withIdentity("ALFEmitter").startAt(Date.from(d.plusSeconds(conf.getInterval())))
.build();
 
scheduler.scheduleJob(job2, t);
}
}
}
//System.out.println("Step 10: " + ChronoUnit.MILLIS.between(Instant.now(), d));
} catch (JAXBException | SQLException | SchedulerException e) {
throw new XServicesFault(e);
log.error(e.getMessage());
throw new XServicesFault(e);
}
return of.createALFEventResponseType();
}