Search in sources :

Example 11 with ObjectUtils.defaultIfNull

use of org.apache.commons.lang3.ObjectUtils.defaultIfNull in project nem2-sdk-java by nemtech.

the class RestrictionMosaicRepositoryVertxImpl method toMosaicAddressRestriction.

private MosaicAddressRestriction toMosaicAddressRestriction(MosaicAddressRestrictionDTO mosaicAddressRestrictionDTO) {
    MosaicAddressRestrictionEntryWrapperDTO dto = mosaicAddressRestrictionDTO.getMosaicRestrictionEntry();
    Map<BigInteger, BigInteger> restrictions = dto.getRestrictions().stream().collect(Collectors.toMap(e -> new BigInteger(e.getKey()), e -> toBigInteger(e.getValue())));
    return new MosaicAddressRestriction(mosaicAddressRestrictionDTO.getId(), ObjectUtils.defaultIfNull(dto.getVersion(), 1), dto.getCompositeHash(), MosaicRestrictionEntryType.rawValueOf(dto.getEntryType().getValue()), MapperUtils.toMosaicId(dto.getMosaicId()), MapperUtils.toAddress(dto.getTargetAddress()), restrictions);
}
Also used : MosaicAddressRestrictionEntryWrapperDTO(io.nem.symbol.sdk.openapi.vertx.model.MosaicAddressRestrictionEntryWrapperDTO) RestrictionMosaicRepository(io.nem.symbol.sdk.api.RestrictionMosaicRepository) RestrictionMosaicRoutesApi(io.nem.symbol.sdk.openapi.vertx.api.RestrictionMosaicRoutesApi) MosaicRestrictionEntryTypeEnum(io.nem.symbol.sdk.openapi.vertx.model.MosaicRestrictionEntryTypeEnum) MosaicRestrictionsPage(io.nem.symbol.sdk.openapi.vertx.model.MosaicRestrictionsPage) LinkedHashMap(java.util.LinkedHashMap) MosaicGlobalRestrictionEntryWrapperDTO(io.nem.symbol.sdk.openapi.vertx.model.MosaicGlobalRestrictionEntryWrapperDTO) MosaicRestrictionSearchCriteria(io.nem.symbol.sdk.api.MosaicRestrictionSearchCriteria) MosaicRestriction(io.nem.symbol.sdk.model.restriction.MosaicRestriction) Order(io.nem.symbol.sdk.openapi.vertx.model.Order) MosaicRestrictionType(io.nem.symbol.sdk.model.transaction.MosaicRestrictionType) ObjectUtils(org.apache.commons.lang3.ObjectUtils) Map(java.util.Map) MerkleStateInfo(io.nem.symbol.sdk.model.blockchain.MerkleStateInfo) MosaicGlobalRestrictionEntryRestrictionDTO(io.nem.symbol.sdk.openapi.vertx.model.MosaicGlobalRestrictionEntryRestrictionDTO) Observable(io.reactivex.Observable) BigInteger(java.math.BigInteger) AsyncResult(io.vertx.core.AsyncResult) MosaicGlobalRestrictionDTO(io.nem.symbol.sdk.openapi.vertx.model.MosaicGlobalRestrictionDTO) MapperUtils(io.nem.symbol.core.utils.MapperUtils) ApiClient(io.nem.symbol.sdk.openapi.vertx.invoker.ApiClient) MosaicAddressRestrictionDTO(io.nem.symbol.sdk.openapi.vertx.model.MosaicAddressRestrictionDTO) RestrictionMosaicRoutesApiImpl(io.nem.symbol.sdk.openapi.vertx.api.RestrictionMosaicRoutesApiImpl) MosaicGlobalRestriction(io.nem.symbol.sdk.model.restriction.MosaicGlobalRestriction) MosaicRestrictionEntryType(io.nem.symbol.sdk.model.restriction.MosaicRestrictionEntryType) Collectors(java.util.stream.Collectors) Consumer(java.util.function.Consumer) MosaicGlobalRestrictionItem(io.nem.symbol.sdk.model.restriction.MosaicGlobalRestrictionItem) Handler(io.vertx.core.Handler) Page(io.nem.symbol.sdk.api.Page) MosaicAddressRestriction(io.nem.symbol.sdk.model.restriction.MosaicAddressRestriction) MosaicAddressRestriction(io.nem.symbol.sdk.model.restriction.MosaicAddressRestriction) BigInteger(java.math.BigInteger) MosaicAddressRestrictionEntryWrapperDTO(io.nem.symbol.sdk.openapi.vertx.model.MosaicAddressRestrictionEntryWrapperDTO)

Example 12 with ObjectUtils.defaultIfNull

use of org.apache.commons.lang3.ObjectUtils.defaultIfNull in project midpoint by Evolveum.

the class ReportServiceImpl method evaluateSubreportParameters.

public VariablesMap evaluateSubreportParameters(PrismObject<ReportType> report, VariablesMap variables, Task task, OperationResult result) {
    VariablesMap subreportVariable = new VariablesMap();
    if (report != null && report.asObjectable().getObjectCollection() != null && report.asObjectable().getObjectCollection().getSubreport() != null && !report.asObjectable().getObjectCollection().getSubreport().isEmpty()) {
        Collection<SubreportParameterType> subreports = report.asObjectable().getObjectCollection().getSubreport();
        List<SubreportParameterType> sortedSubreports = new ArrayList<>(subreports);
        sortedSubreports.sort(Comparator.comparingInt(s -> ObjectUtils.defaultIfNull(s.getOrder(), Integer.MAX_VALUE)));
        for (SubreportParameterType subreport : sortedSubreports) {
            if (subreport.getExpression() == null || subreport.getName() == null) {
                continue;
            }
            ExpressionType expression = subreport.getExpression();
            try {
                Collection<? extends PrismValue> subreportParameter = evaluateScript(report, expression, variables, "subreport parameter", task, result);
                Class<?> subreportParameterClass;
                if (subreport.getType() != null) {
                    subreportParameterClass = getPrismContext().getSchemaRegistry().determineClassForType(subreport.getType());
                } else {
                    if (subreportParameter != null && !subreportParameter.isEmpty()) {
                        subreportParameterClass = subreportParameter.iterator().next().getRealClass();
                    } else {
                        subreportParameterClass = Object.class;
                    }
                }
                subreportVariable.put(subreport.getName(), subreportParameter, subreportParameterClass);
            } catch (Exception e) {
                LOGGER.error("Couldn't execute expression " + expression, e);
            }
        }
        return subreportVariable;
    }
    return subreportVariable;
}
Also used : com.evolveum.midpoint.schema(com.evolveum.midpoint.schema) java.util(java.util) ArchetypeManager(com.evolveum.midpoint.model.common.ArchetypeManager) GroovyScriptEvaluator(com.evolveum.midpoint.model.common.expression.script.groovy.GroovyScriptEvaluator) com.evolveum.midpoint.xml.ns._public.common.common_3(com.evolveum.midpoint.xml.ns._public.common.common_3) ScriptExpressionFactory(com.evolveum.midpoint.model.common.expression.script.ScriptExpressionFactory) com.evolveum.midpoint.schema.expression(com.evolveum.midpoint.schema.expression) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Autowired(org.springframework.beans.factory.annotation.Autowired) Trace(com.evolveum.midpoint.util.logging.Trace) ModelExpressionThreadLocalHolder(com.evolveum.midpoint.model.common.expression.ModelExpressionThreadLocalHolder) TaskManager(com.evolveum.midpoint.task.api.TaskManager) com.evolveum.midpoint.util.exception(com.evolveum.midpoint.util.exception) LocalizationService(com.evolveum.midpoint.common.LocalizationService) ExpressionEnvironment(com.evolveum.midpoint.model.common.expression.ExpressionEnvironment) QNameUtil(com.evolveum.midpoint.util.QNameUtil) com.evolveum.midpoint.model.api(com.evolveum.midpoint.model.api) ObjectUtils(org.apache.commons.lang3.ObjectUtils) ScriptExpression(com.evolveum.midpoint.model.common.expression.script.ScriptExpression) Qualifier(org.springframework.beans.factory.annotation.Qualifier) VariablesMap(com.evolveum.midpoint.schema.expression.VariablesMap) RepositoryService(com.evolveum.midpoint.repo.api.RepositoryService) com.evolveum.midpoint.prism(com.evolveum.midpoint.prism) AuditService(com.evolveum.midpoint.audit.api.AuditService) DashboardUtils(com.evolveum.midpoint.model.api.util.DashboardUtils) CommandLineScriptExecutor(com.evolveum.midpoint.repo.common.commandline.CommandLineScriptExecutor) ScriptExpressionEvaluationContext(com.evolveum.midpoint.model.common.expression.script.ScriptExpressionEvaluationContext) ScriptExpressionEvaluatorFactory(com.evolveum.midpoint.model.common.expression.script.ScriptExpressionEvaluatorFactory) AuthorizationParameters(com.evolveum.midpoint.security.enforcer.api.AuthorizationParameters) SecurityEnforcer(com.evolveum.midpoint.security.enforcer.api.SecurityEnforcer) MiscUtil(com.evolveum.midpoint.util.MiscUtil) ObjectResolver(com.evolveum.midpoint.repo.common.ObjectResolver) Task(com.evolveum.midpoint.task.api.Task) DefaultColumnUtils(com.evolveum.midpoint.model.common.util.DefaultColumnUtils) Component(org.springframework.stereotype.Component) ExpressionFactory(com.evolveum.midpoint.repo.common.expression.ExpressionFactory) FunctionLibrary(com.evolveum.midpoint.model.common.expression.functions.FunctionLibrary) ExpressionUtil(com.evolveum.midpoint.repo.common.expression.ExpressionUtil) DashboardService(com.evolveum.midpoint.model.api.interaction.DashboardService) ReportService(com.evolveum.midpoint.report.api.ReportService) QName(javax.xml.namespace.QName) CompiledObjectCollectionView(com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView) NotNull(org.jetbrains.annotations.NotNull) Clock(com.evolveum.midpoint.common.Clock) Validate(org.apache.commons.lang.Validate) TraceManager(com.evolveum.midpoint.util.logging.TraceManager) VariablesMap(com.evolveum.midpoint.schema.expression.VariablesMap)

