io.qt.websockets.QWebSocketServer Maven / Gradle / Ivy
Show all versions of qtjambi-websockets Show documentation
package io.qt.websockets;
import io.qt.*;
/**
* Implements a WebSocket-based server
* Java wrapper for Qt class QWebSocketServer
*/
public class QWebSocketServer extends io.qt.core.QObject
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* This variable stores the meta-object for the class.
*/
public static final io.qt.core.@NonNull QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QWebSocketServer.class);
/**
* Java wrapper for Qt enum QWebSocketServer::SslMode
*/
public enum SslMode implements QtEnumerator {
/**
* Representing QWebSocketServer:: SecureMode
*/
SecureMode(0),
/**
* Representing QWebSocketServer:: NonSecureMode
*/
NonSecureMode(1);
static {
QtJambi_LibraryUtilities.initialize();
}
private SslMode(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
@Override
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull SslMode resolve(int value) {
switch (value) {
case 0: return SecureMode;
case 1: return NonSecureMode;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* See QWebSocketServer:: acceptError(QAbstractSocket::SocketError)
*/
@SuppressWarnings({"exports"})
public final @NonNull Signal1 acceptError = new Signal1<>();
/**
* See QWebSocketServer:: alertReceived(QSsl::AlertLevel, QSsl::AlertType, QString)
* @since This signal was introduced in Qt 6.2.
*/
@SuppressWarnings({"exports"})
public final @NonNull Signal3 alertReceived = new Signal3<>();
/**
* See QWebSocketServer:: alertSent(QSsl::AlertLevel, QSsl::AlertType, QString)
* @since This signal was introduced in Qt 6.2.
*/
@SuppressWarnings({"exports"})
public final @NonNull Signal3 alertSent = new Signal3<>();
/**
* See QWebSocketServer:: closed()
*/
public final @NonNull Signal0 closed = new Signal0();
/**
* See QWebSocketServer:: handshakeInterruptedOnError(QSslError)
* @since This signal was introduced in Qt 6.2.
*/
@SuppressWarnings({"exports"})
public final @NonNull Signal1 handshakeInterruptedOnError = new Signal1<>();
/**
* See QWebSocketServer:: newConnection()
*/
public final @NonNull Signal0 newConnection = new Signal0();
/**
* See QWebSocketServer:: originAuthenticationRequired(QWebSocketCorsAuthenticator*)
*/
public final @NonNull Signal1 originAuthenticationRequired = new Signal1<>();
/**
* See QWebSocketServer:: peerVerifyError(QSslError)
*/
@SuppressWarnings({"exports"})
public final @NonNull Signal1 peerVerifyError = new Signal1<>();
/**
* See QWebSocketServer:: preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator*)
*/
@SuppressWarnings({"exports"})
public final @NonNull Signal1 preSharedKeyAuthenticationRequired = new Signal1<>();
/**
* See QWebSocketServer:: serverError(QWebSocketProtocol::CloseCode)
*/
public final @NonNull Signal1 serverError = new Signal1<>();
/**
* See QWebSocketServer:: sslErrors(QList<QSslError>)
*/
@SuppressWarnings({"exports"})
public final @NonNull Signal1> sslErrors = new Signal1<>();
/**
* See QWebSocketServer:: QWebSocketServer(QString, QWebSocketServer::SslMode, QObject*)
* @param serverName
* @param secureMode
* @param parent
*/
public QWebSocketServer(java.lang.@NonNull String serverName, io.qt.websockets.QWebSocketServer.@NonNull SslMode secureMode, io.qt.core.@Nullable QObject parent){
super((QPrivateConstructor)null);
initialize_native(this, serverName, secureMode, parent);
}
private native static void initialize_native(QWebSocketServer instance, java.lang.String serverName, io.qt.websockets.QWebSocketServer.SslMode secureMode, io.qt.core.QObject parent);
/**
*
*/
@QtUninvokable
public final void close(){
close_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void close_native(long __this__nativeId);
/**
* See QWebSocketServer:: error()const
* @return
*/
@QtUninvokable
public final io.qt.websockets.QWebSocketProtocol.@NonNull CloseCode error(){
return io.qt.websockets.QWebSocketProtocol.CloseCode.resolve(error_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int error_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: errorString()const
* @return
*/
@QtUninvokable
public final java.lang.@NonNull String errorString(){
return errorString_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String errorString_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: handleConnection(QTcpSocket*)const
* @param socket
*/
@SuppressWarnings({"exports"})
@QtUninvokable
public final void handleConnection(io.qt.network.@Nullable QTcpSocket socket){
handleConnection_native_QTcpSocket_ptr_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(socket));
}
@QtUninvokable
private native void handleConnection_native_QTcpSocket_ptr_constfct(long __this__nativeId, long socket);
/**
* See QWebSocketServer:: handshakeTimeout()const
* @return
*/
@QtUninvokable
public final java.time.@NonNull Duration handshakeTimeout(){
return handshakeTimeout_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.time.Duration handshakeTimeout_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: handshakeTimeoutMS()const
* @return
*/
@QtUninvokable
public final int handshakeTimeoutMS(){
return handshakeTimeoutMS_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int handshakeTimeoutMS_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: hasPendingConnections()const
* @return
*/
@QtUninvokable
public final boolean hasPendingConnections(){
return hasPendingConnections_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean hasPendingConnections_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: isListening()const
* @return
*/
@QtUninvokable
public final boolean isListening(){
return isListening_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isListening_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: listen(QHostAddress, quint16)
* @param address
* @param port
* @return
*/
@SuppressWarnings({"exports"})
@QtUninvokable
public final boolean listen(io.qt.network.@NonNull QHostAddress address, short port){
return listen_native_cref_QHostAddress_quint16(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(address), port);
}
@QtUninvokable
private native boolean listen_native_cref_QHostAddress_quint16(long __this__nativeId, long address, short port);
/**
* See QWebSocketServer:: maxPendingConnections()const
* @return
*/
@QtUninvokable
public final int maxPendingConnections(){
return maxPendingConnections_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int maxPendingConnections_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: nativeDescriptor()const
*
* @deprecated Use {@link io.qt.websockets.QWebSocketServer#socketDescriptor()} instead@return
*/
@Deprecated
@QtUninvokable
public final long nativeDescriptor(){
return nativeDescriptor_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@Deprecated
@QtUninvokable
private native long nativeDescriptor_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: pauseAccepting()
*/
@QtUninvokable
public final void pauseAccepting(){
pauseAccepting_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void pauseAccepting_native(long __this__nativeId);
/**
* See QWebSocketServer:: proxy()const
* @return
*/
@SuppressWarnings({"exports"})
@QtUninvokable
public final io.qt.network.@NonNull QNetworkProxy proxy(){
return proxy_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.network.QNetworkProxy proxy_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: resumeAccepting()
*/
@QtUninvokable
public final void resumeAccepting(){
resumeAccepting_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void resumeAccepting_native(long __this__nativeId);
/**
* See QWebSocketServer:: secureMode()const
* @return
*/
@QtUninvokable
public final io.qt.websockets.QWebSocketServer.@NonNull SslMode secureMode(){
return io.qt.websockets.QWebSocketServer.SslMode.resolve(secureMode_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int secureMode_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: serverAddress()const
* @return
*/
@SuppressWarnings({"exports"})
@QtUninvokable
public final io.qt.network.@NonNull QHostAddress serverAddress(){
return serverAddress_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.network.QHostAddress serverAddress_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: serverName()const
* @return
*/
@QtUninvokable
public final java.lang.@NonNull String serverName(){
return serverName_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String serverName_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: serverPort()const
* @return
*/
@QtUninvokable
public final short serverPort(){
return serverPort_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native short serverPort_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: serverUrl()const
* @return
*/
@QtUninvokable
public final io.qt.core.@NonNull QUrl serverUrl(){
return serverUrl_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QUrl serverUrl_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: setHandshakeTimeout(int)
* @param msec
*/
@QtUninvokable
public final void setHandshakeTimeout(int msec){
setHandshakeTimeout_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), msec);
}
@QtUninvokable
private native void setHandshakeTimeout_native_int(long __this__nativeId, int msec);
/**
* See QWebSocketServer:: setHandshakeTimeout(std::chrono::milliseconds)
* @param msec
*/
@QtUninvokable
public final void setHandshakeTimeout(java.time.temporal.@NonNull TemporalAmount msec){
setHandshakeTimeout_native_std_chrono_milliseconds(QtJambi_LibraryUtilities.internal.nativeId(this), msec);
}
@QtUninvokable
private native void setHandshakeTimeout_native_std_chrono_milliseconds(long __this__nativeId, java.time.temporal.TemporalAmount msec);
/**
* See QWebSocketServer:: setMaxPendingConnections(int)
* @param numConnections
*/
@QtUninvokable
public final void setMaxPendingConnections(int numConnections){
setMaxPendingConnections_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), numConnections);
}
@QtUninvokable
private native void setMaxPendingConnections_native_int(long __this__nativeId, int numConnections);
/**
* See QWebSocketServer:: setNativeDescriptor(qintptr)
*
* @deprecated Use {@link io.qt.websockets.QWebSocketServer#setSocketDescriptor(long)} instead@param descriptor
* @return
*/
@Deprecated
@QtUninvokable
public final boolean setNativeDescriptor(long descriptor){
return setNativeDescriptor_native_qintptr(QtJambi_LibraryUtilities.internal.nativeId(this), descriptor);
}
@Deprecated
@QtUninvokable
private native boolean setNativeDescriptor_native_qintptr(long __this__nativeId, long descriptor);
/**
* See QWebSocketServer:: setProxy(QNetworkProxy)
* @param networkProxy
*/
@SuppressWarnings({"exports"})
@QtUninvokable
public final void setProxy(io.qt.network.@NonNull QNetworkProxy networkProxy){
setProxy_native_cref_QNetworkProxy(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(networkProxy));
}
@QtUninvokable
private native void setProxy_native_cref_QNetworkProxy(long __this__nativeId, long networkProxy);
/**
* See QWebSocketServer:: setServerName(QString)
* @param serverName
*/
@QtUninvokable
public final void setServerName(java.lang.@NonNull String serverName){
setServerName_native_cref_QString(QtJambi_LibraryUtilities.internal.nativeId(this), serverName);
}
@QtUninvokable
private native void setServerName_native_cref_QString(long __this__nativeId, java.lang.String serverName);
/**
* See QWebSocketServer:: setSocketDescriptor(qintptr)
* @param socketDescriptor
* @return
*/
@QtUninvokable
public final boolean setSocketDescriptor(long socketDescriptor){
return setSocketDescriptor_native_qintptr(QtJambi_LibraryUtilities.internal.nativeId(this), socketDescriptor);
}
@QtUninvokable
private native boolean setSocketDescriptor_native_qintptr(long __this__nativeId, long socketDescriptor);
/**
* See QWebSocketServer:: setSslConfiguration(QSslConfiguration)
* @param sslConfiguration
*/
@SuppressWarnings({"exports"})
@QtUninvokable
public final void setSslConfiguration(io.qt.network.@NonNull QSslConfiguration sslConfiguration){
setSslConfiguration_native_cref_QSslConfiguration(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(sslConfiguration));
}
@QtUninvokable
private native void setSslConfiguration_native_cref_QSslConfiguration(long __this__nativeId, long sslConfiguration);
/**
* Sets the list of protocols supported by the server to protocols
* See QWebSocketServer:: setSupportedSubprotocols(QStringList)
* @since This function was introduced in Qt 6.4.
* @param protocols
*/
@QtUninvokable
public final void setSupportedSubprotocols(java.util.@NonNull Collection protocols){
setSupportedSubprotocols_native_cref_QStringList(QtJambi_LibraryUtilities.internal.nativeId(this), protocols);
}
@QtUninvokable
private native void setSupportedSubprotocols_native_cref_QStringList(long __this__nativeId, java.util.Collection protocols);
/**
* See QWebSocketServer:: socketDescriptor()const
* @return
*/
@QtUninvokable
public final long socketDescriptor(){
return socketDescriptor_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native long socketDescriptor_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: sslConfiguration()const
* @return
*/
@SuppressWarnings({"exports"})
@QtUninvokable
public final io.qt.network.@NonNull QSslConfiguration sslConfiguration(){
return sslConfiguration_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.network.QSslConfiguration sslConfiguration_native_constfct(long __this__nativeId);
/**
* Returns the list of protocols supported by the server
* See QWebSocketServer:: supportedSubprotocols()const
* @since This function was introduced in Qt 6.4.
* @return
*/
@QtUninvokable
public final io.qt.core.@NonNull QStringList supportedSubprotocols(){
return supportedSubprotocols_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QStringList supportedSubprotocols_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: supportedVersions()const
* @return
*/
@QtUninvokable
public final io.qt.core.@NonNull QList supportedVersions(){
return supportedVersions_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QList supportedVersions_native_constfct(long __this__nativeId);
/**
* See QWebSocketServer:: nextPendingConnection()
* @return
*/
@QtUninvokable
public io.qt.websockets.@Nullable QWebSocket nextPendingConnection(){
return nextPendingConnection_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.websockets.QWebSocket nextPendingConnection_native(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QWebSocketServer(QPrivateConstructor p) { super(p); }
/**
* Overloaded constructor for {@link #QWebSocketServer(java.lang.String, io.qt.websockets.QWebSocketServer.SslMode, io.qt.core.QObject)}
* with parent = null
.
*/
public QWebSocketServer(java.lang.@NonNull String serverName, io.qt.websockets.QWebSocketServer.@NonNull SslMode secureMode) {
this(serverName, secureMode, (io.qt.core.QObject)null);
}
/**
* Overloaded function for {@link #listen(io.qt.network.QHostAddress, short)}
* with port = 0
.
*/
@SuppressWarnings({"exports"})
@QtUninvokable
public final boolean listen(io.qt.network.@NonNull QHostAddress address) {
return listen(address, (short)0);
}
/**
* Overloaded function for {@link #listen(io.qt.network.QHostAddress, short)}
* with:
* address = new io.qt.network.QHostAddress(io.qt.network.QHostAddress.SpecialAddress.Any)
* port = 0
*
*/
@QtUninvokable
public final boolean listen() {
return listen(new io.qt.network.QHostAddress(io.qt.network.QHostAddress.SpecialAddress.Any), (short)0);
}
/**
* Overloaded function for {@link #listen(io.qt.network.QHostAddress.SpecialAddress, short)}
* with port = 0
.
*/
@SuppressWarnings({"exports"})
@QtUninvokable
public final boolean listen(io.qt.network.QHostAddress.@NonNull SpecialAddress address) {
return listen(address, (short)0);
}
/**
* Overloaded function for {@link #listen(io.qt.network.QHostAddress, short)}.
*/
@SuppressWarnings({"exports"})
@QtUninvokable
public final boolean listen(io.qt.network.QHostAddress.@NonNull SpecialAddress address, short port) {
return listen(new io.qt.network.QHostAddress(address), port);
}
}