@Override public Trigger copy(String uuid) { try { Trigger t = get(uuid).clone(); t.setName("Copy of " + t.getName()); create(t); return t; } catch (Exception e) { return null; } }
@Override public Trigger modify(String uuid, Trigger data) { try { if (uuid == null || uuid.isEmpty() || data == null) { LOG.warning("Cannot even start modifying trigger, basic data missing"); return null; } else { delete(uuid); data.setUUID(uuid); create(data); try { data.register(); } catch (Exception f) { LOG.warning("Cannot register trigger " + data.getName()); } return data; } } catch (Exception e) { LOG.log(Level.SEVERE, "Error while modifying trigger" + data.getName(), e); return null; } }