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

公開メンバ関数

String init ()
 
String update ()
 
String updateImpl ()
 
String cancel ()
 
boolean isCacheRefreshEnabled ()
 
int getCacheRefreshEnabledIntervalMinutes ()
 
void addSourceConfig ()
 
List< GluuLdapConfiguration > getSourceConfigs ()
 
GluuLdapConfiguration getInumConfig ()
 
GluuLdapConfiguration getTargetConfig ()
 
CacheRefreshConfiguration getCacheRefreshConfig ()
 
GluuAppliance getAppliance ()
 
CacheRefreshUpdateMethod [] getAllCacheRefreshUpdateMethods ()
 
void validateInterceptorScript ()
 
String getInterceptorValidationMessage ()
 
boolean isShowInterceptorValidationDialog ()
 
void hideShowInterceptorValidationDialog ()
 
boolean isInitialized ()
 
void addItemToSimpleProperties (List< SimpleProperty > simpleProperties)
 
void removeItemFromSimpleProperties (List< SimpleProperty > simpleProperties, SimpleProperty simpleProperty)
 
void addItemToSimpleCustomProperties (List< SimpleCustomProperty > simpleCustomProperties)
 
void removeItemFromSimpleCustomProperties (List< SimpleCustomProperty > simpleCustomProperties, SimpleCustomProperty simpleCustomProperty)
 
GluuLdapConfiguration getActiveLdapConfig ()
 
void updateBindPassword ()
 
void setActiveLdapConfig (GluuLdapConfiguration activeLdapConfig)
 
void addLdapConfig (List< GluuLdapConfiguration > ldapConfigList)
 
void removeLdapConfig (List< GluuLdapConfiguration > ldapConfigList, GluuLdapConfiguration removeLdapConfig)
 
CacheRefreshUpdateMethod getUpdateMethod ()
 
void setUpdateMethod (CacheRefreshUpdateMethod updateMethod)
 
List< SimpleProperty > getKeyAttributes ()
 
List< SimpleProperty > getKeyObjectClasses ()
 
List< SimpleProperty > getSourceAttributes ()
 
List< SimpleCustomProperty > getAttributeMapping ()
 
void validateProperty (FacesContext context, UIComponent comp, Object value)
 
boolean checkDuplicateKetattribute ()
 

非公開メンバ関数

CacheRefreshConfiguration getOxTrustCacheRefreshConfig ()
 
void updateLists ()
 
void updateAppliance ()
 
boolean vdsCacheRefreshPollingInterval ()
 
boolean validateLists ()
 
boolean validateList (GluuLdapConfiguration ldapConfig, String configType, boolean validateBaseDNs)
 
boolean validateList (List< String > values, String attributeName)
 
List< SimpleProperty > toSimpleProperties (List< String > values)
 
List< SimpleCustomProperty > toSimpleCustomProperties (List< CacheRefreshAttributeMapping > attributeMappings)
 
List< String > toStringList (List< SimpleProperty > simpleProperties)
 
List< CacheRefreshAttributeMapping > toAttributeMappingList (List< SimpleCustomProperty > simpleCustomProperties)
 
GluuLdapConfiguration fixLdapConfiguration (GluuLdapConfiguration ldapConfig)
 
List< GluuLdapConfiguration > fixLdapConfigurations (List< GluuLdapConfiguration > ldapConfigs)
 
String getGluuSimplePersonAttributesWithValues (GluuSimplePerson gluuSimplePerson)
 
String getGluuCustomPersonAttributesWithValues (GluuCustomPerson gluuCustomPerson)
 
String [] getSourceAttributes (CacheRefreshConfiguration cacheRefreshConfigurationuration)
 
String [] getCompoundKeyAttributesWithoutValues (CacheRefreshConfiguration cacheRefreshConfigurationuration)
 
Map< String, String > getTargetServerAttributesMapping (CacheRefreshConfiguration cacheRefreshConfigurationuration)
 

非公開変数類

Logger log
 
ApplianceService applianceService
 
IPersonService personService
 
ExternalCacheRefreshService externalCacheRefreshService
 
InumService inumService
 
CacheRefreshService cacheRefreshService
 
OxTrustAuditService oxTrustAuditService
 
JsonConfigurationService jsonConfigurationService
 
FacesMessages facesMessages
 
ConversationService conversationService
 
AppConfiguration appConfiguration
 
EncryptionService encryptionService
 
CacheRefreshConfiguration cacheRefreshConfiguration
 
boolean cacheRefreshEnabled
 
int cacheRefreshEnabledIntervalMinutes
 
GluuLdapConfiguration activeLdapConfig
 
GluuAppliance appliance
 
List< SimpleProperty > keyAttributes
 
List< SimpleProperty > keyObjectClasses
 
List< SimpleProperty > sourceAttributes
 
List< SimpleCustomProperty > attributeMapping
 
boolean showInterceptorValidationDialog
 
String interceptorValidationMessage
 
boolean initialized
 
CacheRefreshUpdateMethod updateMethod
 

静的非公開変数類

static final long serialVersionUID = -5210460481895022468L
 

詳解

Action class for configuring cache refresh

著者
Yuriy Movchan Date: 07.26.2011

関数詳解

◆ addItemToSimpleCustomProperties()

void org.gluu.oxtrust.action.ConfigureCacheRefreshAction.addItemToSimpleCustomProperties ( List< SimpleCustomProperty >  simpleCustomProperties)
inline

org.gluu.oxtrust.model.SimpleCustomPropertiesListModelを実装しています。

558  {
559  if (simpleCustomProperties != null) {
560  simpleCustomProperties.add(new SimpleCustomProperty("", ""));
561  }
562  }

◆ addItemToSimpleProperties()

void org.gluu.oxtrust.action.ConfigureCacheRefreshAction.addItemToSimpleProperties ( List< SimpleProperty >  simpleProperties)
inline

org.gluu.oxtrust.model.SimplePropertiesListModelを実装しています。

