Package org.glassfish.api.admin

Examples of org.glassfish.api.admin.CommandModel$ParamModel


     * method.
     */
    public static Collection<CommandModel.ParamModel> getParamMetaData(
            String commandName, Collection<String> commandParamsToSkip,
            ServiceLocator habitat, Logger logger) {
        CommandModel cm = habitat.<CommandRunner>getService(CommandRunner.class).getModel(commandName, logger);
        Collection<String> parameterNames = cm.getParametersNames();

        ArrayList<CommandModel.ParamModel> metaData = new ArrayList<CommandModel.ParamModel>();
        CommandModel.ParamModel paramModel;
        for (String name : parameterNames) {
            paramModel = cm.getModelFor(name);
            String parameterName = (paramModel.getParam().primary()) ? "id" : paramModel.getName();

            boolean skipParameter = false;
            try {
                skipParameter = commandParamsToSkip.contains(parameterName);
View Full Code Here


     * @return Collection the meta-data for the parameter of the resource
     * method.
     */
    public static Collection<CommandModel.ParamModel> getParamMetaData(
            String commandName, ServiceLocator habitat, Logger logger) {
        final CommandModel model = habitat.<CommandRunner>getService(CommandRunner.class).getModel(commandName, logger);
        if (model == null) {
            return null;
        }

        return model.getParameters();
    }
View Full Code Here

     * method.
     */
    public static Collection<CommandModel.ParamModel> getParamMetaData(
            String commandName, Collection<String> commandParamsToSkip,
            ServiceLocator habitat, Logger logger) {
        CommandModel cm = habitat.<CommandRunner>getService(CommandRunner.class).getModel(commandName, logger);
        Collection<String> parameterNames = cm.getParametersNames();

        ArrayList<CommandModel.ParamModel> metaData = new ArrayList<CommandModel.ParamModel>();
        CommandModel.ParamModel paramModel;
        for (String name : parameterNames) {
            paramModel = cm.getModelFor(name);
            String parameterName = (paramModel.getParam().primary()) ? "id" : paramModel.getName();

            boolean skipParameter = false;
            try {
                skipParameter = commandParamsToSkip.contains(parameterName);
View Full Code Here

    }

    protected void generateGetPostCommandMethod(ClientClassWriter writer, String resourceName) {
        String commandName = ResourcesGeneratorBase.configBeanToPOSTCommand.get("List"+resourceName);
        if (commandName != null) {
            final CommandModel cm = getCommandModel(commandName);
            if (cm != null ) {//and the command exits
                writer.generateCommandMethod(Util.methodNameFromDtdName(commandName, null), "POST", ResourceUtil.convertToXMLName(resourceName), cm);
            }
        }
    }
View Full Code Here

    //    private void generateCommandMethods(String parentBeanName, ClassWriter parentWriter) {
    protected void generateCommandMethods(ClientClassWriter writer, String className) {
        List<CommandResourceMetaData> commandMetaData = CommandResourceMetaData.getMetaData(className);
        if (commandMetaData.size() > 0) {
            for (CommandResourceMetaData metaData : commandMetaData) {
                CommandModel cm = getCommandModel(metaData.command);
                if (cm != null) {
                    String methodName = Util.methodNameFromDtdName(metaData.command, null);
                    if (!methodName.startsWith("_")) {
                        writer.generateCommandMethod(methodName, metaData.httpMethod, metaData.resourcePath, cm);
                    }
View Full Code Here

        return false;
    }

    public Collection<CommandModel.ParamModel> getParamMetaData(String commandName) {
        CommandRunner cr = habitat.getService(CommandRunner.class);
        CommandModel cm = cr.getModel(commandName, RestService.logger);
        Collection<CommandModel.ParamModel> params = cm.getParameters();
        return params;
    }
View Full Code Here

    }

    protected void generateGetPostCommandMethod(ClientClassWriter writer, String resourceName) {
        String commandName = ResourcesGeneratorBase.configBeanToPOSTCommand.get("List"+resourceName);
        if (commandName != null) {
            final CommandModel cm = getCommandModel(commandName);
            if (cm != null ) {//and the command exits
                writer.generateCommandMethod(Util.methodNameFromDtdName(commandName, null), "POST", ResourceUtil.convertToXMLName(resourceName), cm);
            }
        }
    }
View Full Code Here

    //    private void generateCommandMethods(String parentBeanName, ClassWriter parentWriter) {
    protected void generateCommandMethods(ClientClassWriter writer, String className) {
        List<CommandResourceMetaData> commandMetaData = CommandResourceMetaData.getMetaData(className);
        if (commandMetaData.size() > 0) {
            for (CommandResourceMetaData metaData : commandMetaData) {
                CommandModel cm = getCommandModel(metaData.command);
                if (cm != null) {
                    String methodName = Util.methodNameFromDtdName(metaData.command, null);
                    if (!methodName.startsWith("_")) {
                        writer.generateCommandMethod(methodName, metaData.httpMethod, metaData.resourcePath, cm);
                    }
View Full Code Here

     * method.
     */
    public static Collection<CommandModel.ParamModel> getParamMetaData(
            String commandName, Collection<String> commandParamsToSkip,
            ServiceLocator habitat, Logger logger) {
        CommandModel cm = habitat.<CommandRunner>getService(CommandRunner.class).getModel(commandName, logger);
        Collection<String> parameterNames = cm.getParametersNames();

        ArrayList<CommandModel.ParamModel> metaData = new ArrayList<CommandModel.ParamModel>();
        CommandModel.ParamModel paramModel;
        for (String name : parameterNames) {
            paramModel = cm.getModelFor(name);
            String parameterName = (paramModel.getParam().primary()) ? "id" : paramModel.getName();

            boolean skipParameter = false;
            try {
                skipParameter = commandParamsToSkip.contains(parameterName);
View Full Code Here

        return false;
    }

    public Collection<CommandModel.ParamModel> getParamMetaData(String commandName) {
        CommandRunner cr = habitat.getService(CommandRunner.class);
        CommandModel cm = cr.getModel(commandName, RestService.logger);
        Collection<CommandModel.ParamModel> params = cm.getParameters();
        return params;
    }
View Full Code Here

TOP

Related Classes of org.glassfish.api.admin.CommandModel$ParamModel

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.