Author: alessio.soldano(a)jboss.com
Date: 2007-12-18 08:50:19 -0500 (Tue, 18 Dec 2007)
New Revision: 5345
Added:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java
Modified:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java
Log:
New record filters and minor changes
Added:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java
(rev 0)
+++
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java 2007-12-18
13:50:19 UTC (rev 5345)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wsf.framework.management.recording;
+
+//$Id$
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * A simple record filter acting like the AND operator
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 18-Dec-2007
+ *
+ */
+public class AndFilter implements RecordFilter
+{
+
+ private RecordFilter filter1;
+ private RecordFilter filter2;
+
+ public AndFilter(RecordFilter filter1, RecordFilter filter2)
+ {
+ this.filter1 = filter1;
+ this.filter2 = filter2;
+ }
+
+ public boolean match(Record record)
+ {
+ return filter1.match(record) && filter2.match(record);
+ }
+
+ public RecordFilter getFilter1()
+ {
+ return filter1;
+ }
+
+ public RecordFilter getFilter2()
+ {
+ return filter2;
+ }
+
+}
Property changes on:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java 2007-12-18
12:43:22 UTC (rev 5344)
+++
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java 2007-12-18
13:50:19 UTC (rev 5345)
@@ -31,7 +31,7 @@
import org.jboss.wsf.spi.management.recording.RecordFilter;
/**
- * This filter matches record having the source/destination host equal to
+ * This filter matches records having the source/destination host equal to
* any of the provided hosts.
*
* @author alessio.soldano(a)jboss.com
@@ -65,4 +65,14 @@
}
return false;
}
+
+ public List<String> getHosts()
+ {
+ return hosts;
+ }
+
+ public boolean isSource()
+ {
+ return source;
+ }
}
Modified:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java 2007-12-18
12:43:22 UTC (rev 5344)
+++
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java 2007-12-18
13:50:19 UTC (rev 5345)
@@ -49,7 +49,7 @@
if (record.getMessageType() == MessageType.INBOUND)
{
sb.append("INBOUND MESSAGE ");
- if (this.isProcessSourceHost())
+ if (this.isProcessSourceHost() && record.getSourceHost() != null)
{
sb.append("from ");
sb.append(record.getSourceHost());
@@ -58,7 +58,7 @@
else if (record.getMessageType() == MessageType.OUTBOUND)
{
sb.append("OUTBOUND MESSAGE ");
- if (this.isProcessDestinationHost())
+ if (this.isProcessDestinationHost() && record.getDestinationHost() !=
null)
{
sb.append("to ");
sb.append(record.getDestinationHost());
@@ -67,12 +67,12 @@
else
{
log.warn("Unknown message type: " + record.getMessageType());
- if (this.isProcessSourceHost())
+ if (this.isProcessSourceHost() && record.getSourceHost() != null)
{
sb.append("from ");
sb.append(record.getSourceHost());
}
- if (this.isProcessDestinationHost())
+ if (this.isProcessDestinationHost() && record.getDestinationHost() !=
null)
{
sb.append("to ");
sb.append(record.getDestinationHost());
Added:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java
(rev 0)
+++
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java 2007-12-18
13:50:19 UTC (rev 5345)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wsf.framework.management.recording;
+
+//$Id$
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * A simple record filter acting like the negation operator
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 18-Dec-2007
+ *
+ */
+public class NotFilter implements RecordFilter
+{
+
+ private RecordFilter filter;
+
+ public NotFilter(RecordFilter filter)
+ {
+ this.filter = filter;
+ }
+
+ public boolean match(Record record)
+ {
+ return !filter.match(record);
+ }
+
+ public RecordFilter getFilter()
+ {
+ return filter;
+ }
+
+}
Property changes on:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java 2007-12-18
12:43:22 UTC (rev 5344)
+++
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java 2007-12-18
13:50:19 UTC (rev 5345)
@@ -29,7 +29,7 @@
import org.jboss.wsf.spi.management.recording.RecordFilter;
/**
- * This filter matches record having a given operation QName value.
+ * This filter matches records having a given operation QName value.
*
* @author alessio.soldano(a)jboss.com
* @since 11-Dec-2007
@@ -67,4 +67,9 @@
}
}
+ public QName getOperation()
+ {
+ return operation;
+ }
+
}
Added:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java
(rev 0)
+++
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java 2007-12-18
13:50:19 UTC (rev 5345)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wsf.framework.management.recording;
+
+//$Id$
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * A simple record filter acting like the OR operator
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 18-Dec-2007
+ *
+ */
+public class OrFilter implements RecordFilter
+{
+
+ private RecordFilter filter1;
+ private RecordFilter filter2;
+
+ public OrFilter(RecordFilter filter1, RecordFilter filter2)
+ {
+ this.filter1 = filter1;
+ this.filter2 = filter2;
+ }
+
+ public boolean match(Record record)
+ {
+ return filter1.match(record) || filter2.match(record);
+ }
+
+ public RecordFilter getFilter1()
+ {
+ return filter1;
+ }
+
+ public RecordFilter getFilter2()
+ {
+ return filter2;
+ }
+
+}
Property changes on:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java
===================================================================
---
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java 2007-12-18
12:43:22 UTC (rev 5344)
+++
framework/branches/asoldano/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java 2007-12-18
13:50:19 UTC (rev 5345)
@@ -49,6 +49,10 @@
private Date date;
private String envelope;
+ RecordImpl()
+ {
+
+ }
public void addHeaders(String key, List<String> value)
{