com.vaadin.server.ConnectorIdGenerationEvent Maven / Gradle / Ivy
/*
* Copyright (C) 2000-2024 Vaadin Ltd
*
* This program is available under Vaadin Commercial License and Service Terms.
*
* See for the full
* license.
*/
package com.vaadin.server;
import java.util.EventObject;
/**
* Event object containing information related to connector id generation.
*
* @author Vaadin Ltd
* @since 8.1
*/
public class ConnectorIdGenerationEvent extends EventObject {
private final VaadinSession session;
private final ClientConnector connector;
/**
* Creates a new event for the given session and connector.
*
* @param session
* the session for which a connector id is needed, not
* null
* @param connector
* the connector that should get an id, not null
*/
public ConnectorIdGenerationEvent(VaadinSession session,
ClientConnector connector) {
super(session.getService());
assert session != null;
assert connector != null;
this.session = session;
this.connector = connector;
}
/**
* Gets the session for which connector id is needed.
*
* @return the session, not null
*/
public VaadinSession getSession() {
return session;
}
/**
* Gets the connector that should get an id.
*
* @return the connector, not null
*/
public ClientConnector getConnector() {
return connector;
}
@Override
public VaadinService getSource() {
return (VaadinService) super.getSource();
}
}