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);
 | 
					                this.lastUpdateUser);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static SEBClientConfig createNew(final Long institutionId) {
 | 
					    public static SEBClientConfig createNew(final Long institutionId, final long pingIterval) {
 | 
				
			||||||
        return new SEBClientConfig(
 | 
					        return new SEBClientConfig(
 | 
				
			||||||
                null,
 | 
					                null,
 | 
				
			||||||
                institutionId,
 | 
					                institutionId,
 | 
				
			||||||
                null,
 | 
					                null,
 | 
				
			||||||
                ConfigPurpose.CONFIGURE_CLIENT,
 | 
					                ConfigPurpose.CONFIGURE_CLIENT,
 | 
				
			||||||
                1000L,
 | 
					                pingIterval,
 | 
				
			||||||
                VDIType.NO,
 | 
					                VDIType.NO,
 | 
				
			||||||
                null,
 | 
					                null,
 | 
				
			||||||
                null,
 | 
					                null,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -150,12 +150,14 @@ public class SEBClientConfigForm implements TemplateComposer {
 | 
				
			||||||
    private final DownloadService downloadService;
 | 
					    private final DownloadService downloadService;
 | 
				
			||||||
    private final String downloadFileName;
 | 
					    private final String downloadFileName;
 | 
				
			||||||
    private final Cryptor cryptor;
 | 
					    private final Cryptor cryptor;
 | 
				
			||||||
 | 
					    private final long defaultSEBPingInterval;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected SEBClientConfigForm(
 | 
					    protected SEBClientConfigForm(
 | 
				
			||||||
            final PageService pageService,
 | 
					            final PageService pageService,
 | 
				
			||||||
            final DownloadService downloadService,
 | 
					            final DownloadService downloadService,
 | 
				
			||||||
            final Cryptor cryptor,
 | 
					            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.pageService = pageService;
 | 
				
			||||||
        this.restService = pageService.getRestService();
 | 
					        this.restService = pageService.getRestService();
 | 
				
			||||||
| 
						 | 
					@ -163,6 +165,7 @@ public class SEBClientConfigForm implements TemplateComposer {
 | 
				
			||||||
        this.currentUser = pageService.getCurrentUser();
 | 
					        this.currentUser = pageService.getCurrentUser();
 | 
				
			||||||
        this.downloadService = downloadService;
 | 
					        this.downloadService = downloadService;
 | 
				
			||||||
        this.downloadFileName = downloadFileName;
 | 
					        this.downloadFileName = downloadFileName;
 | 
				
			||||||
 | 
					        this.defaultSEBPingInterval = defaultSEBPingInterval;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
| 
						 | 
					@ -179,7 +182,8 @@ public class SEBClientConfigForm implements TemplateComposer {
 | 
				
			||||||
        final SEBClientConfig clientConfig = (isNew)
 | 
					        final SEBClientConfig clientConfig = (isNew)
 | 
				
			||||||
                ? SEBClientConfig.createNew((parentEntityKey != null)
 | 
					                ? SEBClientConfig.createNew((parentEntityKey != null)
 | 
				
			||||||
                        ? Long.valueOf(parentEntityKey.modelId)
 | 
					                        ? Long.valueOf(parentEntityKey.modelId)
 | 
				
			||||||
                        : user.institutionId)
 | 
					                        : user.institutionId,
 | 
				
			||||||
 | 
					                        this.defaultSEBPingInterval)
 | 
				
			||||||
                : this.restService
 | 
					                : this.restService
 | 
				
			||||||
                        .getBuilder(GetClientConfig.class)
 | 
					                        .getBuilder(GetClientConfig.class)
 | 
				
			||||||
                        .withURIVariable(API.PARAM_MODEL_ID, entityKey.modelId)
 | 
					                        .withURIVariable(API.PARAM_MODEL_ID, entityKey.modelId)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -97,8 +97,6 @@ public class SEBClientEventBatchService {
 | 
				
			||||||
            initialDelay = 100)
 | 
					            initialDelay = 100)
 | 
				
			||||||
    public void processEvents() {
 | 
					    public void processEvents() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        final long start = Utils.getMillisecondsNow();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        final int size = this.eventDataQueue.size();
 | 
					        final int size = this.eventDataQueue.size();
 | 
				
			||||||
        if (size > 1000) {
 | 
					        if (size > 1000) {
 | 
				
			||||||
            log.warn("-----> There are more then 1000 SEB client logs in the waiting queue: {}", size);
 | 
					            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) {
 | 
					        } catch (final Exception e) {
 | 
				
			||||||
            log.error("Failed to process SEB events from eventDataQueue: ", e);
 | 
					            log.error("Failed to process SEB events from eventDataQueue: ", e);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					 | 
				
			||||||
        System.out.println("************ tuck: " + (Utils.getMillisecondsNow() - start));
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private EventData convertData(final EventData eventData) {
 | 
					    private EventData convertData(final EventData eventData) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue