Package org.apache.sling.event

Examples of org.apache.sling.event.EventPropertiesMap


            final List<String> list = new ArrayList<String>();
            list.add("1");
            list.add("2");

            final EventPropertiesMap map = new EventPropertiesMap();
            map.put("a", "a1");
            map.put("b", "b2");

            // we start a single job
            final Map<String, Object> props = new HashMap<String, Object>();
            props.put("string", "Hello");
            props.put("int", new Integer(5));
View Full Code Here


                    }
                } else {
                    final String jobTopic = (String)event.getProperty(ResourceHelper.PROPERTY_JOB_TOPIC);
                    final String jobName = (String)event.getProperty(JobUtil.PROPERTY_JOB_NAME);

                    final Map<String, Object> props =  new EventPropertiesMap(event);
                    props.put(JobImpl.PROPERTY_BRIDGED_EVENT, Boolean.TRUE);

                    // check for deprecated/unsupported properties
                    for(final String ignoredProp : IGNORED_CONFIG_PROPERTIES) {
                        if ( props.containsKey(ignoredProp)) {
                            Utility.logDeprecated(logger, "Job " + EventUtil.toString(event) + " is using deprecated and ignored property " + ignoredProp);
                            props.remove(ignoredProp);
                        }
                    }
                    if ( jobName != null ) {
                        this.jobManager.addJob(jobTopic, jobName, props);
                    } else {
View Full Code Here

     * @param e The job event.
     * @return The real job event.
     */
    private Event getJobEvent(Event e, String nodePath) {
        final String eventTopic = (String)e.getProperty(EventUtil.PROPERTY_JOB_TOPIC);
        final Dictionary<String, Object> properties = new EventPropertiesMap(e);
        // put properties for finished job callback
        properties.put(EventUtil.JobStatusNotifier.CONTEXT_PROPERTY_NAME,
                new EventUtil.JobStatusNotifier.NotifierContext(this, nodePath));
        return new Event(eventTopic, properties);
    }
View Full Code Here

            if ( retries != -1 && retryCount > retries ) {
                reschedule = false;
            }
            if ( reschedule ) {
                // update event with retry count and retries
                final Dictionary<String, Object> newProperties = new EventPropertiesMap(job);
                newProperties.put(EventUtil.PROPERTY_JOB_RETRY_COUNT, retryCount);
                newProperties.put(EventUtil.PROPERTY_JOB_RETRIES, retries);
                job = new Event(job.getTopic(), newProperties);
            }
        }
        final boolean parallelProcessing = job.getProperty(EventUtil.PROPERTY_JOB_QUEUE_NAME) != null
                                        || job.getProperty(EventUtil.PROPERTY_JOB_PARALLEL) != null;
View Full Code Here

        eventNode.setProperty(EventHelper.NODE_PROPERTY_CREATED, Calendar.getInstance());
        eventNode.setProperty(EventHelper.NODE_PROPERTY_TOPIC, e.getTopic());
        eventNode.setProperty(EventHelper.NODE_PROPERTY_APPLICATION, this.applicationId);

        EventUtil.addProperties(eventNode,
                                new EventPropertiesMap(e),
                                IGNORE_PROPERTIES,
                                EventHelper.NODE_PROPERTY_PROPERTIES);
        this.addNodeProperties(eventNode, e);
        rootNode.save();
View Full Code Here

     * @throws ClassNotFoundException
     */
    protected Event readEvent(Node eventNode)
    throws RepositoryException, ClassNotFoundException {
        final String topic = eventNode.getProperty(EventHelper.NODE_PROPERTY_TOPIC).getString();
        final EventPropertiesMap eventProps = EventUtil.readProperties(eventNode,
                EventHelper.NODE_PROPERTY_PROPERTIES,
                IGNORE_PREFIXES);

        eventProps.put(JobStatusProvider.PROPERTY_EVENT_ID, eventNode.getPath());
        this.addEventProperties(eventNode, eventProps);
        try {
            final Event event = new Event(topic, eventProps);
            return event;
        } catch (IllegalArgumentException iae) {
View Full Code Here

TOP

Related Classes of org.apache.sling.event.EventPropertiesMap

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.