diff options
| author | jesus m. rodriguez <jesusr@redhat.com> | 2009-11-02 15:42:46 -0500 |
|---|---|---|
| committer | jesus m. rodriguez <jesusr@redhat.com> | 2009-11-02 15:42:46 -0500 |
| commit | a1c4c70f2db04f9b2f41fc2896bd4f9a1b9cc350 (patch) | |
| tree | eda077e3676975fbd9d61a2fcd26afdac56f09e1 /proxy/code/src/org | |
| parent | 8ad3573bb3dcc930e39724cb6a9ce58d4ee80262 (diff) | |
fix checkstyle errors
Diffstat (limited to 'proxy/code/src/org')
19 files changed, 206 insertions, 66 deletions
diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/BaseModel.java b/proxy/code/src/org/fedoraproject/candlepin/model/BaseModel.java index 761796a..e071fc3 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/BaseModel.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/BaseModel.java @@ -28,12 +28,12 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.PROPERTY) public class BaseModel { - private String uuid; - private String name; + private String uuid; + private String name; /** * Construct new with UUID - * @param uuid + * @param uuid unique idea for the model object */ public BaseModel(String uuid) { this.uuid = uuid; @@ -45,19 +45,35 @@ public class BaseModel { public BaseModel() { } - + + /** + * Returns the unique id of the model object. + * @return the unique id of the model object. + */ public String getUuid() { return uuid; } + /** + * Sets the unique id of the model object. + * @param uuid unique id of the model. + */ public void setUuid(String uuid) { this.uuid = uuid; } + /** + * Returns the name of the object. + * @return the name of the object. + */ public String getName() { return name; } + /** + * Set the name of the model object. + * @param name name of the object + */ public void setName(String name) { this.name = name; } @@ -86,14 +102,29 @@ public class BaseModel { */ @Override public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null) return false; - if (getClass() != obj.getClass()) return false; + if (this == obj) { + return true; + } + + if (obj == null) { + return false; + } + + if (getClass() != obj.getClass()) { + return false; + } + BaseModel other = (BaseModel) obj; + if (this.getUuid() == null) { - if (other.getUuid() != null) return false; + if (other.getUuid() != null) { + return false; + } } - else if (!this.getUuid().equals(other.getUuid())) return false; + else if (!this.getUuid().equals(other.getUuid())) { + return false; + } + return true; } } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/Consumer.java b/proxy/code/src/org/fedoraproject/candlepin/model/Consumer.java index 38a0192..5db9bda 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/Consumer.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/Consumer.java @@ -23,6 +23,9 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; +/** + * Represents Consumer entity + */ @XmlRootElement @XmlAccessorType(XmlAccessType.PROPERTY) public class Consumer extends BaseModel { @@ -44,7 +47,7 @@ public class Consumer extends BaseModel { } /** - * @param uuid + * @param uuid unique id of consumer */ public Consumer(String uuid) { super(uuid); @@ -120,7 +123,7 @@ public class Consumer extends BaseModel { /** * Add a Product to this Consumer. - * + * @param p Product to be consumed. */ public void addConsumedProduct(Product p) { if (this.consumedProducts == null) { @@ -135,8 +138,8 @@ public class Consumer extends BaseModel { */ @Override public String toString() { - return "Consumer [type=" + this.getType() + ", getName()=" + getName() - + ", getUuid()=" + getUuid() + "]"; + return "Consumer [type=" + this.getType() + ", getName()=" + + getName() + ", getUuid()=" + getUuid() + "]"; } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerInfo.java b/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerInfo.java index 934568f..8a983b4 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerInfo.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerInfo.java @@ -22,6 +22,9 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; +/** + * Consumer metadata stored as ConsumerInfo + */ @XmlRootElement @XmlAccessorType(XmlAccessType.PROPERTY) public class ConsumerInfo { diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerType.java b/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerType.java index f69755b..d441b27 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerType.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/ConsumerType.java @@ -18,6 +18,9 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; +/** + * Represents the tyep of consumer. + */ @XmlRootElement @XmlAccessorType(XmlAccessType.PROPERTY) public class ConsumerType extends BaseModel { diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/Entitlement.java b/proxy/code/src/org/fedoraproject/candlepin/model/Entitlement.java index 2100664..1089e91 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/Entitlement.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/Entitlement.java @@ -22,6 +22,9 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; +/** + * Represents the actual Entitlement record. + */ @XmlRootElement @XmlAccessorType(XmlAccessType.PROPERTY) public class Entitlement extends BaseModel { @@ -40,7 +43,7 @@ public class Entitlement extends BaseModel { } /** - * @param uuid + * @param uuid unique id of the entitlement */ public Entitlement(String uuid) { super(uuid); @@ -55,7 +58,7 @@ public class Entitlement extends BaseModel { } /** - * @param org the org to set + * @param ownerIn the owner to set */ public void setOwner(Owner ownerIn) { this.owner = ownerIn; diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/EntitlementPool.java b/proxy/code/src/org/fedoraproject/candlepin/model/EntitlementPool.java index 49c7919..e6604e7 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/EntitlementPool.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/EntitlementPool.java @@ -21,6 +21,9 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; +/** + * Represents a collection of entitlements for a given order. + */ @XmlRootElement @XmlAccessorType(XmlAccessType.PROPERTY) public class EntitlementPool extends BaseModel { @@ -34,7 +37,7 @@ public class EntitlementPool extends BaseModel { private Date endDate; /** - * @param uuid + * @param uuid unique id of the pool */ public EntitlementPool(String uuid) { super(uuid); diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/JsonTestObject.java b/proxy/code/src/org/fedoraproject/candlepin/model/JsonTestObject.java index 24793be..fb44d11 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/JsonTestObject.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/JsonTestObject.java @@ -34,18 +34,34 @@ public class JsonTestObject extends BaseModel { //private String[] stringarray = new String[1]; private JsonTestObject parent; + /** + * sets the parent + * @param p Parent + */ public void setParent(JsonTestObject p) { parent = p; } - + + /** + * returns parent object + * @return parent object + */ public JsonTestObject getParent() { return parent; } - + + /** + * sets the list string + * @param items items to set + */ public void setStringList(List<String> items) { stringlist = items; } + /** + * returns the string list + * @return the string list + */ public List<String> getStringList() { return stringlist; } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/ObjectFactory.java b/proxy/code/src/org/fedoraproject/candlepin/model/ObjectFactory.java index e9fee23..7d2e27b 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/ObjectFactory.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/ObjectFactory.java @@ -30,7 +30,7 @@ import java.util.Map; public class ObjectFactory { /** Logger for this class */ - private static final Logger logger = Logger.getLogger(ObjectFactory.class); + private static Logger logger = Logger.getLogger(ObjectFactory.class); /** the singleton instance of the ObjectFactory */ private static ObjectFactory instance = new ObjectFactory(); @@ -80,7 +80,7 @@ public class ObjectFactory { /** * Get a List of objects by type - * @param clazz + * @param clazz class to lookup * @return List if found. null if not. */ public List<Object> listObjectsByClass(Class<?> clazz) { @@ -94,8 +94,9 @@ public class ObjectFactory { /** * Lookup an Owner by UUID + * @param clazz class to lookup * @param uuid to lookup - * @return Owner + * @return BaseModel if found, null otherwise. */ public BaseModel lookupByUUID(Class<?> clazz, String uuid) { return (BaseModel) lookupByFieldName(clazz, "uuid", uuid); @@ -103,9 +104,10 @@ public class ObjectFactory { /** * Lookup an object by a field name - * @param clazz - * @param fieldName - * @return BaseModel if found. + * @param clazz class to lookup + * @param fieldName field to use + * @param value value to match + * @return BaseModel if found, null otherwise. */ public Object lookupByFieldName(Class<?> clazz, String fieldName, String value) { String key = clazz.getName(); @@ -130,7 +132,8 @@ public class ObjectFactory { /** * Store an object - * @param u + * @param u object to store + * @return The stored object */ public Object store(Object u) { String key = u.getClass().getName(); @@ -147,7 +150,7 @@ public class ObjectFactory { /** * Delete an object * @param clazz to lookup - * @param uuidIn to lookup and delete + * @param removeMe model to remove */ public void delete(Class clazz, BaseModel removeMe) { String key = clazz.getName(); diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/Owner.java b/proxy/code/src/org/fedoraproject/candlepin/model/Owner.java index 16b1f56..8bc43de 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/Owner.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/Owner.java @@ -21,6 +21,9 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; +/** + * Represents the owner of entitlements + */ @XmlRootElement @XmlAccessorType(XmlAccessType.PROPERTY) public class Owner extends BaseModel { @@ -30,7 +33,7 @@ public class Owner extends BaseModel { private List<User> users; /** - * @param uuid + * @param uuid unique id for the owner */ public Owner(String uuid) { super(uuid); @@ -91,6 +94,10 @@ public class Owner extends BaseModel { this.users.add(u); } + /** + * Add a consumer to this owner + * @param c consumer for this owner. + */ public void addConsumer(Consumer c) { c.setOwner(this); if (this.consumers == null) { @@ -100,6 +107,10 @@ public class Owner extends BaseModel { } + /** + * add owner to the pool, and reference to the pool. + * @param pool EntitlementPool for this owner. + */ public void addEntitlementPool(EntitlementPool pool) { pool.setOwner(this); if (this.entitlementPools == null) { @@ -113,7 +124,7 @@ public class Owner extends BaseModel { */ @Override public String toString() { - return "Owner [getName()=" + getName() + ", getUuid()=" - + getUuid() + "]"; + return "Owner [getName()=" + getName() + ", getUuid()=" + + getUuid() + "]"; } } diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/Product.java b/proxy/code/src/org/fedoraproject/candlepin/model/Product.java index caad6ee..b05b168 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/Product.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/Product.java @@ -21,6 +21,9 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; +/** + * Represents a Product that can be consumed and entitled. + */ @XmlRootElement @XmlAccessorType(XmlAccessType.PROPERTY) public class Product extends BaseModel { @@ -30,7 +33,7 @@ public class Product extends BaseModel { /** * Create product with UUID - * @param uuid + * @param uuid unique id for the product */ public Product(String uuid) { super(uuid); @@ -68,8 +71,8 @@ public class Product extends BaseModel { } /** - * Get the list of - * @return + * Get the list of compatible consumer types + * @return list of compatible consumer types */ public List<String> getCompatibleConsumerTypes() { diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/User.java b/proxy/code/src/org/fedoraproject/candlepin/model/User.java index b5b1256..cbe2395 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/User.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/User.java @@ -21,6 +21,10 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; +/** + * Represents the user. + * TODO: how does this differ from an Owner. + */ @XmlRootElement @XmlAccessorType(XmlAccessType.PROPERTY) public class User extends BaseModel { diff --git a/proxy/code/src/org/fedoraproject/candlepin/resource/ApiHandler.java b/proxy/code/src/org/fedoraproject/candlepin/resource/ApiHandler.java index 4c240f3..e1ad297 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/resource/ApiHandler.java +++ b/proxy/code/src/org/fedoraproject/candlepin/resource/ApiHandler.java @@ -1,3 +1,17 @@ +/** + * Copyright (c) 2009 Red Hat, Inc. + * + * This software is licensed to you under the GNU General Public License, + * version 2 (GPLv2). There is NO WARRANTY for this software, express or + * implied, including the implied warranties of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 + * along with this software; if not, see + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. + * + * Red Hat trademarks are not licensed under GPLv2. No permission is + * granted to use or replicate Red Hat trademarks that are incorporated + * in this software or its documentation. + */ package org.fedoraproject.candlepin.resource; import org.fedoraproject.candlepin.model.BaseModel; @@ -9,7 +23,10 @@ import org.apache.log4j.Logger; import java.util.HashSet; import java.util.Set; - +/** + * API gateway for authentication + * TODO: do we still need this? + */ public class ApiHandler { private static ApiHandler instance = new ApiHandler(); @@ -18,18 +35,25 @@ public class ApiHandler { /** * Logger for this class */ - private static final Logger logger = Logger.getLogger(ApiHandler.class); + private static Logger logger = Logger.getLogger(ApiHandler.class); private ApiHandler() { authTokens = new HashSet(); } - + + /** + * returns instance of this singleton. + * @return instance of this singleton. + */ public static ApiHandler get() { return instance; } /** * Auth + * @param login username + * @param password password + * @return token */ public String login(String login, String password) { User u = (User) ObjectFactory.get(). @@ -55,8 +79,11 @@ public class ApiHandler { /** Owners */ - /** Fetch an owner - * + /** + * Fetch an owner + * @param authToken token + * @param uuid unique id of owner + * @return owner */ public Owner getOwner(String authToken, String uuid) { checkToken(authToken); diff --git a/proxy/code/src/org/fedoraproject/candlepin/resource/AuthHandler.java b/proxy/code/src/org/fedoraproject/candlepin/resource/AuthHandler.java deleted file mode 100644 index ab78385..0000000 --- a/proxy/code/src/org/fedoraproject/candlepin/resource/AuthHandler.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.fedoraproject.candlepin.resource; - -public class AuthHandler { - -} diff --git a/proxy/code/src/org/fedoraproject/candlepin/resource/AuthenticationException.java b/proxy/code/src/org/fedoraproject/candlepin/resource/AuthenticationException.java index c21778d..8d3692a 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/resource/AuthenticationException.java +++ b/proxy/code/src/org/fedoraproject/candlepin/resource/AuthenticationException.java @@ -15,18 +15,17 @@ package org.fedoraproject.candlepin.resource; /** + * Represents an error while authenticating. * @author mmccune - * */ public class AuthenticationException extends RuntimeException { private static final long serialVersionUID = 1L; /** - * @param message + * @param message exception message */ public AuthenticationException(String message) { super(message); } - } diff --git a/proxy/code/src/org/fedoraproject/candlepin/resource/BaseResource.java b/proxy/code/src/org/fedoraproject/candlepin/resource/BaseResource.java index e8432dd..83f40f3 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/resource/BaseResource.java +++ b/proxy/code/src/org/fedoraproject/candlepin/resource/BaseResource.java @@ -27,12 +27,16 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +/** + * Base api gateway for all model objects. + */ public abstract class BaseResource { + private Class model; /** * Ctor - * @param model + * @param modelClass class of derived model class. */ public BaseResource(Class modelClass) { this.model = modelClass; @@ -41,8 +45,13 @@ public abstract class BaseResource { /** * Logger for this class */ - private static final Logger log = Logger.getLogger(BaseResource.class); + private static Logger log = Logger.getLogger(BaseResource.class); + /** + * Returns the model object matching the given uuid. + * @param uuid unique id of model sought. + * @return the model object matching the given uuid. + */ @GET @Path("/{uuid}") @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public Object get(@PathParam("uuid") String uuid) { @@ -73,7 +82,11 @@ public abstract class BaseResource { // return ObjectFactory.get().store(newobject); // } - + + /** + * Delete the model object matching the given uuid. + * @param uuid unique id of object to be deleted. + */ @DELETE @Path("/{uuid}") public void delete(String uuid) { System.out.println("Delete called: " + uuid); diff --git a/proxy/code/src/org/fedoraproject/candlepin/resource/ConsumerResource.java b/proxy/code/src/org/fedoraproject/candlepin/resource/ConsumerResource.java index 4ccc96d..0356edd 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/resource/ConsumerResource.java +++ b/proxy/code/src/org/fedoraproject/candlepin/resource/ConsumerResource.java @@ -30,6 +30,9 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +/** + * API Gateway for Consumers + */ @Path("/consumer") public class ConsumerResource extends BaseResource { @@ -39,7 +42,11 @@ public class ConsumerResource extends BaseResource { public ConsumerResource() { super(Consumer.class); } - + + /** + * List available Consumers + * @return list of available consumers. + */ @GET @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public List<Consumer> list() { @@ -50,7 +57,12 @@ public class ConsumerResource extends BaseResource { } return consumers; } - + + /** + * Create a Consumer + * @param ci Consumer metadata encapsulated in a ConsumerInfo. + * @return newly created Consumer + */ @POST @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) @@ -66,6 +78,10 @@ public class ConsumerResource extends BaseResource { return c; } + /** + * Returns the ConsumerInfo for the given Consumer. + * @return the ConsumerInfo for the given Consumer. + */ @GET @Path("/info") @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public ConsumerInfo getInfo() { diff --git a/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementMatcher.java b/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementMatcher.java index c90cd5b..fbfd12c 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementMatcher.java +++ b/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementMatcher.java @@ -25,8 +25,8 @@ import org.apache.log4j.Logger; import java.util.List; /** - * EntitlementMatcher - initial class for matching products compatability with - * an entitlement. + * EntitlementMatcher - initial class for matching products compatability + * with an entitlement. * @version $Rev$ */ public class EntitlementMatcher { @@ -34,14 +34,13 @@ public class EntitlementMatcher { /** * Logger for this class */ - private static final Logger log = Logger + private static Logger log = Logger .getLogger(EntitlementMatcher.class); - /** * Check if a given consumer is compat with given product. - * @param consumer to check - * @param product to check + * @param c consumer to check + * @param p product to check * @return boolean if compat or not */ public boolean isCompatible(Consumer c, Product p) { @@ -54,5 +53,4 @@ public class EntitlementMatcher { return (types != null && types.contains(c.getType())); } - } diff --git a/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementPoolResource.java b/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementPoolResource.java index aed0df9..8c93aa3 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementPoolResource.java +++ b/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementPoolResource.java @@ -25,6 +25,9 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +/** + * API gateway for the EntitlementPool + */ @Path("/entitlementpool") public class EntitlementPoolResource extends BaseResource { @@ -34,7 +37,11 @@ public class EntitlementPoolResource extends BaseResource { public EntitlementPoolResource() { super(EntitlementPool.class); } - + + /** + * Returns the list of available entitlement pools. + * @return the list of available entitlement pools. + */ @GET @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public List<EntitlementPool> list() { diff --git a/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementResource.java b/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementResource.java index a2fe6a2..05b29c5 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementResource.java +++ b/proxy/code/src/org/fedoraproject/candlepin/resource/EntitlementResource.java @@ -51,7 +51,7 @@ public class EntitlementResource extends BaseResource { } /** Logger for this class */ - private static final Logger log = Logger.getLogger(EntitlementResource.class); + private static Logger log = Logger.getLogger(EntitlementResource.class); private Object validateObjectInput(Form form, String fieldName, Class clazz) { String uuid = form.getFirst(fieldName); @@ -77,6 +77,7 @@ public class EntitlementResource extends BaseResource { /** * Test method * @param c consumer test + * @return test object */ @POST @Consumes({MediaType.APPLICATION_JSON}) @@ -91,6 +92,7 @@ public class EntitlementResource extends BaseResource { * Entitles the given Consumer with the given Product. * @param c Consumer to be entitled * @param p The Product + * @return Entitled object */ @POST @Consumes({MediaType.APPLICATION_JSON}) @@ -136,17 +138,17 @@ public class EntitlementResource extends BaseResource { /** * Check to see if a given Consumer is entitled to given Product - * @param consumer_uuid consumer_uuid to check if entitled or not - * @param product_uuid product_uuid to check if entitled or not + * @param consumerUuid consumerUuid to check if entitled or not + * @param productUuid productUuid to check if entitled or not * @return boolean if entitled or not */ @GET @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) @Path("/has") - public boolean hasEntitlement(@PathParam("consumer_uuid") String consumer_uuid, - @PathParam("product_uuid") String product_uuid) { - Consumer c = (Consumer) validateObjectInput(consumer_uuid, Consumer.class); - Product p = (Product) validateObjectInput(product_uuid, Product.class); + public boolean hasEntitlement(@PathParam("consumer_uuid") String consumerUuid, + @PathParam("product_uuid") String productUuid) { + Consumer c = (Consumer) validateObjectInput(consumerUuid, Consumer.class); + Product p = (Product) validateObjectInput(productUuid, Product.class); for (Entitlement e : c.getEntitlements()) { if (e.getProduct().equals(p)) { return true; @@ -158,7 +160,7 @@ public class EntitlementResource extends BaseResource { /** * Match/List the available entitlements for a given Consumer. Right now * this returns ALL entitlements because we haven't built any filtering logic. - * @param uuid consumer_uuid + * @param uuid consumerUuid * @return List<Entitlement> of applicable */ @GET |
