made default SEB client ping interval configurable
This commit is contained in:
		
							parent
							
								
									d99dc58bc9
								
							
						
					
					
						commit
						c06bca1f86
					
				
					 3 changed files with 8 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -506,13 +506,13 @@ public final class SEBClientConfig implements GrantEntity, Activatable {
 | 
			
		|||
                this.lastUpdateUser);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static SEBClientConfig createNew(final Long institutionId) {
 | 
			
		||||
    public static SEBClientConfig createNew(final Long institutionId, final long pingIterval) {
 | 
			
		||||
        return new SEBClientConfig(
 | 
			
		||||
                null,
 | 
			
		||||
                institutionId,
 | 
			
		||||
                null,
 | 
			
		||||
                ConfigPurpose.CONFIGURE_CLIENT,
 | 
			
		||||
                1000L,
 | 
			
		||||
                pingIterval,
 | 
			
		||||
                VDIType.NO,
 | 
			
		||||
                null,
 | 
			
		||||
                null,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -150,12 +150,14 @@ public class SEBClientConfigForm implements TemplateComposer {
 | 
			
		|||
    private final DownloadService downloadService;
 | 
			
		||||
    private final String downloadFileName;
 | 
			
		||||
    private final Cryptor cryptor;
 | 
			
		||||
    private final long defaultSEBPingInterval;
 | 
			
		||||
 | 
			
		||||
    protected SEBClientConfigForm(
 | 
			
		||||
            final PageService pageService,
 | 
			
		||||
            final DownloadService downloadService,
 | 
			
		||||
            final Cryptor cryptor,
 | 
			
		||||
            @Value("${sebserver.gui.seb.client.config.download.filename}") final String downloadFileName) {
 | 
			
		||||
            @Value("${sebserver.gui.seb.client.config.download.filename}") final String downloadFileName,
 | 
			
		||||
            @Value("${sebserver.gui.seb.client.config.ping.interval:1000}") final long defaultSEBPingInterval) {
 | 
			
		||||
 | 
			
		||||
        this.pageService = pageService;
 | 
			
		||||
        this.restService = pageService.getRestService();
 | 
			
		||||
| 
						 | 
				
			
			@ -163,6 +165,7 @@ public class SEBClientConfigForm implements TemplateComposer {
 | 
			
		|||
        this.currentUser = pageService.getCurrentUser();
 | 
			
		||||
        this.downloadService = downloadService;
 | 
			
		||||
        this.downloadFileName = downloadFileName;
 | 
			
		||||
        this.defaultSEBPingInterval = defaultSEBPingInterval;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
| 
						 | 
				
			
			@ -179,7 +182,8 @@ public class SEBClientConfigForm implements TemplateComposer {
 | 
			
		|||
        final SEBClientConfig clientConfig = (isNew)
 | 
			
		||||
                ? SEBClientConfig.createNew((parentEntityKey != null)
 | 
			
		||||
                        ? Long.valueOf(parentEntityKey.modelId)
 | 
			
		||||
                        : user.institutionId)
 | 
			
		||||
                        : user.institutionId,
 | 
			
		||||
                        this.defaultSEBPingInterval)
 | 
			
		||||
                : this.restService
 | 
			
		||||
                        .getBuilder(GetClientConfig.class)
 | 
			
		||||
                        .withURIVariable(API.PARAM_MODEL_ID, entityKey.modelId)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -97,8 +97,6 @@ public class SEBClientEventBatchService {
 | 
			
		|||
            initialDelay = 100)
 | 
			
		||||
    public void processEvents() {
 | 
			
		||||
 | 
			
		||||
        final long start = Utils.getMillisecondsNow();
 | 
			
		||||
 | 
			
		||||
        final int size = this.eventDataQueue.size();
 | 
			
		||||
        if (size > 1000) {
 | 
			
		||||
            log.warn("-----> There are more then 1000 SEB client logs in the waiting queue: {}", size);
 | 
			
		||||
| 
						 | 
				
			
			@ -137,8 +135,6 @@ public class SEBClientEventBatchService {
 | 
			
		|||
        } catch (final Exception e) {
 | 
			
		||||
            log.error("Failed to process SEB events from eventDataQueue: ", e);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        System.out.println("************ tuck: " + (Utils.getMillisecondsNow() - start));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private EventData convertData(final EventData eventData) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue