/
IFriendsOperations.java
126 lines (116 loc) · 7.83 KB
/
IFriendsOperations.java
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*
* Copyright 2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.social.vkontakte.api;
import org.springframework.social.vkontakte.api.impl.json.VKArray;
import org.springframework.social.vkontakte.api.vkenums.FriendsOrder;
import org.springframework.social.vkontakte.api.vkenums.NameCase;
import java.util.List;
/**
* Defines operations for interacting with a user's friends.
* @author vkolodrevskiy
*/
public interface IFriendsOperations {
String DEFAULT_FIELDS = "first_name,last_name,photo_50,photo_100,photo_200,contacts,bdate,sex,screen_name";
/**
* Retrieves a list of user friends for the current authorized user.
* @return a list of user friends profiles.
* @throws org.springframework.social.ApiException if there is an error while communicating with VKontakte.
* @throws org.springframework.social.MissingAuthorizationException if VKontakteTemplate was not created with an access token.
* @throws org.springframework.social.vkontakte.api.VKontakteErrorException if VKontakte returned error.
*/
VKArray<VKontakteProfile> get();
/**
* Retrieves a list of user friends for the current authorized user.
* @param fields VKontakte fields to retrieve, comma-delimited.
* @return a list of user friends profiles.
* @throws org.springframework.social.ApiException if there is an error while communicating with VKontakte.
* @throws org.springframework.social.MissingAuthorizationException if VKontakteTemplate was not created with an access token.
* @throws org.springframework.social.vkontakte.api.VKontakteErrorException if VKontakte returned error.
*/
VKArray<VKontakteProfile> get(String fields);
/**
* Retrieves a list of user friends for specified user unique identifier.
* @param userId user unique identifier for which to get friends.
* @return a list of user friends profiles.
* @throws org.springframework.social.ApiException if there is an error while communicating with VKontakte.
* @throws org.springframework.social.MissingAuthorizationException if VKontakteTemplate was not created with an access token.
* @throws org.springframework.social.vkontakte.api.VKontakteErrorException if VKontakte returned error.
*/
VKArray<VKontakteProfile> get(Long userId);
/**
* Retrieves a list of user friends for specified user unique identifier.
* @param userId user unique identifier for which to get friends.
* @param fields VKontakte fields to retrieve, comma-delimited.
* @return a list of user friends profiles.
* @throws org.springframework.social.ApiException if there is an error while communicating with VKontakte.
* @throws org.springframework.social.MissingAuthorizationException if VKontakteTemplate was not created with an access token.
* @throws org.springframework.social.vkontakte.api.VKontakteErrorException if VKontakte returned error.
*/
VKArray<VKontakteProfile> get(Long userId, String fields);
/**
* Retrieves a list of user friends for specified user unique identifier.
* @param userId user unique identifier for which to get friends.
* @param fields VKontakte fields to retrieve, comma-delimited.
* @param count Number(positive number) of friends to return. If you want to return all friends pass negative number.
* @param offset Offset(positive number) needed to return a specific subset of friends.
* @return a list of user friends profiles.
* @throws org.springframework.social.ApiException if there is an error while communicating with VKontakte.
* @throws org.springframework.social.MissingAuthorizationException if VKontakteTemplate was not created with an access token.
* @throws org.springframework.social.vkontakte.api.VKontakteErrorException if VKontakte returned error.
*/
VKArray<VKontakteProfile> get(Long userId, String fields, int count, int offset);
/**
* Retrieves a list of user friends for specified user unique identifier.
* @param userId user unique identifier for which to get friends.
* @param fields VKontakte fields to retrieve, comma-delimited.
* @param order sort order.
* @param nameCase case for declension of user name and surname.
* @param count Number(positive number) of friends to return. If you want to return all friends pass negative number.
* @param offset Offset(positive number) needed to return a specific subset of friends.
* @return a list of user friends profiles.
* @throws org.springframework.social.ApiException if there is an error while communicating with VKontakte.
* @throws org.springframework.social.MissingAuthorizationException if VKontakteTemplate was not created with an access token.
* @throws org.springframework.social.vkontakte.api.VKontakteErrorException if VKontakte returned error.
*/
VKArray<VKontakteProfile> get(Long userId, String fields, FriendsOrder order, NameCase nameCase, int count, int offset);
/**
* Retrieves a list of user friends id's that are online for the current authorized user.
* Result <code>List</code> will contain 2 lists if you set <code>onlineMobile</code> parameter to <code>true</code>.
* First list will contain id's of online friends that use website, second list will contain id's of friends using mobile.
* @param onlineMobile <code>true</code> to return an additional online_mobile field, <code>false</code> otherwise.
* @param count Number(positive number) of friends to return. If you want to return all friends pass negative number.
* @param offset Offset(positive number) needed to return a specific subset of friends.
* @return a list of user online friends profiles.
* @throws org.springframework.social.ApiException if there is an error while communicating with VKontakte.
* @throws org.springframework.social.MissingAuthorizationException if VKontakteTemplate was not created with an access token.
* @throws org.springframework.social.vkontakte.api.VKontakteErrorException if VKontakte returned error.
*/
List<List<String>> getOnline(boolean onlineMobile, int count, int offset);
/**
* Retrieves a list of user friends that are online for specified user unique identifier.
* Result <code>List</code> will contain 2 lists if you set <code>onlineMobile</code> parameter to <code>true</code>.
* First list will contain id's of online friends that use website, second list will contain id's of friends using mobile.
* @param userId user unique identifier for which to get friends.
* @param onlineMobile <code>true</code> to return an additional online_mobile field, <code>false</code> otherwise.
* @param count Number(positive number) of friends to return. If you want to return all friends pass negative number.
* @param offset Offset(positive number) needed to return a specific subset of friends.
* @return a list of user online friends profiles.
* @throws org.springframework.social.ApiException if there is an error while communicating with VKontakte.
* @throws org.springframework.social.MissingAuthorizationException if VKontakteTemplate was not created with an access token.
* @throws org.springframework.social.vkontakte.api.VKontakteErrorException if VKontakte returned error.
*/
List<List<String>> getOnline(Long userId, boolean onlineMobile, int count, int offset);
}