org.sapia.ubik.net.mplex
Class SimpleStreamSelector
java.lang.Object
org.sapia.ubik.net.mplex.SimpleStreamSelector
- All Implemented Interfaces:
- StreamSelector
public class SimpleStreamSelector
- extends java.lang.Object
- implements StreamSelector
This basic selector implementation allows you to define a selection logic based on a
simple string value. It can be configures with two types of comparison:
- The type
TYPE_STARTS_WITH will select a stream of data only if it
starts with the string value of this selector.
- The type
TYPE_CONTAINS will select a stream of data only if it
contains the entire string value of this selector.
- Author:
- Jean-Cedric Desrochers
- Copyright:
- Copyright © 2002-2004
Sapia Open Source Software. All Rights Reserved.
- License:
- Read the license.txt file of the jar or visit the
license page
at the Sapia OSS web site
|
Constructor Summary |
SimpleStreamSelector(java.lang.String aValue,
int aType)
Creates a new SimpleStreamSelector instance. |
|
Method Summary |
boolean |
selectStream(byte[] header)
Selects or not a stream by analyzing the header of the stream passed in. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TYPE_STARTS_WITH
public static final byte TYPE_STARTS_WITH
- See Also:
- Constant Field Values
TYPE_CONTAINS
public static final byte TYPE_CONTAINS
- See Also:
- Constant Field Values
SimpleStreamSelector
public SimpleStreamSelector(java.lang.String aValue,
int aType)
- Creates a new SimpleStreamSelector instance.
selectStream
public boolean selectStream(byte[] header)
- Selects or not a stream by analyzing the header of the stream passed in.
- Specified by:
selectStream in interface StreamSelector
- Parameters:
header - The first 64 bytes of the stream.
- Returns:
- True if the header is accepted by this selector, false otherwise.
Copyright © 2010 Sapia OSS. All Rights Reserved.