gluu
公開メンバ関数 | 非公開メンバ関数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.gluu.oxtrust.ldap.cache.service.CacheRefreshService クラス
org.gluu.oxtrust.ldap.cache.service.CacheRefreshService の継承関係図
Inheritance graph
org.gluu.oxtrust.ldap.cache.service.CacheRefreshService 連携図
Collaboration graph

公開メンバ関数

Filter createFilter (String customLdapFilter)
 
Filter createFilter (String[] keyAttributes, String[] keyObjectClasses, String keyAttributeStart, Filter customFilter)
 
Filter createObjectClassPresenceFilter ()
 
void addInumMap (PersistenceEntryManager ldapEntryManager, GluuInumMap inumMap)
 
boolean containsInumMap (PersistenceEntryManager ldapEntryManager, GluuInumMap inumMap)
 
String generateInumForNewInumMap (String inumbBaseDn, PersistenceEntryManager ldapEntryManager)
 
String getDnForInum (String baseDn, String inum)
 
void setTargetEntryAttributes (GluuSimplePerson sourcePerson, Map< String, String > targetServerAttributesMapping, GluuCustomPerson targetPerson)
 

非公開メンバ関数

String generateInumForNewInumMapImpl ()
 

非公開変数類

Logger log
 
InumService inumService
 

静的非公開変数類

static final long serialVersionUID = -2225880517520443390L
 

詳解

Provides cache refresh related operations

著者
Yuriy Movchan Date: 07.04.2011

関数詳解

◆ addInumMap()

void org.gluu.oxtrust.ldap.cache.service.CacheRefreshService.addInumMap ( PersistenceEntryManager  ldapEntryManager,
GluuInumMap  inumMap 
)
inline
102  {
103  ldapEntryManager.persist(inumMap);
104  }

◆ containsInumMap()

boolean org.gluu.oxtrust.ldap.cache.service.CacheRefreshService.containsInumMap ( PersistenceEntryManager  ldapEntryManager,
GluuInumMap  inumMap 
)
inline
106  {
107  return ldapEntryManager.contains(inumMap);
108  }

◆ createFilter() [1/2]

Filter org.gluu.oxtrust.ldap.cache.service.CacheRefreshService.createFilter ( String  customLdapFilter)
inline
52  {
53  if (StringHelper.isEmpty(customLdapFilter)) {
54  return null;
55  }
56 
57  return Filter.create(customLdapFilter);
58  }

◆ createFilter() [2/2]

Filter org.gluu.oxtrust.ldap.cache.service.CacheRefreshService.createFilter ( String []  keyAttributes,
String []  keyObjectClasses,
String  keyAttributeStart,
Filter  customFilter 
)
inline
60  {
61  if ((keyAttributes == null) || (keyObjectClasses == null)) {
62  return null;
63  }
64 
65  List<Filter> filters = new ArrayList<Filter>();
66  for (int i = 0; i < keyAttributes.length; i++) {
67  String filterString = keyAttributes[i];
68 
69  if (filterString.contains("=")) {
70  filters.add(Filter.create(filterString));
71  // } else {
72  // filters.add(Filter.createPresenceFilter(filterString));
73  }
74 
75  // Limit result list
76  if ((i == 0) && (keyAttributeStart != null)) {
77  int index = filterString.indexOf('=');
78  if (index != -1) {
79  filterString = filterString.substring(0, index);
80  }
81 
82  filterString = String.format("%s=%s*", filterString, keyAttributeStart);
83  filters.add(Filter.create(filterString));
84  }
85  }
86 
87  for (String keyObjectClass : keyObjectClasses) {
88  filters.add(Filter.createEqualityFilter(OxConstants.OBJECT_CLASS, keyObjectClass));
89  }
90 
91  if (customFilter != null) {
92  filters.add(customFilter);
93  }
94 
95  return Filter.createANDFilter(filters);
96  }

◆ createObjectClassPresenceFilter()

Filter org.gluu.oxtrust.ldap.cache.service.CacheRefreshService.createObjectClassPresenceFilter ( )
inline
98  {
99  return Filter.createPresenceFilter(OxConstants.OBJECT_CLASS);
100  }

◆ generateInumForNewInumMap()

