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;
}
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;
}
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);
}
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;
}
Aggregations