org/sonews/daemon/command/XPatCommand.java
author chris <chris@marvin>
Fri Jun 26 16:48:50 2009 +0200 (2009-06-26)
changeset 1 6fceb66e1ad7
child 3 2fdc9cc89502
permissions -rw-r--r--
Hooray... sonews/0.5.0 final

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