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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
|
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript"/>
<title>
File: alog-facilities-xmpp.ads
</title>
<link rel='stylesheet' href='support/docgen.css' type='text/css'/>
<script src='support/docgen.js' type='text/javascript' charset='utf-8'></script>
</head>
<body onload="onloadDoc();">
<div id='leftSide'>
<div id='leftSideInside'>
<div id='header'>
<h2 class="button">Documentation</h2>
<a href='index.html'><div class="button2">Table of Contents</div></a>
<a href='tree.html'><div class="button2">Class Inheritance Tree</div></a>
</div>
</div>
</div> <!-- leftSide -->
<div class='subprograms'>
<div class='details'><ol><li id="l1"><pre><span class="comment">--</span> </pre></li>
<li id="l2"><pre><span class="comment">-- Copyright (c) 2008-2009,</span> </pre></li>
<li id="l3"><pre><span class="comment">-- Reto Buerki, Adrian-Ken Rueegsegger</span> </pre></li>
<li id="l4"><pre><span class="comment">-- secunet SwissIT AG</span> </pre></li>
<li id="l5"><pre><span class="comment">--</span> </pre></li>
<li id="l6"><pre><span class="comment">-- This file is part of Alog.</span> </pre></li>
<li id="l7"><pre><span class="comment">--</span> </pre></li>
<li id="l8"><pre><span class="comment">-- Alog is free software; you can redistribute it and/or modify</span> </pre></li>
<li id="l9"><pre><span class="comment">-- it under the terms of the GNU Lesser General Public License as published</span> </pre></li>
<li id="l10"><pre><span class="comment">-- by the Free Software Foundation; either version 2.1 of the License, or</span> </pre></li>
<li id="l11"><pre><span class="comment">-- (at your option) any later version.</span> </pre></li>
<li id="l12"><pre><span class="comment">--</span> </pre></li>
<li id="l13"><pre><span class="comment">-- Alog is distributed in the hope that it will be useful,</span> </pre></li>
<li id="l14"><pre><span class="comment">-- but WITHOUT ANY WARRANTY; without even the implied warranty of</span> </pre></li>
<li id="l15"><pre><span class="comment">-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> </pre></li>
<li id="l16"><pre><span class="comment">-- GNU Lesser General Public License for more details.</span> </pre></li>
<li id="l17"><pre><span class="comment">--</span> </pre></li>
<li id="l18"><pre><span class="comment">-- You should have received a copy of the GNU Lesser General Public License</span> </pre></li>
<li id="l19"><pre><span class="comment">-- along with Alog; if not, write to the Free Software</span> </pre></li>
<li id="l20"><pre><span class="comment">-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,</span> </pre></li>
<li id="l21"><pre><span class="comment">-- MA 02110-1301 USA</span> </pre></li>
<li id="l22"><pre> </pre></li>
<li id="l23"><pre><span class="comment">-- XMPP-Logging (jabber) facility.</span> </pre></li>
<li id="l24"><pre><span class="comment">-- Send log-messages to a configured Jabber ID via a given jabber server.</span> </pre></li>
<li id="l25"><pre><span class="comment">-- AWS must be installed for this facility to work.</span> </pre></li>
<li id="l26"><pre><span class="keyword">package</span> <span class="droplink">Alog.Facilities.XMPP<ul><li><a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:26:25" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities-xmpp.ads.html#l26" title="To spec">To spec</a></li><li><a href="src_alog-facilities-xmpp.adb.html#l27" title="To body">To body</a></li></ul></span> <span class="keyword">is</span> </pre></li>
<li id="l27"><pre> </pre></li>
<li id="l28"><pre> <span class="keyword">type</span> <span class="droplink">Instance<ul><li><a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:28:9" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities-xmpp.ads.html#l83" title="To body">To body</a></li></ul></span> <span class="keyword">is</span> <span class="keyword">new</span> <span class="droplink">Alog.Facilities.Instance<ul><li><a href="alog-facilities.ads.html#alog-facilities.ads:38:9" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities.ads.html#l38" title="To spec">To spec</a></li><li><a href="src_alog-facilities.ads.html#l127" title="To body">To body</a></li></ul></span> <span class="keyword">with</span> <span class="keyword">private</span>; </pre></li>
<li id="l29"><pre> <span class="comment">-- XMPP based logging facility.</span> </pre></li>
<li id="l30"><pre> </pre></li>
<li id="l31"><pre> <span class="keyword">type</span> <a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:31:9" title="defined at alog-facilities-xmpp.ads:31:9">Handle</a> <span class="keyword">is</span> <span class="keyword">access</span> <span class="keyword">all</span> <span class="droplink">Instance<ul><li><a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:28:9" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities-xmpp.ads.html#l28" title="To spec">To spec</a></li><li><a href="src_alog-facilities-xmpp.ads.html#l83" title="To body">To body</a></li></ul></span>; </pre></li>
<li id="l32"><pre> </pre></li>
<li id="l33"><pre> <span class="keyword">procedure</span> <span class="droplink">Set_Sender<ul><li><a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:33:14" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities-xmpp.adb.html#l42" title="To body">To body</a></li></ul></span> </pre></li>
<li id="l34"><pre> (<span class="droplink">Facility<ul><li><a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:34:7" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities-xmpp.adb.html#l43" title="To body">To body</a></li></ul></span> : <span class="keyword">in</span> <span class="keyword">out</span> <span class="droplink">Instance<ul><li><a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:28:9" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities-xmpp.ads.html#l28" title="To spec">To spec</a></li><li><a href="src_alog-facilities-xmpp.ads.html#l83" title="To body">To body</a></li></ul></span>; </pre></li>
<li id="l35"><pre> <a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:35:7" title="defined at alog-facilities-xmpp.ads:35:7">JID</a> : String; </pre></li>
<li id="l36"><pre> <a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:36:7" title="defined at alog-facilities-xmpp.ads:36:7">Password</a> : String); </pre></li>
<li id="l37"><pre> <span class="comment">-- Set sender for log messages. This procedure MUST be called before</span> </pre></li>
<li id="l38"><pre> <span class="comment">-- subsequent calls to Write_Message().</span> </pre></li>
<li id="l39"><pre> </pre></li>
<li id="l40"><pre> <span class="keyword">procedure</span> <span class="droplink">Set_Recipient<ul><li><a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:40:14" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities-xmpp.adb.html#l31" title="To body">To body</a></li></ul></span> </pre></li>
<li id="l41"><pre> (<span class="droplink">Facility<ul><li><a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:41:7" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities-xmpp.adb.html#l32" title="To body">To body</a></li></ul></span> : <span class="keyword">in</span> <span class="keyword">out</span> <span class="droplink">Instance<ul><li><a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:28:9" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities-xmpp.ads.html#l28" title="To spec">To spec</a></li><li><a href="src_alog-facilities-xmpp.ads.html#l83" title="To body">To body</a></li></ul></span>; </pre></li>
<li id="l42"><pre> <a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:42:7" title="defined at alog-facilities-xmpp.ads:42:7">JID</a> : String); </pre></li>
<li id="l43"><pre> <span class="comment">-- Set recipient for log-messages. This procedure MUST be called before</span> </pre></li>
<li id="l44"><pre> <span class="comment">-- subsequent calls to Write_Message().</span> </pre></li>
<li id="l45"><pre> </pre></li>
<li id="l46"><pre> <span class="keyword">procedure</span> <span class="droplink">Set_Server<ul><li><a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:46:14" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities-xmpp.adb.html#l55" title="To body">To body</a></li></ul></span> </pre></li>
<li id="l47"><pre> (<span class="droplink">Facility<ul><li><a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:47:7" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities-xmpp.adb.html#l56" title="To body">To body</a></li></ul></span> : <span class="keyword">in</span> <span class="keyword">out</span> <span class="droplink">Instance<ul><li><a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:28:9" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities-xmpp.ads.html#l28" title="To spec">To spec</a></li><li><a href="src_alog-facilities-xmpp.ads.html#l83" title="To body">To body</a></li></ul></span>; </pre></li>
<li id="l48"><pre> <a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:48:7" title="defined at alog-facilities-xmpp.ads:48:7">Name</a> : String); </pre></li>
<li id="l49"><pre> <span class="comment">-- Set server for log-messages. This procedure MUST be called before</span> </pre></li>
<li id="l50"><pre> <span class="comment">-- subsequent calls to Write_Message().</span> </pre></li>
<li id="l51"><pre> </pre></li>
<li id="l52"><pre> <a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:52:4" title="defined at alog-facilities-xmpp.ads:52:4">No_Sender</a> : <span class="keyword">exception</span>; </pre></li>
<li id="l53"><pre> <span class="comment">-- No sender ID specified. Cannot send message.</span> </pre></li>
<li id="l54"><pre> </pre></li>
<li id="l55"><pre> <a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:55:4" title="defined at alog-facilities-xmpp.ads:55:4">No_Recipient</a> : <span class="keyword">exception</span>; </pre></li>
<li id="l56"><pre> <span class="comment">-- No recipient specified. Cannot send message.</span> </pre></li>
<li id="l57"><pre> </pre></li>
<li id="l58"><pre> <a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:58:4" title="defined at alog-facilities-xmpp.ads:58:4">No_Server</a> : <span class="keyword">exception</span>; </pre></li>
<li id="l59"><pre> <span class="comment">-- No server specified. Cannot send message.</span> </pre></li>
<li id="l60"><pre> </pre></li>
<li id="l61"><pre> <a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:61:4" title="defined at alog-facilities-xmpp.ads:61:4">Recipient_Not_Present</a> : <span class="keyword">exception</span>; </pre></li>
<li id="l62"><pre> <span class="comment">-- Recipient can not be reached through specified server.</span> </pre></li>
<li id="l63"><pre> </pre></li>
<li id="l64"><pre> <a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:64:4" title="defined at alog-facilities-xmpp.ads:64:4">Delivery_Failed</a> : <span class="keyword">exception</span>; </pre></li>
<li id="l65"><pre> <span class="comment">-- Message could not be delivered.</span> </pre></li>
<li id="l66"><pre> </pre></li>
<li id="l67"><pre><span class="keyword">private</span> </pre></li>
<li id="l68"><pre> </pre></li>
<li id="l69"><pre> <span class="keyword">overriding</span> </pre></li>
<li id="l70"><pre> <span class="keyword">procedure</span> Write </pre></li>
<li id="l71"><pre> (Facility : <span class="droplink">Instance<ul><li><a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:28:9" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities-xmpp.ads.html#l28" title="To spec">To spec</a></li><li><a href="src_alog-facilities-xmpp.ads.html#l83" title="To body">To body</a></li></ul></span>; </pre></li>
<li id="l72"><pre> Level : <span class="droplink">Log_Level<ul><li><a href="alog.ads.html#alog.ads:32:9" title="To API doc">To API doc</a></li><li><a href="src_alog.ads.html#l32" title="To spec">To spec</a></li></ul></span> := Info; </pre></li>
<li id="l73"><pre> Msg : String); </pre></li>
<li id="l74"><pre> <span class="comment">-- Implementation of the Write procedure for XMPP.</span> </pre></li>
<li id="l75"><pre> </pre></li>
<li id="l76"><pre> <span class="keyword">type</span> Sender_Account <span class="keyword">is</span> <span class="keyword">tagged</span> </pre></li>
<li id="l77"><pre> <span class="keyword">record</span> </pre></li>
<li id="l78"><pre> JID : Unbounded_String; </pre></li>
<li id="l79"><pre> Password : Unbounded_String; </pre></li>
<li id="l80"><pre> <span class="keyword">end</span> <span class="keyword">record</span>; </pre></li>
<li id="l81"><pre> <span class="comment">-- Holds sender information.</span> </pre></li>
<li id="l82"><pre> </pre></li>
<li id="l83"><pre> <span class="keyword">type</span> <span class="droplink">Instance<ul><li><a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:28:9" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities-xmpp.ads.html#l28" title="To spec">To spec</a></li></ul></span> <span class="keyword">is</span> <span class="keyword">new</span> <span class="droplink">Alog.Facilities.Instance<ul><li><a href="alog-facilities.ads.html#alog-facilities.ads:38:9" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities.ads.html#l38" title="To spec">To spec</a></li><li><a href="src_alog-facilities.ads.html#l127" title="To body">To body</a></li></ul></span> <span class="keyword">with</span> <span class="keyword">record</span> </pre></li>
<li id="l84"><pre> Sender : Sender_Account := </pre></li>
<li id="l85"><pre> (JID => To_Unbounded_String (<span class="string">"alog@localhost"</span>), </pre></li>
<li id="l86"><pre> Password => To_Unbounded_String (<span class="string">""</span>)); </pre></li>
<li id="l87"><pre> <span class="comment">-- Notification sender JID/password.</span> </pre></li>
<li id="l88"><pre> </pre></li>
<li id="l89"><pre> Is_Sender : Boolean := False; </pre></li>
<li id="l90"><pre> <span class="comment">-- Indicates whether sender id is set.</span> </pre></li>
<li id="l91"><pre> </pre></li>
<li id="l92"><pre> Server : Unbounded_String; </pre></li>
<li id="l93"><pre> <span class="comment">-- Server to connect to.</span> </pre></li>
<li id="l94"><pre> </pre></li>
<li id="l95"><pre> Is_Server : Boolean := False; </pre></li>
<li id="l96"><pre> <span class="comment">-- Indicates whether a server is set.</span> </pre></li>
<li id="l97"><pre> </pre></li>
<li id="l98"><pre> Recipient : Unbounded_String; </pre></li>
<li id="l99"><pre> <span class="comment">-- Recipient for log-mails. Must be specified before calling</span> </pre></li>
<li id="l100"><pre> <span class="comment">-- Write_Message(), else No_Recipient exception is thrown.</span> </pre></li>
<li id="l101"><pre> </pre></li>
<li id="l102"><pre> Is_Recipient : Boolean := False; </pre></li>
<li id="l103"><pre> <span class="comment">-- Indicates whether a recipient is set.</span> </pre></li>
<li id="l104"><pre> </pre></li>
<li id="l105"><pre> Subject : Unbounded_String := </pre></li>
<li id="l106"><pre> To_Unbounded_String (<span class="string">"Alog: Log-Message"</span>); </pre></li>
<li id="l107"><pre> <span class="comment">-- Subject of messages from Alog-System (default: Alog: Log-Message).</span> </pre></li>
<li id="l108"><pre> <span class="keyword">end</span> <span class="keyword">record</span>; </pre></li>
<li id="l109"><pre> </pre></li>
<li id="l110"><pre><span class="keyword">end</span> <span class="droplink">Alog.Facilities.XMPP<ul><li><a href="alog-facilities-xmpp.ads.html#alog-facilities-xmpp.ads:26:25" title="To API doc">To API doc</a></li><li><a href="src_alog-facilities-xmpp.ads.html#l26" title="To spec">To spec</a></li><li><a href="src_alog-facilities-xmpp.adb.html#l27" title="To body">To body</a></li></ul></span>; </pre></li>
</ol></div>
</div>
</body>
</html>
|