public void forceDisconnect(String connectionId) throws OpenViduJavaClientException, OpenViduHttpException {
		HttpDelete request = new HttpDelete(OpenVidu.urlOpenViduServer + OpenVidu.API_SESSIONS + "/" + this.sessionId
				+ "/connection/" + connectionId);
		request.setHeader(HttpHeaders.CONTENT_TYPE, "application/x-www-form-urlencoded");

		HttpResponse response = null;
		try {
			response = OpenVidu.httpClient.execute(request);
		} catch (IOException e) {
			throw new OpenViduJavaClientException(e.getMessage(), e.getCause());
		}

		try {
			int statusCode = response.getStatusLine().getStatusCode();
			if ((statusCode == org.apache.http.HttpStatus.SC_NO_CONTENT)) {
				// Remove connection from activeConnections map
				Connection connectionClosed = this.activeConnections.remove(connectionId);
				// Remove every Publisher of the closed connection from every subscriber list of
				// other connections
				if (connectionClosed != null) {
					for (Publisher publisher : connectionClosed.getPublishers()) {
						String streamId = publisher.getStreamId();
						for (Connection connection : this.activeConnections.values()) {
							connection.setSubscribers(connection.getSubscribers().stream()
									.filter(subscriber -> !streamId.equals(subscriber)).collect(Collectors.toList()));
						}
					}
				} else {
					log.warn(
							"The closed connection wasn't fetched in OpenVidu Java Client. No changes in the collection of active connections of the Session");
				}
				log.info("Connection {} closed", connectionId);
			} else {
				throw new OpenViduHttpException(statusCode);
			}
		} finally

		{
			EntityUtils.consumeQuietly(response.getEntity());
		}
	}
public void forceDisconnect ( String connectionId ) throws OpenViduJavaClientException , OpenViduHttpException { HttpDelete request = new HttpDelete ( OpenVidu . urlOpenViduServer + OpenVidu . API_SESSIONS + "/" + this . sessionId + "/connection/" + connectionId ) ; request . setHeader ( HttpHeaders . CONTENT_TYPE , "application/x-www-form-urlencoded" ) ; HttpResponse response = null ; try { response = OpenVidu . httpClient . execute ( request ) ; } catch ( IOException e ) { throw new OpenViduJavaClientException ( e . getMessage ( ) , e . getCause ( ) ) ; } try { int statusCode = response . getStatusLine ( ) . getStatusCode ( ) ; if ( ( statusCode == org . apache . http . HttpStatus . SC_NO_CONTENT ) ) { Connection connectionClosed = this . activeConnections . remove ( connectionId ) ; if ( connectionClosed != null ) { for ( Publisher publisher : connectionClosed . getPublishers ( ) ) { String streamId = publisher . getStreamId ( ) ; for ( Connection connection : this . activeConnections . values ( ) ) { connection . setSubscribers ( connection . getSubscribers ( ) . stream ( ) . filter ( subscriber -> ! streamId . equals ( subscriber ) ) . collect ( Collectors . toList ( ) ) ) ; } } } else { log . warn ( "The closed connection wasn't fetched in OpenVidu Java Client. No changes in the collection of active connections of the Session" ) ; } log . info ( "Connection {} closed" , connectionId ) ; } else { throw new OpenViduHttpException ( statusCode ) ; } } finally { EntityUtils . consumeQuietly ( response . getEntity ( ) ) ; } }
Forces the user with Connection <code>connectionId</code> to leave the
session. OpenVidu Browser will trigger the proper events on the client-side
(<code>streamDestroyed</code>, <code>connectionDestroyed</code>,
<code>sessionDisconnected</code>) with reason set to
"forceDisconnectByServer" <br>

You can get <code>connectionId</code> parameter with
{@link io.openvidu.java.client.Session#fetch()} (use
{@link io.openvidu.java.client.Connection#getConnectionId()} to get the
`connectionId` you want)

@throws OpenViduJavaClientException
@throws OpenViduHttpException