private JobDefinitionEntity createOrUpdateJobDefinitionEntity(JobDefinitionEntity jobDefinitionEntity,NamespaceEntity namespaceEntity,String jobName,String description,String activitiId,List<Parameter> parameters,S3PropertiesLocation s3PropertiesLocation){
  JobDefinitionEntity jobDefinitionEntityLocal=jobDefinitionEntity;
  if (jobDefinitionEntityLocal == null) {
    jobDefinitionEntityLocal=new JobDefinitionEntity();
  }
  jobDefinitionEntityLocal.setName(jobName);
  jobDefinitionEntityLocal.setNamespace(namespaceEntity);
  jobDefinitionEntityLocal.setDescription(description);
  jobDefinitionEntityLocal.setActivitiId(activitiId);
  String bucketName=null;
  String key=null;
  if (s3PropertiesLocation != null) {
    bucketName=s3PropertiesLocation.getBucketName();
    key=s3PropertiesLocation.getKey();
  }
  jobDefinitionEntityLocal.setS3BucketName(bucketName);
  jobDefinitionEntityLocal.setS3ObjectKey(key);
  List<JobDefinitionParameterEntity> parameterEntities=new ArrayList<>();
  if (!CollectionUtils.isEmpty(parameters)) {
    for (    Parameter parameter : parameters) {
      JobDefinitionParameterEntity parameterEntity=new JobDefinitionParameterEntity();
      parameterEntities.add(parameterEntity);
      parameterEntity.setName(parameter.getName());
      parameterEntity.setValue(parameter.getValue());
    }
  }
  jobDefinitionEntityLocal.setParameters(parameterEntities);
  return jobDefinitionEntityLocal;
}

private JobDefinitionEntity createOrUpdateJobDefinitionEntity ( JobDefinitionEntity jobDefinitionEntity , NamespaceEntity namespaceEntity , String jobName , String description , String activitiId , List < Parameter > parameters , S3PropertiesLocation s3PropertiesLocation ) { JobDefinitionEntity jobDefinitionEntityLocal = jobDefinitionEntity ; if ( jobDefinitionEntityLocal == null ) { jobDefinitionEntityLocal = new JobDefinitionEntity ( ) ; } jobDefinitionEntityLocal . setName ( jobName ) ; jobDefinitionEntityLocal . setNamespace ( namespaceEntity ) ; jobDefinitionEntityLocal . setDescription ( description ) ; jobDefinitionEntityLocal . setActivitiId ( activitiId ) ; String bucketName = null ; String key = null ; if ( s3PropertiesLocation != null ) { bucketName = s3PropertiesLocation . getBucketName ( ) ; key = s3PropertiesLocation . getKey ( ) ; } jobDefinitionEntityLocal . setS3BucketName ( bucketName ) ; jobDefinitionEntityLocal . setS3ObjectKey ( key ) ; List < JobDefinitionParameterEntity > parameterEntities = new ArrayList < > ( ) ; if ( ! CollectionUtils . isEmpty ( parameters ) ) { for ( Parameter parameter : parameters ) { JobDefinitionParameterEntity parameterEntity = new JobDefinitionParameterEntity ( ) ; parameterEntities . add ( parameterEntity ) ; parameterEntity . setName ( parameter . getName ( ) ) ; parameterEntity . setValue ( parameter . getValue ( ) ) ; } } jobDefinitionEntityLocal . setParameters ( parameterEntities ) ; return jobDefinitionEntityLocal ; }
creates a new job definition entity from the request information .
