diff --git a/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketExtensionFilter.java b/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketExtensionFilter.java deleted file mode 100644 index 8b0f40cd5..000000000 --- a/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketExtensionFilter.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * - * Copyright 2003-2007 Jive Software. - * - * 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.jivesoftware.smack.filter; - -import org.jivesoftware.smack.packet.ExtensionElement; -import org.jivesoftware.smack.packet.Stanza; -import org.jivesoftware.smack.util.StringUtils; - -/** - * Filters for packets with a particular type of stanza extension. - * - * @author Matt Tucker - * @deprecated use {@link StanzaExtensionFilter} instead. - */ -@Deprecated -public class PacketExtensionFilter implements StanzaFilter { - - private final String elementName; - private final String namespace; - - /** - * Creates a new stanza extension filter. Packets will pass the filter if - * they have a stanza extension that matches the specified element name - * and namespace. - * - * @param elementName the XML element name of the stanza extension. - * @param namespace the XML namespace of the stanza extension. - */ - public PacketExtensionFilter(String elementName, String namespace) { - StringUtils.requireNotNullNorEmpty(namespace, "namespace must not be null nor empty"); - - this.elementName = elementName; - this.namespace = namespace; - } - - /** - * Creates a new stanza extension filter. Packets will pass the filter if they have a packet - * extension that matches the specified namespace. - * - * @param namespace the XML namespace of the stanza extension. - */ - public PacketExtensionFilter(String namespace) { - this(null, namespace); - } - - /** - * Creates a new stanza extension filter for the given stanza extension. - * - * @param packetExtension TODO javadoc me please - */ - public PacketExtensionFilter(ExtensionElement packetExtension) { - this(packetExtension.getElementName(), packetExtension.getNamespace()); - } - - @Override - public boolean accept(Stanza packet) { - return packet.hasExtension(elementName, namespace); - } - - @Override - public String toString() { - return getClass().getSimpleName() + ": element=" + elementName + " namespace=" + namespace; - } -} diff --git a/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketFilter.java b/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketFilter.java deleted file mode 100644 index 10f9b834f..000000000 --- a/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketFilter.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2003-2007 Jive Software. - * - * 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.jivesoftware.smack.filter; - -/** - * Defines a way to filter packets for particular attributes. Stanza filters are used when - * constructing stanza listeners or collectors -- the filter defines what packets match the criteria - * of the collector or listener for further stanza processing. - *
- * Several simple filters are pre-defined. These filters can be logically combined for more complex - * stanza filtering by using the {@link org.jivesoftware.smack.filter.AndFilter AndFilter} and - * {@link org.jivesoftware.smack.filter.OrFilter OrFilter} filters. It's also possible to define - * your own filters by implementing this interface. The code example below creates a trivial filter - * for packets with a specific ID (real code should use {@link StanzaIdFilter} instead). - * - *
- * // Use an anonymous inner class to define a stanza filter that returns - * // all packets that have a stanza ID of "RS145". - * PacketFilter myFilter = new PacketFilter() { - * public boolean accept(Packet packet) { - * return "RS145".equals(packet.getStanzaId()); - * } - * }; - * // Create a new stanza collector using the filter we created. - * StanzaCollector myCollector = packetReader.createStanzaCollector(myFilter); - *- * - * @see org.jivesoftware.smack.StanzaCollector - * @see org.jivesoftware.smack.StanzaListener - * @author Matt Tucker - * @deprecated use {@link StanzaFilter} - */ -@Deprecated -public interface PacketFilter extends StanzaFilter { - -} diff --git a/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketIDFilter.java b/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketIDFilter.java deleted file mode 100644 index 643f3f3fe..000000000 --- a/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketIDFilter.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * - * Copyright 2003-2007 Jive Software. - * - * 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.jivesoftware.smack.filter; - -import org.jivesoftware.smack.packet.Stanza; -import org.jivesoftware.smack.util.StringUtils; - -/** - * Filters for packets with a particular stanza ID. - * - * @author Matt Tucker - * @deprecated use {@link StanzaIdFilter} instead. - */ -@Deprecated -public class PacketIDFilter implements StanzaFilter { - - private final String packetID; - - /** - * Creates a new stanza ID filter using the specified packet's ID. - * - * @param packet the stanza which the ID is taken from. - * @deprecated use {@link StanzaIdFilter#StanzaIdFilter(Stanza)} instead. - */ - @Deprecated - public PacketIDFilter(Stanza packet) { - this(packet.getStanzaId()); - } - - /** - * Creates a new stanza ID filter using the specified stanza ID. - * - * @param packetID the stanza ID to filter for. - * @deprecated use {@link StanzaIdFilter#StanzaIdFilter(Stanza)} instead. - */ - @Deprecated - public PacketIDFilter(String packetID) { - StringUtils.requireNotNullNorEmpty(packetID, "Packet ID must not be null nor empty."); - this.packetID = packetID; - } - - @Override - public boolean accept(Stanza packet) { - return packetID.equals(packet.getStanzaId()); - } - - @Override - public String toString() { - return getClass().getSimpleName() + ": id=" + packetID; - } -} diff --git a/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketTypeFilter.java b/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketTypeFilter.java deleted file mode 100644 index 37d37a49c..000000000 --- a/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketTypeFilter.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * - * Copyright 2003-2007 Jive Software. - * - * 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.jivesoftware.smack.filter; - -import org.jivesoftware.smack.packet.Message; -import org.jivesoftware.smack.packet.Presence; -import org.jivesoftware.smack.packet.Stanza; - -/** - * Filters for packets of a particular type. The type is given as a Class object, so - * example types would: - *
Message.class
- * IQ.class
- * Presence.class
- * packetType
.
- *
- * @param packetType the Class type.
- */
- public PacketTypeFilter(Class extends Stanza> packetType) {
- this.packetType = packetType;
- }
-
- @Override
- public boolean accept(Stanza packet) {
- return packetType.isInstance(packet);
- }
-
- @Override
- public String toString() {
- return getClass().getSimpleName() + ": " + packetType.getName();
- }
-}