Skip to main content
summaryrefslogtreecommitdiffstats
blob: a942c26f9aadf94f1dc404e4b80edadeb18c3e9f (plain) (blame)
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
/*******************************************************************************
 * Copyright (c) 2013 Boeing.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.account.rest.client;

import java.net.URI;
import java.util.Collection;
import java.util.Map;
import org.eclipse.osee.account.rest.model.AccountDetailsData;
import org.eclipse.osee.account.rest.model.AccountInfoData;
import org.eclipse.osee.account.rest.model.AccountInput;
import org.eclipse.osee.account.rest.model.AccountPreferencesData;
import org.eclipse.osee.account.rest.model.AccountSessionData;
import org.eclipse.osee.account.rest.model.AccountSessionDetailsData;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;

/**
 * AccountId parameter can be any field that uniquely identifies an account such as:
 * <ol>
 * <li>ID</li>
 * <li>UUID</li>
 * <li>Email</li>
 * <li>User name</li>
 * <li>Display name</li>
 * </ol>
 * 
 * @author Roberto E. Escobar
 */
public interface AccountClient {

   public static interface UnsubscribeInfo {
      String getName();

      URI getUnsubscribeUri();
   }

   AccountSessionData login(String scheme, String username, String password);

   boolean logout(AccountSessionData session);

   AccountInfoData createAccount(String userName, AccountInput input);

   boolean deleteAccount(String uuid);

   ResultSet<AccountSessionDetailsData> getAccountSessionDataByUniqueField(String accountId);

   ResultSet<AccountInfoData> getAllAccounts();

   AccountDetailsData getAccountDetailsByUniqueField(String accountId);

   AccountPreferencesData getAccountPreferencesByUniqueField(String accountId);

   boolean setAccountActive(String accountId, boolean active);

   boolean isAccountActive(String accountId);

   boolean setAccountPreferences(String accountId, Map<String, String> preferences);

   ResultSet<UnsubscribeInfo> getUnsubscribeUris(String userUuid, Collection<String> groupNames);

}

Back to the top