com.sun.sgs.impl.util
Class BoundNamesUtil

java.lang.Object
  extended by com.sun.sgs.impl.util.BoundNamesUtil

public final class BoundNamesUtil
extends Object

A utility class for obtaining an iterator for a set of bound names (matching a prefix) in a data service.


Method Summary
static Iterable<String> getServiceBoundNamesIterable(DataService dataService, String prefix)
          Returns an Iterable that can be used to obtain an Iterator for the set of service bound names matching the specified prefix in the specified dataService.
static Iterator<String> getServiceBoundNamesIterator(DataService dataService, String prefix)
          Returns an Iterator for the set of service bound names matching the specified prefix in the specified dataService.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getServiceBoundNamesIterable

public static Iterable<String> getServiceBoundNamesIterable(DataService dataService,
                                                            String prefix)
Returns an Iterable that can be used to obtain an Iterator for the set of service bound names matching the specified prefix in the specified dataService. Only names starting with the specified prefix and containing additional characters after the prefix will be returned. The returned Iterable is not serializable.

The iterator method of the returned Iterable returns the result of invoking getServiceBoundNamesIterator with the specified dataService and prefix.

Parameters:
dataService - a data service
prefix - the prefix of service bound names
Returns:
an Iterable for the set of service bound names matching the prefix
See Also:
getServiceBoundNamesIterator(com.sun.sgs.service.DataService, java.lang.String)

getServiceBoundNamesIterator

public static Iterator<String> getServiceBoundNamesIterator(DataService dataService,
                                                            String prefix)
Returns an Iterator for the set of service bound names matching the specified prefix in the specified dataService. Only names starting with the specified prefix and containing additional characters after the prefix will be returned. The returned Iterator is not serializable.

The remove method of the returned iterator removes the binding of the last name returned by next by invoking removeServiceBinding on the given dataService passing the name.

Note: the remove method does not remove from the data store the ManagedObject bound to the name. If the ManagedObject needs to be removed, that object should be removed by invoking the dataService's removeObject method passing the ManagedObject bound to the name.

Parameters:
dataService - a data service
prefix - the prefix of service bound names
Returns:
an Iterator for the set of service bound names matching the prefix

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved