org.qtunes.auth
Class SessionMatcher
java.lang.Object
   org.qtunes.core.util.AbstractMatcher<Session>
org.qtunes.core.util.AbstractMatcher<Session>
       org.qtunes.auth.SessionMatcher
org.qtunes.auth.SessionMatcher
- All Implemented Interfaces: 
- java.io.Serializable
- public class SessionMatcher 
- extends AbstractMatcher<Session>
A AbstractMatcher which can be used to match a Session object.
 Tests include
 
 | service | the name of the service that created this Session | 
|---|
 | ttl | the number of seconds until this Service expires | 
|---|
 | age | the number of seconds since this Service was created | 
|---|
 | idle | the number of seconds this Service has been idle | 
|---|
 | traffic | the number of bytes this Session has transmitted | 
|---|
 | tracksStarted | the number of tracks this Session has started | 
|---|
 | tracksCompleted | the number of tracks this Session has completed | 
|---|
 | ip | if appropriate, the IP address of the session. This can be tested as ip="192.168.1.2", ip="192.168.0.0/16", ip="*.local" or a regular expression match | 
|---|
 
 or any property specified in the Session properties. So as an example,
 service="AppleServer" and (remote="Mike's Remote" or ip="10.0.0.16") could
 be used to scrobble tracks played by a certain remote or streamed to a certain host.
- See Also:
- Serialized Form
 
| Method Summary | 
|  java.lang.Object | getProperty(Session session,
            java.lang.String property)Return the specified Property from the source object being tested
 | 
|  boolean | test(java.lang.String key,
     java.lang.String op,
     java.lang.String testval,
     java.lang.Object propval)Compare two values
 | 
 
 
| Methods inherited from class java.lang.Object | 
| clone, finalize, getClass, notify, notifyAll, wait, wait, wait | 
 
SessionMatcher
public SessionMatcher(java.lang.String filter)
getProperty
public java.lang.Object getProperty(Session session,
                                    java.lang.String property)
- Description copied from class: AbstractMatcher
- Return the specified Property from the source object being tested
 
- 
- Specified by:
- getPropertyin class- AbstractMatcher<Session>
 
- 
 
test
public boolean test(java.lang.String key,
                    java.lang.String op,
                    java.lang.String testval,
                    java.lang.Object propval)
- Description copied from class: AbstractMatcher
- Compare two values
 
- 
- Overrides:
- testin class- AbstractMatcher<Session>
 
- 
- Parameters:
- key- the key the values are stored under
- op- the operation, one of "=", "!=", "<", ">", "<=", ">=", "=~" or "!~"
- testval- the value specified in the test
- propval- the property value that we're testing, as returned from- AbstractMatcher.getProperty(E, java.lang.String)