gluu
公開メンバ関数 | 静的公開メンバ関数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.gluu.oxtrust.model.scim2.extensions.ExtensionField クラス
org.gluu.oxtrust.model.scim2.extensions.ExtensionField 連携図
Collaboration graph

公開メンバ関数

Type getAttributeDefinitionType ()
 
String getName ()
 
void setName (String name)
 
boolean isMultiValued ()
 
AttributeDataType getType ()
 
void setMultiValued (boolean multiValued)
 
void setType (AttributeDataType type)
 
String getDescription ()
 
void setDescription (String description)
 

静的公開メンバ関数

static Object valueOf (ExtensionField field, Object val)
 
static Object valueFromString (ExtensionField field, String val)
 
static String stringValueOf (ExtensionField field, Object val)
 

非公開変数類

String name
 
boolean multiValued
 
AttributeDataType type
 
String description
 

静的非公開変数類

static final String XSD_DATE_TIME_PATTERN ="^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.*$"
 

詳解

Represents the metadata of an attribute that belongs to a SCIM resource extension.

Attributes part of extensions, aka "extended attributes" or "custom attributes" have implicit characteristics equal to the defaults shown in section 2.2 of RFC 7643. In other words, all custom attributes have:

The only "configurable" characteristics supported are:

These can be tweaked via oxTrust admin web console.

See also: Extension class.

関数詳解

◆ getAttributeDefinitionType()

Type org.gluu.oxtrust.model.scim2.extensions.ExtensionField.getAttributeDefinitionType ( )
inline

Maps the org.xdi.model.GluuAttributeDataType associated to this ExtensionField (see getType) to a member of the enum AttributeDefinition.Type.

The mapping is straightforward. Special case is org.xdi.model.GluuAttributeDataType.NUMERIC mapped to Type.DECIMAL.

戻り値
An enum value of AttributeDefinition.Type
161  {
162 
163  Type attrType=null;
164  switch (type) {
165  case BINARY:
166  attrType = Type.BINARY;
167  break;
168  case STRING:
169  attrType = Type.STRING;
170  break;
171  case DATE:
172  attrType = Type.DATETIME;
173  break;
174  case NUMERIC:
175  attrType = Type.DECIMAL; //Return the broader of DECIMAL or INTEGER;
176  break;
177  case BOOLEAN:
178  attrType = Type.BOOLEAN;
179  break;
180  }
181  return attrType;
182 
183  }
AttributeDataType type
Definition: ExtensionField.java:45

◆ getDescription()

String org.gluu.oxtrust.model.scim2.extensions.ExtensionField.getDescription ( )
inline
209  {
210  return description;
211  }
String description
Definition: ExtensionField.java:46

◆ getName()

String org.gluu.oxtrust.model.scim2.extensions.ExtensionField.getName ( )
inline
185  {
186  return name;
187  }
String name
Definition: ExtensionField.java:43

◆ getType()

AttributeDataType org.gluu.oxtrust.model.scim2.extensions.ExtensionField.getType ( )
inline
197  {
198  return type;
199  }
AttributeDataType type
Definition: ExtensionField.java:45

◆ isMultiValued()

boolean org.gluu.oxtrust.model.scim2.extensions.ExtensionField.isMultiValued ( )
inline
193  {
194  return multiValued;
195  }
boolean multiValued
Definition: ExtensionField.java:44

◆ setDescription()

void org.gluu.oxtrust.model.scim2.extensions.ExtensionField.setDescription ( String  description)
inline
213  {
214  this.description = description;
215  }
String description
Definition: ExtensionField.java:46

◆ setMultiValued()

void org.gluu.oxtrust.model.scim2.extensions.ExtensionField.setMultiValued ( boolean  multiValued)
inline
201  {
202  this.multiValued = multiValued;
203  }
boolean multiValued
Definition: ExtensionField.java:44

◆ setName()

void org.gluu.oxtrust.model.scim2.extensions.ExtensionField.setName ( String  name)
inline
189  {
190  this.name = name;
191  }
String name
Definition: ExtensionField.java:43

◆ setType()

void org.gluu.oxtrust.model.scim2.extensions.ExtensionField.setType ( AttributeDataType  type)
inline
205  {
206  this.type = type;
207  }
AttributeDataType type
Definition: ExtensionField.java:45

