org/sonews/daemon/command/XPatCommand.java
author chris <chris@marvin>
Wed, 01 Jul 2009 10:48:22 +0200
changeset 2 1090e2141798
parent 1 6fceb66e1ad7
child 3 2fdc9cc89502
permissions -rw-r--r--
sonews/0.5.1 fixes merged
     1 /*
     2  *   SONEWS News Server
     3  *   see AUTHORS for the list of contributors
     4  *
     5  *   This program is free software: you can redistribute it and/or modify
     6  *   it under the terms of the GNU General Public License as published by
     7  *   the Free Software Foundation, either version 3 of the License, or
     8  *   (at your option) any later version.
     9  *
    10  *   This program is distributed in the hope that it will be useful,
    11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13  *   GNU General Public License for more details.
    14  *
    15  *   You should have received a copy of the GNU General Public License
    16  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
    17  */
    18 
    19 package org.sonews.daemon.command;
    20 
    21 import java.io.IOException;
    22 import java.sql.SQLException;
    23 import org.sonews.daemon.NNTPConnection;
    24 
    25 /**
    26  * <pre>
    27  *   XPAT header range|<message-id> pat [pat...]
    28  *
    29  *   The XPAT command is used to retrieve specific headers from
    30  *   specific articles, based on pattern matching on the contents of
    31  *   the header. This command was first available in INN.
    32  *
    33  *   The required header parameter is the name of a header line (e.g.
    34  *   "subject") in a news group article. See RFC-1036 for a list
    35  *   of valid header lines. The required range argument may be
    36  *   any of the following:
    37  *               an article number
    38  *               an article number followed by a dash to indicate
    39  *                  all following
    40  *               an article number followed by a dash followed by
    41  *                  another article number
    42  *
    43  *   The required message-id argument indicates a specific
    44  *   article. The range and message-id arguments are mutually
    45  *   exclusive. At least one pattern in wildmat must be specified
    46  *   as well. If there are additional arguments the are joined
    47  *   together separated by a single space to form one complete
    48  *   pattern. Successful responses start with a 221 response
    49  *   followed by a the headers from all messages in which the
    50  *   pattern matched the contents of the specified header line. This
    51  *   includes an empty list. Once the output is complete, a period
    52  *   is sent on a line by itself. If the optional argument is a
    53  *   message-id and no such article exists, the 430 error response
    54  *   is returned. A 502 response will be returned if the client only
    55  *   has permission to transfer articles.
    56  *
    57  *   Responses
    58  *
    59  *       221 Header follows
    60  *       430 no such article
    61  *       502 no permission
    62  * </pre>
    63  * [Source:"draft-ietf-nntp-imp-02.txt"] [Copyright: 1998 S. Barber]
    64  * 
    65  * @author Christian Lins
    66  * @since sonews/0.5.0
    67  */
    68 public class XPatCommand extends AbstractCommand
    69 {
    70 
    71   public XPatCommand(final NNTPConnection conn)
    72   {
    73     super(conn);
    74   }
    75   
    76   @Override
    77   public boolean hasFinished()
    78   {
    79     return true;
    80   }
    81 
    82   @Override
    83   public void processLine(final String line) 
    84     throws IOException, SQLException
    85   {
    86     printStatus(500, "not (yet) supported");
    87   }
    88 
    89 }