Package org.glassfish.admin.rest.resources

Examples of org.glassfish.admin.rest.resources.CommandResult


public class AdminCommandStateCmdResultJsonProvider extends AdminCommandStateJsonProvider {
   
    @Override
    protected void addActionReporter(ActionReporter ar, JSONObject json) throws JSONException {
        if (ar != null) {
            CommandResult cr = CompositeUtil.instance().getModel(CommandResult.class);
            cr.setMessage(ar.getMessage());
            cr.setProperties(ar.getTopMessagePart().getProps());
            Properties props = ar.getExtraProperties();
            if (props != null) {
                Map<String, Object> map = new HashMap<String, Object>();
                for (Map.Entry<Object, Object> entry : props.entrySet()) {
                    map.put(entry.getKey().toString(), entry.getValue());
                }
                cr.setExtraProperties(map);
            }
            json.put("command-result", (JSONObject) JsonUtil.getJsonObject(cr));
        }
    }
View Full Code Here

TOP

Related Classes of org.glassfish.admin.rest.resources.CommandResult

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.