Rio Project 4.2 API Documentation



org.rioproject.tools.cli
Class ServiceFinder.ServiceFilter

java.lang.Object
  extended by org.rioproject.tools.cli.ServiceFinder.ServiceFilter
All Implemented Interfaces:
ServiceItemFilter
Enclosing class:
ServiceFinder

public class ServiceFinder.ServiceFilter
extends Object
implements ServiceItemFilter

A ServiceItemFilter that filters on host names and attributes


Constructor Summary
ServiceFinder.ServiceFilter(String[] hostNames, Entry[] attrs)
          Create an ServiceFilter
 
Method Summary
 boolean check(ServiceItem item)
          If the input ServiceItem has an ApplianceInfo and the hostname or address matches an array element in the hostNames array, return true
 boolean hostNameMatches(Entry[] attrs)
          Determine if the attribute collecton contains an ApplianceInfo which matches an element in the hostNames array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceFinder.ServiceFilter

public ServiceFinder.ServiceFilter(String[] hostNames,
                                   Entry[] attrs)
Create an ServiceFilter

Parameters:
hostNames - The names of hosts to match
attrs - Additional attributes to filter
Method Detail

check

public boolean check(ServiceItem item)
If the input ServiceItem has an ApplianceInfo and the hostname or address matches an array element in the hostNames array, return true

Specified by:
check in interface ServiceItemFilter
See Also:
ServiceItemFilter.check(net.jini.core.lookup.ServiceItem)

hostNameMatches

public boolean hostNameMatches(Entry[] attrs)
Determine if the attribute collecton contains an ApplianceInfo which matches an element in the hostNames array

Parameters:
attrs - Array of Entry objects
Returns:
If an ApplianceInfo is found in the collection and and the hostname or address matches an array element in the hostNames array, return true, otherwise, return false

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.