540  {
541  oxTrustAuditService.audit("addItemToSimpleProperties:" + simpleProperties.size());
542  if(simpleProperties.size() >=1) {
543  oxTrustAuditService.audit("Value:" + simpleProperties.get(0).getValue());
544  }
545  if (checkDuplicateKetattribute() && simpleProperties != null) {
546  simpleProperties.add(new SimpleProperty(""));
547  }
548  }
boolean checkDuplicateKetattribute()
Definition: ConfigureCacheRefreshAction.java:678
void audit(String message, GluuCustomPerson user, HttpServletRequest request)
Definition: OxTrustAuditService.java:18
OxTrustAuditService oxTrustAuditService
Definition: ConfigureCacheRefreshAction.java:90

◆ addLdapConfig()

void org.gluu.oxtrust.action.ConfigureCacheRefreshAction.addLdapConfig ( List< GluuLdapConfiguration >  ldapConfigList)
inline

org.gluu.oxtrust.model.LdapConfigurationModelを実装しています。

594  {
595  GluuLdapConfiguration ldapConfiguration = new GluuLdapConfiguration();
596  ldapConfiguration.setBindPassword("");
597  ldapConfigList.add(ldapConfiguration);
598  }

◆ addSourceConfig()

void org.gluu.oxtrust.action.ConfigureCacheRefreshAction.addSourceConfig ( )
inline
358  {
359  addLdapConfig(this.cacheRefreshConfiguration.getSourceConfigs());
360  }
void addLdapConfig(List< GluuLdapConfiguration > ldapConfigList)
Definition: ConfigureCacheRefreshAction.java:594
CacheRefreshConfiguration cacheRefreshConfiguration
Definition: ConfigureCacheRefreshAction.java:108

◆ cancel()

String org.gluu.oxtrust.action.ConfigureCacheRefreshAction.cancel ( )
inline
300  {
301  facesMessages.add(FacesMessage.SEVERITY_INFO, "Cache configuration update were canceled");
302 
303  conversationService.endConversation();
304 
305  return OxTrustConstants.RESULT_SUCCESS;
306  }
FacesMessages facesMessages
Definition: ConfigureCacheRefreshAction.java:96
ConversationService conversationService
Definition: ConfigureCacheRefreshAction.java:99

◆ checkDuplicateKetattribute()

boolean org.gluu.oxtrust.action.ConfigureCacheRefreshAction.checkDuplicateKetattribute ( )
inline
678  {
679  for (SimpleProperty keyAttribute1 : keyAttributes) {
680  String checkValue = keyAttribute1.getValue();
681  int i = 0;
682 
683  for (SimpleProperty keyAttribute : keyAttributes) {
684  String value = keyAttribute.getValue();
685 
686  if (checkValue.equals(value) && !checkValue.isEmpty() && !value.isEmpty()) {
687  i = i + 1;
688  if (i == 2) {
689  facesMessages.add(FacesMessage.SEVERITY_ERROR, "Key Attribute already Exist!",
690  "Key Attribute already Exist!");
691  return false;
692  }
693  }
694  }
695  }
696  return true;
697  }
FacesMessages facesMessages
Definition: ConfigureCacheRefreshAction.java:96
List< SimpleProperty > keyAttributes
Definition: ConfigureCacheRefreshAction.java:117

◆ fixLdapConfiguration()

GluuLdapConfiguration org.gluu.oxtrust.action.ConfigureCacheRefreshAction.fixLdapConfiguration ( GluuLdapConfiguration  ldapConfig)
inlineprivate
382  {
383  ldapConfig.updateStringsLists();
384  if (ldapConfig.isUseAnonymousBind()) {
385  ldapConfig.setBindDN(null);
386  }
387 
388  return ldapConfig;
389  }

◆ fixLdapConfigurations()

List<GluuLdapConfiguration> org.gluu.oxtrust.action.ConfigureCacheRefreshAction.fixLdapConfigurations ( List< GluuLdapConfiguration >  ldapConfigs)
inlineprivate
391  {
392  for (GluuLdapConfiguration ldapConfig : ldapConfigs) {
393  fixLdapConfiguration(ldapConfig);
394  }
395 
396  return ldapConfigs;
397  }
GluuLdapConfiguration fixLdapConfiguration(GluuLdapConfiguration ldapConfig)
Definition: ConfigureCacheRefreshAction.java:382

◆ getActiveLdapConfig()

GluuLdapConfiguration org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getActiveLdapConfig ( )
inline
572  {
573  return activeLdapConfig;
574  }
GluuLdapConfiguration activeLdapConfig
Definition: ConfigureCacheRefreshAction.java:113

◆ getAllCacheRefreshUpdateMethods()

CacheRefreshUpdateMethod [] org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getAllCacheRefreshUpdateMethods ( )
inline
399  {
400  return CacheRefreshUpdateMethod.values();
401  }

◆ getAppliance()

GluuAppliance org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getAppliance ( )
inline
378  {
379  return appliance;
380  }
GluuAppliance appliance
Definition: ConfigureCacheRefreshAction.java:115

◆ getAttributeMapping()

List<SimpleCustomProperty> org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getAttributeMapping ( )
inline
657  {
658  return attributeMapping;
659  }
List< SimpleCustomProperty > attributeMapping
Definition: ConfigureCacheRefreshAction.java:120

◆ getCacheRefreshConfig()

CacheRefreshConfiguration org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getCacheRefreshConfig ( )
inline
374  {
375  return this.cacheRefreshConfiguration;
376  }
CacheRefreshConfiguration cacheRefreshConfiguration
Definition: ConfigureCacheRefreshAction.java:108

◆ getCacheRefreshEnabledIntervalMinutes()

int org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getCacheRefreshEnabledIntervalMinutes ( )
inline
312  {
314  }
int cacheRefreshEnabledIntervalMinutes
Definition: ConfigureCacheRefreshAction.java:111

◆ getCompoundKeyAttributesWithoutValues()

String [] org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getCompoundKeyAttributesWithoutValues ( CacheRefreshConfiguration  cacheRefreshConfigurationuration)
inlineprivate
615  {
616  String[] result = cacheRefreshConfigurationuration.getKeyAttributes().toArray(new String[0]);
617  for (int i = 0; i < result.length; i++) {
618  int index = result[i].indexOf('=');
619  if (index != -1) {
620  result[i] = result[i].substring(0, index);
621  }
622  }
623 
624  return result;
625  }

