Package org.rhq.enterprise.gui.operation.definition

Examples of org.rhq.enterprise.gui.operation.definition.OperationDefinitionUIBean


            OperationDefinitionParametersUIBean operationParametersUIBean = FacesContextUtility
                .getBean(OperationDefinitionParametersUIBean.class);
            Configuration configuration = operationParametersUIBean.getConfiguration();

            OperationDefinitionUIBean operationDefUIBean;
            if (this instanceof ResourceOperationScheduleUIBean) {
                operationDefUIBean = FacesContextUtility.getBean(ResourceOperationDefinitionUIBean.class);
            } else if (this instanceof ResourceGroupOperationScheduleUIBean) {
                operationDefUIBean = FacesContextUtility.getBean(ResourceGroupOperationDefinitionUIBean.class);
            } else {
                throw new IllegalStateException("Unsupported class - this is a bug, please report it: "
                    + this.getClass().toString());
            }

            // if the user selected a timeout, add it to our configuration
            String timeout = operationDefUIBean.getTimeout();
            if (!timeout.trim().equals("")) {
                Integer.parseInt(timeout); // see if it fails, to return back to the UI

                if (configuration == null) {
                    configuration = new Configuration();
                }

                configuration.put(new PropertySimple(OperationDefinition.TIMEOUT_PARAM_NAME, timeout));
            }

            String operationName = operationDefUIBean.getName();
            String description = operationDefUIBean.getDescription();

            scheduleOperation(subject, operationName, configuration, simpleTrigger, description);
        } catch (Exception e) {
            FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR,
                "There was an error scheduling your operation: " + e.getMessage());
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.gui.operation.definition.OperationDefinitionUIBean

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.