gluu
公開メンバ関数 | 静的非公開変数類 | 全メンバ一覧
org.xdi.oxauth.model.common.SimpleUser クラス
org.xdi.oxauth.model.common.SimpleUser の継承関係図
Inheritance graph
org.xdi.oxauth.model.common.SimpleUser 連携図
Collaboration graph

公開メンバ関数

Object getAttribute (String userAttribute, boolean optional) throws InvalidClaimException
 
List< String > getAttributeValues (String ldapAttribute)
 

静的非公開変数類

static final long serialVersionUID = -2634191420188575733L
 

詳解

著者
Javier Rojas Blum Date: 11.25.2011

関数詳解

◆ getAttribute()

Object org.xdi.oxauth.model.common.SimpleUser.getAttribute ( String  userAttribute,
boolean  optional 
) throws InvalidClaimException
inline
23  {
24  Object attribute = null;
25 
26  for (org.gluu.persist.model.base.CustomAttribute customAttribute : customAttributes) {
27  if (customAttribute.getName().equals(userAttribute)) {
28  List<String> values = customAttribute.getValues();
29  if (values != null) {
30  if (values.size() == 1) {
31  attribute = values.get(0);
32  } else {
33  JSONArray array = new JSONArray();
34  for (String v : values) {
35  array.put(v);
36  }
37  attribute = array;
38  }
39  }
40 
41  break;
42  }
43  }
44 
45  if (attribute != null) {
46  return attribute;
47  } else if (optional) {
48  return attribute;
49  } else {
50  throw new InvalidClaimException("The claim " + userAttribute + " was not found.");
51  }
52  }

◆ getAttributeValues()

List<String> org.xdi.oxauth.model.common.SimpleUser.getAttributeValues ( String  ldapAttribute)
inline
54  {
55  List<String> attributes = null;
56  if (ldapAttribute != null && !ldapAttribute.isEmpty()) {
57  for (CustomAttribute customAttribute : customAttributes) {
58  if (StringHelper.equalsIgnoreCase(ldapAttribute, customAttribute.getName())) {
59  attributes = customAttribute.getValues();
60  break;
61  }
62  }
63  }
64 
65  return attributes;
66  }

メンバ詳解

◆ serialVersionUID

final long org.xdi.oxauth.model.common.SimpleUser.serialVersionUID = -2634191420188575733L
staticprivate

このクラス詳解は次のファイルから抽出されました: