Search in sources :

Example 1 with EntitlementBody

use of org.candlepin.model.dto.EntitlementBody in project candlepin by candlepin.

the class X509V3ExtensionUtil method getByteExtensions.

public Set<X509ByteExtensionWrapper> getByteExtensions(Product sku, List<org.candlepin.model.dto.Product> productModels, String contentPrefix, Map<String, EnvironmentContent> promotedContent) throws IOException {
    Set<X509ByteExtensionWrapper> toReturn = new LinkedHashSet<>();
    EntitlementBody eb = createEntitlementBodyContent(sku, productModels, contentPrefix, promotedContent);
    X509ByteExtensionWrapper bodyExtension = new X509ByteExtensionWrapper(OIDUtil.REDHAT_OID + "." + OIDUtil.TOPLEVEL_NAMESPACES.get(OIDUtil.ENTITLEMENT_DATA_KEY), false, retrieveContentValue(eb));
    toReturn.add(bodyExtension);
    return toReturn;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) X509ByteExtensionWrapper(org.candlepin.pki.X509ByteExtensionWrapper) EntitlementBody(org.candlepin.model.dto.EntitlementBody)

Example 2 with EntitlementBody

use of org.candlepin.model.dto.EntitlementBody in project candlepin by candlepin.

the class X509V3ExtensionUtil method createEntitlementBody.

public EntitlementBody createEntitlementBody(List<org.candlepin.model.dto.Product> productModels, Consumer consumer, Pool pool, Integer quantity) {
    EntitlementBody toReturn = new EntitlementBody();
    toReturn.setConsumer(consumer.getUuid());
    toReturn.setQuantity(quantity);
    toReturn.setSubscription(createSubscription(pool));
    toReturn.setOrder(createOrder(pool));
    toReturn.setProducts(productModels);
    toReturn.setPool(createPool(pool));
    return toReturn;
}
Also used : EntitlementBody(org.candlepin.model.dto.EntitlementBody)

Example 3 with EntitlementBody

use of org.candlepin.model.dto.EntitlementBody in project candlepin by candlepin.

the class X509V3ExtensionUtil method createEntitlementDataPayload.

public byte[] createEntitlementDataPayload(List<org.candlepin.model.dto.Product> productModels, Consumer consumer, Pool pool, Integer quantity) throws IOException {
    EntitlementBody map = createEntitlementBody(productModels, consumer, pool, quantity);
    String json = toJson(map);
    return processPayload(json);
}
Also used : EntitlementBody(org.candlepin.model.dto.EntitlementBody)

Example 4 with EntitlementBody

use of org.candlepin.model.dto.EntitlementBody in project candlepin by candlepin.

the class X509V3ExtensionUtil method createEntitlementBodyContent.

public EntitlementBody createEntitlementBodyContent(Product sku, List<org.candlepin.model.dto.Product> productModels, String contentPrefix, Map<String, EnvironmentContent> promotedContent) {
    EntitlementBody toReturn = new EntitlementBody();
    toReturn.setProducts(productModels);
    return toReturn;
}
Also used : EntitlementBody(org.candlepin.model.dto.EntitlementBody)

Aggregations

EntitlementBody (org.candlepin.model.dto.EntitlementBody)4 LinkedHashSet (java.util.LinkedHashSet)1 X509ByteExtensionWrapper (org.candlepin.pki.X509ByteExtensionWrapper)1