private Principal createPrincipal ( String schema , JsonNode principalNode ) { if ( schema . equalsIgnoreCase ( PRINCIPAL_SCHEMA_USER ) ) { return new Principal ( PRINCIPAL_SCHEMA_USER , principalNode . asText ( ) , options . isStripAwsPrincipalIdHyphensEnabled ( ) ) ; } else if ( schema . equalsIgnoreCase ( PRINCIPAL_SCHEMA_SERVICE ) ) { return new Principal ( schema , principalNode . asText ( ) ) ; } else if ( schema . equalsIgnoreCase ( PRINCIPAL_SCHEMA_FEDERATED ) ) { if ( WebIdentityProviders . fromString ( principalNode . asText ( ) ) != null ) { return new Principal ( WebIdentityProviders . fromString ( principalNode . asText ( ) ) ) ; } else { return new Principal ( PRINCIPAL_SCHEMA_FEDERATED , principalNode . asText ( ) ) ; } } throw new SdkClientException ( "Schema " + schema + " is not a valid value for the principal." ) ; }
Creates a new principal instance for the given schema and the Json node .