Exemple #1
0
  @Override
  public void start() {
    TypedProperties properties = getTypedProperties();

    deleteOnComplete = properties.is(SETTING_DELETE_ON_COMPLETE, deleteOnComplete);

    String sourceResourceId = properties.get(SETTING_SOURCE_RESOURCE);
    IResourceRuntime sourceResource = context.getDeployedResources().get(sourceResourceId);
    if (sourceResource == null) {
      throw new MisconfiguredException("The source resource must be defined");
    } else {
      sourceDir = sourceResource.reference();
    }

    String targetResourceId = properties.get(SETTING_TARGET_RESOURCE);
    IResourceRuntime targetResource = context.getDeployedResources().get(targetResourceId);
    if (targetResource == null) {
      throw new MisconfiguredException("The target resource must be defined");
    } else {
      targetDir = targetResource.reference();
    }

    targetRelativePath = properties.get(SETTING_TARGET_RELATIVE_PATH, "");
    overwrite = properties.is(SETTING_OVERWRITE, overwrite);
    targetSubDir = properties.is(SETTING_TARGET_SUB_DIR, targetSubDir);
    mustExist = properties.is(SETTING_MUST_EXIST, mustExist);
    extractEmptyFiles = properties.is(SETTING_EXTRACT_EMPTY_FILES, extractEmptyFiles);
    encoding = properties.get(SETTING_ENCODING, encoding);
  }
Exemple #2
0
  @Override
  protected void start() {
    error = null;
    TypedProperties properties = getTypedProperties();
    this.sourceStep1Id = properties.get(SOURCE_1);
    if (isBlank(sourceStep1Id)) {
      throw new MisconfiguredException("Please choose a step where the original data comes from");
    }
    this.sourceStep2Id = properties.get(SOURCE_2);
    if (isBlank(sourceStep2Id)) {
      throw new MisconfiguredException("Please choose a step where the data to compare comes from");
    }

    this.inMemoryCompare = properties.is(IN_MEMORY_COMPARE);
    this.rowsPerMessage = properties.getInt(ROWS_PER_MESSAGE);
    Component comp = context.getFlowStep().getComponent();
    comp.setOutputModel(comp.getInputModel());
    Model inputModel = context.getFlowStep().getComponent().getInputModel();
    if (inputModel == null) {
      throw new MisconfiguredException("The input model is not set and it is required");
    }

    entities = new ArrayList<>(inputModel.getModelEntities());
    Collections.sort(
        entities,
        new Comparator<ModelEntity>() {
          @Override
          public int compare(ModelEntity o1, ModelEntity o2) {
            ComponentEntitySetting order1 =
                context
                    .getFlowStep()
                    .getComponent()
                    .getSingleEntitySetting(o1.getId(), DataDiff.ENTITY_ORDER);
            int orderValue1 = order1 != null ? Integer.parseInt(order1.getValue()) : 0;

            ComponentEntitySetting order2 =
                context
                    .getFlowStep()
                    .getComponent()
                    .getSingleEntitySetting(o2.getId(), DataDiff.ENTITY_ORDER);
            int orderValue2 = order2 != null ? Integer.parseInt(order2.getValue()) : 0;

            return new Integer(orderValue1).compareTo(new Integer(orderValue2));
          }
        });
  }
Exemple #3
0
 @Override
 protected void start(TypedProperties properties) {
   streamable =
       new HttpDirectory(
           properties.get(URL),
           properties.get(HTTP_METHOD, HTTP_METHOD_GET),
           properties.get(CONTENT_TYPE),
           properties.getInt(HTTP_TIMEOUT),
           properties.get(SECURITY),
           properties.get(SECURITY_USERNAME),
           properties.get(SECURITY_PASSWORD),
           properties.get(SECURITY_TOKEN_VALUE),
           properties.get(SECURITY_OAUTH10_CONSUMER_KEY),
           properties.get(SECURITY_OAUTH10_CONSUMER_SECRET),
           properties.get(SECURITY_OAUTH10_TOKEN),
           properties.get(SECURITY_OAUTH10_TOKEN_SECRET),
           properties.get(SECURITY_OAUTH10_VERSION),
           properties.get(SECURITY_OAUTH10_SIGNATURE_METHOD),
           properties.get(SECURITY_OAUTH10_REALM));
 }