This file is indexed.

/usr/share/ada/adainclude/alog/alog-facilities-xmpp.ads is in libalog0.4.1-base-dev 0.4.1-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
--
--  Copyright (c) 2008-2009,
--  Reto Buerki, Adrian-Ken Rueegsegger
--
--  This file is part of Alog.
--
--  Alog is free software; you can redistribute it and/or modify
--  it under the terms of the GNU Lesser General Public License as published
--  by the Free Software Foundation; either version 2.1 of the License, or
--  (at your option) any later version.
--
--  Alog is distributed in the hope that it will be useful,
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--  GNU Lesser General Public License for more details.
--
--  You should have received a copy of the GNU Lesser General Public License
--  along with Alog; if not, write to the Free Software
--  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
--  MA  02110-1301  USA

--  XMPP-Logging (jabber) facility.
--  Send log-messages to a configured Jabber ID via a given jabber server.
--  AWS must be installed for this facility to work.
package Alog.Facilities.XMPP is

   type Instance is new Alog.Facilities.Instance with private;
   --  XMPP based logging facility.

   type Handle is access all Instance;

   procedure Set_Sender
     (Facility : in out Instance;
      JID      :        String;
      Password :        String);
   --  Set sender for log messages. This procedure MUST be called before
   --  subsequent calls to Write_Message().

   procedure Set_Recipient
     (Facility : in out Instance;
      JID      :        String);
   --  Set recipient for log-messages. This procedure MUST be called before
   --  subsequent calls to Write_Message().

   procedure Set_Server
     (Facility : in out Instance;
      Name     :        String);
   --  Set server for log-messages. This procedure MUST be called before
   --  subsequent calls to Write_Message().

   No_Sender             : exception;
   --  No sender ID specified. Cannot send message.

   No_Recipient          : exception;
   --  No recipient specified. Cannot send message.

   No_Server             : exception;
   --  No server specified. Cannot send message.

   Recipient_Not_Present : exception;
   --  Recipient can not be reached through specified server.

   Delivery_Failed       : exception;
   --  Message could not be delivered.

private

   overriding
   procedure Write
     (Facility : Instance;
      Level    : Log_Level := Info;
      Msg      : String);
   --  Implementation of the Write procedure for XMPP.

   type Sender_Account is tagged
      record
         JID      : Unbounded_String;
         Password : Unbounded_String;
      end record;
   --  Holds sender information.

   type Instance is new Alog.Facilities.Instance with record
      Sender       : Sender_Account :=
        (JID      => To_Unbounded_String ("alog@localhost"),
         Password => To_Unbounded_String (""));
      --  Notification sender JID/password.

      Is_Sender    : Boolean := False;
      --  Indicates whether sender id is set.

      Server       : Unbounded_String;
      --  Server to connect to.

      Is_Server    : Boolean := False;
      --  Indicates whether a server is set.

      Recipient    : Unbounded_String;
      --  Recipient for log-mails. Must be specified before calling
      --  Write_Message(), else No_Recipient exception is thrown.

      Is_Recipient : Boolean := False;
      --  Indicates whether a recipient is set.

      Subject      : Unbounded_String :=
        To_Unbounded_String ("Alog: Log-Message");
      --  Subject of messages from Alog-System (default: Alog: Log-Message).
   end record;

end Alog.Facilities.XMPP;