Package org.candlepin.common.exceptions

Examples of org.candlepin.common.exceptions.NotFoundException


            events.add(toReturn);
            eventAdapter.addMessageText(events);
            return toReturn;
        }

        throw new NotFoundException(i18n.tr(
            "Event with ID ''{0}'' could not be found.", uuid));
    }
View Full Code Here


        else if (!StringUtils.isEmpty(principalName)) {
            statuses = curator.findByPrincipalName(principalName);
        }

        if (statuses == null) {
            throw new NotFoundException("");
        }

        return statuses;
    }
View Full Code Here

        Consumer c = null;
        if (consumerUuid != null) {
            c = consumerCurator.findByUuid(consumerUuid);
            if (c == null) {
                throw new NotFoundException(i18n.tr("Unit: {0} not found",
                    consumerUuid));
            }

            if (!c.getOwner().getId().equals(owner.getId())) {
                throw new BadRequestException(
View Full Code Here

    private Owner findOwner(String key) {
        Owner owner = ownerCurator.lookupByKey(key);

        if (owner == null) {
            throw new NotFoundException(i18n.tr(
                "owner with key: {0} was not found.", key));
        }

        return owner;
    }
View Full Code Here

    private Consumer findConsumer(String consumerUuid) {
        Consumer consumer = consumerCurator.findByUuid(consumerUuid);

        if (consumer == null) {
            throw new NotFoundException(i18n.tr("No such unit: {0}",
                consumerUuid));
        }
        return consumer;
    }
View Full Code Here

            if (autoCreateOwner &&
                ownerService.isOwnerKeyValidForCreation(ownerKey)) {
                owner = this.createOwner(new Owner(ownerKey, ownerKey));
            }
            else {
                throw new NotFoundException(i18n.tr(
                    "owner with key: {0} was not found.", ownerKey));
            }
        }

        return RefreshPoolsJob.forOwner(owner, lazyRegen);
View Full Code Here

    public void updateSubscription(Subscription subscription) {
        // TODO: Do we even need the owner id here?
        Subscription existingSubscription = this.subscriptionCurator
            .find(subscription.getId());
        if (existingSubscription == null) {
            throw new NotFoundException(i18n.tr(
                "subscription with id: {0} not found.", subscription.getId()));
        }
        this.subscriptionCurator.merge(subscription);
    }
View Full Code Here

        owner.setUpstreamConsumer(null);

        ExporterMetadata metadata = exportCurator.lookupByTypeAndOwner(
            ExporterMetadata.TYPE_PER_USER, owner);
        if (metadata == null) {
            throw new NotFoundException("No import found for owner " + ownerKey);
        }
        exportCurator.delete(metadata);

        this.recordManifestDeletion(owner, principal.getUsername(), uc);
View Full Code Here

        @QueryParam("to") String to,
        @QueryParam("days") String days) {
        Owner o = findOwner(ownerKey);

        if (o == null) {
            throw new NotFoundException(i18n.tr(
                "owner with key: {0} was not found.", ownerKey));
        }


        return statisticCurator.getStatisticsByOwner(o, "", "", "",
View Full Code Here

        @QueryParam("to") String to,
        @QueryParam("days") String days) {
        Owner o = findOwner(ownerKey);

        if (o == null) {
            throw new NotFoundException(i18n.tr(
                "owner with key: {0} was not found.", ownerKey));
        }

        return statisticCurator.getStatisticsByOwner(o, qType, reference, "",
                                ResourceDateParser.getFromDate(from, to, days),
View Full Code Here

TOP

Related Classes of org.candlepin.common.exceptions.NotFoundException

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.