public static boolean isDualRole(String hostEntityId,String realm){
  try {
    SPSSOConfigElement spConfig=saml2MetaManager.getSPSSOConfig(realm,hostEntityId);
    if (spConfig == null) {
      return false;
    }
    IDPSSOConfigElement idpConfig=saml2MetaManager.getIDPSSOConfig(realm,hostEntityId);
    return idpConfig != null;
  }
 catch (  Exception e) {
    return false;
  }
}

public static boolean isDualRole ( String hostEntityId , String realm ) { try { SPSSOConfigElement spConfig = saml2MetaManager . getSPSSOConfig ( realm , hostEntityId ) ; if ( spConfig == null ) { return false ; } IDPSSOConfigElement idpConfig = saml2MetaManager . getIDPSSOConfig ( realm , hostEntityId ) ; return idpConfig != null ; } catch ( Exception e ) { return false ; } }
returns true if this entity is acting as both sp and idp .
