public String getRealm(Subject subject) throws Exception {
        String realm = null;
        WSCredential credential = getWSCredential(subject);
        if (credential != null) {
            realm = credential.getRealmName();
        }
        return realm;
    }
public String getRealm ( Subject subject ) throws Exception { String realm = null ; WSCredential credential = getWSCredential ( subject ) ; if ( credential != null ) { realm = credential . getRealmName ( ) ; } return realm ; }
Gets the realm from the subjects' WSCredential.

@param subject {@code null} is not supported.
@return