◆ getGluuCustomPersonAttributesWithValues()

String org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getGluuCustomPersonAttributesWithValues ( GluuCustomPerson  gluuCustomPerson)
inlineprivate
504  {
505  StringBuilder sb = new StringBuilder();
506  sb.append("dn: '").append(gluuCustomPerson.getDn()).append("'\n");
507  sb.append("inum: '").append(gluuCustomPerson.getInum()).append("',\n");
508  sb.append("gluuStatus: '").append(gluuCustomPerson.getStatus()).append("'");
509 
510  for (GluuCustomAttribute customAttribute : gluuCustomPerson.getCustomAttributes()) {
511  sb.append("\n").append(customAttribute.getName()).append(": '");
512  if ((customAttribute.getValues() != null) && (customAttribute.getValues().length > 1)) {
513  sb.append(Arrays.toString(customAttribute.getValues()));
514  } else {
515  sb.append(customAttribute.getValue());
516  }
517  sb.append("'");
518  }
519 
520  return sb.toString();
521  }

◆ getGluuSimplePersonAttributesWithValues()

String org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getGluuSimplePersonAttributesWithValues ( GluuSimplePerson  gluuSimplePerson)
inlineprivate
480  {
481  StringBuilder sb = new StringBuilder();
482 
483  int index = 0;
484  for (GluuCustomAttribute customAttribute : gluuSimplePerson.getCustomAttributes()) {
485 
486  // TODO: Do we need this?
487  if (index > 0) {
488  sb.append("\n");
489  }
490  sb.append("\n").append(customAttribute.getName()).append(": '");
491  if ((customAttribute.getValues() != null) && (customAttribute.getValues().length > 1)) {
492  sb.append(Arrays.toString(customAttribute.getValues()));
493  } else {
494  sb.append(customAttribute.getValue());
495  }
496 
497  sb.append("'");
498  index++;
499  }
500 
501  return sb.toString();
502  }

◆ getInterceptorValidationMessage()

String org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getInterceptorValidationMessage ( )
inline
523  {
525  }
String interceptorValidationMessage
Definition: ConfigureCacheRefreshAction.java:123

◆ getInumConfig()

GluuLdapConfiguration org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getInumConfig ( )
inline
366  {
367  return this.cacheRefreshConfiguration.getInumConfig();
368  }
CacheRefreshConfiguration cacheRefreshConfiguration
Definition: ConfigureCacheRefreshAction.java:108

◆ getKeyAttributes()

List<SimpleProperty> org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getKeyAttributes ( )
inline
645  {
646  return keyAttributes;
647  }
List< SimpleProperty > keyAttributes
Definition: ConfigureCacheRefreshAction.java:117

◆ getKeyObjectClasses()

List<SimpleProperty> org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getKeyObjectClasses ( )
inline
649  {
650  return keyObjectClasses;
651  }
List< SimpleProperty > keyObjectClasses
Definition: ConfigureCacheRefreshAction.java:118

◆ getOxTrustCacheRefreshConfig()

CacheRefreshConfiguration org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getOxTrustCacheRefreshConfig ( )
inlineprivate
145  {
146  CacheRefreshConfiguration cacheRefreshConfiguration = jsonConfigurationService
148 
149  if (cacheRefreshConfiguration == null) {
150  cacheRefreshConfiguration = new CacheRefreshConfiguration();
151  cacheRefreshConfiguration.setUpdateMethod(CacheRefreshUpdateMethod.COPY.getValue());
152  cacheRefreshConfiguration.setSourceConfigs(new ArrayList<GluuLdapConfiguration>());
153  cacheRefreshConfiguration.setInumConfig(new GluuLdapConfiguration());
154  cacheRefreshConfiguration.setTargetConfig(new GluuLdapConfiguration());
155  cacheRefreshConfiguration.setKeyAttributes(new ArrayList<String>(0));
156  cacheRefreshConfiguration.setKeyObjectClasses(new ArrayList<String>());
157  cacheRefreshConfiguration.setSourceAttributes(new ArrayList<String>());
158  cacheRefreshConfiguration.setAttributeMapping(new ArrayList<CacheRefreshAttributeMapping>());
159  cacheRefreshConfiguration.setDefaultInumServer(true);
160  }
161 
162  this.updateMethod = CacheRefreshUpdateMethod.getByValue(cacheRefreshConfiguration.getUpdateMethod());
163  this.keyAttributes = toSimpleProperties(cacheRefreshConfiguration.getKeyAttributes());
164  this.keyObjectClasses = toSimpleProperties(cacheRefreshConfiguration.getKeyObjectClasses());
165  this.sourceAttributes = toSimpleProperties(cacheRefreshConfiguration.getSourceAttributes());
166  this.attributeMapping = toSimpleCustomProperties(cacheRefreshConfiguration.getAttributeMapping());
167 
169  }
List< SimpleProperty > keyAttributes
Definition: ConfigureCacheRefreshAction.java:117
CacheRefreshUpdateMethod updateMethod
Definition: ConfigureCacheRefreshAction.java:127
List< SimpleProperty > keyObjectClasses
Definition: ConfigureCacheRefreshAction.java:118
JsonConfigurationService jsonConfigurationService
Definition: ConfigureCacheRefreshAction.java:93
List< SimpleProperty > toSimpleProperties(List< String > values)
Definition: ConfigureCacheRefreshAction.java:316
List< SimpleCustomProperty > attributeMapping
Definition: ConfigureCacheRefreshAction.java:120
CacheRefreshConfiguration getOxTrustCacheRefreshConfiguration()
Definition: JsonConfigurationService.java:80
static CacheRefreshUpdateMethod getByValue(String value)
Definition: CacheRefreshUpdateMethod.java:47
List< SimpleProperty > sourceAttributes
Definition: ConfigureCacheRefreshAction.java:119
CacheRefreshConfiguration cacheRefreshConfiguration
Definition: ConfigureCacheRefreshAction.java:108
List< SimpleCustomProperty > toSimpleCustomProperties(List< CacheRefreshAttributeMapping > attributeMappings)
Definition: ConfigureCacheRefreshAction.java:326