◆ stringValueOf()

static String org.gluu.oxtrust.model.scim2.extensions.ExtensionField.stringValueOf ( ExtensionField  field,
Object  val 
)
inlinestatic

Takes an object and a ExtensionField, and returns a String (suitable for storing in LDAP). For a field data type NUMERIC, BOOLEAN or STRING, a straight string representation is returned. When it's DATE, it is converted from ISO to generalized date time format.

引数
fieldAn instance of ExtensionField
valA value
戻り値
String formated properly
134  {
135 
136  String value=null;
137  switch (field.getType()) {
138  case NUMERIC:
139  case STRING:
140  case BINARY:
141  value=val.toString();
142  break;
143  case DATE:
144  value=DateUtil.ISOToGeneralizedStringDate(val.toString());
145  break;
146  case BOOLEAN:
147  value=val.toString().toUpperCase(); //LDAP accepts TRUE or FALSE only
148  break;
149  }
150  return value;
151 
152  }

◆ valueFromString()

static Object org.gluu.oxtrust.model.scim2.extensions.ExtensionField.valueFromString ( ExtensionField  field,
String  val 
)
inlinestatic

Equivalent to valueOf, however, a String is supplied as value. Here no validations on data type consistence takes place (it is expected that value passed reflects the type of the field). If the field is a DATE, a conversion from ISO format is done, nonetheless, DATE fields still remain being represented as Java strings

引数
fieldAn ExtensionField
valA non-null String value
戻り値
A value
93  {
94 
95  Object value=null; //In practice value will never end up being null
96  switch (field.getType()){
97  case STRING:
98  case BINARY:
99  value = val;
100  break;
101  case DATE:
102  //Dates are stored and read as strings indeed (no handling of Date or DateTime objects)
103  value=DateUtil.generalizedToISOStringDate(val);
104  break;
105  case NUMERIC:
106  try{
107  value = new Integer(val);
108  }
109  catch (Exception e){
110  try{
111  value = new Double(val);
112  }
113  catch (Exception e2) {
114  value = null;
115  }
116  }
117  break;
118  case BOOLEAN:
119  value=Boolean.valueOf(val);
120  break;
121  }
122  return value;
123 
124  }

◆ valueOf()

static Object org.gluu.oxtrust.model.scim2.extensions.ExtensionField.valueOf ( ExtensionField  field,
Object  val 
)
inlinestatic

Tries parsing the value passed according to the data type associated to the field

引数
fieldAn ExtensionField instance that determines the data type expected to be received
valA non-null object that represents a (hopefully valid) value for this field
戻り値
Null if the value is not consistent with the data type expected. Otherwise, the same value received is returned
54  {
55 
56  Object value=null;
57  switch (field.getType()){
58  case STRING:
59  case BINARY:
60  if (val instanceof String)
61  value = val;
62  break;
63  case DATE:
64  //Dates are stored and read as strings indeed (no usage of Date-related classes take place)
65  if (val instanceof String) {
66  Pattern p = Pattern.compile(XSD_DATE_TIME_PATTERN);
67  if (p.matcher(val.toString()).find())
68  value=val;
69  }
70  break;
71  case NUMERIC:
72  if (val instanceof Integer || val instanceof Double)
73  value = val;
74  break;
75  case BOOLEAN:
76  if (val instanceof Boolean)
77  value = val;
78  break;
79  }
80  return value;
81 
82  }
static final String XSD_DATE_TIME_PATTERN
Definition: ExtensionField.java:41

メンバ詳解

◆ description

String org.gluu.oxtrust.model.scim2.extensions.ExtensionField.description
private

◆ multiValued

boolean org.gluu.oxtrust.model.scim2.extensions.ExtensionField.multiValued
private

◆ name

String org.gluu.oxtrust.model.scim2.extensions.ExtensionField.name
private

◆ type

AttributeDataType org.gluu.oxtrust.model.scim2.extensions.ExtensionField.type
private

◆ XSD_DATE_TIME_PATTERN

final String org.gluu.oxtrust.model.scim2.extensions.ExtensionField.XSD_DATE_TIME_PATTERN ="^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.*$"
staticprivate

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