return (Ruleset) rulesets.get(id);
}
public Ruleset loadRuleset( Reader reader )
{
Ruleset ruleset = null;
try
{
DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = dbfactory.newDocumentBuilder();
InputSource source = new InputSource(reader);
Document doc = builder.parse(source);
Unmarshaller unmarshaller = new Unmarshaller(this.mapper);
ruleset = (Ruleset) unmarshaller.unmarshal(doc);
ruleset.sync();
rulesets.put(ruleset.getId(), ruleset);
}
catch (Throwable t)
{
log.error("ForwardService: Could not unmarshal: " + reader, t);