◆ getSourceAttributes() [1/2]

String [] org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getSourceAttributes ( CacheRefreshConfiguration  cacheRefreshConfigurationuration)
inlineprivate
611  {
612  return cacheRefreshConfigurationuration.getSourceAttributes().toArray(new String[0]);
613  }

◆ getSourceAttributes() [2/2]

List<SimpleProperty> org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getSourceAttributes ( )
inline
653  {
654  return sourceAttributes;
655  }
List< SimpleProperty > sourceAttributes
Definition: ConfigureCacheRefreshAction.java:119

◆ getSourceConfigs()

List<GluuLdapConfiguration> org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getSourceConfigs ( )
inline
362  {
363  return this.cacheRefreshConfiguration.getSourceConfigs();
364  }
CacheRefreshConfiguration cacheRefreshConfiguration
Definition: ConfigureCacheRefreshAction.java:108

◆ getTargetConfig()

GluuLdapConfiguration org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getTargetConfig ( )
inline
370  {
371  return this.cacheRefreshConfiguration.getTargetConfig();
372  }
CacheRefreshConfiguration cacheRefreshConfiguration
Definition: ConfigureCacheRefreshAction.java:108

◆ getTargetServerAttributesMapping()

Map<String, String> org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getTargetServerAttributesMapping ( CacheRefreshConfiguration  cacheRefreshConfigurationuration)
inlineprivate
628  {
629  Map<String, String> result = new HashMap<String, String>();
630  for (CacheRefreshAttributeMapping attributeMapping : cacheRefreshConfigurationuration.getAttributeMapping()) {
631  result.put(attributeMapping.getDestination(), attributeMapping.getSource());
632  }
633 
634  return result;
635  }
List< SimpleCustomProperty > attributeMapping
Definition: ConfigureCacheRefreshAction.java:120

◆ getUpdateMethod()

CacheRefreshUpdateMethod org.gluu.oxtrust.action.ConfigureCacheRefreshAction.getUpdateMethod ( )
inline
637  {
638  return updateMethod;
639  }
CacheRefreshUpdateMethod updateMethod
Definition: ConfigureCacheRefreshAction.java:127

◆ hideShowInterceptorValidationDialog()

void org.gluu.oxtrust.action.ConfigureCacheRefreshAction.hideShowInterceptorValidationDialog ( )
inline
531  {
532  this.showInterceptorValidationDialog = false;
533  }
boolean showInterceptorValidationDialog
Definition: ConfigureCacheRefreshAction.java:122

◆ init()

String org.gluu.oxtrust.action.ConfigureCacheRefreshAction.init ( )
inline
129  {
130  if (initialized) {
131  return OxTrustConstants.RESULT_SUCCESS;
132  }
133 
134  this.showInterceptorValidationDialog = false;
135 
137 
139 
140  this.initialized = true;
141 
142  return OxTrustConstants.RESULT_SUCCESS;
143  }
GluuAppliance getAppliance(String[] returnAttributes)
Definition: ApplianceService.java:111
CacheRefreshConfiguration getOxTrustCacheRefreshConfig()
Definition: ConfigureCacheRefreshAction.java:145
GluuAppliance appliance
Definition: ConfigureCacheRefreshAction.java:115
boolean showInterceptorValidationDialog
Definition: ConfigureCacheRefreshAction.java:122
CacheRefreshConfiguration cacheRefreshConfiguration
Definition: ConfigureCacheRefreshAction.java:108
boolean initialized
Definition: ConfigureCacheRefreshAction.java:125
ApplianceService applianceService
Definition: ConfigureCacheRefreshAction.java:75

◆ isCacheRefreshEnabled()

boolean org.gluu.oxtrust.action.ConfigureCacheRefreshAction.isCacheRefreshEnabled ( )
inline
308  {
309  return cacheRefreshEnabled;
310  }
boolean cacheRefreshEnabled
Definition: ConfigureCacheRefreshAction.java:110

◆ isInitialized()

boolean org.gluu.oxtrust.action.ConfigureCacheRefreshAction.isInitialized ( )
inline
535  {
536  return initialized;
537  }
boolean initialized
Definition: ConfigureCacheRefreshAction.java:125

◆ isShowInterceptorValidationDialog()

boolean org.gluu.oxtrust.action.ConfigureCacheRefreshAction.isShowInterceptorValidationDialog ( )
inline
527  {
529  }
boolean showInterceptorValidationDialog
Definition: ConfigureCacheRefreshAction.java:122

◆ removeItemFromSimpleCustomProperties()

void org.gluu.oxtrust.action.ConfigureCacheRefreshAction.removeItemFromSimpleCustomProperties ( List< SimpleCustomProperty >  simpleCustomProperties,
SimpleCustomProperty  simpleCustomProperty 
)
inline

org.gluu.oxtrust.model.SimpleCustomPropertiesListModelを実装しています。

566  {
567  if (simpleCustomProperties != null) {
568  simpleCustomProperties.remove(simpleCustomProperty);
569  }
570  }

◆ removeItemFromSimpleProperties()

void org.gluu.oxtrust.action.ConfigureCacheRefreshAction.removeItemFromSimpleProperties ( List< SimpleProperty >  simpleProperties,
SimpleProperty  simpleProperty 
)
inline

org.gluu.oxtrust.model.SimplePropertiesListModelを実装しています。

551  {
552  if (simpleProperties != null) {
553  simpleProperties.remove(simpleProperty);
554  }
555  }

◆ removeLdapConfig()

void org.gluu.oxtrust.action.ConfigureCacheRefreshAction.removeLdapConfig ( List< GluuLdapConfiguration >  ldapConfigList,
GluuLdapConfiguration  removeLdapConfig 
)
inline

org.gluu.oxtrust.model.LdapConfigurationModelを実装しています。

