diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2016-04-09 15:53:24 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2016-04-09 15:53:24 -0700 |
commit | 371ccae3d1f31ec38f4af77fb7fcd175d49b3cd5 (patch) | |
tree | 38c4f1e8828f9af9c4b77a173bee0d312b321698 /src/main/java/com/p4square/f1oauth/F1API.java | |
parent | bbf907e51dfcf157bdee24dead1d531122aa25db (diff) | |
parent | 3102d8bce3426d9cf41aeaf201c360d342677770 (diff) |
Merge pull request #10 from PuyallupFoursquare/maven
Switching from Ivy+Ant to Maven.
Diffstat (limited to 'src/main/java/com/p4square/f1oauth/F1API.java')
-rw-r--r-- | src/main/java/com/p4square/f1oauth/F1API.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/main/java/com/p4square/f1oauth/F1API.java b/src/main/java/com/p4square/f1oauth/F1API.java new file mode 100644 index 0000000..a525c3f --- /dev/null +++ b/src/main/java/com/p4square/f1oauth/F1API.java @@ -0,0 +1,56 @@ +/* + * Copyright 2014 Jesse Morgan + */ + +package com.p4square.f1oauth; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import com.p4square.restlet.oauth.OAuthException; +import com.p4square.restlet.oauth.OAuthUser; + +/** + * F1 API methods which require an authenticated user. + * + * @author Jesse Morgan <jesse@jesterpm.net> + */ +public interface F1API { + /** + * Fetch information about a user. + * + * @param user The user to fetch information about. + * @return An F1User object. + */ + F1User getF1User(OAuthUser user) throws OAuthException, IOException; + + /** + * Fetch a list of all attributes ids and names. + * + * @return A Map of attribute name to attribute id. + */ + Map<String, String> getAttributeList() throws F1Exception; + + /** + * Add an attribute to the user. + * + * @param user The user to add the attribute to. + * @param attributeName The attribute to add. + * @param attribute The attribute to add. + */ + boolean addAttribute(String userId, Attribute attribute) throws F1Exception; + + /** + * Return attributes assigned to user. + * + * A user may be assigned multiple attributes with the same name, thus even if + * attributeName is specified, multiple attributes may be returned. + * + * @param userId The user to query. + * @param attributeName A specific attribute to return, null for all. + * @return A list of Attributes + */ + List<Attribute> getAttribute(String userId, String attributeName) throws F1Exception; + +} |