Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/* *********************************************************************
* This Original Work is copyright of 51 Degrees Mobile Experts Limited.
* Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
* Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
*
* This Original Work is licensed under the European Union Public Licence
* (EUPL) v.1.2 and is subject to its terms as set out below.
*
* If a copy of the EUPL was not distributed with this file, You can obtain
* one at https://opensource.org/licenses/EUPL-1.2.
*
* The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
* amended by the European Commission) shall be deemed incompatible for
* the purposes of the Work and the provisions of the compatibility
* clause in Article 5 of the EUPL shall not apply.
*
* If using the Work as, or as part of, a network application, by
* including the attribution notice(s) required under Article 5 of the EUPL
* in the end user terms of the application under an appropriate heading,
* such notice(s) shall fulfill the requirements of that article.
* ********************************************************************* */
package fiftyone.pipeline.engines.data;
import fiftyone.pipeline.core.data.ElementDataBase;
import fiftyone.pipeline.core.data.FlowData;
import fiftyone.pipeline.core.data.FlowError;
import fiftyone.pipeline.core.data.TryGetResult;
import fiftyone.pipeline.engines.exceptions.LazyLoadTimeoutException;
import fiftyone.pipeline.engines.exceptions.PropertyMissingException;
import fiftyone.pipeline.engines.flowelements.AspectEngine;
import fiftyone.pipeline.engines.services.MissingPropertyResult;
import fiftyone.pipeline.engines.services.MissingPropertyService;
import fiftyone.pipeline.exceptions.AggregateException;
import org.slf4j.Logger;
import java.util.*;
import java.util.concurrent.*;
import java.util.stream.Collectors;
import static fiftyone.pipeline.util.Check.getNotNull;
import static fiftyone.pipeline.util.StringManipulation.stringJoin;
/**
* Abstract base class for {@link AspectData} which overrides the
* @see Specification
*/
public abstract class AspectDataBase extends ElementDataBase implements AspectData {
private final MissingPropertyService missingPropertyService;
private final List> engines;
private final Map, Future>> processFutures;
/**
* Constructs a new instance with a non-thread-safe, case-insensitive
* {@link Map} as the underlying storage.
* @param logger used for logging
* @param flowData the {@link FlowData} instance this element data will be
* associated with
* @param engine the engine which created the instance
*/
public AspectDataBase(
Logger logger,
FlowData flowData,
AspectEngine extends AspectData, ? extends AspectPropertyMetaData> engine) {
this(logger, flowData, engine, null);
}
/**
* Constructs a new instance with a non-thread-safe, case-insensitive
* {@link Map} as the underlying storage.
* @param logger used for logging
* @param flowData the {@link FlowData} instance this element data will be
* associated with
* @param engine the engine which created the instance
* @param missingPropertyService service used to determine the reason for
* a property value being missing
*/
public AspectDataBase(
Logger logger,
FlowData flowData,
AspectEngine extends AspectData,? extends AspectPropertyMetaData> engine,
MissingPropertyService missingPropertyService) {
super(logger, flowData);
this.engines = new ArrayList<>();
this.engines.add(getNotNull(engine, "Engine must not be null"));
this.processFutures = new HashMap<>();
this.missingPropertyService = missingPropertyService;
}
/**
* Constructs a new instance with a custom {@link Map} as the underlying
* storage.
* @param logger used for logging
* @param flowData the {@link FlowData} instance this element data will be
* associated with
* @param engine the engine which created the instance
* @param missingPropertyService service used to determine the reason for
* a property value being missing
* @param map the custom {@link Map} implementation to use as the underlying
* storage
*/
public AspectDataBase(
Logger logger,
FlowData flowData,
AspectEngine extends AspectData,? extends AspectPropertyMetaData> engine,
MissingPropertyService missingPropertyService,
Map map) {
super(logger, flowData, map);
this.engines = new ArrayList<>();
this.engines.add(getNotNull(engine, "Engine must not be null"));
this.processFutures = new HashMap<>();
this.missingPropertyService = missingPropertyService;
}
@Override
public List> getEngines() {
return Collections.unmodifiableList(engines);
}
@Override
public Future> getProcessFuture() {
return new Future