/* * 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 java.util.List; 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 List types; private DOMSource event; public EventInfo(long aTime, String aSource, Id aId, List aTypes, DOMSource aEvent) { time = aTime; source = aSource; id = aId; types = aTypes; event = aEvent; } public long getTime() { return time; } public String getSource() { return source; } public Id getId() { return id; } public List getTypes() { return types; } 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(", types " + types); buf.append(", event " + new XMLDocument(event).print(true)); buf.append(")"); return buf.toString(); } }