]> git.mxchange.org Git - hub.git/blob - application/hub/exceptions/node/class_NodeSessionIdVerficationException.php
7f4e20646a3500ca5af8ad4f699e76ec47331820
[hub.git] / application / hub / exceptions / node / class_NodeSessionIdVerficationException.php
1 <?php
2 /**
3  * This exception is thrown when a provided session id in a message cannot be
4  * verified. This can be the case when e.g. it doesn't match any records or the
5  * IP/port combination doesn't match to it.
6  *
7  * @author              Roland Haeder <webmaster@ship-simu.org>
8  * @version             0.0.0
9  * @copyright   Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
10  * @license             GNU GPL 3.0 or any newer version
11  * @link                http://www.ship-simu.org
12  *
13  * This program is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation, either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program. If not, see <http://www.gnu.org/licenses/>.
25  */
26 class NodeSessionIdVerficationException extends FrameworkException {
27         /**
28          * The super constructor for all exceptions
29          *
30          * @param       $messageArray   Error message array
31          * @param       $code                   Error code
32          * @return      void
33          */
34         public function __construct (array $messageArray, $code) {
35                 // Construct the message
36                 $message = sprintf("[%s:%d] Session id %s cannot be verfied. ip=%s/%s,listen port=%s,status=%s.",
37                         $messageArray[0]->__toString(),
38                         $this->getLine(),
39                         $messageArray[1][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID],
40                         $messageArray[1][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP],
41                         $messageArray[1][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP],
42                         $messageArray[1][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_LISTEN_PORT],
43                         $messageArray[1][XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS]
44                 );
45
46                 // Call parent exception constructor
47                 parent::__construct($message, $code);
48         }
49 }
50
51 // [EOF]
52 ?>