From nobody Sat Nov 23 05:21:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682581894; cv=none; d=zohomail.com; s=zohoarc; b=MjUU07Xq/du4V3G1/4i7UmP+6Tn1FhgiQlfp45lHBCZ036ncq29LNNRiPLFXrtGWtCf6aSJm8f+rNtw7cAtVrbodveHdTel+6LCd9oKwk3Twst2PUPeWvenX05PiLP8nFoLAxyFyioPEc2gdBKwbDX0RP4zjue9lSfAL/DRDREU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682581894; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jP3jhtrgbjh/VPHlkK2VbDFWmfbVxYEyTDIdBC2uxEY=; b=CPL+/jTZlvDXoyfLSVFj1qKlXydY0o4nVqKcwie41wULRT5GAsl3rFoRlR1dE4Rk/RxnGj19BAeI1v2tTBeRk/MDqlTbtOZCCvEYP8r67uHjcHOqvMH7xD5pO7UcLpwqVSgnJnzVOQWHqV9sFWCHgg+V/fyzvr8aH7FkBSRN6rs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1682581894827131.13413696984685; Thu, 27 Apr 2023 00:51:34 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-154-qVkpaF3NM0-GytrSmPgudw-1; Thu, 27 Apr 2023 03:51:31 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5FE811C04195; Thu, 27 Apr 2023 07:51:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A41F63F4D; Thu, 27 Apr 2023 07:51:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 254341946A62; Thu, 27 Apr 2023 07:51:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 89D0219465BD for ; Thu, 27 Apr 2023 07:51:27 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7A3841121314; Thu, 27 Apr 2023 07:51:27 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.225.231]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0E2561121318 for ; Thu, 27 Apr 2023 07:51:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682581893; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jP3jhtrgbjh/VPHlkK2VbDFWmfbVxYEyTDIdBC2uxEY=; b=RIT84wP7sLernuphnWgHlgR021+a+UQwZ54Z5ikdjW55Ug/FR/MipET6ATzCjYFzurTUB0 8BE239xh9zJf1Fb9Wnuz+bQl3VSscdUYMnUtJIQBhqKWJJyB9JYf+HtlPlOfjr0Yz3ncxf 3ztR/toTyWFVPf5rlgSACzRt7J0caCw= X-MC-Unique: qVkpaF3NM0-GytrSmPgudw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] docs: Drop java.rst Date: Thu, 27 Apr 2023 09:51:23 +0200 Message-Id: <20230427075123.39293-3-abologna@redhat.com> In-Reply-To: <20230427075123.39293-1-abologna@redhat.com> References: <20230427075123.39293-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1682581896975100003 Content-Type: text/plain; charset="utf-8"; x-default="true" We no longer link to it from anywhere. Signed-off-by: Andrea Bolognani --- docs/java.rst | 127 ----------------------------------------------- docs/meson.build | 1 - 2 files changed, 128 deletions(-) delete mode 100644 docs/java.rst diff --git a/docs/java.rst b/docs/java.rst deleted file mode 100644 index c817601079..0000000000 --- a/docs/java.rst +++ /dev/null @@ -1,127 +0,0 @@ -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -Java API bindings -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - -.. contents:: - -Presentation ------------- - -The Java bindings make use of `JNA `__ to expos= e the -C API in a Java friendly way. The bindings are based on work initiated by = Toth -Istvan. - -Getting it ----------- - -The latest versions of the libvirt Java bindings can be downloaded from: - -- `libvirt.org HTTP server `__ - -A maven repository is located at https://download.libvirt.org/maven2/ whic= h you -can use to include this in your maven projects. - -GIT source repository ---------------------- - -The Java bindings code source is now maintained in a -`git `__ repository available on -`gitlab.com `__: - -:: - - git clone https://gitlab.com/libvirt/libvirt-java.git - -Building --------- - -The code is built using ant, and assumes that you have the jna jar install= ed. -Once you have downloaded the code you can build the code with - -:: - - - % cd libvirt-java - % ant build - -Content -------- - -The bindings are articulated around a few classes in the ``org/libvirt`` -package, notably the ``Connect``, ``Domain`` and ``Network`` ones. Functio= ns in -the `C API `__ taking ``virConnectPtr``, ``virDomainPtr``= or -``virNetworkPtr`` as their first argument usually become methods for the -classes, their name is just stripped from the virConnect or virDomain(Get) -prefix and the first letter gets converted to lower case, for example the C -functions: - -``int virConnectNumOfDomains (virConnectPtr conn);`` - -``int virDomainSetMaxMemory (virDomainPtr domain, unsigned long memory);`` - -become - -``virConn.numOfDomains()`` - -``virDomain.setMaxMemory(long memory)`` - -There is of course some functions where the mapping is less direct and usi= ng -extra classes to map complex arguments. The -`Javadoc `__ is available online -or as part of a separate libvirt-java-javadoc package. - -So let's look at a simple example inspired from the ``test.java`` test fou= nd in -``src`` in the source tree: - -:: - - import org.libvirt.*; - public class minitest { - public static void main(String[] args) { - Connect conn=3Dnull; - try{ - conn =3D new Connect("test:///default", true); - } catch (LibvirtException e) { - System.out.println("exception caught:"+e); - System.out.println(e.getError()); - } - try{ - Domain testDomain=3Dconn.domainLookupByName("test"); - System.out.println("Domain:" + testDomain.getName() + " id = " + - testDomain.getID() + " running " + - testDomain.getOSType()); - } catch (LibvirtException e) { - System.out.println("exception caught:"+e); - System.out.println(e.getError()); - } - } - } - -There is not much to comment about it, it really is a straight mapping fro= m the -C API, the only points to notice are: - -- the import of the modules in the ``org.libvirt`` package -- getting a connection to the hypervisor, in that case using the readonly - access to the default test hypervisor. -- getting an object representing the test domain using ``lookupByName`` -- if the domain is not found a LibvirtError exception will be raised -- extracting and printing some information about the domain using various - methods associated to the Domain class. - -Maven ------ - -Up until version 0.4.7 the Java bindings were available from the central m= aven -repository. - -If you want to use 0.4.8 or higher, please add the following repository to= your -pom.xml - -:: - - - - libvirt-org - https://download.libvirt.org/maven2 - - diff --git a/docs/meson.build b/docs/meson.build index 4945340a1e..68359be0b4 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -85,7 +85,6 @@ docs_rst_files =3D [ 'hacking', 'hooks', 'issue-handling', - 'java', 'libvirt-go', 'libvirt-go-xml', 'logging', --=20 2.40.0