X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=listener%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fxmlrouter%2Flistener%2FEventInfo.java;fp=listener%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fxmlrouter%2Flistener%2FEventInfo.java;h=1c4e48ec2cae387c60ba472c0254eb44d88eafd1;hb=3994d4a35e7404908fc17beac75479c1a72fa915;hp=0000000000000000000000000000000000000000;hpb=bf43ef9863e3d5827eac1a4ce0fafafaadd92a08;p=xmlrouter diff --git a/listener/src/main/java/org/wamblee/xmlrouter/listener/EventInfo.java b/listener/src/main/java/org/wamblee/xmlrouter/listener/EventInfo.java new file mode 100644 index 0000000..1c4e48e --- /dev/null +++ b/listener/src/main/java/org/wamblee/xmlrouter/listener/EventInfo.java @@ -0,0 +1,82 @@ +/* + * Copyright 2005-2011 the original author or 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 + * + * 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 org.wamblee.xmlrouter.listener; + +import javax.xml.transform.dom.DOMSource; + +import org.wamblee.xml.XMLDocument; +import org.wamblee.xmlrouter.common.Id; + +/** + * Combines information about the event. + * + * @author Erik Brakkee + * + */ +public class EventInfo { + + private long time; + private String source; + private Id id; + private String type; + private DOMSource event; + + public EventInfo(long aTime, String aSource, Id aId, + String aType, DOMSource aEvent) { + time = aTime; + source = aSource; + id = aId; + type = aType; + event = aEvent; + } + + public long getTime() { + return time; + } + + public String getSource() { + return source; + } + + public Id getId() { + return id; + } + + public String getType() { + return type; + } + + public void setType(String aType) { + type = aType; + } + + public DOMSource getEvent() { + return event; + } + + @Override + public String toString() { + StringBuffer buf = new StringBuffer(); + buf.append("Event("); + buf.append("time " + time); + buf.append(", source " + source); + buf.append(", id " + id); + buf.append(", type " + type); + buf.append(", event " + new XMLDocument(event).print(true)); + buf.append(")"); + return buf.toString(); + } +}