gluu
公開メンバ関数 | 関数 | 非公開メンバ関数 | 非公開変数類 | 全メンバ一覧
org.gluu.credmanager.ui.vm.admin.LdapSettingsViewModel クラス
org.gluu.credmanager.ui.vm.admin.LdapSettingsViewModel の継承関係図
Inheritance graph
org.gluu.credmanager.ui.vm.admin.LdapSettingsViewModel 連携図
Collaboration graph

公開メンバ関数

LdapSettings getLdapSettings ()
 
void setLdapSettings (LdapSettings ldapSettings)
 
void init ()
 
void save ()
 
String getSubpage ()
 
List< AdminConsoleMenuItemgetExtraButtons ()
 
void loadSubPage (@BindingParam("page") String page)
 
MainSettings getSettings ()
 

関数

boolean updateMainSettings (String sucessMessage)
 
boolean updateMainSettings ()
 

非公開メンバ関数

void reloadConfig ()
 
String updateLdapSettings ()
 

非公開変数類

Logger logger = LoggerFactory.getLogger(getClass())
 
LdapService ldapService
 
LdapSettings ldapSettings
 

詳解

著者
jgomer

関数詳解

◆ getExtraButtons()

List<AdminConsoleMenuItem> org.gluu.credmanager.ui.vm.admin.MainViewModel.getExtraButtons ( )
inlineinherited
49  {
50  return extraButtons;
51  }
List< AdminConsoleMenuItem > extraButtons
Definition: MainViewModel.java:41

◆ getLdapSettings()

LdapSettings org.gluu.credmanager.ui.vm.admin.LdapSettingsViewModel.getLdapSettings ( )
inline
36  {
37  return ldapSettings;
38  }
LdapSettings ldapSettings
Definition: LdapSettingsViewModel.java:34

◆ getSettings()

MainSettings org.gluu.credmanager.ui.vm.admin.MainViewModel.getSettings ( )
inlineinherited
70  {
71  return confHandler.getSettings();
72  }
ConfigurationHandler confHandler
Definition: MainViewModel.java:36
MainSettings getSettings()
Definition: ConfigurationHandler.java:126

◆ getSubpage()

String org.gluu.credmanager.ui.vm.admin.MainViewModel.getSubpage ( )
inlineinherited
45  {
46  return subpage;
47  }
String subpage
Definition: MainViewModel.java:43

◆ init()

void org.gluu.credmanager.ui.vm.admin.LdapSettingsViewModel.init ( )
inline
45  {
46  reloadConfig();
47  }
void reloadConfig()
Definition: LdapSettingsViewModel.java:70

◆ loadSubPage()

void org.gluu.credmanager.ui.vm.admin.MainViewModel.loadSubPage ( @BindingParam("page") String  page)
inlineinherited

