private static void printChannelMapping(final ChannelController cc) { System.out.println(" Configuration " + cc.pattern.model.getLocation()); System.out.println(" Resource: " + cc.pattern.target.getLocationResource()); System.out.println(" Channel: " + cc.channelLocator); System.out.println(" Initialisation successful: " + (cc.pattern.registrationSuccessful.isActive() && cc.pattern.registrationSuccessful.getValue())); }
@Override public JSONObject onPOST(String data, OgemaHttpRequest req) { JSONObject request = super.onPOST(data, req); //cleanUp(); boolean bval = false; for(Entry<String, Boolean> e: checkboxList.entrySet()) { bval = e.getValue(); } if(!selected.isActive()) { selected.create(); selected.setValue(bval); selected.activate(false); } else selected.setValue(bval); return request; }
protected static boolean needsIndividualPushOnInit(RestPullConfig pull) { return pull.isActive() && pull.pushOnInit().isActive() && pull.pushOnInit().getValue(); }
boolean schedules = false; boolean references = false; if (pullConfig.schedules().isActive()) schedules = pullConfig.schedules().getValue(); if (pullConfig.resolveReferences().isActive()) references = pullConfig.resolveReferences().getValue(); if (schedules) HttpResponse resp = client.execute(get); boolean forceUpdate = false; if (pullConfig.forceWrite().isActive()) forceUpdate = pullConfig.forceWrite().getValue(); try (InputStream is = resp.getEntity().getContent()) {
public boolean isRecursivePushTrigger() { if (con.pushConfig().isActive()) return con.pushConfig().pushOnSubresourceChanged().isActive() && con.pushConfig().pushOnSubresourceChanged().getValue(); if (con.individualPushConfigs().isActive()) { for (RestPushConfig config: con.individualPushConfigs().getAllElements()) { if (config.pushOnSubresourceChanged().isActive() && config.pushOnSubresourceChanged().getValue()) return true; } } return false; }
if (pullConfig.depth().isActive()) depth = pullConfig.depth().getValue(); if (pullConfig.schedules().isActive()) schedules = pullConfig.schedules().getValue(); if (pullConfig.resolveReferences().isActive()) references = pullConfig.resolveReferences().getValue(); String relativePath = pullConfig.remoteRelativePath().getValue();
return; if (sendingApp.active().isActive() && !sendingApp.active().getValue()) { logger.info("Message received from deactivated messaging app {}", senderId); return;
@Override public void start() { boolean callOnEveryUpdate = true; if (m_config.callOnEveryUpdate().isActive()) { callOnEveryUpdate = m_config.callOnEveryUpdate().getValue(); } for (SingleValueResource input : m_config.inputs().getAllElements()) { input.addStructureListener(this); input.addValueListener(this, callOnEveryUpdate); } active = true; evaluate(); }
for (S emailConfig : entries.getAllElements()) { String userName = emailConfig.userName().getValue(); if (emailConfig.active().isActive() && emailConfig.active().getValue()) { activeUser = userName;
/** * Apply the threshold rule. */ private void enforceRules() { BooleanResource target = m_config.target(); if (!m_active) { target.deactivate(false); return; } final float value = m_config.source().getValue(); final boolean thresholdExceeded = (m_equalityExceeds) ? (value >= m_threshold) : (value > m_threshold); final boolean newState = (m_invert) ? (!thresholdExceeded) : thresholdExceeded; if (target.isActive()) { final boolean oldState = target.getValue(); if (oldState != newState) target.setValue(newState); } else { target.setValue(newState); target.activate(false); } lastExecTime = appMan.getFrameworkTime(); }
final boolean ignoreGaps = m_config.ignoreGaps().isActive() && m_config.ignoreGaps().getValue(); final long startTime; final boolean evaluateState = m_config.incrementalUpdate().getValue(); if (m_config.writeImmediately().getValue() && m_config.writeImmediately().isActive()) endTime = Long.MAX_VALUE; else
ResourceSimulation(ConfigPattern config, ReadOnlyTimeSeries input, ApplicationManager appMan) { this.config = config; this.resource = config.target.getLocationResource(); this.input = input; this.additive = config.additive.isActive() && config.additive.getValue(); if (!config.forecast.isActive()) { this.forecast = null; this.iterator = null; } else { final String scheduleName = config.forecast.getValue(); Schedule sched0 = resource.getSubResource(scheduleName); if (sched0 == null) sched0 = resource.getSubResource(scheduleName, AbsoluteSchedule.class).create(); this.forecast = sched0; sched0.activate(false); this.iterator = new CyclicIterator(input, appMan.getFrameworkTime()); } this.timer = appMan.createTimer(10000000, this); timerElapsed(timer); resource.activate(false); LoggingUtils.activateLogging(resource, -2); appMan.getLogger().debug("Simulation started for resource {}", resource); }
if (!mnt.batteryLow().isActive()) { mnt.batteryLow().create().activate(false);
if (!globalPush && con.push().isActive()) con.pushConfig().create().activate(false); if (con.pushOnSubresourceChanged().isActive() && con.pushOnSubresourceChanged().getValue()) { if (con.pushConfig().isActive()) { con.pushConfig().pushOnSubresourceChanged().<BooleanResource> create().setValue(true); if (config.pushOnSubresourceChanged().isActive()) continue; config.pushOnSubresourceChanged().<BooleanResource> create().setValue(true);