601  {
602  for (Iterator<GluuLdapConfiguration> iterator = ldapConfigList.iterator(); iterator.hasNext();) {
603  GluuLdapConfiguration ldapConfig = iterator.next();
604  if (System.identityHashCode(removeLdapConfig) == System.identityHashCode(ldapConfig)) {
605  iterator.remove();
606  return;
607  }
608  }
609  }
void removeLdapConfig(List< GluuLdapConfiguration > ldapConfigList, GluuLdapConfiguration removeLdapConfig)
Definition: ConfigureCacheRefreshAction.java:601

◆ setActiveLdapConfig()

void org.gluu.oxtrust.action.ConfigureCacheRefreshAction.setActiveLdapConfig ( GluuLdapConfiguration  activeLdapConfig)
inline

org.gluu.oxtrust.model.LdapConfigurationModelを実装しています。

589  {
591  }
GluuLdapConfiguration activeLdapConfig
Definition: ConfigureCacheRefreshAction.java:113

◆ setUpdateMethod()

void org.gluu.oxtrust.action.ConfigureCacheRefreshAction.setUpdateMethod ( CacheRefreshUpdateMethod  updateMethod)
inline
641  {
642  this.updateMethod = updateMethod;
643  }
CacheRefreshUpdateMethod updateMethod
Definition: ConfigureCacheRefreshAction.java:127

◆ toAttributeMappingList()

List<CacheRefreshAttributeMapping> org.gluu.oxtrust.action.ConfigureCacheRefreshAction.toAttributeMappingList ( List< SimpleCustomProperty >  simpleCustomProperties)
inlineprivate
347  {
348  List<CacheRefreshAttributeMapping> result = new ArrayList<CacheRefreshAttributeMapping>();
349 
350  for (SimpleCustomProperty simpleCustomProperty : simpleCustomProperties) {
351  result.add(new CacheRefreshAttributeMapping(simpleCustomProperty.getValue1(),
352  simpleCustomProperty.getValue2()));
353  }
354 
355  return result;
356  }

◆ toSimpleCustomProperties()

List<SimpleCustomProperty> org.gluu.oxtrust.action.ConfigureCacheRefreshAction.toSimpleCustomProperties ( List< CacheRefreshAttributeMapping >  attributeMappings)
inlineprivate
326  {
327  List<SimpleCustomProperty> result = new ArrayList<SimpleCustomProperty>();
328 
329  for (CacheRefreshAttributeMapping attributeMapping : attributeMappings) {
330  result.add(new SimpleCustomProperty(attributeMapping.getSource(), attributeMapping.getDestination()));
331  }
332 
333  return result;
334  }
List< SimpleCustomProperty > attributeMapping
Definition: ConfigureCacheRefreshAction.java:120

◆ toSimpleProperties()

List<SimpleProperty> org.gluu.oxtrust.action.ConfigureCacheRefreshAction.toSimpleProperties ( List< String >  values)
inlineprivate
316  {
317  List<SimpleProperty> result = new ArrayList<SimpleProperty>();
318 
319  for (String value : values) {
320  result.add(new SimpleProperty(value));
321  }
322 
323  return result;
324  }

◆ toStringList()

List<String> org.gluu.oxtrust.action.ConfigureCacheRefreshAction.toStringList ( List< SimpleProperty >  simpleProperties)
inlineprivate
336  {
337  List<String> result = new ArrayList<String>();
338 
339  for (SimpleProperty simpleProperty : simpleProperties) {
340  result.add(simpleProperty.getValue());
341  }
342 
343  return result;
344  }

◆ update()

String org.gluu.oxtrust.action.ConfigureCacheRefreshAction.update ( )
inline
171  {
172  String outcome = updateImpl();
173 
174  if (OxTrustConstants.RESULT_SUCCESS.equals(outcome)) {
175  facesMessages.add(FacesMessage.SEVERITY_INFO, "Cache configuration updated");
176  } else if (OxTrustConstants.RESULT_FAILURE.equals(outcome)) {
177  facesMessages.add(FacesMessage.SEVERITY_ERROR, "Failed to update cache refresh configuration");
178  }
179 
180  return outcome;
181  }
FacesMessages facesMessages
Definition: ConfigureCacheRefreshAction.java:96
String updateImpl()
Definition: ConfigureCacheRefreshAction.java:183

◆ updateAppliance()

void org.gluu.oxtrust.action.ConfigureCacheRefreshAction.updateAppliance ( )
inlineprivate
220  {
223  updateAppliance.setVdsCacheRefreshPollingInterval(this.appliance.getVdsCacheRefreshPollingInterval());
224  updateAppliance.setCacheRefreshServerIpAddress(this.appliance.getCacheRefreshServerIpAddress());
225  applianceService.updateAppliance(updateAppliance);
226  }
void updateAppliance(GluuAppliance appliance)
Definition: ApplianceService.java:75
GluuAppliance getAppliance(String[] returnAttributes)
Definition: ApplianceService.java:111
GluuBoolean getVdsCacheRefreshEnabled()
Definition: GluuAppliance.java:590
void setVdsCacheRefreshEnabled(GluuBoolean vdsCacheRefreshEnabled)
Definition: GluuAppliance.java:594
String getCacheRefreshServerIpAddress()
Definition: GluuAppliance.java:245
String getVdsCacheRefreshPollingInterval()
Definition: GluuAppliance.java:614
void updateAppliance()
Definition: ConfigureCacheRefreshAction.java:220
GluuAppliance appliance
Definition: ConfigureCacheRefreshAction.java:115
ApplianceService applianceService
Definition: ConfigureCacheRefreshAction.java:75

◆ updateBindPassword()

void org.gluu.oxtrust.action.ConfigureCacheRefreshAction.updateBindPassword ( )
inline
576  {
577  if (this.activeLdapConfig == null) {
578  return;
579  }
580 
581  try {
582  this.activeLdapConfig.setBindPassword(encryptionService.encrypt(this.activeLdapConfig.getBindPassword()));
583  } catch (EncryptionException ex) {
584  log.error("Failed to encrypt password", ex);
585  }
586  }
Logger log
Definition: ConfigureCacheRefreshAction.java:72
String encrypt(String unencryptedString)
Definition: EncryptionService.java:42
GluuLdapConfiguration activeLdapConfig
Definition: ConfigureCacheRefreshAction.java:113
EncryptionService encryptionService
Definition: ConfigureCacheRefreshAction.java:105