Example 13 with ObjectUtils.defaultIfNull

use of org.apache.commons.lang3.ObjectUtils.defaultIfNull in project plugin-prov by ligoj.

the class ProvQuoteUploadResource method persist.

/**
 * Validate the input object, do a lookup, then create the {@link ProvQuoteInstance} and the
 * {@link ProvQuoteStorage} entities.
 */
private <V extends AbstractQuoteVmEditionVo> void persist(final VmUpload upload, final int subscription, final BiFunction<V, UploadContext, Integer> merger, final UploadContext context, final V vo, final ObjIntConsumer<QuoteStorageEditionVo> diskConsumer, final ResourceType resourceType) {
    // Create the quote instance from the validated inputs
    final var id = merger.apply(vo, context);
    if (id == null) {
        // Do not continue
        return;
    }
    // Storage part
    final var disks = IntStream.range(0, upload.getDisk().size()).filter(index -> upload.getDisk().get(index) > 0).mapToObj(index -> {
        final var size = upload.getDisk().get(index).intValue();
        final var sizeMax = upload.getDiskMax().size() > index ? upload.getDiskMax().get(index).intValue() : null;
        // Size is provided, propagate the upload properties
        final var svo = new QuoteStorageEditionVo();
        svo.setName(vo.getName() + (index == 0 ? "" : index));
        diskConsumer.accept(svo, id);
        svo.setSize(size);
        svo.setSizeMax(sizeMax);
        svo.setLatency(getItem(upload.getLatency(), index));
        svo.setOptimized(getItem(upload.getOptimized(), index));
        // Find the nicest storage
        svo.setType(storageResource.lookup(context.quote, svo).stream().findFirst().orElseThrow(() -> new ValidationJsonException("storage", "NotNull")).getPrice().getType().getCode());
        // Default the storage name to the instance name
        svo.setSubscription(subscription);
        return storageResource.create(svo).getId();
    }).collect(Collectors.toList());
    // Tags part
    Arrays.stream(StringUtils.split(ObjectUtils.defaultIfNull(upload.getTags(), ""), ",;")).map(StringUtils::trimToNull).filter(Objects::nonNull).forEach(t -> {
        // Instance tags
        final var tag = new TagEditionVo();
        final var parts = StringUtils.splitPreserveAllTokens(t + ":", ':');
        tag.setName(parts[0].trim());
        tag.setValue(StringUtils.trimToNull(parts[1]));
        tag.setResource(id);
        tag.setType(resourceType);
        tagResource.create(subscription, tag);
        // Storage tags
        tag.setType(ResourceType.STORAGE);
        disks.forEach(d -> {
            tag.setResource(d);
            tagResource.create(subscription, tag);
        });
    });
}
Also used : CsvForBean(org.ligoj.bootstrap.core.csv.CsvForBean) Arrays(java.util.Arrays) Produces(javax.ws.rs.Produces) BiFunction(java.util.function.BiFunction) Path(javax.ws.rs.Path) ProvUsageRepository(org.ligoj.app.plugin.prov.dao.ProvUsageRepository) Autowired(org.springframework.beans.factory.annotation.Autowired) ProvQuoteStorage(org.ligoj.app.plugin.prov.model.ProvQuoteStorage) StringUtils(org.apache.commons.lang3.StringUtils) ValidationJsonException(org.ligoj.bootstrap.core.validation.ValidationJsonException) MediaType(javax.ws.rs.core.MediaType) ByteArrayInputStream(java.io.ByteArrayInputStream) Consumes(javax.ws.rs.Consumes) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) Multipart(org.apache.cxf.jaxrs.ext.multipart.Multipart) ProvQuoteDatabase(org.ligoj.app.plugin.prov.model.ProvQuoteDatabase) ProvQuoteStorageResource(org.ligoj.app.plugin.prov.quote.storage.ProvQuoteStorageResource) Transactional(javax.transaction.Transactional) ResourceType(org.ligoj.app.plugin.prov.model.ResourceType) Collectors(java.util.stream.Collectors) AbstractProvQuoteVmResource(org.ligoj.app.plugin.prov.AbstractProvQuoteVmResource) StandardCharsets(java.nio.charset.StandardCharsets) Serializable(java.io.Serializable) Objects(java.util.Objects) IOUtils(org.apache.commons.io.IOUtils) List(java.util.List) QuoteStorageEditionVo(org.ligoj.app.plugin.prov.quote.storage.QuoteStorageEditionVo) Slf4j(lombok.extern.slf4j.Slf4j) QuoteDatabaseEditionVo(org.ligoj.app.plugin.prov.quote.database.QuoteDatabaseEditionVo) Optional(java.util.Optional) Pattern(java.util.regex.Pattern) ProvQuoteDatabaseResource(org.ligoj.app.plugin.prov.quote.database.ProvQuoteDatabaseResource) IntStream(java.util.stream.IntStream) PathParam(javax.ws.rs.PathParam) QuoteInstanceEditionVo(org.ligoj.app.plugin.prov.quote.instance.QuoteInstanceEditionVo) HashMap(java.util.HashMap) ArrayUtils(org.apache.commons.lang3.ArrayUtils) ObjIntConsumer(java.util.function.ObjIntConsumer) ProvQuoteInstance(org.ligoj.app.plugin.prov.model.ProvQuoteInstance) Function(java.util.function.Function) CollectionUtils(org.apache.commons.collections4.CollectionUtils) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) ObjectUtils(org.apache.commons.lang3.ObjectUtils) Service(org.springframework.stereotype.Service) EntityNotFoundException(javax.persistence.EntityNotFoundException) AbstractQuoteVmEditionVo(org.ligoj.app.plugin.prov.AbstractQuoteVmEditionVo) ProvUsage(org.ligoj.app.plugin.prov.model.ProvUsage) ProvQuoteInstanceResource(org.ligoj.app.plugin.prov.quote.instance.ProvQuoteInstanceResource) MapUtils(org.apache.commons.collections4.MapUtils) POST(javax.ws.rs.POST) SequenceInputStream(java.io.SequenceInputStream) ProvQuoteInstanceRepository(org.ligoj.app.plugin.prov.dao.ProvQuoteInstanceRepository) IOException(java.io.IOException) SubscriptionResource(org.ligoj.app.resource.subscription.SubscriptionResource) InputStreamReader(java.io.InputStreamReader) ProvTagResource(org.ligoj.app.plugin.prov.ProvTagResource) TagEditionVo(org.ligoj.app.plugin.prov.TagEditionVo) StringReader(java.io.StringReader) ConstraintViolationException(javax.validation.ConstraintViolationException) ProvQuoteDatabaseRepository(org.ligoj.app.plugin.prov.dao.ProvQuoteDatabaseRepository) ProvResource(org.ligoj.app.plugin.prov.ProvResource) ProvQuote(org.ligoj.app.plugin.prov.model.ProvQuote) BufferedReader(java.io.BufferedReader) Hibernate(org.hibernate.Hibernate) InputStream(java.io.InputStream) StringUtils(org.apache.commons.lang3.StringUtils) ValidationJsonException(org.ligoj.bootstrap.core.validation.ValidationJsonException) QuoteStorageEditionVo(org.ligoj.app.plugin.prov.quote.storage.QuoteStorageEditionVo) TagEditionVo(org.ligoj.app.plugin.prov.TagEditionVo)

