All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.almende.eve.scheduling.PersistentSchedulerConfig Maven / Gradle / Ivy

There is a newer version: 3.1.1
Show newest version
/*
 * Copyright: Almende B.V. (2014), Rotterdam, The Netherlands
 * License: The Apache Software License, Version 2.0
 */
package com.almende.eve.scheduling;

import com.almende.util.jackson.JOM;
import com.fasterxml.jackson.databind.node.ObjectNode;

/**
 * The Class PersistentSchedulerConfig.
 */
public class PersistentSchedulerConfig extends SimpleSchedulerConfig {
	
	/**
	 * Instantiates a new simple scheduler config.
	 */
	public PersistentSchedulerConfig() {
		this(JOM.createObjectNode());
	}
	
	/**
	 * Instantiates a new simple scheduler config.
	 * 
	 * @param node
	 *            the node
	 */
	public PersistentSchedulerConfig(final ObjectNode node) {
		super(node);
		if (!node.has("class")) {
			setClassName(PersistentSchedulerBuilder.class.getName());
		}
	}
	
	/**
	 * Sets the state.
	 * 
	 * @param node
	 *            the new state
	 */
	public void setState(final ObjectNode node) {
		this.set("state", node);
	}
	
	/**
	 * Gets the state.
	 * 
	 * @return the state
	 */
	public ObjectNode getState() {
		if (this.has("state")) {
			return (ObjectNode) this.get("state");
		}
		return null;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy