RedbackRuntimeConfiguration=function(userManagerImpls,ldapConfiguration,migratedFromRedbackConfiguration,configurationPropertiesEntries
- ,useUsersCache,usersCacheTimeToIdleSeconds,usersCacheTimeToLiveSeconds){
+ ,useUsersCache,cacheConfiguration){
$.log("new RedbackRuntimeConfiguration");
var self=this;
this.modified=ko.observable(false);
this.useUsersCache=ko.observable(useUsersCache);
this.useUsersCache.subscribe(function(newValue){self.modified(true)});
- this.usersCacheTimeToIdleSeconds=ko.observable(usersCacheTimeToIdleSeconds);
- this.usersCacheTimeToIdleSeconds.subscribe(function(newValue){self.modified(true)});
+ this.usersCacheConfiguration=ko.observable(cacheConfiguration);
+ this.usersCacheConfiguration.subscribe(function(newValue){self.modified(true)});
- this.usersCacheTimeToLiveSeconds=ko.observable(usersCacheTimeToLiveSeconds);
- this.usersCacheTimeToLiveSeconds.subscribe(function(newValue){self.modified(true)});
}
var redbackRuntimeConfiguration =
new RedbackRuntimeConfiguration(data.userManagerImpls,ldapConfiguration,data.migratedFromRedbackConfiguration,[]
- ,data.useUsersCache,data.usersCacheTimeToIdleSeconds,data.usersCacheTimeToLiveSeconds);
+ ,data.useUsersCache,mapCacheConfiguration(data.usersCacheConfiguration));
$.log("mapRedbackRuntimeConfiguration done");
var configurationPropertiesEntries = data.configurationPropertiesEntries == null ? []: $.each(data.configurationPropertiesEntries,function(item){
}
+ CacheConfiguration=function(timeToIdleSeconds,timeToLiveSeconds){
+ var self=this;
+ this.modified=ko.observable(false);
+
+ this.timeToIdleSeconds=ko.observable(timeToIdleSeconds);
+ this.timeToIdleSeconds.subscribe(function(newValue){self.modified(true)});
+
+ this.timeToLiveSeconds=ko.observable(timeToLiveSeconds);
+ this.timeToLiveSeconds.subscribe(function(newValue){self.modified(true)});
+ }
+
+ mapCacheConfiguration=function(data){
+ if(!data){
+ return new CacheConfiguration();
+ }
+ return new CacheConfiguration(data.timeToIdleSeconds,data.timeToLiveSeconds);
+ }
});
\ No newline at end of file
<div class="control-group">
<label class="control-label" for="usersCacheTimeToLiveSeconds">${$.i18n.prop('redback.runtime.usersCacheTimeToLiveSeconds.label')}</label>
<div class="controls">
- <input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheTimeToLiveSeconds"
+ <input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheConfiguration().timeToLiveSeconds"
id="usersCacheTimeToLiveSeconds" name="usersCacheTimeToLiveSeconds" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="usersCacheTimeToIdleSeconds">${$.i18n.prop('redback.runtime.usersCacheTimeToIdleSeconds.label')}</label>
<div class="controls">
- <input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheTimeToIdleSeconds"
+ <input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheConfiguration().timeToIdleSeconds"
id="usersCacheTimeToIdleSeconds" name="usersCacheTimeToIdleSeconds" />
</div>
</div>