Example 14 with ObjectUtils.defaultIfNull

use of org.apache.commons.lang3.ObjectUtils.defaultIfNull in project plugin-prov by ligoj.

the class ProvQuoteUploadResource method upload.

/**
 * Upload a file of quote.
 *
 * @param subscription    The subscription identifier, will be used to filter the locations from the associated
 *                        provider.
 * @param uploadedFile    Instance entries files to import. Currently support only CSV format.
 * @param headers         the CSV header names. When <code>null</code> or empty, the default headers are used.
 * @param headersIncluded When <code>true</code>, the first line is the headers and the given <code>headers</code>
 *                        parameter is ignored. Otherwise the <code>headers</code> parameter is used.
 * @param defaultUsage    The optional usage name. When not <code>null</code>, each quote instance without defined
 *                        usage will be associated to this usage.
 * @param mode            The merge option indicates how the entries are inserted.
 * @param ramMultiplier   The multiplier for imported RAM values. Default is 1.
 * @param encoding        CSV encoding. Default is UTF-8.
 * @param errorContinue   When <code>true</code> errors do not block the upload.
 * @param createUsage     When <code>true</code>, missing usage are automatically created.
 * @param separator       CSV separator. Default is ";".
 * @throws IOException When the CSV stream cannot be written.
 */