Changes the page loaded in the content area. Also sets values needed in the UI (these are taken directly from calls to AdminService's getConfigSettings method.

引数
pageThe (string) url of the page that must be loaded (by default /admin/default.zul is being shown)
66  {
67  subpage = page;
68  }
String subpage
Definition: MainViewModel.java:43

◆ reloadConfig()

void org.gluu.credmanager.ui.vm.admin.LdapSettingsViewModel.reloadConfig ( )
inlineprivate
70  {
71  ldapSettings = (LdapSettings) Utils.cloneObject(getSettings().getLdapSettings());
72  }
LdapSettings getLdapSettings()
Definition: LdapSettingsViewModel.java:36
MainSettings getSettings()
Definition: MainViewModel.java:70
LdapSettings ldapSettings
Definition: LdapSettingsViewModel.java:34

◆ save()

void org.gluu.credmanager.ui.vm.admin.LdapSettingsViewModel.save ( )
inline
51  {
52 
53  //salt is optional
54  if (Utils.isNotEmpty(ldapSettings.getOxLdapLocation()) && ldapSettings.getOxLdapLocation().trim().length() > 0) {
55  String msg = updateLdapSettings();
56  if (msg != null) {
57  reloadConfig();
58  Messagebox.show(msg, null, Messagebox.OK, Messagebox.EXCLAMATION);
59  } else {
62  }
63  //BindUtils.postNotifyChange(null, null, this, "ldapSettings");
64  } else {
65  UIUtils.showMessageUI(false, Labels.getLabel("adm.ldap_nonempty"));
66  }
67 
68  }
boolean updateMainSettings()
Definition: MainViewModel.java:94
String updateLdapSettings()
Definition: LdapSettingsViewModel.java:75
void setLdapSettings(LdapSettings ldapSettings)
Definition: MainSettings.java:158
MainSettings getSettings()
Definition: MainViewModel.java:70
void reloadConfig()
Definition: LdapSettingsViewModel.java:70
String getOxLdapLocation()
Definition: LdapSettings.java:31
LdapSettings ldapSettings
Definition: LdapSettingsViewModel.java:34

◆ setLdapSettings()

void org.gluu.credmanager.ui.vm.admin.LdapSettingsViewModel.setLdapSettings ( LdapSettings  ldapSettings)
inline
40  {
42  }
LdapSettings ldapSettings
Definition: LdapSettingsViewModel.java:34

◆ updateLdapSettings()

String org.gluu.credmanager.ui.vm.admin.LdapSettingsViewModel.updateLdapSettings ( )
inlineprivate
75  {
76 
77  boolean success = false;
78  String msg = null;
79  try {
80  logger.info("Testing newer LDAP settings");
81  success = ldapService.setup(ldapSettings);
82  } catch (Exception e) {
83  msg = e.getMessage();
84  }
85  if (!success && msg == null) {
86  msg = Labels.getLabel("adm.ldap_novalid");
87  }
88  if (!success) {
89  try {
90  //Revert to good settings
91  logger.warn("Reverting to previously working LDAP settings");
93  msg += "\n" + Labels.getLabel("admin.reverted");
94  } else {
95  msg += "\n" + Labels.getLabel("admin.error_reverting");
96  }
97  } catch (Exception e) {
98  msg += "\n" + Labels.getLabel("admin.error_reverting");
99  logger.error(e.getMessage(), e);
100  }
101  }
102  return msg;
103 
104  }
boolean setup(LdapSettings ldapSettings)
Definition: LdapService.java:112
Logger logger
Definition: LdapSettingsViewModel.java:29
LdapSettings getLdapSettings()
Definition: LdapSettingsViewModel.java:36
LdapService ldapService
Definition: LdapSettingsViewModel.java:32
MainSettings getSettings()
Definition: MainViewModel.java:70
LdapSettings ldapSettings
Definition: LdapSettingsViewModel.java:34

◆ updateMainSettings() [1/2]

boolean org.gluu.credmanager.ui.vm.admin.MainViewModel.updateMainSettings ( String  sucessMessage)
inlinepackageinherited
74  {
75 
76  boolean success = false;
77  try {
78  //update app-level config and persist
79  getSettings().save();
80  if (sucessMessage == null) {
81  UIUtils.showMessageUI(true);
82  } else {
83  Messagebox.show(sucessMessage, null, Messagebox.OK, Messagebox.INFORMATION);
84  }
85  success = true;
86  } catch (Exception e) {
87  logger.error(e.getMessage(), e);
88  UIUtils.showMessageUI(false, Labels.getLabel("adm.conffile_error_update"));
89  }
90  return success;
91 
92  }
void save()
Definition: MainSettings.java:85
MainSettings getSettings()
Definition: MainViewModel.java:70
Logger logger
Definition: MainViewModel.java:33

◆ updateMainSettings() [2/2]

boolean org.gluu.credmanager.ui.vm.admin.MainViewModel.updateMainSettings ( )
inlinepackageinherited
94  {
95  return updateMainSettings(null);
96  }
boolean updateMainSettings()
Definition: MainViewModel.java:94

メンバ詳解

◆ ldapService

LdapService org.gluu.credmanager.ui.vm.admin.LdapSettingsViewModel.ldapService
private

◆ ldapSettings

LdapSettings org.gluu.credmanager.ui.vm.admin.LdapSettingsViewModel.ldapSettings
private

◆ logger

Logger org.gluu.credmanager.ui.vm.admin.LdapSettingsViewModel.logger = LoggerFactory.getLogger(getClass())
private

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