Hola, few things about that class: - I noticed that there's no need to maintain the data in the Set sorted, since when calculating the base string have to be merged; - I'd maintain the data structures as more anonym as possible, Iterable should be enough; - AFAIK there's no need to store the request somewhere; what about switching to a final class? Thanks in advance, have a nice weekend, Simo
http://people.apache.org/~simonetripodi/ http://www.99soft.org/ On Sat, Jul 10, 2010 at 2:09 PM, <[email protected]> wrote: > Author: pidster > Date: Sat Jul 10 12:09:34 2010 > New Revision: 962827 > > URL: http://svn.apache.org/viewvc?rev=962827&view=rev > Log: > Add accessor methods for parameters; code will be duplicated in various > places otherwise > > Modified: > > incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/OAuthRequest.java > > Modified: > incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/OAuthRequest.java > URL: > http://svn.apache.org/viewvc/incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/OAuthRequest.java?rev=962827&r1=962826&r2=962827&view=diff > ============================================================================== > --- > incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/OAuthRequest.java > (original) > +++ > incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/OAuthRequest.java > Sat Jul 10 12:09:34 2010 > @@ -18,6 +18,7 @@ package org.apache.amber; > > import java.net.URL; > import java.util.Collection; > +import java.util.SortedSet; > > /** > * A convenient object representing the properties of an OAuth request to a > @@ -35,6 +36,9 @@ public interface OAuthRequest { > > void setHTTPMethod(HTTPMethod httpMethod); > > + /** > + * @param parameter > + */ > void addOAuthMessageParameter(OAuthMessageParameter parameter); > > /** > @@ -42,15 +46,30 @@ public interface OAuthRequest { > * > * @return the OAuth parameters will be included in the OAuth message. > */ > - Collection<OAuthMessageParameter> getOAuthMessageParameters(); > + SortedSet<OAuthMessageParameter> getOAuthMessageParameters(); > > + /** > + * @param parameter > + */ > void addOAuthRequestParameter(OAuthRequestParameter parameter); > > + /** > + * @param signatureMethod > + * @return > + */ > + String getOAuthMessageParameter(OAuthParameter parameter); > + > /** > * Returns the aux parameters client will included in the request. > * > * @return the aux parameters client will included in the request. > */ > - Collection<OAuthRequestParameter> getOAuthRequestParameters(); > + SortedSet<OAuthRequestParameter> getOAuthRequestParameters(); > + > + /** > + * @param signatureMethod > + * @return > + */ > + String getOAuthRequestParameter(String name); > > } > > >