@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Path("{subscription:\\d+}/upload")
public void upload(@PathParam("subscription") final int subscription, @Multipart(value = CSV_FILE) final InputStream uploadedFile, @Multipart(value = "headers", required = false) final String[] headers, @Multipart(value = "headers-included", required = false) final boolean headersIncluded, @Multipart(value = "usage", required = false) final String defaultUsage, @Multipart(value = "mergeUpload", required = false) final MergeMode mode, @Multipart(value = "memoryUnit", required = false) final Integer ramMultiplier, @Multipart(value = "errorContinue", required = false) final boolean errorContinue, @Multipart(value = "encoding", required = false) final String encoding, @Multipart(value = "createMissingUsage", required = false) final boolean createUsage, @Multipart(value = "separator", required = false) final String separator) throws IOException {
    log.info("Upload provisioning requested...");
    subscriptionResource.checkVisible(subscription);
    final var quote = resource.getRepository().findBy("subscription.id", subscription);
    final var safeEncoding = ObjectUtils.defaultIfNull(encoding, DEFAULT_ENCODING);
    // Check headers validity
    final String[] headersArray;
    final InputStream fileNoHeader;
    if (headersIncluded) {
        // Header at first line
        final var br = new BufferedReader(new StringReader(IOUtils.toString(uploadedFile, safeEncoding)));
        headersArray = StringUtils.defaultString(br.readLine()).split(separator);
        fileNoHeader = new ByteArrayInputStream(IOUtils.toByteArray(br, safeEncoding));
    } else {
        // Headers are provided separately
        headersArray = ArrayUtils.isEmpty(headers) ? DEFAULT_HEADERS : headers;
        fileNoHeader = uploadedFile;
    }
    final var headersArray2 = checkHeaders(headersArray);
    final var headersString = StringUtils.chop(ArrayUtils.toString(headersArray2)).substring(1).replace(",", separator) + "\n";
    final var reader = new InputStreamReader(new SequenceInputStream(new ByteArrayInputStream(headersString.getBytes(safeEncoding)), fileNoHeader), safeEncoding);
    // Build entries
    log.info("Upload provisioning : reading, using header {}", headersString);
    final var list = csvForBean.toBean(VmUpload.class, reader);
    log.info("Upload provisioning : importing {} entries", list.size());
    final var cursor = new AtomicInteger(0);
    final var previousQi = qiRepository.findAll(quote).stream().collect(Collectors.toConcurrentMap(ProvQuoteInstance::getName, Function.identity()));
    final var previousQb = qbRepository.findAll(quote).stream().collect(Collectors.toConcurrentMap(ProvQuoteDatabase::getName, Function.identity()));
    // Initialization for parallel process
    Hibernate.initialize(quote.getUsages());
    Hibernate.initialize(quote.getBudgets());
    final var context = new UploadContext();
    context.quote = quote;
    context.previousQi = previousQi;
    context.previousQb = previousQb;
    list.stream().filter(Objects::nonNull).filter(i -> i.getName() != null).forEach(i -> {
        try {
            persist(subscription, defaultUsage, mode, ramMultiplier, list.size(), cursor, context, createUsage, i);
        } catch (final ValidationJsonException e) {
            handleUploadError(errorContinue, handleValidationError(i, e));
        } catch (final ConstraintViolationException e) {
            handleUploadError(errorContinue, handleValidationError(i, new ValidationJsonException(e)));
        } catch (final RuntimeException e) {
            log.error("Unmanaged error during import of " + i.getName(), e);
            handleUploadError(errorContinue, e);
        }
    });
    log.info("Upload provisioning : flushing");
}
Also used : CsvForBean(org.ligoj.bootstrap.core.csv.CsvForBean) Arrays(java.util.Arrays) Produces(javax.ws.rs.Produces) BiFunction(java.util.function.BiFunction) Path(javax.ws.rs.Path) ProvUsageRepository(org.ligoj.app.plugin.prov.dao.ProvUsageRepository) Autowired(org.springframework.beans.factory.annotation.Autowired) ProvQuoteStorage(org.ligoj.app.plugin.prov.model.ProvQuoteStorage) StringUtils(org.apache.commons.lang3.StringUtils) ValidationJsonException(org.ligoj.bootstrap.core.validation.ValidationJsonException) MediaType(javax.ws.rs.core.MediaType) ByteArrayInputStream(java.io.ByteArrayInputStream) Consumes(javax.ws.rs.Consumes) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) Multipart(org.apache.cxf.jaxrs.ext.multipart.Multipart) ProvQuoteDatabase(org.ligoj.app.plugin.prov.model.ProvQuoteDatabase) ProvQuoteStorageResource(org.ligoj.app.plugin.prov.quote.storage.ProvQuoteStorageResource) Transactional(javax.transaction.Transactional) ResourceType(org.ligoj.app.plugin.prov.model.ResourceType) Collectors(java.util.stream.Collectors) AbstractProvQuoteVmResource(org.ligoj.app.plugin.prov.AbstractProvQuoteVmResource) StandardCharsets(java.nio.charset.StandardCharsets) Serializable(java.io.Serializable) Objects(java.util.Objects) IOUtils(org.apache.commons.io.IOUtils) List(java.util.List) QuoteStorageEditionVo(org.ligoj.app.plugin.prov.quote.storage.QuoteStorageEditionVo) Slf4j(lombok.extern.slf4j.Slf4j) QuoteDatabaseEditionVo(org.ligoj.app.plugin.prov.quote.database.QuoteDatabaseEditionVo) Optional(java.util.Optional) Pattern(java.util.regex.Pattern) ProvQuoteDatabaseResource(org.ligoj.app.plugin.prov.quote.database.ProvQuoteDatabaseResource) IntStream(java.util.stream.IntStream) PathParam(javax.ws.rs.PathParam) QuoteInstanceEditionVo(org.ligoj.app.plugin.prov.quote.instance.QuoteInstanceEditionVo) HashMap(java.util.HashMap) ArrayUtils(org.apache.commons.lang3.ArrayUtils) ObjIntConsumer(java.util.function.ObjIntConsumer) ProvQuoteInstance(org.ligoj.app.plugin.prov.model.ProvQuoteInstance) Function(java.util.function.Function) CollectionUtils(org.apache.commons.collections4.CollectionUtils) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) ObjectUtils(org.apache.commons.lang3.ObjectUtils) Service(org.springframework.stereotype.Service) EntityNotFoundException(javax.persistence.EntityNotFoundException) AbstractQuoteVmEditionVo(org.ligoj.app.plugin.prov.AbstractQuoteVmEditionVo) ProvUsage(org.ligoj.app.plugin.prov.model.ProvUsage) ProvQuoteInstanceResource(org.ligoj.app.plugin.prov.quote.instance.ProvQuoteInstanceResource) MapUtils(org.apache.commons.collections4.MapUtils) POST(javax.ws.rs.POST) SequenceInputStream(java.io.SequenceInputStream) ProvQuoteInstanceRepository(org.ligoj.app.plugin.prov.dao.ProvQuoteInstanceRepository) IOException(java.io.IOException) SubscriptionResource(org.ligoj.app.resource.subscription.SubscriptionResource) InputStreamReader(java.io.InputStreamReader) ProvTagResource(org.ligoj.app.plugin.prov.ProvTagResource) TagEditionVo(org.ligoj.app.plugin.prov.TagEditionVo) StringReader(java.io.StringReader) ConstraintViolationException(javax.validation.ConstraintViolationException) ProvQuoteDatabaseRepository(org.ligoj.app.plugin.prov.dao.ProvQuoteDatabaseRepository) ProvResource(org.ligoj.app.plugin.prov.ProvResource) ProvQuote(org.ligoj.app.plugin.prov.model.ProvQuote) BufferedReader(java.io.BufferedReader) Hibernate(org.hibernate.Hibernate) InputStream(java.io.InputStream) InputStreamReader(java.io.InputStreamReader) ByteArrayInputStream(java.io.ByteArrayInputStream) SequenceInputStream(java.io.SequenceInputStream) InputStream(java.io.InputStream) SequenceInputStream(java.io.SequenceInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) BufferedReader(java.io.BufferedReader) StringReader(java.io.StringReader) Objects(java.util.Objects) ValidationJsonException(org.ligoj.bootstrap.core.validation.ValidationJsonException) ConstraintViolationException(javax.validation.ConstraintViolationException) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes)

Aggregations

ObjectUtils (org.apache.commons.lang3.ObjectUtils)13 Map (java.util.Map)10 Collectors (java.util.stream.Collectors)9 Objects (java.util.Objects)6 Optional (java.util.Optional)6 HashMap (java.util.HashMap)5 List (java.util.List)5 Function (java.util.function.Function)5 Transactional (javax.transaction.Transactional)5 Consumes (javax.ws.rs.Consumes)5 POST (javax.ws.rs.POST)5 Path (javax.ws.rs.Path)5 PathParam (javax.ws.rs.PathParam)5 Produces (javax.ws.rs.Produces)5 MediaType (javax.ws.rs.core.MediaType)5 StringUtils (org.apache.commons.lang3.StringUtils)4 MapperUtils (io.nem.symbol.core.utils.MapperUtils)3 MosaicRestrictionSearchCriteria (io.nem.symbol.sdk.api.MosaicRestrictionSearchCriteria)3 Page (io.nem.symbol.sdk.api.Page)3 RestrictionMosaicRepository (io.nem.symbol.sdk.api.RestrictionMosaicRepository)3