@Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.HANDLER + "." + this.getClass().getName())); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return this.eventSwitch; }
@Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.HANDLER + "." + this.getClass().getName())); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return eventSwitch; }
@Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.HANDLER + "." + this.getClass().getName())); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return this.eventSwitch; }
@Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.CONSUMER)); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return eventSwitch; }
@Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.PRODUCER)); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return eventSwitch; }
@Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.PRODUCER)); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return eventSwitch; }
@Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.PRODUCER)); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return eventSwitch; }
@Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.CONSUMER)); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return eventSwitch; }
@Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.CONSUMER)); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return eventSwitch; }
@Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.PRODUCER)); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return eventSwitch; }
@Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.CONSUMER)); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return eventSwitch; }
/** * Get the handler switch. * * @return the handler switch. */ @Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.HANDLER + "." + this.getClass().getName())); if (status) { dosgiSwitch.turnOn(); } else { dosgiSwitch.turnOff(); } } } catch (Exception e) { // ignore } return dosgiSwitch; }
/** * Get the cluster bundle event handler switch. * * @return the cluster bundle event handler switch. */ @Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.HANDLER + "." + this.getClass().getName())); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return eventSwitch; }
/** * Get the cluster configuration event handler switch. * * @return the cluster configuration event handler switch. */ @Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.HANDLER + "." + this.getClass().getName())); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // nothing to do } return eventSwitch; }
/** * Get the cluster configuration event handler switch. * * @return the cluster configuration event handler switch. */ @Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.HANDLER + "." + this.getClass().getName())); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // nothing to do } return eventSwitch; }
/** * Get the handler switch. * * @return the handler switch. */ @Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.HANDLER + "." + this.getClass().getName())); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return eventSwitch; }
/** * Get the cluster bundle event handler switch. * * @return the cluster bundle event handler switch. */ @Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.HANDLER + "." + this.getClass().getName())); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return eventSwitch; }
/** * Get the handler switch. * * @return the handler switch. */ @Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.HANDLER + "." + this.getClass().getName())); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return eventSwitch; }
/** * Get the handler switch. * * @return the handler switch. */ @Override public Switch getSwitch() { // load the switch status from the config try { Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE, null); if (configuration != null) { Boolean status = new Boolean((String) configuration.getProperties().get(Configurations.HANDLER + "." + this.getClass().getName())); if (status) { eventSwitch.turnOn(); } else { eventSwitch.turnOff(); } } } catch (Exception e) { // ignore } return eventSwitch; }
/** * Handle the {@code ProducerSwitchCommand} command. * * @param command */ public ConsumerSwitchResult execute(ConsumerSwitchCommand command) { // query if (command.getStatus() == null) { return new ConsumerSwitchResult(command.getId(), Boolean.TRUE, consumer.getSwitch().getStatus().getValue()); } else if (command.getStatus().equals(SwitchStatus.ON)) { // turn on the switch consumer.getSwitch().turnOn(); // persist the change persist(command.getStatus()); return new ConsumerSwitchResult(command.getId(), Boolean.TRUE, Boolean.TRUE); } else if (command.getStatus().equals(SwitchStatus.OFF)) { // turn on the switch consumer.getSwitch().turnOff(); // persist the change persist(command.getStatus()); return new ConsumerSwitchResult(command.getId(), Boolean.TRUE, Boolean.FALSE); } else { return new ConsumerSwitchResult(command.getId(), Boolean.FALSE, consumer.getSwitch().getStatus().getValue()); } }