Package org.glassfish.admin.rest

Examples of org.glassfish.admin.rest.RestConfig


    @Override
    public void execute(AdminCommandContext context) {

        ActionReport report = context.getActionReport();

        RestConfig restConfig = config.getExtensionByType(RestConfig.class);


        if (restConfig == null) {
            report.setMessage("debug=false, indentLevel=-1, showHiddenCommands=false, wadlGeneration=false, logOutput=false, logInput=false, showDeprecatedItems=false, sessionTokenTimeout=30");

            report.getTopMessagePart().addProperty("debug", "false");
            report.getTopMessagePart().addProperty("indentLevel", "-1");
            report.getTopMessagePart().addProperty("showHiddenCommands", "false");
            report.getTopMessagePart().addProperty("showDeprecatedItems", "false");
            report.getTopMessagePart().addProperty("wadlGeneration", "" + "false");
            report.getTopMessagePart().addProperty("logOutput", "" + "false");
            report.getTopMessagePart().addProperty("logInput", "" + "false");
            report.getTopMessagePart().addProperty("sessionTokenTimeout", "30");

        } else {
            report.setMessage("debug="+restConfig.getDebug()+", indentLevel="+restConfig.getIndentLevel()+", showHiddenCommands="+restConfig.getShowHiddenCommands()+", wadlGeneration="+restConfig.getWadlGeneration()+", logOutput="+restConfig.getLogOutput()
                    +", logInput="+restConfig.getLogInput() + ", sessionTokenTimeout="+restConfig.getSessionTokenTimeout());

            report.getTopMessagePart().addProperty("debug", restConfig.getDebug());
            report.getTopMessagePart().addProperty("indentLevel", restConfig.getIndentLevel());
            report.getTopMessagePart().addProperty("showHiddenCommands", restConfig.getShowHiddenCommands());
            report.getTopMessagePart().addProperty("showDeprecatedItems", restConfig.getShowDeprecatedItems());
            report.getTopMessagePart().addProperty("wadlGeneration", restConfig.getWadlGeneration());
            report.getTopMessagePart().addProperty("logOutput", restConfig.getLogOutput());
            report.getTopMessagePart().addProperty("logInput", restConfig.getLogInput());
            report.getTopMessagePart().addProperty("sessionTokenTimeout", "" + restConfig.getSessionTokenTimeout());
        }



        report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
View Full Code Here


    public void execute(AdminCommandContext context) {

        ActionReport report = context.getActionReport();

        RestConfig restConfig = config.getExtensionByType(RestConfig.class);

        /**
         * The schedules does not exist in this Config.  We will need to
         * add it plus the default schedules.
         */
        if (restConfig == null) {
            try {
                ConfigSupport.apply(new SingleConfigCode<Config>() {

                    public Object run(Config parent) throws TransactionFailure {

                        RestConfig child = parent.createChild(RestConfig.class);


                        parent.getContainers().add(child);
                        return child;
                    }
View Full Code Here

    }

    public abstract String getContent(T proxy);

    protected int getFormattingIndentLevel() {
        RestConfig rg = getRestConfig();
        if (rg == null){
            return -1;
        }
        else {
            return Integer.parseInt(rg.getIndentLevel());
        }
       
    }
View Full Code Here

     /*
     * returns true if the HTML viewer displays the hidden CLI command links
     */  
    protected boolean canShowHiddenCommands() {

        RestConfig rg = getRestConfig();
        if ((rg != null) && (rg.getShowHiddenCommands().equalsIgnoreCase("true"))) {
            return true;
        }
        return false;
    }
View Full Code Here

     * of a config bean
     */
       
    protected boolean canShowDeprecatedItems() {

        RestConfig rg = getRestConfig();
        if ((rg != null) && (rg.getShowDeprecatedItems().equalsIgnoreCase("true"))) {
            return true;
        }
        return false;
    }
View Full Code Here

    /* check for the __debug request header
     *
     */
    protected boolean isDebug() {

        RestConfig rg = getRestConfig();
        if ((rg != null) && (rg.getDebug().equalsIgnoreCase("true"))) {
            return true;
        }
   
        if (requestHeaders == null) {
            return true;
View Full Code Here

TOP

Related Classes of org.glassfish.admin.rest.RestConfig

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.