public void replaceXMLEventType(String xmlEventTypeName, ConfigurationEventTypeXMLDOM config)
      throws ConfigurationException {
    SchemaModel schemaModel = null;
    if (config.getSchemaResource() != null || config.getSchemaText() != null) {
      try {
        schemaModel =
            XSDSchemaMapper.loadAndMap(config.getSchemaResource(), config.getSchemaText(), 2);
      } catch (Exception ex) {
        throw new ConfigurationException(ex.getMessage(), ex);
      }
    }

    try {
      eventAdapterService.replaceXMLEventType(xmlEventTypeName, config, schemaModel);
    } catch (EventAdapterException e) {
      throw new ConfigurationException("Error updating XML event type: " + e.getMessage(), e);
    }
  }
  public void addEventType(String eventTypeName, ConfigurationEventTypeXMLDOM xmlDOMEventTypeDesc) {
    SchemaModel schemaModel = null;

    if ((xmlDOMEventTypeDesc.getSchemaResource() != null)
        || (xmlDOMEventTypeDesc.getSchemaText() != null)) {
      try {
        schemaModel =
            XSDSchemaMapper.loadAndMap(
                xmlDOMEventTypeDesc.getSchemaResource(), xmlDOMEventTypeDesc.getSchemaText(), 2);
      } catch (Exception ex) {
        throw new ConfigurationException(ex.getMessage(), ex);
      }
    }

    try {
      eventAdapterService.addXMLDOMType(eventTypeName, xmlDOMEventTypeDesc, schemaModel, false);
    } catch (EventAdapterException t) {
      throw new ConfigurationException(t.getMessage(), t);
    }
  }