Package com.amazonaws.auth.policy

Examples of com.amazonaws.auth.policy.Principal


        String[] fields = JSONObject.getNames(jPrincipals);
        for (String field : fields) {
            String serviceId = jPrincipals.optString(field);
            if (serviceId != null && serviceId.length() > 0) {
                if (field.equalsIgnoreCase("AWS")) {
                    statement.getPrincipals().add(new Principal(serviceId));
                } else if (field.equalsIgnoreCase("Service")) {
                    statement.getPrincipals().add(
                            new Principal(Services.fromString(serviceId)));
                } else if (field.equalsIgnoreCase("Federated")) {
                    statement.getPrincipals().add(
                            new Principal(WebIdentityProviders.fromString(serviceId)));
                }
            } else {
                JSONArray jPrincipal = jPrincipals.getJSONArray(field);
                convertPrincipalRecord(field, statement, jPrincipal);
            }
View Full Code Here


            }
        }
    }

    private void convertPrincipalRecord(String schema, Statement statement, JSONArray jPrincipal) throws JSONException {
        Principal principal = null;
        for (int index = 0 ; index < jPrincipal.length() ; index++) {
            if (schema.equals("AWS")) {
                if (jPrincipal.getString(index).equals("*")) {
                    principal = Principal.AllUsers;
                }
                principal = new Principal(jPrincipal.getString(index));
            } else if (schema.equals("Service")) {
                principal = new Principal(Services.fromString(jPrincipal.getString(index)));
            }
            statement.getPrincipals().add(principal);
        }
    }
View Full Code Here

TOP

Related Classes of com.amazonaws.auth.policy.Principal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.