String org.gluu.oxtrust.ldap.cache.service.CacheRefreshService.generateInumForNewInumMap ( String  inumbBaseDn,
PersistenceEntryManager  ldapEntryManager 
)
inline
110  {
111  String newInum = generateInumForNewInumMapImpl();
112  String newDn = getDnForInum(inumbBaseDn, newInum);
113 
114  GluuInumMap inumMap = new GluuInumMap();
115  inumMap.setDn(newDn);
116 
117  while (containsInumMap(ldapEntryManager, inumMap)) {
118  newInum = generateInumForNewInumMapImpl();
119  newDn = getDnForInum(inumbBaseDn, newInum);
120  inumMap.setDn(newDn);
121  }
122 
123  return newInum;
124  }
String generateInumForNewInumMapImpl()
Definition: CacheRefreshService.java:130
String getDnForInum(String baseDn, String inum)
Definition: CacheRefreshService.java:126
boolean containsInumMap(PersistenceEntryManager ldapEntryManager, GluuInumMap inumMap)
Definition: CacheRefreshService.java:106

◆ generateInumForNewInumMapImpl()

String org.gluu.oxtrust.ldap.cache.service.CacheRefreshService.generateInumForNewInumMapImpl ( )
inlineprivate
130  {
131  String inum = inumService.generateInums(OxTrustConstants.INUM_TYPE_PEOPLE_SLUG);
132  return inum;
133  }
InumService inumService
Definition: CacheRefreshService.java:50
String generateInums(String type)
Definition: InumService.java:177

◆ getDnForInum()

String org.gluu.oxtrust.ldap.cache.service.CacheRefreshService.getDnForInum ( String  baseDn,
String  inum 
)
inline
126  {
127  return String.format("inum=%s,%s", inum, baseDn);
128  }

◆ setTargetEntryAttributes()

void org.gluu.oxtrust.ldap.cache.service.CacheRefreshService.setTargetEntryAttributes ( GluuSimplePerson  sourcePerson,
Map< String, String >  targetServerAttributesMapping,
GluuCustomPerson  targetPerson 
)
inline
136  {
137  // Collect all attributes to single map
138  Map<String, GluuCustomAttribute> customAttributesMap = new HashMap<String, GluuCustomAttribute>();
139  for (GluuCustomAttribute sourceCustomAttribute : sourcePerson.getCustomAttributes()) {
140  customAttributesMap.put(StringHelper.toLowerCase(sourceCustomAttribute.getName()), sourceCustomAttribute);
141  }
142 
143  List<GluuCustomAttribute> resultAttributes = new ArrayList<GluuCustomAttribute>();
144 
145  // Add attributes configured via mapping
146  Set<String> processedAttributeNames = new HashSet<String>();
147  for (Entry<String, String> targetServerAttributeEntry : targetServerAttributesMapping.entrySet()) {
148  String sourceKeyAttributeName = StringHelper.toLowerCase(targetServerAttributeEntry.getValue());
149  String targetKeyAttributeName = targetServerAttributeEntry.getKey();
150 
151  processedAttributeNames.add(sourceKeyAttributeName);
152 
153  GluuCustomAttribute gluuCustomAttribute = customAttributesMap.get(sourceKeyAttributeName);
154  if (gluuCustomAttribute != null) {
155  String[] values = gluuCustomAttribute.getValues();
156  String[] clonedValue = ArrayHelper.arrayClone(values);
157 
158  GluuCustomAttribute gluuCustomAttributeCopy = new GluuCustomAttribute(targetKeyAttributeName, clonedValue);
159  gluuCustomAttributeCopy.setName(targetKeyAttributeName);
160  resultAttributes.add(gluuCustomAttributeCopy);
161  }
162  }
163 
164  // Set destination entry attributes
165  for (Entry<String, GluuCustomAttribute> sourceCustomAttributeEntry : customAttributesMap.entrySet()) {
166  if (!processedAttributeNames.contains(sourceCustomAttributeEntry.getKey())) {
167  targetPerson.setAttribute(sourceCustomAttributeEntry.getValue());
168  }
169  }
170 
171  for (GluuCustomAttribute resultAttribute : resultAttributes) {
172  targetPerson.setAttribute(resultAttribute);
173  }
174  }

メンバ詳解

◆ inumService

InumService org.gluu.oxtrust.ldap.cache.service.CacheRefreshService.inumService
private

◆ log

Logger org.gluu.oxtrust.ldap.cache.service.CacheRefreshService.log
private

◆ serialVersionUID

final long org.gluu.oxtrust.ldap.cache.service.CacheRefreshService.serialVersionUID = -2225880517520443390L
staticprivate

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