class NessusAdapterV1 extends AbstractAdapter<NessusAdapterContext, NessusAdapterConfig> implements NessusAdapter {

	String resolvePolicyUIDByTitle(String content, String searchedPolicyTitle, NessusAdapterContext context)
			throws AdapterException {
		try {

			ArrayNode templatesArray = context.json().fetch("templates", content).asArray();
			for (Iterator<JsonNode> elements = templatesArray.elements(); elements.hasNext();) {
				JsonNode node = elements.next();
				String title = context.json().fetch("title", node).asText();
				if (searchedPolicyTitle.equals(title)) {
					return context.json().fetch("uuid", node).asText();
				}
			}
			return null;
		} catch (Exception e) {
			// JSON errors are marked as adapter exceptions and all others too...
			throw asAdapterException("Was not able to resolve policy uid", e, context);
		}
	}

}