Package org.hudsonci.model.project.property

Examples of org.hudsonci.model.project.property.TriggerProjectProperty


     * @throws Descriptor.FormException if incorrect parameters
     */
    @SuppressWarnings("unchecked")
    public static void setChildrenTrigger(Job job, TriggerDescriptor descriptor, String key, StaplerRequest req,
                                          JSONObject json) throws Descriptor.FormException {
        TriggerProjectProperty property = CascadingUtil.getTriggerProjectProperty(job, key);
        if (property.getValue() != null) {
            property.getValue().stop();
        }
        Trigger trigger = null;
        if (json.has(key)) {
            trigger = descriptor.newInstance(req, json.getJSONObject(key));
            trigger.start(job, true);
        }
        property.setValue(trigger);
        Set<String> cascadingChildrenNames = job.getCascadingChildrenNames();
        if (null != cascadingChildrenNames) {
            for (String childName : cascadingChildrenNames) {
                Job childJob = (Job) Hudson.getInstance().getItem(childName);
                if (null != childJob && StringUtils.equals(job.getName(), childJob.getCascadingProjectName())) {
                    TriggerProjectProperty childProperty = CascadingUtil.getTriggerProjectProperty(childJob, key);
                    if (!childProperty.isOverridden()) {
                        setChildrenTrigger(childJob, descriptor, key, req, json);
                    } else if (!childProperty.allowOverrideValue(trigger, childProperty.getValue())) {
                        childProperty.setOverridden(false);
                    }
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.hudsonci.model.project.property.TriggerProjectProperty

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.