Package com.alu.e3.prov.restapi.model.Validation

Examples of com.alu.e3.prov.restapi.model.Validation.Schema


    return mVal;
  }

  private static final TdrData fromDataModel(TdrGenerationRule tdrGenerationRule) {
    if (tdrGenerationRule==null) return null; //throw new IllegalArgumentException("tdrGenerationRules must not be null");
    TdrData t = new TdrData();
    t.getStatic().addAll  (BeanConverterUtil.<StaticTdr, TdrStaticRule>fromDataModels(tdrGenerationRule.getStaticRules()));
    t.getDynamic().addAll  (BeanConverterUtil.<DynamicTdr, TdrDynamicRule>fromDataModels(tdrGenerationRule.getDynamicRules()));
    return t;
  }
View Full Code Here


    StaticTdr s = new StaticTdr();
    s.setValue          (tdrStaticRule.getValue());
    s.setTdrPropName      (tdrStaticRule.getTdrPropName());
    s.setPropertyName      (tdrStaticRule.getPropertyName());

    TdrType tdrType = new TdrType();
    s.setTypes          (tdrType);
    tdrType.getType().addAll  (tdrStaticRule.getTypes());

    return s;
  }
View Full Code Here

    DynamicTdr s = new DynamicTdr();
    s.setHttpHeaderName      (tdrDynamicRule.getHttpHeaderName());
    s.setTdrPropName      (tdrDynamicRule.getTdrPropName());
    s.setExtractFrom      (tdrDynamicRule.getExtractFrom());

    TdrType tdrType = new TdrType();
    s.setTypes          (tdrType);
    tdrType.getType().addAll  (tdrDynamicRule.getTypes());

    return s;
  }
View Full Code Here

  private static final Validation fromDataModel(com.alu.e3.data.model.sub.Validation val) {
    if (val == null)
      return null;

    Validation rVal = new Validation();

    if (val.getXml() != null) {
      rVal.setXml(new Validation.Xml());
    }
    if (val.getSchema() != null) {
      rVal.setSchema(fromDataModel(val.getSchema()));
    }

    if (val.getSoap() != null) {
      rVal.setSoap(new Validation.Soap(com.alu.e3.prov.restapi.model.SoapVersionEnum.fromValue(val.getSoap().getVersion().value())));
    }

    return rVal;
  }
View Full Code Here

  protected void doGenResources(List<JarEntryData> entries, Api api, Map<Object, Object> variablesMap) throws UnsupportedEncodingException, IOException {
    if (api.getValidation() != null) {
      Validation val = api.getValidation();

      Schema schema = val.getSchema();

      if (schema != null) {

        // loop on schema resources and store them on files
        StringBuffer buf = new StringBuffer();
        List<ResourceItem> resources = schema.getResourcesList();
        int resourcesCount = resources.size();
        for (int i = 0; i < resourcesCount; i++) {
          ResourceItem item = resources.get(i);

          if (item != null) {
            boolean isMain = item.isIsMain();
            String fileName = item.getName();
            if (isMain) {
              fileName = "main." + fileName;
            }

            // log file name
            buf.append(fileName);
            if ((i + 1) < resourcesCount) {
              buf.append(";");
            }

            addJarEntry(entries, item.getGrammar().getBytes("UTF-8"), RESOURCES_FOLDER_PATH_IN_JAR + File.separator + fileName);
          }
        }

        // if the validation is WSDL, we need to add the schemas to
        // validate the SOAP envelop
        if (schema.getType() == SchemaValidationEnum.WSDL) {
          addSOAPResources(entries, buf, RESOURCES_FOLDER_PATH_IN_JAR);
        }

        // write resources.list file
        addJarEntry(entries, buf.toString().getBytes("UTF-8"), RESOURCES_FOLDER_PATH_IN_JAR + File.separator + "resources.list");
View Full Code Here

    return rVal;
  }

  private static final com.alu.e3.prov.restapi.model.Validation.Schema fromDataModel(com.alu.e3.data.model.sub.Validation.Schema schema) {
    Schema ret = new Schema()
    ret.setType(com.alu.e3.prov.restapi.model.SchemaValidationEnum.fromValue(schema.getType().value()));

    ret.setResourcesList(BeanConverterUtil.<ResourceItem, com.alu.e3.data.model.sub.ResourceItem> fromDataModels(schema.getResourcesList()));

    return ret;
  }
View Full Code Here

   
    return perfWatch;
  }
 
  public TdrStreamWriter(File dir) throws TransformerConfigurationException {
    this(new RotatableFileWriterProvider(dir, TDR_FILE_SIZE, TDR_FILE_AGE) {
      @Override
      protected String getFileName() {
        return "tdrs." + System.currentTimeMillis() + ".xml";   // TDR file name
      }
View Full Code Here

   
    topologyWatcher.setPollingInterval(POLLING_INTERVAL);
   
    topologyClient = new DummyTopologyClient();
   
    healthCheckFactory = new DummyHealthCheckFactory();
   
    setHealthCheckGateways(gatewayList);
    setHealthCheckGatewaysActive(gatewayActiveList);
    setHealthCheckSpeakers(activeSpeakerList);
   
View Full Code Here

  private void createTestResources(String[] gatewayList, String[] gatewayActiveList, String[] activeSpeakerList) {
    topologyWatcher = new TopologyWatcher();
   
    topologyWatcher.setPollingInterval(POLLING_INTERVAL);
   
    topologyClient = new DummyTopologyClient();
   
    healthCheckFactory = new DummyHealthCheckFactory();
   
    setHealthCheckGateways(gatewayList);
    setHealthCheckGatewaysActive(gatewayActiveList);
View Full Code Here

   
    return instance;
  }
 
  private void createTestResources(String[] gatewayList, String[] gatewayActiveList, String[] activeSpeakerList) {
    topologyWatcher = new TopologyWatcher();
   
    topologyWatcher.setPollingInterval(POLLING_INTERVAL);
   
    topologyClient = new DummyTopologyClient();
   
View Full Code Here

TOP

Related Classes of com.alu.e3.prov.restapi.model.Validation.Schema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.