+ /**
+ * Batches up criteria for entity lookup.
+ */
+ struct Criteria {
+ /**
+ * Constructor.
+ *
+ * @param id entityID to lookup
+ * @param q element/type of role, if any
+ * @param prot protocol support constant, if any
+ * @param valid true iff stale metadata should be ignored
+ */
+ Criteria(const XMLCh* id, const xmltooling::QName* q=NULL, const XMLCh* prot=NULL, bool valid=true)
+ : entityID_unicode(id), entityID_ascii(NULL), artifact(NULL), role(q), protocol(prot), protocol2(NULL), validOnly(valid) {
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param id entityID to lookup
+ * @param q element/type of role, if any
+ * @param prot protocol support constant, if any
+ * @param valid true iff stale metadata should be ignored
+ */
+ Criteria(const char* id, const xmltooling::QName* q=NULL, const XMLCh* prot=NULL, bool valid=true)
+ : entityID_unicode(NULL), entityID_ascii(id), artifact(NULL), role(q), protocol(prot), protocol2(NULL), validOnly(valid) {
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param a artifact to lookup
+ * @param q element/type of role, if any
+ * @param prot protocol support constant, if any
+ * @param valid true iff stale metadata should be ignored
+ */
+ Criteria(const SAMLArtifact* a, const xmltooling::QName* q=NULL, const XMLCh* prot=NULL, bool valid=true)
+ : entityID_unicode(NULL), entityID_ascii(NULL), artifact(a), role(q), protocol(prot), protocol2(NULL), validOnly(valid) {
+ }
+
+ /** Unique ID of entity. */
+ const XMLCh* entityID_unicode;
+ /** Unique ID of entity. */
+ const char* entityID_ascii;
+ /** SAML artifact */
+ const SAMLArtifact* artifact;
+ /** Element or schema type QName of metadata role. */
+ const xmltooling::QName* role;
+ /** Protocol support constant. */
+ const XMLCh* protocol;
+ /** Backup protocol support constant. */
+ const XMLCh* protocol2;
+ /** Controls whether stale metadata is ignored. */
+ bool validOnly;
+ };
+
+ /**
+ * Gets entity metadata based on supplied criteria. If a valid entity is returned,
+ * the provider will be left in a locked state. The caller MUST unlock the
+ * provider when finished with the entity.
+ *
+ * @param criteria lookup criteria
+ *
+ * @return the entity's metadata (and optionally a role) or NULL if there is no qualifying metadata
+ */
+ virtual std::pair<const EntityDescriptor*,const RoleDescriptor*> getEntityDescriptor(const Criteria& criteria) const=0;
+