Package org.glassfish.admin.restconnector

Examples of org.glassfish.admin.restconnector.RestConfig


    @Override
    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>() {

                    @Override
                    public Object run(Config parent) throws TransactionFailure {
                        RestConfig child = parent.createChild(RestConfig.class);
                        parent.getContainers().add(child);
                        return child;
                    }
                }, config);
            } catch (TransactionFailure e) {
View Full Code Here


    @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

    @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,"text/html;qs=2"})
    public Response create(HashMap<String, String> data) {
        if (data == null) {
            data = new HashMap<String, String>();
        }
        final RestConfig restConfig = ResourceUtil.getRestConfig(locatorBridge.getRemoteLocator());

        Response.ResponseBuilder responseBuilder = Response.status(UNAUTHORIZED);
        RestActionReporter ar = new RestActionReporter();
        Request grizzlyRequest = request.get();
View Full Code Here

     * attributes of a config bean
     */

    public static boolean canShowDeprecatedItems(ServiceLocator habitat) {

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

    }

    public abstract String getContent(T proxy);

    protected int getFormattingIndentLevel() {
        RestConfig rg = ResourceUtil.getRestConfig(habitat);
        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 = ResourceUtil.getRestConfig(habitat);
        if ((rg != null) && (rg.getShowHiddenCommands().equalsIgnoreCase("true"))) {
            return true;
        }
        return false;
    }
View Full Code Here

     * of a config bean
     */

    protected boolean canShowDeprecatedItems() {

        RestConfig rg = ResourceUtil.getRestConfig(habitat);
        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 = ResourceUtil.getRestConfig(habitat);
        if ((rg != null) && (rg.getDebug().equalsIgnoreCase("true"))) {
            return true;
        }

        if (requestHeaders == null) {
            return true;
View Full Code Here

    /**
     * Get the current configured indenting value for the REST layer
     * @return
     */
    public static int getFormattingIndentLevel() {
        RestConfig rg = ResourceUtil.getRestConfig(Globals.getDefaultBaseServiceLocator());
        if (rg == null) {
            return -1;
        } else {
            return Integer.parseInt(rg.getIndentLevel());
        }

    }
View Full Code Here

     * attributes of a config bean
     */

    public static boolean canShowDeprecatedItems(ServiceLocator habitat) {

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

TOP

Related Classes of org.glassfish.admin.restconnector.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.