Skip to content

Commit

Permalink
Merge branch 'devel' into #22103-use-dispose-listener-for-autosave-
Browse files Browse the repository at this point in the history
  • Loading branch information
MashaKorax committed Mar 27, 2024
2 parents 5e400df + d421a60 commit 4922567
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.jkiss.dbeaver.model.websocket.event;

import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.model.websocket.event.client.WSSessionPingClientEvent;
import org.jkiss.dbeaver.model.websocket.event.client.WSSubscribeOnTopicClientEvent;
import org.jkiss.dbeaver.model.websocket.event.client.WSUnsubscribeFromTopicClientEvent;
import org.jkiss.dbeaver.model.websocket.event.client.WSUpdateActiveProjectsClientEvent;
Expand All @@ -25,6 +26,7 @@ public enum WSClientEventType {
TOPIC_SUBSCRIBE("cb_client_topic_subscribe", WSSubscribeOnTopicClientEvent.class),
TOPIC_UNSUBSCRIBE("cb_client_topic_unsubscribe", WSUnsubscribeFromTopicClientEvent.class),
ACTIVE_PROJECTS("cb_client_projects_active", WSUpdateActiveProjectsClientEvent.class),
SESSION_PING("cb_client_session_ping", WSSessionPingClientEvent.class),
;

private final String eventId;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.model.websocket.event.client;

import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.model.websocket.event.WSClientEvent;
import org.jkiss.dbeaver.model.websocket.event.WSClientEventType;

public class WSSessionPingClientEvent extends WSClientEvent {
protected WSSessionPingClientEvent(@Nullable String topicId) {
super(WSClientEventType.SESSION_PING.getEventId(), topicId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,35 @@

import org.jkiss.dbeaver.model.websocket.event.WSEventType;

import java.util.Map;

public class WSSessionStateEvent extends WSAbstractSessionEvent {
private final long lastAccessTime;
private final long remainingTime;
private final boolean isValid;
private final boolean isCacheExpired;
private final String locale;
private final Map<String, Object> actionParameters;

public WSSessionStateEvent(long remainingTime, boolean isValid) {
public WSSessionStateEvent(
long lastAccessTime,
long remainingTime,
boolean isValid,
boolean isCacheExpired,
String locale,
Map<String, Object> actionParameters
) {
super(WSEventType.SESSION_STATE);
this.lastAccessTime = lastAccessTime;
this.remainingTime = remainingTime;
this.isValid = isValid;
this.isCacheExpired = isCacheExpired;
this.locale = locale;
this.actionParameters = actionParameters;
}

public long getLastAccessTime() {
return lastAccessTime;
}

public long getRemainingTime() {
Expand All @@ -35,4 +56,16 @@ public long getRemainingTime() {
public boolean isValid() {
return isValid;
}

public boolean isCacheExpired() {
return isCacheExpired;
}

public String getLocale() {
return locale;
}

public Map<String, Object> getActionParameters() {
return actionParameters;
}
}

0 comments on commit 4922567

Please sign in to comment.