SunTM's XACML Implementation for JavaTM

com.sun.xacml.finder
Class ResourceFinderResult

java.lang.Object
  extended bycom.sun.xacml.finder.ResourceFinderResult

public class ResourceFinderResult
extends Object

This is used to return Resource Ids from the ResourceFinder. Unlike the PolicyFinder, this never returns an empty set, since it will always contain at least the original parent resource. This class will provide two sets of identifiers: those that were successfully resolved and those that had an error.

Since:
1.0

Constructor Summary
ResourceFinderResult()
          Creates an empty result.
ResourceFinderResult(HashMap failures)
          Creates a result containing only Resource Ids that caused errors.
ResourceFinderResult(Set resources)
          Creates a result containing the given Set of resource identifiers.
ResourceFinderResult(Set resources, Map failures)
          Creates a new result containing both successfully resolved Resource Ids and resources that caused errors.
 
Method Summary
 Map getFailures()
          Returns the Map of Resource Ids that caused an error on resolution, which will be empty if no resources caused any error.
 Set getResources()
          Returns the Set of successfully resolved Resource Id AttributeValues, which will be empty if no resources were successfully resolved.
 boolean isEmpty()
          Returns whether or not this result contains any Resource Id listings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceFinderResult

public ResourceFinderResult()
Creates an empty result.


ResourceFinderResult

public ResourceFinderResult(Set resources)
Creates a result containing the given Set of resource identifiers. The Setmust not be null. The new ResourceFinderResult represents a resource retrieval that encountered no errors.

Parameters:
resources - a non-null Set of AttributeValues

ResourceFinderResult

public ResourceFinderResult(HashMap failures)
Creates a result containing only Resource Ids that caused errors. The Map must not be null. The keys in the Map are AttributeValues identifying the resources that could not be resolved, and they map to a Status object explaining the error. The new ResourceFinderResult represents a resource retrieval that did not succeed in finding any resource identifiers.

Parameters:
failures - a non-null Map mapping failed AttributeValue identifiers to their Status

ResourceFinderResult

public ResourceFinderResult(Set resources,
                            Map failures)
Creates a new result containing both successfully resolved Resource Ids and resources that caused errors.

Parameters:
resources - a non-null Set of AttributeValues
failures - a non-null Map mapping failed AttributeValue identifiers to their Status
Method Detail

isEmpty

public boolean isEmpty()
Returns whether or not this result contains any Resource Id listings. This will return false if either the set of successfully resolved resource identifiers or the map of failed resources is not empty.

Returns:
false if this result names any resources, otherwise true

getResources

public Set getResources()
Returns the Set of successfully resolved Resource Id AttributeValues, which will be empty if no resources were successfully resolved.

Returns:
a Set of AttributeValues

getFailures

public Map getFailures()
Returns the Map of Resource Ids that caused an error on resolution, which will be empty if no resources caused any error.

Returns:
a Map of AttributeValues to Status

Sun's XACML Implementation Version 1.2

Copyright 2003-2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.