InstanceReaderFilter(String theServerName, URL theDomainXml, XMLInputFactory theXif) throws XMLStreamException, DomainXmlPreParserException { super(theDomainXml, theXif); instanceName = theServerName; dxpp = new DomainXmlPreParser(domainXml, xif, instanceName); }
private void handleServer() { String name = getName(); String configRef = getConfigRef(); printf("SERVER: " + name + ", ref= " + configRef); if (instanceName.equals(name)) serverConfigRef = configRef; }
private void handleClusters() throws XMLStreamException { // we are pointed at the servers element printf("FOUND CLUSTERS"); while (skipToStartButNotPast(CLUSTER, CLUSTERS)) { handleCluster(); } }
private void handleConfigs() throws XMLStreamException { // we are pointed at the configs element printf("FOUND CONFIGS"); while (skipToStartButNotPast(CONFIG, CONFIGS)) { handleConfig(); } }
private void handleCluster() throws XMLStreamException { ClusterData cd = new ClusterData(); cd.name = getName(); cd.configRef = getConfigRef(); handleServerRefs(cd); clusters.add(cd); printf(cd.toString()); }
DomainXmlPreParser(URL domainXml, XMLInputFactory xif, String instanceNameIn) throws DomainXmlPreParserException { if (domainXml == null || xif == null || !StringUtils.ok(instanceNameIn)) throw new IllegalArgumentException(); InputStream in = null; try { instanceName = instanceNameIn; in = domainXml.openStream(); reader = xif.createXMLStreamReader(domainXml.toExternalForm(), in); parse(); postProcess(); validate(); } catch (DomainXmlPreParserException e) { throw e; } catch (Exception e2) { throw new DomainXmlPreParserException(e2); } finally { cleanup(in); } }
private void handleElement() throws XMLStreamException { String name = reader.getLocalName(); if (!StringUtils.ok(name)) return; if (name.equals(SERVERS)) { handleServers(); } else if (name.equals(CLUSTERS)) { handleClusters(); } else if (name.equals(CONFIGS)) { handleConfigs(); } }
/** * @return true if we want to filter out this config element */ private boolean handleConfig(XMLStreamReader reader) { String name = reader.getAttributeValue(null, NAME); if (dxpp.getConfigName().equals(name)) return false; return true; }
/** * Note that dxpp.getClusterName() will definitely return null * for stand-alone instances. This is normal. * * @return true if we want to filter out this cluster element */ private boolean handleCluster(XMLStreamReader reader) { String name = reader.getAttributeValue(null, NAME); String myCluster = dxpp.getClusterName(); if (StringUtils.ok(myCluster) && myCluster.equals(name)) return false; return true; }
/** * @return true if we want to filter out this server element */ private boolean handleServer(XMLStreamReader r) { String name = r.getAttributeValue(null, NAME); if (StringUtils.ok(name) && dxpp.getServerNames().contains(name)) return false; return true; }
private void handleCluster() throws XMLStreamException { ClusterData cd = new ClusterData(); cd.name = getName(); cd.configRef = getConfigRef(); handleServerRefs(cd); clusters.add(cd); printf(cd.toString()); }
DomainXmlPreParser(URL domainXml, XMLInputFactory xif, String instanceNameIn) throws DomainXmlPreParserException { if (domainXml == null || xif == null || !StringUtils.ok(instanceNameIn)) throw new IllegalArgumentException(); instanceName = instanceNameIn; try ( InputStream in = domainXml.openStream(); InputStreamReader isr = new InputStreamReader(in, Charset.defaultCharset().toString()) ) { reader = xif.createXMLStreamReader(domainXml.toExternalForm(), isr); parse(); postProcess(); validate(); } catch (DomainXmlPreParserException e) { throw e; } catch (Exception e2) { throw new DomainXmlPreParserException(e2); } finally { cleanup(); } }
private void handleConfigs() throws XMLStreamException { // we are pointed at the configs element printf("FOUND CONFIGS"); while (skipToStartButNotPast(CONFIG, CONFIGS)) { handleConfig(); } }
private void handleElement() throws XMLStreamException { String name = reader.getLocalName(); if (!StringUtils.ok(name)) return; if (name.equals(SERVERS)) { handleServers(); } else if (name.equals(CLUSTERS)) { handleClusters(); } else if (name.equals(CONFIGS)) { handleConfigs(); } }
/** * @return true if we want to filter out this config element */ private boolean handleConfig(XMLStreamReader reader) { String name = reader.getAttributeValue(null, NAME); if (dxpp.getConfigName().equals(name)) return false; return true; }
/** * Note that dxpp.getClusterName() will definitely return null * for stand-alone instances. This is normal. * * @return true if we want to filter out this cluster element */ private boolean handleCluster(XMLStreamReader reader) { String name = reader.getAttributeValue(null, NAME); String myCluster = dxpp.getClusterName(); if (StringUtils.ok(myCluster) && myCluster.equals(name)) return false; return true; }
/** * @return true if we want to filter out this server element */ private boolean handleServer(XMLStreamReader r) { String name = r.getAttributeValue(null, NAME); if (StringUtils.ok(name) && dxpp.getServerNames().contains(name)) return false; return true; }
private void handleClusters() throws XMLStreamException { // we are pointed at the servers element printf("FOUND CLUSTERS"); while (skipToStartButNotPast(CLUSTER, CLUSTERS)) { handleCluster(); } }
private void handleServer() { String name = getName(); String configRef = getConfigRef(); printf("SERVER: " + name + ", ref= " + configRef); if (instanceName.equals(name)) serverConfigRef = configRef; }
InstanceReaderFilter(String theServerName, URL theDomainXml, XMLInputFactory theXif) throws XMLStreamException, DomainXmlPreParserException { super(theDomainXml, theXif); instanceName = theServerName; dxpp = new DomainXmlPreParser(domainXml, xif, instanceName); }