public void setResources(ConfTree resources) { this.resources = resources; resourceOperations = new ConfTreeOperations(resources); }
public void setInternal(ConfTree internal) { this.internal = internal; internalOperations = new ConfTreeOperations(internal); }
public void setAppConf(ConfTree appConf) { this.appConf = appConf; appConfOperations = new ConfTreeOperations(appConf); }
@Override public ConfTreeOperations getDesiredAppconf() throws IOException { ConfTree resource = getApplicationResource(MODEL_DESIRED_APPCONF, ConfTree.class); return new ConfTreeOperations(resource); }
@Override public ConfTreeOperations getDesiredResources() throws IOException { ConfTree resource = getApplicationResource(MODEL_DESIRED_RESOURCES, ConfTree.class); return new ConfTreeOperations(resource); }
@Override public ConfTreeOperations getLiveResources() throws IOException { ConfTree resource = getApplicationResource(LIVE_RESOURCES, ConfTree.class); return new ConfTreeOperations(resource); }
@Override public ConfTreeOperations getResolvedResources() throws IOException { ConfTree resource = getApplicationResource(MODEL_RESOLVED_RESOURCES, ConfTree.class); return new ConfTreeOperations(resource); }
@Override public ConfTreeOperations getDesiredResources() throws IOException { ConfTree resource = getApplicationResource(MODEL_DESIRED_RESOURCES, ConfTree.class); return new ConfTreeOperations(resource); }
@Override public ConfTreeOperations getResolvedResources() throws IOException { ConfTree resource = getApplicationResource(MODEL_RESOLVED_RESOURCES, ConfTree.class); return new ConfTreeOperations(resource); }
@Override public ConfTreeOperations getResolvedAppconf() throws IOException { ConfTree resource = getApplicationResource(MODEL_RESOLVED_APPCONF, ConfTree.class); return new ConfTreeOperations(resource); }
@Override public ConfTreeOperations getLiveResources() throws IOException { ConfTree resource = getApplicationResource(LIVE_RESOURCES, ConfTree.class); return new ConfTreeOperations(resource); }
protected ConfTree buildConfTree(Map<String, String> optionsMap) throws BadCommandArgumentsException { ConfTree confTree = new ConfTree(); ConfTreeOperations ops = new ConfTreeOperations(confTree); confTree.global.putAll(optionsMap); return confTree; } }
/** * Load from a resource. The inner conf tree is the loaded data -unresolved * @param resource resource * @return loaded value * @throws IOException load failure */ public static ConfTreeOperations fromResource(String resource) throws IOException { ConfTreeSerDeser confTreeSerDeser = new ConfTreeSerDeser(); ConfTreeOperations ops = new ConfTreeOperations( confTreeSerDeser.fromResource(resource) ); return ops; }
/** * Load from a resource. The inner conf tree is the loaded data -unresolved * @param resource resource * @return loaded value * @throws IOException load failure */ public static ConfTreeOperations fromFile(File resource) throws IOException { ConfTreeSerDeser confTreeSerDeser = new ConfTreeSerDeser(); ConfTreeOperations ops = new ConfTreeOperations( confTreeSerDeser.fromFile(resource) ); return ops; }
/** * Build from an existing instance -which is cloned via JSON ser/deser * @param instance the source instance * @return loaded value * @throws IOException load failure */ public static ConfTreeOperations fromInstance(ConfTree instance) throws IOException { ConfTreeSerDeser confTreeSerDeser = new ConfTreeSerDeser(); ConfTreeOperations ops = new ConfTreeOperations( confTreeSerDeser.fromJson(confTreeSerDeser.toJson(instance)) ); return ops; }
public static ConfTreeOperations unmarshallToCTO(Messages.WrappedJsonProto wire) throws IOException { return new ConfTreeOperations(new ConfTreeSerDeser().fromJson(wire.getJson())); }
/** * Load from a file and merge it in * @param file file * @param validator properties validator * @throws IOException any IO problem * @throws BadConfigException if the file is invalid */ public void mergeFile(File file, InputPropertiesValidator validator) throws IOException, BadConfigException { ConfTreeSerDeser confTreeSerDeser = new ConfTreeSerDeser(); ConfTree tree = confTreeSerDeser.fromFile(file); ConfTreeOperations ops = new ConfTreeOperations(tree); ops.validate(validator); merge(ops.confTree); }
public static ConfTreeOperations unmarshallToCTO(Messages.WrappedJsonProto wire) throws IOException { return new ConfTreeOperations(new ConfTreeSerDeser().fromJson(wire.getJson())); }
/** * Schedule the escalation action * @param internal * @throws BadConfigException */ private void scheduleEscalation(ConfTree internal) throws BadConfigException { EscalateOutstandingRequests escalate = new EscalateOutstandingRequests(); ConfTreeOperations ops = new ConfTreeOperations(internal); int seconds = ops.getGlobalOptions().getOptionInt(InternalKeys.ESCALATION_CHECK_INTERVAL, InternalKeys.DEFAULT_ESCALATION_CHECK_INTERVAL); RenewingAction<EscalateOutstandingRequests> renew = new RenewingAction<>( escalate, seconds, seconds, TimeUnit.SECONDS, 0); actionQueues.renewing("escalation", renew); }
/** * Schedule the escalation action * @param internal * @throws BadConfigException */ private void scheduleEscalation(ConfTree internal) throws BadConfigException { EscalateOutstandingRequests escalate = new EscalateOutstandingRequests(); ConfTreeOperations ops = new ConfTreeOperations(internal); int seconds = ops.getGlobalOptions().getOptionInt(InternalKeys.ESCALATION_CHECK_INTERVAL, InternalKeys.DEFAULT_ESCALATION_CHECK_INTERVAL); RenewingAction<EscalateOutstandingRequests> renew = new RenewingAction<>( escalate, seconds, seconds, TimeUnit.SECONDS, 0); actionQueues.renewing("escalation", renew); }