package at.gv.egiz.eaaf.modules.pvp2.impl.metadata; import org.joda.time.DateTime; import org.opensaml.core.criterion.EntityIdCriterion; import org.opensaml.saml.metadata.resolver.ExtendedRefreshableMetadataResolver; import org.opensaml.saml.metadata.resolver.filter.MetadataFilter; import org.opensaml.saml.saml2.metadata.EntityDescriptor; import at.gv.egiz.eaaf.modules.pvp2.api.metadata.IPvp2MetadataProvider; import net.shibboleth.utilities.java.support.resolver.CriteriaSet; import net.shibboleth.utilities.java.support.resolver.ResolverException; public class PvpMetadataResolverAdapter implements IPvp2MetadataProvider { private ExtendedRefreshableMetadataResolver internalProvider; public PvpMetadataResolverAdapter(ExtendedRefreshableMetadataResolver provider) { this.internalProvider = provider; } @Override public void refresh() throws ResolverException { internalProvider.refresh(); } @Override public DateTime getLastRefresh() { return internalProvider.getLastRefresh(); } @Override public DateTime getLastUpdate() { return internalProvider.getLastUpdate(); } @Override public boolean isRequireValidMetadata() { return internalProvider.isRequireValidMetadata(); } @Override public void setRequireValidMetadata(boolean requireValidMetadata) { internalProvider.setRequireValidMetadata(requireValidMetadata); } @Override public MetadataFilter getMetadataFilter() { return internalProvider.getMetadataFilter(); } @Override public void setMetadataFilter(MetadataFilter newFilter) { internalProvider.setMetadataFilter(newFilter); } @Override public Iterable resolve(CriteriaSet criteria) throws ResolverException { return internalProvider.resolve(criteria); } @Override public EntityDescriptor resolveSingle(CriteriaSet criteria) throws ResolverException { return internalProvider.resolveSingle(criteria); } @Override public String getId() { return internalProvider.getId(); } @Override public EntityDescriptor getEntityDescriptor(String entityId) throws ResolverException { final CriteriaSet criteria = new CriteriaSet(); criteria.add(new EntityIdCriterion(entityId)); return internalProvider.resolveSingle(criteria); } @Override public DateTime getLastSuccessfulRefresh() { return internalProvider.getLastSuccessfulRefresh(); } @Override public Boolean wasLastRefreshSuccess() { return internalProvider.wasLastRefreshSuccess(); } }