Added dependency support to DataConnectors
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / aa / attrresolv / AttributeResolver.java
1 /* 
2  * The Shibboleth License, Version 1. 
3  * Copyright (c) 2002 
4  * University Corporation for Advanced Internet Development, Inc. 
5  * All rights reserved
6  * 
7  * 
8  * Redistribution and use in source and binary forms, with or without 
9  * modification, are permitted provided that the following conditions are met:
10  * 
11  * Redistributions of source code must retain the above copyright notice, this 
12  * list of conditions and the following disclaimer.
13  * 
14  * Redistributions in binary form must reproduce the above copyright notice, 
15  * this list of conditions and the following disclaimer in the documentation 
16  * and/or other materials provided with the distribution, if any, must include 
17  * the following acknowledgment: "This product includes software developed by 
18  * the University Corporation for Advanced Internet Development 
19  * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement 
20  * may appear in the software itself, if and wherever such third-party 
21  * acknowledgments normally appear.
22  * 
23  * Neither the name of Shibboleth nor the names of its contributors, nor 
24  * Internet2, nor the University Corporation for Advanced Internet Development, 
25  * Inc., nor UCAID may be used to endorse or promote products derived from this 
26  * software without specific prior written permission. For written permission, 
27  * please contact shibboleth@shibboleth.org
28  * 
29  * Products derived from this software may not be called Shibboleth, Internet2, 
30  * UCAID, or the University Corporation for Advanced Internet Development, nor 
31  * may Shibboleth appear in their name, without prior written permission of the 
32  * University Corporation for Advanced Internet Development.
33  * 
34  * 
35  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
36  * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
37  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
38  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK 
39  * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. 
40  * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY 
41  * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT, 
42  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
43  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
44  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
45  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
46  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
47  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48  */
49
50 package edu.internet2.middleware.shibboleth.aa.attrresolv;
51
52 import java.io.IOException;
53 import java.security.Principal;
54 import java.util.ArrayList;
55 import java.util.Arrays;
56 import java.util.HashMap;
57 import java.util.HashSet;
58 import java.util.Iterator;
59 import java.util.List;
60 import java.util.Map;
61 import java.util.Properties;
62 import java.util.Set;
63
64 import javax.naming.directory.Attributes;
65
66 import org.apache.log4j.Logger;
67 import org.apache.xerces.parsers.DOMParser;
68 import org.w3c.dom.Document;
69 import org.w3c.dom.Element;
70 import org.w3c.dom.Node;
71 import org.w3c.dom.NodeList;
72 import org.xml.sax.EntityResolver;
73 import org.xml.sax.ErrorHandler;
74 import org.xml.sax.InputSource;
75 import org.xml.sax.SAXException;
76 import org.xml.sax.SAXParseException;
77
78 import edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttributeSet.ResolverAttributeIterator;
79 import edu.internet2.middleware.shibboleth.aa.attrresolv.provider.ValueHandler;
80 import edu.internet2.middleware.shibboleth.common.ShibResource;
81 import edu.internet2.middleware.shibboleth.common.ShibResource.ResourceNotAvailableException;
82
83 /**
84  * An engine for obtaining attribute values for specified principals.  Attributes values are
85  * resolved using a directed graph of pluggable attribute definitions and data connectors.
86  *   
87  * @author Walter Hoehn (wassa@columbia.edu)
88  *
89  */
90
91 public class AttributeResolver {
92
93         private static Logger log = Logger.getLogger(AttributeResolver.class.getName());
94         private HashMap plugIns = new HashMap();
95         private ResolverCache resolverCache = new ResolverCache();
96         public static final String resolverNamespace = "urn:mace:shibboleth:resolver:1.0";
97
98         public AttributeResolver(Properties properties) throws AttributeResolverException {
99                 if (properties
100                         .getProperty("edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeResolver.ResolverConfig")
101                         == null) {
102                         log.error("No Attribute Resolver configuration file specified.");
103                         throw new AttributeResolverException("No Attribute Resolver configuration file specified.");
104                 }
105
106                 String configFile =
107                         properties.getProperty(
108                                 "edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeResolver.ResolverConfig");
109
110                 try {
111                         ShibResource config = new ShibResource(configFile, this.getClass());
112                         DOMParser parser = new DOMParser();
113                         parser.setFeature("http://xml.org/sax/features/validation", true);
114                         parser.setFeature("http://apache.org/xml/features/validation/schema", true);
115                         parser.setEntityResolver(new EntityResolver() {
116                                 public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
117                                         if (systemId.endsWith("shibboleth-resolver-1.0.xsd")) {
118                                                 try {
119                                                         return new InputSource(
120                                                                 new ShibResource("/schemas/shibboleth-resolver-1.0.xsd", this.getClass())
121                                                                         .getInputStream());
122                                                 } catch (IOException e) {
123                                                         throw new SAXException("Could not load entity: " + e);
124                                                 }
125                                         } else {
126                                                 return null;
127                                         }
128                                 }
129                         });
130
131                         parser.setErrorHandler(new ErrorHandler() {
132                                 public void error(SAXParseException arg0) throws SAXException {
133                                         throw new SAXException("Error parsing xml file: " + arg0);
134                                 }
135                                 public void fatalError(SAXParseException arg0) throws SAXException {
136                                         throw new SAXException("Error parsing xml file: " + arg0);
137                                 }
138                                 public void warning(SAXParseException arg0) throws SAXException {
139                                         throw new SAXException("Error parsing xml file: " + arg0);
140                                 }
141                         });
142                         parser.parse(new InputSource(config.getInputStream()));
143                         loadConfig(parser.getDocument());
144
145                 } catch (ResourceNotAvailableException e) {
146                         log.error("No Attribute Resolver configuration could be loaded from (" + configFile + "): " + e);
147                         throw new AttributeResolverException("No Attribute Resolver configuration found.");
148                 } catch (SAXException e) {
149                         log.error("Error parsing Attribute Resolver Configuration file: " + e);
150                         throw new AttributeResolverException("Error parsing Attribute Resolver Configuration file.");
151                 } catch (IOException e) {
152                         log.error("Error reading Attribute Resolver Configuration file: " + e);
153                         throw new AttributeResolverException("Error reading Attribute Resolver Configuration file.");
154                 }
155         }
156
157         private void loadConfig(Document document) throws AttributeResolverException {
158
159                 log.info("Configuring Attribute Resolver.");
160                 if (!document.getDocumentElement().getTagName().equals("AttributeResolver")) {
161                         log.error("Configuration must include <AttributeResolver> as the root node.");
162                         throw new AttributeResolverException("Cannot load Attribute Resolver.");
163                 }
164
165                 NodeList plugInNodes =
166                         document.getElementsByTagNameNS(resolverNamespace, "AttributeResolver").item(0).getChildNodes();
167                 if (plugInNodes.getLength() <= 0) {
168                         log.error("Configuration inclues no PlugIn definitions.");
169                         throw new AttributeResolverException("Cannot load Attribute Resolver.");
170                 }
171                 for (int i = 0; plugInNodes.getLength() > i; i++) {
172                         if (plugInNodes.item(i).getNodeType() == Node.ELEMENT_NODE) {
173                                 try {
174                                         log.info("Found a PlugIn. Loading...");
175                                         ResolutionPlugIn plugIn = ResolutionPlugInFactory.createPlugIn((Element) plugInNodes.item(i));
176                                         registerPlugIn(plugIn, plugIn.getId());
177                                 } catch (DuplicatePlugInException dpe) {
178                                         log.warn("Skipping PlugIn: " + dpe.getMessage());
179                                 } catch (ClassCastException cce) {
180                                         log.error("Problem realizing PlugIn configuration" + cce.getMessage());
181                                 } catch (AttributeResolverException are) {
182                                         log.warn("Skipping PlugIn: " + ((Element) plugInNodes.item(i)).getAttribute("id"));
183                                 }
184                         }
185                 }
186
187                 verifyPlugIns();
188                 log.info("Configuration complete.");
189         }
190
191         private void verifyPlugIns() throws AttributeResolverException {
192                 
193                 log.info("Verifying PlugIn graph consitency.");
194                 Set inconsistent = new HashSet();
195                 Iterator registered = plugIns.keySet().iterator();
196
197                 while (registered.hasNext()) {
198                         ResolutionPlugIn plugIn = lookupPlugIn((String) registered.next());
199                         log.debug("Checking PlugIn (" + plugIn.getId() + ") for consistency.");
200                         verifyPlugIn(plugIn, new HashSet(), inconsistent);
201                 }
202                 
203                 if (!inconsistent.isEmpty()) {
204                         log.info("Unloading inconsistent PlugIns.");
205                         Iterator inconsistentIt = inconsistent.iterator();
206                         while (inconsistentIt.hasNext()) {
207                                 plugIns.remove(inconsistentIt.next());
208                         }
209                 }
210                 
211                 if (plugIns.size() < 1) {
212                         log.error("Failed to load any PlugIn definitions.");
213                         throw new AttributeResolverException("Cannot load Attribute Resolver.");
214                 }
215
216         }
217
218         private void verifyPlugIn(ResolutionPlugIn plugIn, Set verifyChain, Set inconsistent) {
219
220                 //Short-circuit if we have already found this PlugIn to be inconsistent
221                 if (inconsistent.contains(plugIn.getId())) {
222                         return;
223                 }
224
225                 //Make sure that we don't have a circular dependency
226                 if (verifyChain.contains(plugIn.getId())) {
227                         log.error(
228                                 "The PlugIn (" + plugIn.getId() + ") is inconsistent.  It is involved in a circular dependency chain.");
229                         inconsistent.add(plugIn.getId());
230                         return;
231                 }
232
233         //Recursively go through all DataConnector dependencies and make sure all are registered and consistent.
234                 List depends = new ArrayList();
235                 depends.addAll(Arrays.asList(plugIn.getDataConnectorDependencyIds()));
236                 Iterator dependsIt = depends.iterator();
237                 while (dependsIt.hasNext()) {
238                         String key = (String) dependsIt.next();
239                         if (!plugIns.containsKey(key)) {
240                                 log.error(
241                                         "The PlugIn ("
242                                                 + plugIn.getId()
243                                                 + ") is inconsistent.  It depends on a PlugIn ("
244                                                 + key
245                                                 + ") that is not registered.");
246                                 inconsistent.add(plugIn.getId());
247                                 return;
248                         }
249                         
250                         ResolutionPlugIn dependent = lookupPlugIn(key);
251                         if (!(dependent instanceof DataConnectorPlugIn)) {
252                                 log.error(
253                                         "The PlugIn ("
254                                                 + plugIn.getId()
255                                                 + ") is inconsistent.  It depends on a PlugIn ("
256                                                 + key
257                                                 + ") that is mislabeled as an DataConnectorPlugIn.");
258                                 inconsistent.add(plugIn.getId());
259                                 return;
260                         }
261             
262             verifyChain.add(plugIn.getId());
263             verifyPlugIn(dependent, verifyChain, inconsistent);
264
265             if (inconsistent.contains(key)) {
266                 log.error(
267                     "The PlugIn ("
268                         + plugIn.getId()
269                         + ") is inconsistent.  It depends on a PlugIn ("
270                         + key
271                         + ") that is not inconsistent.");
272                 inconsistent.add(plugIn.getId());
273                 return;
274             }
275                 }
276
277                 //Recursively go through all AttributeDefinition dependencies and make sure all are registered and consistent.
278                 depends.clear();
279                 depends.addAll(Arrays.asList(plugIn.getAttributeDefinitionDependencyIds()));
280                 dependsIt = depends.iterator();
281                 while (dependsIt.hasNext()) {
282                         String key = (String) dependsIt.next();
283
284                         if (!plugIns.containsKey(key)) {
285                                 log.error(
286                                         "The PlugIn ("
287                                                 + plugIn.getId()
288                                                 + ") is inconsistent.  It depends on a PlugIn ("
289                                                 + key
290                                                 + ") that is not registered.");
291                                 inconsistent.add(plugIn.getId());
292                                 return;
293                         }
294
295                         ResolutionPlugIn dependent = lookupPlugIn(key);
296                         if (!(dependent instanceof AttributeDefinitionPlugIn)) {
297                                 log.error(
298                                         "The PlugIn ("
299                                                 + plugIn.getId()
300                                                 + ") is inconsistent.  It depends on a PlugIn ("
301                                                 + key
302                                                 + ") that is mislabeled as an AttributeDefinitionPlugIn.");
303                                 inconsistent.add(plugIn.getId());
304                                 return;
305                         }
306                         
307                         verifyChain.add(plugIn.getId());
308                         verifyPlugIn(dependent, verifyChain, inconsistent);
309
310                         if (inconsistent.contains(key)) {
311                                 log.error(
312                                         "The PlugIn ("
313                                                 + plugIn.getId()
314                                                 + ") is inconsistent.  It depends on a PlugIn ("
315                                                 + key
316                                                 + ") that is not inconsistent.");
317                                 inconsistent.add(plugIn.getId());
318                                 return;
319                         }
320                 }
321         }
322
323         private void registerPlugIn(ResolutionPlugIn connector, String id) throws DuplicatePlugInException {
324
325                 if (plugIns.containsKey(id)) {
326                         log.error("A PlugIn is already registered with the Id (" + id + ").");
327                         throw new DuplicatePlugInException("Found a duplicate PlugIn Id.");
328                 }
329                 plugIns.put(id, connector);
330                 log.info("Registered PlugIn: (" + id + ")");
331
332         }
333
334         private ResolutionPlugIn lookupPlugIn(String id) {
335                 return (ResolutionPlugIn) plugIns.get(id);
336         }
337
338         /**
339          * Resolve a set of attributes for a particular principal and requester.
340          * 
341          * @param principal the <code>Principal</code> for which the attributes should be resolved
342          * @param requester the name of the requesting entity
343          * @param attributes the set of attributes to be resolved
344          */
345         public void resolveAttributes(
346                 Principal principal,
347                 String requester,
348                 ResolverAttributeSet attributes) {
349
350                 HashMap requestCache = new HashMap();
351                 ResolverAttributeIterator iterator =
352                         attributes.resolverAttributeIterator();
353
354                 while (iterator.hasNext()) {
355                         ResolverAttribute attribute = iterator.nextResolverAttribute();
356                         try {
357                                 if (lookupPlugIn(attribute.getName()) == null) {
358                                         log.warn(
359                                                 "No PlugIn registered for attribute: ("
360                                                         + attribute.getName()
361                                                         + ")");
362                                         iterator.remove();
363                                 } else {
364                                         log.info(
365                                                 "Resolving attribute: (" + attribute.getName() + ")");
366                                         if (attribute.resolved()) {
367                                                 log.debug(
368                                                         "Attribute ("
369                                                                 + attribute.getName()
370                                                                 + ") already resolved for this request.  No need for further resolution.");
371
372                                         } else {
373                                                 resolveAttribute(
374                                                         attribute,
375                                                         principal,
376                                                         requester,
377                                                         requestCache,
378                                                         attributes);
379                                         }
380
381                                         if (!attribute.hasValues()) {
382                                                 iterator.remove();
383                                         }
384                                 }
385                         } catch (ResolutionPlugInException rpe) {
386                                 log.error(
387                                         "Problem encountered while resolving attribute: ("
388                                                 + attribute.getName()
389                                                 + "): "
390                                                 + rpe);
391                                 iterator.remove();
392                         }
393                 }
394         }
395
396         public String[] listRegisteredAttributeDefinitionPlugIns() {
397
398                 log.debug("Listing available Attribute Definition PlugIns.");
399                 Set found = new HashSet();
400                 Iterator registered = plugIns.keySet().iterator();
401
402                 while (registered.hasNext()) {
403                         ResolutionPlugIn plugIn = lookupPlugIn((String) registered.next());
404                         if (plugIn instanceof AttributeDefinitionPlugIn) {
405                                 found.add(((AttributeDefinitionPlugIn) plugIn).getId());
406                         }
407                 }
408
409                 if (log.isDebugEnabled()) {
410                         for (Iterator iterator = found.iterator(); iterator.hasNext();) {
411                                 log.debug("Found registered Attribute Definition: " + (String) iterator.next());
412                         }
413                 }
414                 return (String[]) found.toArray(new String[0]);
415         }
416     
417     private Attributes resolveConnector(
418         String connector,
419         Principal principal,
420         String requester,
421         Map requestCache,
422         ResolverAttributeSet requestedAttributes)
423         throws ResolutionPlugInException {
424         
425         DataConnectorPlugIn currentDefinition = (DataConnectorPlugIn)lookupPlugIn(connector);
426
427         //Check to see if we have already resolved the connector during this request
428         if (requestCache.containsKey(currentDefinition.getId())) {
429             log.debug(
430                 "Connector ("
431                     + currentDefinition.getId()
432                     + ") already resolved for this request, using cached version");
433             return (Attributes)requestCache.get(currentDefinition.getId());
434         }
435
436         //Check to see if we have a cached resolution for this connector
437         if (currentDefinition.getTTL() > 0) {
438             Attributes cachedAttributes =
439                 resolverCache.getResolvedConnector(principal, currentDefinition.getId());
440             if (cachedAttributes != null) {
441                 log.debug(
442                     "Connector ("
443                         + currentDefinition.getId()
444                         + ") resolution cached from a previous request, using cached version");
445                 return cachedAttributes;
446             }
447         }
448
449         //Resolve all attribute dependencies
450         String[] attributeDependencies = currentDefinition.getAttributeDefinitionDependencyIds();
451         Dependencies depends = new Dependencies();
452
453         for (int i = 0; attributeDependencies.length > i; i++) {
454             log.debug(
455                 "Connector (" + currentDefinition.getId() + ") depends on attribute (" + attributeDependencies[i] + ").");
456             ResolverAttribute dependant = requestedAttributes.getByName(attributeDependencies[i]);
457             if (dependant == null) {
458                 dependant = new DependentOnlyResolutionAttribute(attributeDependencies[i]);
459             }
460             resolveAttribute(dependant, principal, requester, requestCache, requestedAttributes);
461             depends.addAttributeResolution(attributeDependencies[i], dependant);
462
463         }
464
465         //Resolve all connector dependencies
466         String[] connectorDependencies = currentDefinition.getDataConnectorDependencyIds();
467         for (int i = 0; connectorDependencies.length > i; i++) {
468             log.debug(
469                 "Connector (" + currentDefinition.getId() + ") depends on connector (" + connectorDependencies[i] + ").");
470             depends.addConnectorResolution(
471                 connectorDependencies[i],
472                 resolveConnector(connectorDependencies[i], principal, requester, requestCache, requestedAttributes));
473         }
474
475         //Resolve the connector
476         Attributes resolvedAttributes = currentDefinition.resolve(principal, requester, depends);
477
478         //If necessary, cache for this request
479         requestCache.put(currentDefinition.getId(), resolvedAttributes);
480
481         //Add attribute resolution to cache
482         if (currentDefinition.getTTL() > 0) {
483             resolverCache.cacheConnectorResolution(
484                 principal,
485                 currentDefinition.getId(),
486                 currentDefinition.getTTL(),
487                 resolvedAttributes);
488         }
489         
490         return resolvedAttributes;
491     }
492
493         private void resolveAttribute(
494                 ResolverAttribute attribute,
495                 Principal principal,
496                 String requester,
497                 Map requestCache,
498                 ResolverAttributeSet requestedAttributes)
499                 throws ResolutionPlugInException {
500
501                 AttributeDefinitionPlugIn currentDefinition = (AttributeDefinitionPlugIn) lookupPlugIn(attribute.getName());
502
503                 //Check to see if we have already resolved the attribute during this request
504                 if (requestCache.containsKey(currentDefinition.getId())) {
505                         log.debug(
506                                 "Attribute ("
507                                         + currentDefinition.getId()
508                                         + ") already resolved for this request, using cached version");
509                         attribute.resolveFromCached((ResolverAttribute) requestCache.get(currentDefinition.getId()));
510                         return;
511                 }
512
513                 //Check to see if we have a cached resolution for this attribute
514                 if (currentDefinition.getTTL() > 0) {
515                         ResolverAttribute cachedAttribute =
516                                 resolverCache.getResolvedAttribute(principal, currentDefinition.getId());
517                         if (cachedAttribute != null) {
518                                 log.debug(
519                                         "Attribute ("
520                                                 + currentDefinition.getId()
521                                                 + ") resolution cached from a previous request, using cached version");
522                                 attribute.resolveFromCached(cachedAttribute);
523                                 return;
524                         }
525                 }
526
527                 //Resolve all attribute dependencies
528                 Dependencies depends = new Dependencies();
529         String[] attributeDependencies = currentDefinition.getAttributeDefinitionDependencyIds();
530
531                 boolean dependancyOnly = false;
532                 for (int i = 0; attributeDependencies.length > i; i++) {
533                         log.debug(
534                                 "Attribute (" + attribute.getName() + ") depends on attribute (" + attributeDependencies[i] + ").");
535                         ResolverAttribute dependant = requestedAttributes.getByName(attributeDependencies[i]);
536                         if (dependant == null) {
537                                 dependancyOnly = true;
538                                 dependant = new DependentOnlyResolutionAttribute(attributeDependencies[i]);
539                         }
540                         resolveAttribute(dependant, principal, requester, requestCache, requestedAttributes);
541                         depends.addAttributeResolution(attributeDependencies[i], dependant);
542
543                 }
544
545                 //Resolve all connector dependencies
546                 String[] connectorDependencies = currentDefinition.getDataConnectorDependencyIds();
547                 for (int i = 0; connectorDependencies.length > i; i++) {
548                         log.debug(
549                                 "Attribute (" + attribute.getName() + ") depends on connector (" + connectorDependencies[i] + ").");
550             depends.addConnectorResolution(
551                 connectorDependencies[i],
552                 resolveConnector(connectorDependencies[i], principal, requester, requestCache, requestedAttributes));
553                 }
554
555                 //Resolve the attribute
556                 currentDefinition.resolve(attribute, principal, requester, depends);
557
558                 //If necessary, cache for this request
559                 if (dependancyOnly || !attribute.hasValues()) {
560                         requestCache.put(currentDefinition.getId(), attribute);
561                 }
562
563                 //Add attribute resolution to cache
564                 if (currentDefinition.getTTL() > 0) {
565                         resolverCache.cacheAttributeResolution(
566                                 principal,
567                                 attribute.getName(),
568                                 currentDefinition.getTTL(),
569                                 attribute);
570                 }
571         }
572
573         private class DuplicatePlugInException extends Exception {
574                 public DuplicatePlugInException(String message) {
575                         super(message);
576                 }
577         }
578
579         class DependentOnlyResolutionAttribute implements ResolverAttribute {
580                 String name;
581                 ArrayList values = new ArrayList();
582                 boolean resolved = false;
583
584                 DependentOnlyResolutionAttribute(String name) {
585                         this.name = name;
586                 }
587
588                 public String getName() {
589                         return name;
590                 }
591
592                 public boolean resolved() {
593                         return resolved;
594                 }
595
596                 public void setResolved() {
597                         resolved = true;
598                 }
599
600                 public void resolveFromCached(ResolverAttribute attribute) {
601                 }
602
603                 public void setLifetime(long lifetime) {
604                 }
605
606                 public long getLifetime() {
607                         return 0;
608                 }
609
610                 public void addValue(Object value) {
611                         values.add(value);
612                 }
613
614                 public Iterator getValues() {
615                         return values.iterator();
616                 }
617
618                 public boolean hasValues() {
619                         if (values.isEmpty()) {
620                                 return false;
621                         }
622                         return true;
623                 }
624
625                 public void registerValueHandler(ValueHandler handler) {
626                 }
627
628                 public ValueHandler getRegisteredValueHandler() {
629                         return null;
630                 }
631         }
632
633 }