◆ updateImpl()

String org.gluu.oxtrust.action.ConfigureCacheRefreshAction.updateImpl ( )
inline
183  {
185 
187  return OxTrustConstants.RESULT_FAILURE;
188  }
189 
190  updateLists();
191 
192  if (!validateLists()) {
193  return OxTrustConstants.RESULT_FAILURE;
194  }
195 
196  fixLdapConfigurations(this.cacheRefreshConfiguration.getSourceConfigs());
197  fixLdapConfiguration(this.cacheRefreshConfiguration.getInumConfig());
198  fixLdapConfiguration(this.cacheRefreshConfiguration.getTargetConfig());
199 
200  try {
202 
203  updateAppliance();
204  } catch (Exception ex) {
205  log.error("Failed to save Cache Refresh configuration", ex);
206  return OxTrustConstants.RESULT_FAILURE;
207  }
208 
209  return OxTrustConstants.RESULT_SUCCESS;
210  }
boolean validateLists()
Definition: ConfigureCacheRefreshAction.java:252
boolean vdsCacheRefreshPollingInterval()
Definition: ConfigureCacheRefreshAction.java:230
Logger log
Definition: ConfigureCacheRefreshAction.java:72
JsonConfigurationService jsonConfigurationService
Definition: ConfigureCacheRefreshAction.java:93
void updateAppliance()
Definition: ConfigureCacheRefreshAction.java:220
boolean saveOxTrustCacheRefreshConfiguration(CacheRefreshConfiguration oxTrustCacheRefreshConfiguration)
Definition: JsonConfigurationService.java:119
List< GluuLdapConfiguration > fixLdapConfigurations(List< GluuLdapConfiguration > ldapConfigs)
Definition: ConfigureCacheRefreshAction.java:391
boolean checkDuplicateKetattribute()
Definition: ConfigureCacheRefreshAction.java:678
CacheRefreshConfiguration cacheRefreshConfiguration
Definition: ConfigureCacheRefreshAction.java:108
GluuLdapConfiguration fixLdapConfiguration(GluuLdapConfiguration ldapConfig)
Definition: ConfigureCacheRefreshAction.java:382
void updateLists()
Definition: ConfigureCacheRefreshAction.java:212

◆ updateLists()

void org.gluu.oxtrust.action.ConfigureCacheRefreshAction.updateLists ( )
inlineprivate
212  {
213  cacheRefreshConfiguration.setUpdateMethod(this.updateMethod.getValue());
214  cacheRefreshConfiguration.setKeyAttributes(toStringList(this.keyAttributes));
215  cacheRefreshConfiguration.setKeyObjectClasses(toStringList(this.keyObjectClasses));
216  cacheRefreshConfiguration.setSourceAttributes(toStringList(this.sourceAttributes));
218  }
List< SimpleProperty > keyAttributes
Definition: ConfigureCacheRefreshAction.java:117
String getValue()
Definition: CacheRefreshUpdateMethod.java:39
CacheRefreshUpdateMethod updateMethod
Definition: ConfigureCacheRefreshAction.java:127
List< SimpleProperty > keyObjectClasses
Definition: ConfigureCacheRefreshAction.java:118
List< SimpleCustomProperty > attributeMapping
Definition: ConfigureCacheRefreshAction.java:120
List< CacheRefreshAttributeMapping > toAttributeMappingList(List< SimpleCustomProperty > simpleCustomProperties)
Definition: ConfigureCacheRefreshAction.java:346
List< SimpleProperty > sourceAttributes
Definition: ConfigureCacheRefreshAction.java:119
List< String > toStringList(List< SimpleProperty > simpleProperties)
Definition: ConfigureCacheRefreshAction.java:336
CacheRefreshConfiguration cacheRefreshConfiguration
Definition: ConfigureCacheRefreshAction.java:108

◆ validateInterceptorScript()

