summaryrefslogtreecommitdiff
path: root/src/com/p4square/f1oauth/F1API.java
blob: 88801db86bb99cd1f5488260cce52247bacf9f48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 * Copyright 2014 Jesse Morgan
 */

package com.p4square.f1oauth;

import java.io.IOException;
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, String attributeName, Attribute attribute)
            throws F1Exception;

}