Package org.candlepin.model

Examples of org.candlepin.model.ConsumerType


    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public ConsumerType create(ConsumerType in) throws BadRequestException {
        try {
            ConsumerType toReturn = consumerTypeCurator.create(in);
            return toReturn;
        }
        catch (Exception e) {
            log.error("Problem creating unit type:", e);
            throw new BadRequestException(
View Full Code Here


    @PUT
    @Path("/{id}")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public ConsumerType update(ConsumerType in) throws BadRequestException {
        ConsumerType type = consumerTypeCurator.find(in.getId());

        if (type == null) {
            throw new BadRequestException(
                i18n.tr("Unit type with label {0} could not be found.", in.getId()));
        }
View Full Code Here

     */
    @DELETE
    @Path("/{id}")
    @Produces(MediaType.APPLICATION_JSON)
    public void deleteConsumerType(@PathParam("id") String id) {
        ConsumerType type = consumerTypeCurator.find(id);

        if (type == null) {
            throw new BadRequestException(
                i18n.tr("Unit type with id {0} could not be found.", id));
        }
View Full Code Here

    }

    @Test
    public void filterConsumerIdCert() {
        Consumer c = new Consumer();
        c.setType(new ConsumerType(ConsumerType.ConsumerTypeEnum.SYSTEM));
        IdentityCertificate cert = new IdentityCertificate();
        cert.setCert("FILTERMEPLEASE");
        cert.setKey("KEY");
        c.setIdCert(cert);
View Full Code Here

        prod = new Product("1", "2");
        productCurator.create(prod);

        owner = new Owner("test-owner", "Test Owner");
        owner = ownerCurator.create(owner);
        ct = new ConsumerType(ConsumerTypeEnum.SYSTEM);
        ct = consumerTypeCurator.create(ct);

        consumer = new Consumer("a consumer", "username", owner, ct);
        consumer.addInstalledProduct(new ConsumerInstalledProduct(prod.getId(), prod.getName()));
        consumerCurator.create(consumer);
View Full Code Here

    private HypervisorResource hypervisorResource;

    @Before
    public void setupTest() {
        this.i18n = I18nFactory.getI18n(getClass(), Locale.US, I18nFactory.FALLBACK);
        this.hypervisorType = new ConsumerType(ConsumerTypeEnum.HYPERVISOR);
        this.consumerResource = new ConsumerResource(this.consumerCurator,
            this.consumerTypeCurator, null, this.subscriptionService, null,
            this.idCertService, null, this.i18n, this.sink, this.eventFactory, null, null,
            this.userService, null, null, null, this.ownerCurator,
            this.activationKeyCurator, null, this.complianceRules,
View Full Code Here

    @Before
    public void setUp() {
        consumerResource = injector.getInstance(ConsumerResource.class);

        standardSystemType = consumerTypeCurator.create(new ConsumerType(
            "standard-system"));

        personType = consumerTypeCurator.create(new ConsumerType(
            ConsumerTypeEnum.PERSON));
        owner = ownerCurator.create(new Owner("test-owner"));
        owner.setDefaultServiceLevel(DEFAULT_SERVICE_LEVEL);
        ownerCurator.create(owner);
View Full Code Here

            injector.getInstance(IdentityCertificateCurator.class);
        idCurator.create(idCert);
        consumer.setIdCert(idCert);

        consumer.setType(consumerTypeCurator.create(
            new ConsumerType(ConsumerTypeEnum.CANDLEPIN)));
        consumerCurator.update(consumer);
        setupPrincipal(owner, Access.READ_ONLY);
        securityInterceptor.enable();
        consumerResource.exportData(mock(HttpServletResponse.class),
            consumer.getUuid(), null, null, null);
View Full Code Here

        assertEquals(standardSystemType.getLabel(), submitted.getType()
            .getLabel());
        assertEquals(METADATA_VALUE, submitted.getFact(METADATA_NAME));

        // now pass in consumer type with null id just like the client would
        ConsumerType type = new ConsumerType(standardSystemType.getLabel());
        assertNull(type.getId());
        Consumer nulltypeid = new Consumer(CONSUMER_NAME, USER_NAME, null, type);
        submitted = consumerResource.create(
            nulltypeid,
            TestUtil.createPrincipal(someuser.getUsername(), owner, Access.ALL),
            null, null, null);
View Full Code Here

            assertEquals("localhost:8443/apiurl", c.getUrlApi());
            assertEquals("localhost:8443/weburl", c.getUrlWeb());
            assertEquals("8auuid", c.getUuid());
            assertEquals("consumer_name", c.getName());
            assertEquals(new ConsumerType(ConsumerTypeEnum.CANDLEPIN), c.getType());
        }
View Full Code Here

TOP

Related Classes of org.candlepin.model.ConsumerType

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.