Java Code Examples for org.jboss.as.controller.parsing.Namespace#getMajorVersion()
The following examples show how to use
org.jboss.as.controller.parsing.Namespace#getMajorVersion() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HostXml_Legacy.java From wildfly-core with GNU Lesser General Public License v2.1 | 6 votes |
@Override public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> operationList) throws XMLStreamException { final ModelNode address = new ModelNode().setEmptyList(); if (Element.forName(reader.getLocalName()) != Element.HOST) { throw unexpectedElement(reader); } Namespace readerNS = Namespace.forUri(reader.getNamespaceURI()); if (readerNS == DOMAIN_1_0) { readHostElement_1_0(reader, address, operationList); } else if (readerNS.getMajorVersion() == 1 || readerNS.getMajorVersion() == 2) { readHostElement_1_1(readerNS, reader, address, operationList); } else { // Instead of having to list the remaining versions we just check it is actually a valid version. for (Namespace current : Namespace.domainValues()) { if (readerNS.equals(current)) { readHostElement_3_0(readerNS, reader, address, operationList); return; } } throw unexpectedElement(reader); } }
Example 2
Source File: VaultXml.java From wildfly-core with GNU Lesser General Public License v2.1 | 6 votes |
void parseVault(final XMLExtendedStreamReader reader, final ModelNode address, final Namespace expectedNs, final List<ModelNode> list) throws XMLStreamException { switch (expectedNs) { case DOMAIN_1_0: throw unexpectedElement(reader); case DOMAIN_1_1: case DOMAIN_1_2: case DOMAIN_1_3: case DOMAIN_1_4: case DOMAIN_1_5: parseVault_1_1(reader, address, expectedNs, list); break; default: if (expectedNs.getMajorVersion() == 2) { parseVault_1_1(reader, address, expectedNs, list); } else { parseVault_1_6_and_3_0(reader, address, expectedNs, list); } } }
Example 3
Source File: ManagementXml.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
static ManagementXml newInstance(Namespace namespace, ManagementXmlDelegate delegate, boolean domainConfiguration) { switch (namespace.getMajorVersion()) { case 1: case 2: case 3: return new ManagementXml_Legacy(namespace, delegate, domainConfiguration); case 4: return new ManagementXml_4(namespace, delegate, domainConfiguration); default: return new ManagementXml_5(namespace, delegate, domainConfiguration); } }
Example 4
Source File: AuditLogXml.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
static AuditLogXml newInstance(Namespace namespace, boolean host) { switch (namespace.getMajorVersion()) { case 1: case 2: case 3: return new AuditLogXml_Legacy(host); case 4: return new AuditLogXml_4(host); default: return new AuditLogXml_5(host); } }
Example 5
Source File: JvmXml.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
public static void parseJvm(final XMLExtendedStreamReader reader, final ModelNode parentAddress, final Namespace expectedNs, final List<ModelNode> updates, final Set<String> jvmNames, final boolean server) throws XMLStreamException { switch (expectedNs.getMajorVersion()) { case 1: case 2: parseJvm_1_0(reader, parentAddress, expectedNs, updates, jvmNames, server); break; default: parseJvm_3_0(reader, parentAddress, expectedNs, updates, jvmNames, server); break; } }
Example 6
Source File: HostXml.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
@Override public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> operationList) throws XMLStreamException { Namespace readerNS = Namespace.forUri(reader.getNamespaceURI()); switch (readerNS.getMajorVersion()) { case 1: case 2: case 3: new HostXml_Legacy(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 4: new HostXml_4(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 5: new HostXml_5(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 6: new HostXml_6(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 7: new HostXml_7(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 8: new HostXml_8(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 9: new HostXml_9(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 10: new HostXml_10(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 11: new HostXml_11(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 12: new HostXml_12(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 13: new HostXml_13(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; default: new HostXml_14(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); } }
Example 7
Source File: DomainXml.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
@Override public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> nodes) throws XMLStreamException { Namespace readerNS = Namespace.forUri(reader.getNamespaceURI()); switch (readerNS.getMajorVersion()) { case 1: case 2: case 3: new DomainXml_Legacy(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 4: new DomainXml_4(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 5: new DomainXml_5(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 6: new DomainXml_6(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 7: new DomainXml_7(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 8: new DomainXml_8(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 9: new DomainXml_9(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 10: new DomainXml_10(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 11: new DomainXml_11(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 12: new DomainXml_12(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 13: new DomainXml_13(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; default: new DomainXml_14(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); } }
Example 8
Source File: InterfacesXml.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
private void parseInterfaceCriteria(final XMLExtendedStreamReader reader, final Namespace expectedNs, final ModelNode interfaceModel) throws XMLStreamException { // all subsequent elements are criteria elements if (reader.nextTag() == END_ELEMENT) { return; } requireNamespace(reader, expectedNs); Element element = Element.forName(reader.getLocalName()); switch (element) { case ANY_IPV4_ADDRESS: case ANY_IPV6_ADDRESS: { if (expectedNs.getMajorVersion() >= 3) { throw ParseUtils.unexpectedElement(reader); } else { throw ParseUtils.unsupportedElement(reader, Element.ANY_ADDRESS.getLocalName()); } } case ANY_ADDRESS: { interfaceModel.get(Element.ANY_ADDRESS.getLocalName()).set(true); requireNoContent(reader); // consume this element requireNoContent(reader); // consume rest of criteria (no further content allowed) return; } } do { requireNamespace(reader, expectedNs); element = Element.forName(reader.getLocalName()); switch (element) { case ANY: parseCompoundInterfaceCriterion(reader, expectedNs, interfaceModel.get(ANY).setEmptyObject()); break; case NOT: parseCompoundInterfaceCriterion(reader, expectedNs, interfaceModel.get(NOT).setEmptyObject()); break; default: { // parseSimpleInterfaceCriterion(reader, criteria.add().set(element.getLocalName(), new // ModelNode()).get(element.getLocalName())); parseSimpleInterfaceCriterion(reader, interfaceModel, false); break; } } } while (reader.nextTag() != END_ELEMENT); }
Example 9
Source File: StandaloneXml.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
@Override public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> operationList) throws XMLStreamException { Namespace readerNS = Namespace.forUri(reader.getNamespaceURI()); switch (readerNS.getMajorVersion()) { case 1: case 2: case 3: new StandaloneXml_Legacy(extensionHandler, readerNS, deferredExtensionContext, parsingOptions) .readElement(reader, operationList); break; case 4: new StandaloneXml_4(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 5: new StandaloneXml_5(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 6: new StandaloneXml_6(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 7: new StandaloneXml_7(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 8: new StandaloneXml_8(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 9: new StandaloneXml_9(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 10: new StandaloneXml_10(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 11: new StandaloneXml_11(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 12: new StandaloneXml_12(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 13: new StandaloneXml_13(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; default: new StandaloneXml_14(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); } }