Added
Link Here
|
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2011 Kevin Sawicki |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
6 |
* http://www.eclipse.org/legal/epl-v10.html |
7 |
* |
8 |
*******************************************************************************/ |
9 |
package org.eclipse.mylyn.commons.identity.gravatar; |
10 |
|
11 |
import java.io.IOException; |
12 |
|
13 |
import org.eclipse.core.runtime.IProgressMonitor; |
14 |
|
15 |
/** |
16 |
* Gravatar store interface. |
17 |
* |
18 |
* @author Kevin Sawicki (kevin@github.com) |
19 |
*/ |
20 |
public interface IGravatarStore { |
21 |
|
22 |
/** |
23 |
* Does this store contain a gravatar for the specified hash? |
24 |
* |
25 |
* @param hash |
26 |
* @return true if store contains avatar, false otherwise |
27 |
*/ |
28 |
boolean containsGravatar(String hash); |
29 |
|
30 |
/** |
31 |
* Refresh all gravatars currently in the store |
32 |
* |
33 |
* @param monitor |
34 |
* @return this store |
35 |
*/ |
36 |
IGravatarStore refresh(IProgressMonitor monitor); |
37 |
|
38 |
/** |
39 |
* Schedule refresh of gravatars asynchronously |
40 |
* |
41 |
* @return this store |
42 |
*/ |
43 |
IGravatarStore scheduleRefresh(); |
44 |
|
45 |
/** |
46 |
* Get last refresh time of store |
47 |
* |
48 |
* @return local refresh time |
49 |
*/ |
50 |
long getRefreshTime(); |
51 |
|
52 |
/** |
53 |
* Load gravatar by hash asynchronously |
54 |
* |
55 |
* @param hash |
56 |
* @param callback |
57 |
* @return this store |
58 |
*/ |
59 |
IGravatarStore loadGravatarByHash(String hash, IGravatarCallback callback); |
60 |
|
61 |
/** |
62 |
* Load latest gravatar by specified hash |
63 |
* |
64 |
* @param hash |
65 |
* @return avatar or null if load fails |
66 |
* @throws IOException |
67 |
*/ |
68 |
Gravatar loadGravatarByHash(String hash) throws IOException; |
69 |
|
70 |
/** |
71 |
* Load gravatar by e-mail address asynchronously |
72 |
* |
73 |
* @param email |
74 |
* @param callback |
75 |
* @return this store |
76 |
*/ |
77 |
IGravatarStore loadGravatarByEmail(String email, IGravatarCallback callback); |
78 |
|
79 |
/** |
80 |
* Load latest gravatar for specified e-mail address |
81 |
* |
82 |
* @param email |
83 |
* @return gravatar or null if load fails |
84 |
* @throws IOException |
85 |
*/ |
86 |
Gravatar loadGravatarByEmail(String email) throws IOException; |
87 |
|
88 |
/** |
89 |
* Get cached gravatar by hash |
90 |
* |
91 |
* @param hash |
92 |
* @return gravatar or null if not in cache |
93 |
*/ |
94 |
Gravatar getGravatarByHash(String hash); |
95 |
|
96 |
/** |
97 |
* Get cached gravatar by e-mail address |
98 |
* |
99 |
* @param email |
100 |
* @return gravatar or null if not in cache |
101 |
*/ |
102 |
Gravatar getGravatarByEmail(String email); |
103 |
|
104 |
} |