void org.gluu.oxtrust.action.ConfigureCacheRefreshAction.validateInterceptorScript ( )
inline
403  {
404  String result = update();
405  if (!OxTrustConstants.RESULT_SUCCESS.equals(result)) {
406  return;
407  }
408 
409  // Reinit dialog
410  init();
411 
413 
414  boolean loadedScripts = externalCacheRefreshService.getCustomScriptConfigurations().size() > 0;
415  if (!loadedScripts) {
416  String message = "Can't load Cache Refresh scripts. Using default script";
417  log.error(message);
418  this.interceptorValidationMessage = message;
419 
420  return;
421  }
422 
423  // Prepare data for dummy entry
424  String targetInum = inumService.generateInums(OxTrustConstants.INUM_TYPE_PEOPLE_SLUG, false);
425  String targetPersonDn = personService.getDnForPerson(targetInum);
426  String[] targetCustomObjectClasses = appConfiguration.getPersonObjectClassTypes();
427 
428  // Collect all attributes
429  String[] keyAttributesWithoutValues = getCompoundKeyAttributesWithoutValues(cacheRefreshConfiguration);
431 
432  // Merge all attributes into one set
433  Set<String> allAttributes = new HashSet<String>();
434  for (String attribute : keyAttributesWithoutValues) {
435  allAttributes.add(attribute);
436  }
437 
438  for (String attribute : sourceAttributes) {
439  allAttributes.add(attribute);
440  }
441 
442  // Prepare source person entry with default attributes values
443  GluuSimplePerson sourcePerson = new GluuSimplePerson();
444  List<GluuCustomAttribute> customAttributes = sourcePerson.getCustomAttributes();
445  for (String attribute : allAttributes) {
446  customAttributes.add(new GluuCustomAttribute(attribute, "Test value"));
447  }
448 
449  // Prepare target person
450  GluuCustomPerson targetPerson = new GluuCustomPerson();
451  targetPerson.setDn(targetPersonDn);
452  targetPerson.setInum(targetInum);
453  targetPerson.setStatus(GluuStatus.ACTIVE);
454  targetPerson.setCustomObjectClasses(targetCustomObjectClasses);
455 
456  // Execute mapping according to configuration
457  Map<String, String> targetServerAttributesMapping = getTargetServerAttributesMapping(cacheRefreshConfiguration);
458  cacheRefreshService.setTargetEntryAttributes(sourcePerson, targetServerAttributesMapping, targetPerson);
459 
460  // Execute interceptor script
461  boolean executionResult = externalCacheRefreshService.executeExternalUpdateUserMethods(targetPerson);
462  if (!executionResult) {
463  String message = "Can't execute Cache Refresh scripts.";
464  log.error(message);
465  this.interceptorValidationMessage = message;
466 
467  return;
468  }
469 
470  log.info(
471  "Script has been executed successfully.\n\nSample source entry is:\n'{}'.\n\nSample result entry is:\n'{}'",
474  this.interceptorValidationMessage = String.format(
475  "Script has been executed successfully.\n\nSample source entry is:\n%s.\n\nSample result entry is:\n%s",
478  }
Map< String, String > getTargetServerAttributesMapping(CacheRefreshConfiguration cacheRefreshConfigurationuration)
Definition: ConfigureCacheRefreshAction.java:627
InumService inumService
Definition: ConfigureCacheRefreshAction.java:84
List< SimpleProperty > getSourceAttributes()
Definition: ConfigureCacheRefreshAction.java:653
String getGluuCustomPersonAttributesWithValues(GluuCustomPerson gluuCustomPerson)
Definition: ConfigureCacheRefreshAction.java:504
Logger log
Definition: ConfigureCacheRefreshAction.java:72
abstract String getDnForPerson(String inum)
String init()
Definition: ConfigureCacheRefreshAction.java:129
void setTargetEntryAttributes(GluuSimplePerson sourcePerson, Map< String, String > targetServerAttributesMapping, GluuCustomPerson targetPerson)
Definition: CacheRefreshService.java:135
String generateInums(String type)
Definition: InumService.java:177
String [] getCompoundKeyAttributesWithoutValues(CacheRefreshConfiguration cacheRefreshConfigurationuration)
Definition: ConfigureCacheRefreshAction.java:615
boolean executeExternalUpdateUserMethods(GluuCustomPerson user)
Definition: ExternalCacheRefreshService.java:50
CacheRefreshService cacheRefreshService
Definition: ConfigureCacheRefreshAction.java:87
String interceptorValidationMessage
Definition: ConfigureCacheRefreshAction.java:123
boolean showInterceptorValidationDialog
Definition: ConfigureCacheRefreshAction.java:122
List< SimpleProperty > sourceAttributes
Definition: ConfigureCacheRefreshAction.java:119
IPersonService personService
Definition: ConfigureCacheRefreshAction.java:78
ExternalCacheRefreshService externalCacheRefreshService
Definition: ConfigureCacheRefreshAction.java:81
CacheRefreshConfiguration cacheRefreshConfiguration
Definition: ConfigureCacheRefreshAction.java:108
String getGluuSimplePersonAttributesWithValues(GluuSimplePerson gluuSimplePerson)
Definition: ConfigureCacheRefreshAction.java:480
AppConfiguration appConfiguration
Definition: ConfigureCacheRefreshAction.java:102
String update()
Definition: ConfigureCacheRefreshAction.java:171

◆ validateList() [1/2]

boolean org.gluu.oxtrust.action.ConfigureCacheRefreshAction.validateList ( GluuLdapConfiguration  ldapConfig,
String  configType,
boolean  validateBaseDNs 
)
inlineprivate
271  {
272  boolean result = true;
273  if (ldapConfig.getServers().size() == 0) {
274  facesMessages.add(FacesMessage.SEVERITY_ERROR,
275  "%s LDAP configuration '%s' should contain at least one server", configType,
276  ldapConfig.getConfigId());
277  result = false;
278  }
279 
280  if (validateBaseDNs && (ldapConfig.getBaseDNs().size() == 0)) {
281  facesMessages.add(FacesMessage.SEVERITY_ERROR,
282  "%s LDAP configuration '%s' should contain at least one Base DN", configType,
283  ldapConfig.getConfigId());
284  result = false;
285  }
286 
287  return result;
288  }
FacesMessages facesMessages
Definition: ConfigureCacheRefreshAction.java:96

◆ validateList() [2/2]

boolean org.gluu.oxtrust.action.ConfigureCacheRefreshAction.validateList ( List< String >  values,
String  attributeName 
)
inlineprivate
290  {
291  if (values.size() == 0) {
292  facesMessages.add(FacesMessage.SEVERITY_ERROR, "%s should contain at least one '%s'", attributeName,
293  attributeName);
294  return false;
295  }
296 
297  return true;
298  }
FacesMessages facesMessages
Definition: ConfigureCacheRefreshAction.java:96

◆ validateLists()

boolean org.gluu.oxtrust.action.ConfigureCacheRefreshAction.validateLists ( )
inlineprivate
252  {
253  boolean result = true;
254  for (GluuLdapConfiguration sourceConfig : this.cacheRefreshConfiguration.getSourceConfigs()) {
255  result &= validateList(sourceConfig, "Source", true);
256  }
257 
258  result &= validateList(this.cacheRefreshConfiguration.getInumConfig(), "Inum", true);
259 
260  if (CacheRefreshUpdateMethod.VDS.equals(cacheRefreshConfiguration.getUpdateMethod())) {
261  result &= validateList(this.cacheRefreshConfiguration.getTargetConfig(), "Target", false);
262  }
263 
264  result &= validateList(this.cacheRefreshConfiguration.getKeyAttributes(), "Key attribute");
265  result &= validateList(this.cacheRefreshConfiguration.getKeyObjectClasses(), "Object class");
266  result &= validateList(this.cacheRefreshConfiguration.getSourceAttributes(), "Source attribute");
267 
268  return result;
269  }
boolean validateList(GluuLdapConfiguration ldapConfig, String configType, boolean validateBaseDNs)
Definition: ConfigureCacheRefreshAction.java:271
CacheRefreshConfiguration cacheRefreshConfiguration
Definition: ConfigureCacheRefreshAction.java:108

◆ validateProperty()

void org.gluu.oxtrust.action.ConfigureCacheRefreshAction.validateProperty ( FacesContext  context,
UIComponent  comp,
Object  value 
)
inline
661  {
662  String newkeyAttr = (String) value;
663  oxTrustAuditService.audit("Validation");
664  for (SimpleProperty keyAttribute : keyAttributes) {
665  int i = 0;
666  if (newkeyAttr.equalsIgnoreCase(keyAttribute.getValue())) {
667  i = i + 1;
668  if (i == 2) {
669  ((UIInput) comp).setValid(false);
670  FacesMessage message = new FacesMessage("key attribute already Exist! ");
671  context.addMessage(comp.getClientId(context), message);
672  }
673  }
674 
675  }
676  }
List< SimpleProperty > keyAttributes
Definition: ConfigureCacheRefreshAction.java:117
void audit(String message, GluuCustomPerson user, HttpServletRequest request)
Definition: OxTrustAuditService.java:18
OxTrustAuditService oxTrustAuditService
Definition: ConfigureCacheRefreshAction.java:90

◆ vdsCacheRefreshPollingInterval()

boolean org.gluu.oxtrust.action.ConfigureCacheRefreshAction.vdsCacheRefreshPollingInterval ( )
inlineprivate
230  {
231  String intervalString = this.appliance.getVdsCacheRefreshPollingInterval();
232  if (StringHelper.isEmpty(intervalString)) {
233  return true;
234  }
235 
236  Integer interval = null;
237  try {
238  interval = Integer.valueOf(intervalString);
239  } catch (NumberFormatException ex) {
240  }
241 
242  if ((interval == null) || (interval < 0)) {
243  log.error("Invalid cache refresh pooling interval specified: {}", intervalString);
244  facesMessages.add("vdsCacheRefreshPollingIntervalId", FacesMessage.SEVERITY_ERROR,
245  "Invalid cache refresh pooling interval specified");
246  return false;
247  }
248 
249  return true;
250  }
FacesMessages facesMessages
Definition: ConfigureCacheRefreshAction.java:96
String getVdsCacheRefreshPollingInterval()
Definition: GluuAppliance.java:614
Logger log
Definition: ConfigureCacheRefreshAction.java:72
GluuAppliance appliance
Definition: ConfigureCacheRefreshAction.java:115

メンバ詳解

◆ activeLdapConfig

GluuLdapConfiguration org.gluu.oxtrust.action.ConfigureCacheRefreshAction.activeLdapConfig
private

◆ appConfiguration

AppConfiguration org.gluu.oxtrust.action.ConfigureCacheRefreshAction.appConfiguration
private

◆ appliance

GluuAppliance org.gluu.oxtrust.action.ConfigureCacheRefreshAction.appliance
private

◆ applianceService

ApplianceService org.gluu.oxtrust.action.ConfigureCacheRefreshAction.applianceService
private

◆ attributeMapping

List<SimpleCustomProperty> org.gluu.oxtrust.action.ConfigureCacheRefreshAction.attributeMapping
private

◆ cacheRefreshConfiguration

CacheRefreshConfiguration org.gluu.oxtrust.action.ConfigureCacheRefreshAction.cacheRefreshConfiguration
private

◆ cacheRefreshEnabled

boolean org.gluu.oxtrust.action.ConfigureCacheRefreshAction.cacheRefreshEnabled
private

◆ cacheRefreshEnabledIntervalMinutes

int org.gluu.oxtrust.action.ConfigureCacheRefreshAction.cacheRefreshEnabledIntervalMinutes
private

◆ cacheRefreshService

CacheRefreshService org.gluu.oxtrust.action.ConfigureCacheRefreshAction.cacheRefreshService
private

◆ conversationService

ConversationService org.gluu.oxtrust.action.ConfigureCacheRefreshAction.conversationService
private

◆ encryptionService

EncryptionService org.gluu.oxtrust.action.ConfigureCacheRefreshAction.encryptionService
private

◆ externalCacheRefreshService

ExternalCacheRefreshService org.gluu.oxtrust.action.ConfigureCacheRefreshAction.externalCacheRefreshService
private

◆ facesMessages

FacesMessages org.gluu.oxtrust.action.ConfigureCacheRefreshAction.facesMessages
private

◆ initialized

boolean org.gluu.oxtrust.action.ConfigureCacheRefreshAction.initialized
private

◆ interceptorValidationMessage

String org.gluu.oxtrust.action.ConfigureCacheRefreshAction.interceptorValidationMessage
private

◆ inumService

InumService org.gluu.oxtrust.action.ConfigureCacheRefreshAction.inumService
private

◆ jsonConfigurationService

JsonConfigurationService org.gluu.oxtrust.action.ConfigureCacheRefreshAction.jsonConfigurationService
private

◆ keyAttributes

List<SimpleProperty> org.gluu.oxtrust.action.ConfigureCacheRefreshAction.keyAttributes
private

◆ keyObjectClasses

List<SimpleProperty> org.gluu.oxtrust.action.ConfigureCacheRefreshAction.keyObjectClasses
private

◆ log

Logger org.gluu.oxtrust.action.ConfigureCacheRefreshAction.log
private

◆ oxTrustAuditService

OxTrustAuditService org.gluu.oxtrust.action.ConfigureCacheRefreshAction.oxTrustAuditService
private

◆ personService

IPersonService org.gluu.oxtrust.action.ConfigureCacheRefreshAction.personService
private

◆ serialVersionUID

final long org.gluu.oxtrust.action.ConfigureCacheRefreshAction.serialVersionUID = -5210460481895022468L
staticprivate

◆ showInterceptorValidationDialog

boolean org.gluu.oxtrust.action.ConfigureCacheRefreshAction.showInterceptorValidationDialog
private

◆ sourceAttributes

List<SimpleProperty> org.gluu.oxtrust.action.ConfigureCacheRefreshAction.sourceAttributes
private

◆ updateMethod

CacheRefreshUpdateMethod org.gluu.oxtrust.action.ConfigureCacheRefreshAction.updateMethod
private

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