/** * Examines the given <code>Cache</code> and from it generates XML data that is written to the * given <code>PrintWriter</code>. */ public static void generate(ClientCache cache, PrintWriter pw) { generate(cache, pw, true /* useSchema */); }
/** * Generates XML for a <code>Declarable</code>. Will handle the config <code>Properties</code> for * a {@link Declarable2}. */ private void generate(Declarable d) throws SAXException { generate(d, true); }
/** * Examines the given <code>Cache</code> and from it generates XML data that is written to the * given <code>PrintWriter</code>. */ public static void generate(Cache cache, PrintWriter pw) { generate(cache, pw, true /* useSchema */); }
public static String generateCacheXml(Cache cache) { try { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw, true); CacheXmlGenerator.generate(cache, pw, true, false); pw.close(); return sw.toString(); } catch (Exception ex) { return ""; } }
private void writeCacheXml() { File file = new File("cache-" + System.currentTimeMillis() + ".xml"); try { PrintWriter pw = new PrintWriter(new FileWriter(file), true); CacheXmlGenerator.generate(this.cache, pw); pw.close(); } catch (IOException e) { } }
private void generate(String kind, Declarable d, Properties p) throws SAXException { if (d == null) { return; } handler.startElement("", kind, kind, EMPTY); String className = d.getClass().getName(); handler.startElement("", CLASS_NAME, CLASS_NAME, EMPTY); handler.characters(className.toCharArray(), 0, className.length()); handler.endElement("", CLASS_NAME, CLASS_NAME); generate(p, null); handler.endElement("", kind, kind); }
/** * Examines the given <code>Cache</code> and from it generates XML data that is written to the * given <code>PrintWriter</code>. The schema/dtd for the current version of GemFire is used. * * @param useSchema Should the generated XML reference a schema (as opposed to a DTD)? As of 8.1 * this value is ignored and always true. */ public static void generate(Cache cache, PrintWriter pw, boolean useSchema) { (new CacheXmlGenerator(cache, true /* latest version always true */, VERSION_LATEST, true)) .generate(pw); }
/** * Examines the given <code>ClientCache</code> and from it generates XML data that is written to * the given <code>PrintWriter</code>. The schema/dtd for the current version of GemFire is used. * * @param useSchema Should the generated XML reference a schema (as opposed to a DTD)? As of 8.1 * this value is ignored and always true. */ public static void generate(ClientCache cache, PrintWriter pw, boolean useSchema) { (new CacheXmlGenerator(cache, true /* latest version always true */, VERSION_LATEST, true)) .generate(pw); }
/** * @param useSchema Should the generated XML reference a schema (as opposed to a DTD)? As of 8.1 * this value is ignored and always true. * @param includeDefaults set to false to cause generated xml to not have defaults values. */ public static void generate(Cache cache, PrintWriter pw, boolean useSchema, boolean includeKeysValues, boolean includeDefaults) { (new CacheXmlGenerator(cache, true /* latest version always true */, VERSION_LATEST, includeKeysValues, includeDefaults)).generate(pw); }
/** * Writes a default cache.xml to pw. */ public static void generateDefault(PrintWriter pw) { (new CacheXmlGenerator()).generate(pw); }
/** * Examines the given <code>ClientCache</code> and from it generates XML data that is written to * the given <code>PrintWriter</code>. The schema/dtd for the current version of GemFire is used. * * @param useSchema Should the generated XML reference a schema (as opposed to a DTD)? As of 8.1 * this value is ignored and always true. * @param includeKeysValues true if the xml should include keys and values false otherwise */ public static void generate(ClientCache cache, PrintWriter pw, boolean useSchema, boolean includeKeysValues) { (new CacheXmlGenerator(cache, true /* latest version always true */, VERSION_LATEST, includeKeysValues)).generate(pw); }
/** * Examines the given <code>Cache</code> and from it generates XML data that is written to the * given <code>PrintWriter</code>. The schema/dtd for the current version of GemFire is used. * * @param useSchema Should the generated XML reference a schema (as opposed to a DTD)? As of 8.1 * this value is ignored and always true. * @param includeKeysValues true if the xml should include keys and values false otherwise */ public static void generate(Cache cache, PrintWriter pw, boolean useSchema, boolean includeKeysValues) { (new CacheXmlGenerator(cache, true /* latest version always true */, VERSION_LATEST, includeKeysValues)).generate(pw); }
private void generateGatewayEventFilter(GatewayEventFilter gef) throws SAXException { handler.startElement("", GATEWAY_EVENT_FILTER, GATEWAY_EVENT_FILTER, EMPTY); String className = gef.getClass().getName(); handler.startElement("", CLASS_NAME, CLASS_NAME, EMPTY); handler.characters(className.toCharArray(), 0, className.length()); handler.endElement("", CLASS_NAME, CLASS_NAME); Properties props = null; if (gef instanceof Declarable2) { props = ((Declarable2) gef).getConfig(); generate(props, null); } handler.endElement("", GATEWAY_EVENT_FILTER, GATEWAY_EVENT_FILTER); }
private void generateGatewayTransportFilter(GatewayTransportFilter gef) throws SAXException { handler.startElement("", GATEWAY_TRANSPORT_FILTER, GATEWAY_TRANSPORT_FILTER, EMPTY); String className = gef.getClass().getName(); handler.startElement("", CLASS_NAME, CLASS_NAME, EMPTY); handler.characters(className.toCharArray(), 0, className.length()); handler.endElement("", CLASS_NAME, CLASS_NAME); Properties props = null; if (gef instanceof Declarable2) { props = ((Declarable2) gef).getConfig(); generate(props, null); } handler.endElement("", GATEWAY_TRANSPORT_FILTER, GATEWAY_TRANSPORT_FILTER); }
/** * Examines the given <code>Cache</code> and from it generates XML data that is written to the * given <code>PrintWriter</code>. The schema/dtd for the current version of GemFire is used. * * @param useSchema Should the generated XML reference a schema (as opposed to a DTD)? For * versions 8.1 or newer this should be true, otherwise false. * @param version The version of GemFire whose DTD/schema should be used in the generated XML. See * {@link #VERSION_4_0}. * * @since GemFire 4.0 */ public static void generate(Cache cache, PrintWriter pw, boolean useSchema, String version) { (new CacheXmlGenerator(cache, useSchema, version, true)).generate(pw); }
private void generateGatewayEventSubstitutionFilter(GatewayEventSubstitutionFilter filter) throws SAXException { handler.startElement("", GATEWAY_EVENT_SUBSTITUTION_FILTER, GATEWAY_EVENT_SUBSTITUTION_FILTER, EMPTY); String className = filter.getClass().getName(); handler.startElement("", CLASS_NAME, CLASS_NAME, EMPTY); handler.characters(className.toCharArray(), 0, className.length()); handler.endElement("", CLASS_NAME, CLASS_NAME); Properties props = null; if (filter instanceof Declarable2) { props = ((Declarable2) filter).getConfig(); generate(props, null); } handler.endElement("", GATEWAY_EVENT_SUBSTITUTION_FILTER, GATEWAY_EVENT_SUBSTITUTION_FILTER); }
/** * Examines the given <code>ClientCache</code> and from it generates XML data that is written to * the given <code>PrintWriter</code>. The schema/dtd for the current version of GemFire is used. * * @param useSchema Should the generated XML reference a schema (as opposed to a DTD)? For * versions 8.1 or newer this should be true, otherwise false. * @param version The version of GemFire whose DTD/schema should be used in the generated XML. See * {@link #VERSION_4_0}. * * @since GemFire 6.5 */ public static void generate(ClientCache cache, PrintWriter pw, boolean useSchema, String version) { (new CacheXmlGenerator(cache, useSchema, version, true)).generate(pw); }
/** * Use the CacheXmlGenerator to create XML from the entity associated with the current cache. * * @return XML string representation of the entity. */ private String loadXmlDefinition() { final Cache cache = cacheProvider.getCache(); final StringWriter stringWriter = new StringWriter(); final PrintWriter printWriter = new PrintWriter(stringWriter); CacheXmlGenerator.generate(cache, printWriter, true, false, false); printWriter.close(); return loadXmlDefinition(stringWriter.toString()); }
private void generateInitializer() throws SAXException { if (this.cache.getInitializer() != null) { generate(INITIALIZER, this.cache.getInitializer(), this.cache.getInitializerProps()); } }