public static Set findProtocolsForEntity(String entityId,String realm){
  try {
    Set retSet=new HashSet();
    CircleOfTrustManager manager=new CircleOfTrustManager();
    Set idffSet=manager.getAllEntities(realm,COTConstants.IDFF);
    if (idffSet.contains(entityId)) {
      retSet.add(COTConstants.IDFF);
    }
    Set saml2Set=manager.getAllEntities(realm,COTConstants.SAML2);
    if ((saml2Set != null) && saml2Set.contains(entityId)) {
      retSet.add(COTConstants.SAML2);
    }
    return retSet;
  }
 catch (  COTException e) {
    debug.error("COTUtils.findProtocolsForEntity",e);
    return null;
  }
}

public static Set findProtocolsForEntity ( String entityId , String realm ) { try { Set retSet = new HashSet ( ) ; CircleOfTrustManager manager = new CircleOfTrustManager ( ) ; Set idffSet = manager . getAllEntities ( realm , COTConstants . IDFF ) ; if ( idffSet . contains ( entityId ) ) { retSet . add ( COTConstants . IDFF ) ; } Set saml2Set = manager . getAllEntities ( realm , COTConstants . SAML2 ) ; if ( ( saml2Set != null ) && saml2Set . contains ( entityId ) ) { retSet . add ( COTConstants . SAML2 ) ; } return retSet ; } catch ( COTException e ) { debug . error ( "COTUtils.findProtocolsForEntity" , e ) ; return null ; } }
returns set of protocol the entity supports .
