All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vaadin.server.ConnectorIdGenerationEvent Maven / Gradle / Ivy

There is a newer version: 8.27.3
Show newest version
/*
 * 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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy