blob: b1d2608b723207b5845771dd75a43e70620e7a66 (
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
69
70
71
72
73
74
75
76
77
78
|
/*******************************************************************************
* 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.orcs.account.admin.internal;
import org.eclipse.osee.account.admin.Account;
import org.eclipse.osee.account.admin.AccountPreferences;
import org.eclipse.osee.account.rest.model.AccountWebPreferences;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.jdk.core.type.BaseIdentity;
import org.eclipse.osee.orcs.data.ArtifactReadable;
/**
* @author Roberto E. Escobar
*/
public class AccountArtifact extends BaseIdentity<String>implements Account {
private static final String NOT_AVAILABLE = "N/A";
private final ArtifactReadable artifact;
private final AccountPreferences preferences;
private final AccountWebPreferences webPreferences;
public AccountArtifact(String uuid, ArtifactReadable artifact, AccountPreferences preferences, AccountWebPreferences webPreferences) {
super(artifact.getGuid());
this.artifact = artifact;
this.preferences = preferences;
this.webPreferences = webPreferences;
}
@Override
public long getId() {
return artifact.getUuid();
}
@Override
public boolean isActive() {
return artifact.getSoleAttributeValue(CoreAttributeTypes.Active, false);
}
@Override
public String getName() {
return artifact.getSoleAttributeValue(CoreAttributeTypes.Name, NOT_AVAILABLE);
}
@Override
public String getUserName() {
return artifact.getSoleAttributeValue(CoreAttributeTypes.UserId, NOT_AVAILABLE);
}
@Override
public String getEmail() {
return artifact.getSoleAttributeValue(CoreAttributeTypes.Email, NOT_AVAILABLE);
}
@Override
public AccountWebPreferences getWebPreferences() {
return webPreferences;
}
@Override
public AccountPreferences getPreferences() {
return preferences;
}
@Override
public String toString() {
return "AccountArtifact [artifact=" + artifact + ", preferences=" + preferences + "]";
}
}
|