2 * EntityDescriptor.java
4 * Simplify the transition to SAML 2 by allowing the obsolete
5 * "Provider" interface to be called by its new name "EntityDescriptor".
6 * Can be used to add or rename fields while writing code that
7 * implements the new interface while continuing to support the old.
9 package edu.internet2.middleware.shibboleth.metadata;
12 * @author Howard Gilbert
14 public abstract class EntityDescriptor implements Provider {
17 * Scan the array of Roles, return instance of a particular type
18 * @param type Sub-Class of ProviderRole
19 * @return instance of the type
21 public ProviderRole getRoleByType(Class type) {
23 ProviderRole[] roles = this.getRoles();
24 for (int i=0;i<roles.length;i++) {
25 ProviderRole role = roles[i];
26 if (type.isInstance(role))
33 AttributeAuthorityRole
34 getAttributeAuthorityRole(){
35 AttributeAuthorityRole aa = (AttributeAuthorityRole) getRoleByType(AttributeAuthorityRole.class);
42 IDPProviderRole hs = (IDPProviderRole) getRoleByType(IDPProviderRole.class);