diff options
Diffstat (limited to 'proxy')
13 files changed, 189 insertions, 100 deletions
diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/Consumer.java b/proxy/code/src/org/fedoraproject/candlepin/model/Consumer.java index 242a6a0..3e642fd 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/Consumer.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/Consumer.java @@ -18,6 +18,15 @@ import java.util.HashMap; import java.util.LinkedList; import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Transient; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @@ -27,37 +36,78 @@ import javax.xml.bind.annotation.XmlTransient; * A Consumer is the entity that uses a given Entitlement. It can be a user, * system, or anything else we want to track as using the Entitlement. * - * Every Consumer has an Owner which may or may not own the Entitlment. The + * Every Consumer has an Owner which may or may not own the Entitlement. The * Consumer's attributes or metadata is stored in a ConsumerInfo object which * boils down to a series of name/value pairs. */ @XmlRootElement @XmlAccessorType(XmlAccessType.PROPERTY) -public class Consumer extends BaseModel { +@Entity +@Table(name="cp_consumer") +public class Consumer { + @Id + @GeneratedValue(strategy=GenerationType.AUTO) + private Long id; + @Column(nullable=false) + private String name; + + @ManyToOne private Owner owner; + + // TODO: Is this worth mapping? Do we need a hierarchy amidst consumers? + @Transient private Consumer parent; + + @Transient // TODO private List<Product> consumedProducts; + + @Transient // TODO private List<Entitlement> entitlements; + + @Transient // TODO private ConsumerInfo info; - /** - * default ctor - */ + public Consumer(String name, Owner owner) { + this.name = name; + this.owner = owner; + + this.info = new ConsumerInfo(); + this.info.setParent(this); // TODO: ??? + } + public Consumer() { - this(null); this.info = new ConsumerInfo(); - this.info.setParent(this); + this.info.setParent(this); // TODO: ??? } /** - * @param uuid unique id of consumer + * @return the id */ - public Consumer(String uuid) { - super(uuid); - this.info = new ConsumerInfo(); - this.info.setParent(this); + public Long getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(Long id) { + this.id = id; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; } /** @@ -144,7 +194,7 @@ public class Consumer extends BaseModel { @Override public String toString() { return "Consumer [type=" + this.getType() + ", getName()=" + - getName() + ", getUuid()=" + getUuid() + "]"; + getName() + "]"; } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerInfo.java b/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerInfo.java index cfc7d16..5488041 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerInfo.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerInfo.java @@ -37,8 +37,6 @@ public class ConsumerInfo { private ConsumerType type; private Map<String, String> metadata; - - /** * @return Returns the parent. */ @@ -81,7 +79,6 @@ public class ConsumerInfo { * @param metadataIn The metadata to set. */ public void setMetadata(Map<String, String> metadataIn) { - System.out.println("set metadata called"); metadata = metadataIn; } @@ -91,7 +88,6 @@ public class ConsumerInfo { * @param value to set */ public void setMetadataField(String name, String value) { - System.out.println("set meta field called"); if (this.metadata == null) { metadata = new HashMap<String, String>(); } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/ObjectFactory.java b/proxy/code/src/org/fedoraproject/candlepin/model/ObjectFactory.java index eeaf8ec..51249e4 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/ObjectFactory.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/ObjectFactory.java @@ -60,7 +60,7 @@ public class ObjectFactory { org.addUser(u); // Consumer - Consumer c = new Consumer(BaseModel.generateUUID()); + Consumer c = new Consumer(); c.setName("fake-consumer-i386"); c.setOwner(org); org.addConsumer(c); diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/test/ConsumerTest.java b/proxy/code/src/org/fedoraproject/candlepin/model/test/ConsumerTest.java index 6ad75b8..90c0428 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/test/ConsumerTest.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/test/ConsumerTest.java @@ -17,34 +17,46 @@ package org.fedoraproject.candlepin.model.test; import org.fedoraproject.candlepin.model.Consumer; import org.fedoraproject.candlepin.model.Owner; import org.fedoraproject.candlepin.model.Product; +import org.fedoraproject.candlepin.test.DatabaseTestFixture; +import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; -public class ConsumerTest { +public class ConsumerTest extends DatabaseTestFixture { + + private Owner owner; + private Product rhel; + + @Before + public void setUpTestObjects() { + em.getTransaction().begin(); + String ownerName = "Example Corporation"; + owner = new Owner(ownerName); + rhel = new Product("label", "Red Hat Enterprise Linux"); + em.persist(owner); + em.persist(rhel); + em.getTransaction().commit(); + } @Test public void testConsumedProduct() throws Exception { - Owner o = TestUtil.createOwner(); - - Product rhel = new Product(); - rhel.setName("Red Hat Enterprise Linux"); - - Consumer c = TestUtil.createConsumer(o); - c.addConsumedProduct(rhel); +// +// Consumer c = TestUtil.createConsumer(o); +// c.addConsumedProduct(rhel); } - @Test - public void testProperties() { - Owner o = TestUtil.createOwner(); - Consumer c = TestUtil.createConsumer(o); - c.setMetadataField("cpu", "2"); - - assertEquals(c.getMetadataField("cpu"), "2"); - } +// @Test +// public void testProperties() { +// Owner o = TestUtil.createOwner(); +// Consumer c = TestUtil.createConsumer(o); +// c.setMetadataField("cpu", "2"); +// +// assertEquals(c.getMetadataField("cpu"), "2"); +// } } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/test/OwnerTest.java b/proxy/code/src/org/fedoraproject/candlepin/model/test/OwnerTest.java index b3ab842..98445ec 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/test/OwnerTest.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/test/OwnerTest.java @@ -20,13 +20,14 @@ import org.fedoraproject.candlepin.model.EntitlementPool; import org.fedoraproject.candlepin.model.Owner; import org.fedoraproject.candlepin.model.Product; import org.fedoraproject.candlepin.model.User; +import org.fedoraproject.candlepin.test.DatabaseTestFixture; import java.util.List; import org.junit.Test; import static org.junit.Assert.*; -public class OwnerTest extends ModelTestFixture { +public class OwnerTest extends DatabaseTestFixture { @Test public void testCreate() throws Exception { @@ -79,7 +80,7 @@ public class OwnerTest extends ModelTestFixture { assertEquals(1, owner.getUsers().size()); // Consumer - Consumer c = new Consumer(BaseModel.generateUUID()); + Consumer c = new Consumer(); c.setOwner(owner); owner.addConsumer(c); c.addConsumedProduct(rhel); diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/test/ProductTest.java b/proxy/code/src/org/fedoraproject/candlepin/model/test/ProductTest.java index f1799aa..2a70275 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/test/ProductTest.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/test/ProductTest.java @@ -8,10 +8,11 @@ import javax.persistence.EntityManager; import javax.persistence.PersistenceException; import org.fedoraproject.candlepin.model.Product; +import org.fedoraproject.candlepin.test.DatabaseTestFixture; import org.fedoraproject.candlepin.util.EntityManagerUtil; import org.junit.Test; -public class ProductTest extends ModelTestFixture { +public class ProductTest extends DatabaseTestFixture { @Test diff --git a/proxy/code/src/org/fedoraproject/candlepin/resource/ConsumerResource.java b/proxy/code/src/org/fedoraproject/candlepin/resource/ConsumerResource.java index 5e0f939..cce0294 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/resource/ConsumerResource.java +++ b/proxy/code/src/org/fedoraproject/candlepin/resource/ConsumerResource.java @@ -77,7 +77,7 @@ public class ConsumerResource extends BaseResource { System.out.println("metadata: " + ci.getMetadata()); System.out.println("ci: " + ci); //Owner owner = (Owner) ObjectFactory.get().lookupByUUID(Owner.class, owneruuid); - Consumer c = new Consumer(BaseModel.generateUUID()); + Consumer c = new Consumer(); c.setName(ci.getMetadataField("name")); //c.setOwner(owner); c.setInfo(ci); @@ -110,15 +110,15 @@ public class ConsumerResource extends BaseResource { * @param cid Consumer ID to affect * @param pid Product ID to remove from Consumer. */ - @DELETE @Path("{cid}/products/{pid}") - public void delete(@PathParam("cid") String cid, - @PathParam("pid") String pid) { - System.out.println("cid " + cid + " pid = " + pid); - Consumer c = (Consumer) ObjectFactory.get().lookupByUUID(Consumer.class, cid); - if (!c.getConsumedProducts().remove(pid)) { - log.error("no product " + pid + " found."); - } - } +// @DELETE @Path("{cid}/products/{pid}") +// public void delete(@PathParam("cid") String cid, +// @PathParam("pid") String pid) { +// System.out.println("cid " + cid + " pid = " + pid); +// Consumer c = (Consumer) ObjectFactory.get().lookupByUUID(Consumer.class, cid); +// if (!c.getConsumedProducts().remove(pid)) { +// log.error("no product " + pid + " found."); +// } +// } @GET @Path("{cid}/products/{pid}") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) diff --git a/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementResource.java b/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementResource.java index 0e32188..81c46e1 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementResource.java +++ b/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementResource.java @@ -21,6 +21,7 @@ import org.fedoraproject.candlepin.model.EntitlementPool; import org.fedoraproject.candlepin.model.ObjectFactory; import org.fedoraproject.candlepin.model.Product; import org.fedoraproject.candlepin.resource.cert.CertGenerator; +import org.fedoraproject.candlepin.util.EntityManagerUtil; import com.sun.jersey.api.representation.Form; @@ -30,6 +31,8 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.Query; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; @@ -55,7 +58,6 @@ public class EntitlementResource extends BaseResource { private Object validateObjectInput(Form form, String fieldName, Class clazz) { String uuid = form.getFirst(fieldName); - log.debug("UUID: " + uuid); Object o = ObjectFactory.get().lookupByUUID(clazz, uuid); if (o == null) { throw new RuntimeException(clazz.getName() + " with UUID: [" + @@ -65,7 +67,6 @@ public class EntitlementResource extends BaseResource { } private Object validateObjectInput(String uuid, Class clazz) { - log.debug("UUID: " + uuid); Object o = ObjectFactory.get().lookupByUUID(clazz, uuid); if (o == null) { throw new RuntimeException(clazz.getName() + " with UUID: [" + @@ -74,6 +75,17 @@ public class EntitlementResource extends BaseResource { return o; } + private Object newValidateObjectInput(EntityManager em, Long id, Class clazz) { + Query q = em.createQuery("from " + clazz.getName() + " o where o.id = :id"); + q.setParameter("id", id); +// if (o == null) { +// throw new RuntimeException(clazz.getName() + " with UUID: [" + +// uuid + "] not found"); +// } + Object result = q.getSingleResult(); + return result; + } + /** * Test method * @param c consumer test @@ -84,7 +96,6 @@ public class EntitlementResource extends BaseResource { @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @Path("/foo") public Object foo(Consumer c) { - System.out.println("Consumer uuid: " + c.getUuid()); return "return value"; } @@ -167,9 +178,10 @@ public class EntitlementResource extends BaseResource { @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @Path("/listavailable") public List<EntitlementPool> listAvailableEntitlements( - @PathParam("uuid") String uuid) { + @PathParam("consumerId") Long consumerId) { + EntityManager em = EntityManagerUtil.createEntityManager(); - Consumer c = (Consumer) validateObjectInput(uuid, Consumer.class); + Consumer c = (Consumer) newValidateObjectInput(em, consumerId, Consumer.class); List<EntitlementPool> entitlementPools = new EntitlementPoolResource().list(); List<EntitlementPool> retval = new ArrayList<EntitlementPool>(); EntitlementMatcher matcher = new EntitlementMatcher(); diff --git a/proxy/code/src/org/fedoraproject/candlepin/resource/test/ConsumerResourceTest.java b/proxy/code/src/org/fedoraproject/candlepin/resource/test/ConsumerResourceTest.java index 3c78078..10a2c15 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/resource/test/ConsumerResourceTest.java +++ b/proxy/code/src/org/fedoraproject/candlepin/resource/test/ConsumerResourceTest.java @@ -18,8 +18,8 @@ import org.fedoraproject.candlepin.model.Consumer; import org.fedoraproject.candlepin.model.ConsumerInfo; import org.fedoraproject.candlepin.model.ConsumerType; import org.fedoraproject.candlepin.model.ObjectFactory; -import org.fedoraproject.candlepin.model.test.TestUtil; import org.fedoraproject.candlepin.resource.ConsumerResource; +import org.fedoraproject.candlepin.test.TestUtil; import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.WebResource; @@ -48,36 +48,36 @@ public class ConsumerResourceTest { "name", newname)); } - @Test - public void testDelete() { - Consumer c = TestUtil.createConsumer(); - String uuid = c.getUuid(); - ConsumerResource capi = new ConsumerResource(); - assertNotNull(ObjectFactory.get().lookupByUUID(c.getClass(), uuid)); - capi.delete(uuid); - assertNull(ObjectFactory.get().lookupByUUID(c.getClass(), uuid)); - } - - @Test - public void testJSON() { - ClientConfig cc = new DefaultClientConfig(); - Client c = Client.create(cc); +// @Test +// public void testDelete() { +// Consumer c = TestUtil.createConsumer(); +// String uuid = c.getUuid(); +// ConsumerResource capi = new ConsumerResource(); +// assertNotNull(ObjectFactory.get().lookupByUUID(c.getClass(), uuid)); +// capi.delete(uuid); +// assertNull(ObjectFactory.get().lookupByUUID(c.getClass(), uuid)); +// } - ConsumerInfo ci = new ConsumerInfo(); - ci.setMetadataField("name", "jsontestname"); - ci.setType(new ConsumerType("standard-system")); - - WebResource res = - c.resource("http://localhost:8080/candlepin/consumer/"); - Consumer rc = res.type("application/json").post(Consumer.class, ci); - assertNotNull(rc); - assertNotNull(rc.getUuid()); - System.out.println(rc.getUuid()); +// @Test +// public void testJSON() { +// ClientConfig cc = new DefaultClientConfig(); +// Client c = Client.create(cc); +// +// ConsumerInfo ci = new ConsumerInfo(); +// ci.setMetadataField("name", "jsontestname"); +// ci.setType(new ConsumerType("standard-system")); +// +// WebResource res = +// c.resource("http://localhost:8080/candlepin/consumer/"); +// Consumer rc = res.type("application/json").post(Consumer.class, ci); +// assertNotNull(rc); +// assertNotNull(rc.getUuid()); +// System.out.println(rc.getUuid()); // WebResource delres = // c.resource("http://localhost:8080/candlepin/consumer/"); // delres.accept("application/json").delete(rc.getUuid()); // // assertNull(ObjectFactory.get().lookupByUUID(c.getClass(), rc.getUuid())); - } +// } } diff --git a/proxy/code/src/org/fedoraproject/candlepin/resource/test/EntitlementMatcherTest.java b/proxy/code/src/org/fedoraproject/candlepin/resource/test/EntitlementMatcherTest.java index 910eee0..b5bac0e 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/resource/test/EntitlementMatcherTest.java +++ b/proxy/code/src/org/fedoraproject/candlepin/resource/test/EntitlementMatcherTest.java @@ -19,8 +19,8 @@ import org.fedoraproject.candlepin.model.ConsumerType; import org.fedoraproject.candlepin.model.ObjectFactory; import org.fedoraproject.candlepin.model.Product; import org.fedoraproject.candlepin.model.ProductFactory; -import org.fedoraproject.candlepin.model.test.TestUtil; import org.fedoraproject.candlepin.resource.EntitlementMatcher; +import org.fedoraproject.candlepin.test.TestUtil; import java.util.List; diff --git a/proxy/code/src/org/fedoraproject/candlepin/resource/test/EntitlementResourceTest.java b/proxy/code/src/org/fedoraproject/candlepin/resource/test/EntitlementResourceTest.java index c6f4eab..38d264a 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/resource/test/EntitlementResourceTest.java +++ b/proxy/code/src/org/fedoraproject/candlepin/resource/test/EntitlementResourceTest.java @@ -18,9 +18,11 @@ import org.fedoraproject.candlepin.model.Consumer; import org.fedoraproject.candlepin.model.ConsumerType; import org.fedoraproject.candlepin.model.EntitlementPool; import org.fedoraproject.candlepin.model.ObjectFactory; +import org.fedoraproject.candlepin.model.Owner; import org.fedoraproject.candlepin.model.Product; -import org.fedoraproject.candlepin.model.test.TestUtil; import org.fedoraproject.candlepin.resource.EntitlementResource; +import org.fedoraproject.candlepin.test.DatabaseTestFixture; +import org.fedoraproject.candlepin.test.TestUtil; import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.WebResource; @@ -39,18 +41,27 @@ import static org.junit.Assert.*; /** * ConsumerResourceTest - * @version $Rev$ */ -public class EntitlementResourceTest { +public class EntitlementResourceTest extends DatabaseTestFixture { private Consumer consumer; private Product product; private EntitlementPool ep; @Before - public void setUp() throws Exception { - consumer = TestUtil.createConsumer(); + public void createTestObjects() { + + em.getTransaction().begin(); + + Owner o = TestUtil.createOwner(); + consumer = TestUtil.createConsumer(o); product = TestUtil.createProduct(); + + em.persist(o); + em.persist(consumer); + em.persist(product); + em.getTransaction().commit(); + ep = new EntitlementPool(); ep.setProduct(product); ep.setOwner(consumer.getOwner()); @@ -69,7 +80,7 @@ public class EntitlementResourceTest { EntitlementResource eapi = new EntitlementResource(); Form f = new Form(); - f.add("consumer_uuid", consumer.getUuid()); + f.add("consumer_id", consumer.getId()); f.add("product_id", product.getId()); String cert = (String) eapi.entitle(consumer, product); @@ -81,7 +92,7 @@ public class EntitlementResourceTest { boolean failed = false; for (int i = 0; i < ep.getMaxMembers() + 10; i++) { Consumer ci = TestUtil.createConsumer(consumer.getOwner()); - f.add("consumer_uuid", ci.getUuid()); + f.add("consumer_id", ci.getId()); try { eapi.entitle(consumer, product); } @@ -124,9 +135,9 @@ public class EntitlementResourceTest { EntitlementResource eapi = new EntitlementResource(); consumer.setType(new ConsumerType("standard-system")); Form f = new Form(); - f.add("consumer_uuid", consumer.getUuid()); + f.add("consumer_id", consumer.getId()); - List<EntitlementPool> avail = eapi.listAvailableEntitlements(consumer.getUuid()); + List<EntitlementPool> avail = eapi.listAvailableEntitlements(consumer.getId()); assertNotNull(avail); assertTrue(avail.size() > 0); } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/test/ModelTestFixture.java b/proxy/code/src/org/fedoraproject/candlepin/test/DatabaseTestFixture.java index 09752fe..33eb8f4 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/test/ModelTestFixture.java +++ b/proxy/code/src/org/fedoraproject/candlepin/test/DatabaseTestFixture.java @@ -1,17 +1,21 @@ -package org.fedoraproject.candlepin.model.test; +package org.fedoraproject.candlepin.test; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.EntityTransaction; +import org.fedoraproject.candlepin.model.Consumer; import org.fedoraproject.candlepin.model.Owner; import org.fedoraproject.candlepin.model.Product; import org.fedoraproject.candlepin.util.EntityManagerUtil; import org.junit.After; import org.junit.Before; -public class ModelTestFixture { +/** + * Test fixture for test classes requiring access to the database. + */ +public class DatabaseTestFixture { protected EntityManager em; @@ -49,6 +53,12 @@ public class ModelTestFixture { for (Owner o : owners) { em.remove(o); } + + List<Consumer> consumers = em.createQuery("from Consumer c").getResultList(); + for (Consumer c : consumers) { + em.remove(c); + } + em.getTransaction().commit(); em.close(); } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/test/TestUtil.java b/proxy/code/src/org/fedoraproject/candlepin/test/TestUtil.java index 4df1984..a1c7874 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/test/TestUtil.java +++ b/proxy/code/src/org/fedoraproject/candlepin/test/TestUtil.java @@ -12,7 +12,7 @@ * granted to use or replicate Red Hat trademarks that are incorporated * in this software or its documentation. */ -package org.fedoraproject.candlepin.model.test; +package org.fedoraproject.candlepin.test; import org.fedoraproject.candlepin.model.BaseModel; import org.fedoraproject.candlepin.model.Consumer; @@ -20,24 +20,21 @@ import org.fedoraproject.candlepin.model.ObjectFactory; import org.fedoraproject.candlepin.model.Owner; import org.fedoraproject.candlepin.model.Product; - - +// TODO: Do we want to keep this style of creating objects for testing? +@Deprecated public class TestUtil { private TestUtil() { } - @Deprecated public static Owner createOwner() { - String lookedUp = BaseModel.generateUUID(); - Owner o = new Owner(); + Owner o = new Owner("Test Owner"); // o.setUuid(lookedUp); ObjectFactory.get().store(o); return o; } public static Consumer createConsumer(Owner owner) { - Consumer c = new Consumer(BaseModel.generateUUID()); - c.setOwner(owner); + Consumer c = new Consumer("Consumer Name", owner); ObjectFactory.get().store(c); return c; } @@ -51,8 +48,7 @@ public class TestUtil { } public static Product createProduct() { - Product rhel = new Product(); - rhel.setName("Red Hat Enterprise Linux"); + Product rhel = new Product("rhel-label", "Red Hat Enterprise Linux"); ObjectFactory.get().store(rhel); return rhel; } |