@Override public void delete(final State instance) { STATES.remove(instance.getId()); }
@Override public void delete(final State instance) { final String id = instance.getId(); final File file = new File(getFilename(id)); if (file.exists()) { file.delete(); } states.remove(id); }
@Override public void delete(final State instance) { try { getCollection().remove("{_id: #}", instance.getId()); } catch (final Exception e) { LOG.log(Level.WARNING, "delete error", e); } }
/** * Sets the my params. * * @param myParams * the new my params */ public void setMyParams(final ObjectNode myParams) { this.myParams = myParams; state = new StateBuilder().withConfig((ObjectNode) myParams.get("state")).build(); WakeServiceBuilder.getServices().put(state.getId(), this); }
/** * Instantiates a new wake service. * * @param params * the params, containing at least a "state" field, with a * specific State configuration. */ public WakeService(final ObjectNode params) { myParams = params; state = new StateBuilder().withConfig( (ObjectNode) myParams.get("state")).build(); WakeServiceBuilder.getServices().put(state.getId(), this); }
/** * Instantiates a new InstantiationService. * * @param params * the params, containing at least a "state" field, with a * specific State configuration. * @param cl * the cl */ public InstantiationService(final ObjectNode params, final ClassLoader cl) { this.cl = cl; myParams = params; final State state = new StateBuilder().withConfig( (ObjectNode) myParams.get("state")).build(); stateService = state.getService(); myId = state.getId(); InstantiationServiceBuilder.getServices().put(myId, this); load(); }