Add stubs for org.sonews.acl and add method "impliedCapability" for org.sonews.command.Command interface.
authorcli
Mon Aug 24 13:00:05 2009 +0200 (2009-08-24)
changeset 206ae5e4f8329b
parent 19 91dc9acb03ed
child 21 4b2c8bedb094
Add stubs for org.sonews.acl and add method "impliedCapability" for org.sonews.command.Command interface.
org/sonews/acl/AccessControl.java
org/sonews/acl/AuthInfoCommand.java
org/sonews/daemon/command/ArticleCommand.java
org/sonews/daemon/command/CapabilitiesCommand.java
org/sonews/daemon/command/Command.java
org/sonews/daemon/command/GroupCommand.java
org/sonews/daemon/command/HelpCommand.java
org/sonews/daemon/command/ListCommand.java
org/sonews/daemon/command/ListGroupCommand.java
org/sonews/daemon/command/ModeReaderCommand.java
org/sonews/daemon/command/NewGroupsCommand.java
org/sonews/daemon/command/NextPrevCommand.java
org/sonews/daemon/command/OverCommand.java
org/sonews/daemon/command/PostCommand.java
org/sonews/daemon/command/QuitCommand.java
org/sonews/daemon/command/StatCommand.java
org/sonews/daemon/command/UnsupportedCommand.java
org/sonews/daemon/command/XDaemonCommand.java
org/sonews/daemon/command/XPatCommand.java
org/sonews/storage/StorageProvider.java
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/org/sonews/acl/AccessControl.java	Mon Aug 24 13:00:05 2009 +0200
     1.3 @@ -0,0 +1,31 @@
     1.4 +/*
     1.5 + *   SONEWS News Server
     1.6 + *   see AUTHORS for the list of contributors
     1.7 + *
     1.8 + *   This program is free software: you can redistribute it and/or modify
     1.9 + *   it under the terms of the GNU General Public License as published by
    1.10 + *   the Free Software Foundation, either version 3 of the License, or
    1.11 + *   (at your option) any later version.
    1.12 + *
    1.13 + *   This program is distributed in the hope that it will be useful,
    1.14 + *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 + *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.16 + *   GNU General Public License for more details.
    1.17 + *
    1.18 + *   You should have received a copy of the GNU General Public License
    1.19 + *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1.20 + */
    1.21 +
    1.22 +package org.sonews.acl;
    1.23 +
    1.24 +/**
    1.25 + *
    1.26 + * @author Christian Lins
    1.27 + * @since sonews/1.1
    1.28 + */
    1.29 +public interface AccessControl
    1.30 +{
    1.31 +
    1.32 +  boolean hasPermission(String user, char[] secret, String permission);
    1.33 +
    1.34 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/org/sonews/acl/AuthInfoCommand.java	Mon Aug 24 13:00:05 2009 +0200
     2.3 @@ -0,0 +1,29 @@
     2.4 +/*
     2.5 + *   SONEWS News Server
     2.6 + *   see AUTHORS for the list of contributors
     2.7 + *
     2.8 + *   This program is free software: you can redistribute it and/or modify
     2.9 + *   it under the terms of the GNU General Public License as published by
    2.10 + *   the Free Software Foundation, either version 3 of the License, or
    2.11 + *   (at your option) any later version.
    2.12 + *
    2.13 + *   This program is distributed in the hope that it will be useful,
    2.14 + *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.15 + *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2.16 + *   GNU General Public License for more details.
    2.17 + *
    2.18 + *   You should have received a copy of the GNU General Public License
    2.19 + *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
    2.20 + */
    2.21 +
    2.22 +package org.sonews.acl;
    2.23 +
    2.24 +/**
    2.25 + *
    2.26 + * @author Christian Lins
    2.27 + * @since sonews/1.1
    2.28 + */
    2.29 +public class AuthInfoCommand
    2.30 +{
    2.31 +
    2.32 +}
     3.1 --- a/org/sonews/daemon/command/ArticleCommand.java	Fri Aug 21 17:40:54 2009 +0200
     3.2 +++ b/org/sonews/daemon/command/ArticleCommand.java	Mon Aug 24 13:00:05 2009 +0200
     3.3 @@ -46,6 +46,12 @@
     3.4    }
     3.5  
     3.6    @Override
     3.7 +  public String impliedCapability()
     3.8 +  {
     3.9 +    return null;
    3.10 +  }
    3.11 +
    3.12 +  @Override
    3.13    public boolean isStateful()
    3.14    {
    3.15      return false;
     4.1 --- a/org/sonews/daemon/command/CapabilitiesCommand.java	Fri Aug 21 17:40:54 2009 +0200
     4.2 +++ b/org/sonews/daemon/command/CapabilitiesCommand.java	Mon Aug 24 13:00:05 2009 +0200
     4.3 @@ -23,18 +23,18 @@
     4.4  
     4.5  /**
     4.6   * <pre>
     4.7 - * The CAPABILITIES command allows a client to determine the
     4.8 - * capabilities of the server at any given time.
     4.9 + *  The CAPABILITIES command allows a client to determine the
    4.10 + *  capabilities of the server at any given time.
    4.11   *
    4.12 - * This command MAY be issued at any time; the server MUST NOT require
    4.13 - * it to be issued in order to make use of any capability. The response
    4.14 - * generated by this command MAY change during a session because of
    4.15 - * other state information (which, in turn, may be changed by the
    4.16 - * effects of other commands or by external events).  An NNTP client is
    4.17 - * only able to get the current and correct information concerning
    4.18 - * available capabilities at any point during a session by issuing a
    4.19 - * CAPABILITIES command at that point of that session and processing the
    4.20 - * response.
    4.21 + *  This command MAY be issued at any time; the server MUST NOT require
    4.22 + *  it to be issued in order to make use of any capability. The response
    4.23 + *  generated by this command MAY change during a session because of
    4.24 + *  other state information (which, in turn, may be changed by the
    4.25 + *  effects of other commands or by external events).  An NNTP client is
    4.26 + *  only able to get the current and correct information concerning
    4.27 + *  available capabilities at any point during a session by issuing a
    4.28 + *  CAPABILITIES command at that point of that session and processing the
    4.29 + *  response.
    4.30   * </pre>
    4.31   * @author Christian Lins
    4.32   * @since sonews/0.5.0
    4.33 @@ -67,6 +67,12 @@
    4.34    }
    4.35  
    4.36    @Override
    4.37 +  public String impliedCapability()
    4.38 +  {
    4.39 +    return null;
    4.40 +  }
    4.41 +  
    4.42 +  @Override
    4.43    public boolean isStateful()
    4.44    {
    4.45      return false;
     5.1 --- a/org/sonews/daemon/command/Command.java	Fri Aug 21 17:40:54 2009 +0200
     5.2 +++ b/org/sonews/daemon/command/Command.java	Mon Aug 24 13:00:05 2009 +0200
     5.3 @@ -30,8 +30,17 @@
     5.4  public interface Command
     5.5  {
     5.6  
     5.7 +  /**
     5.8 +   * @return true if this instance can be reused.
     5.9 +   */
    5.10    boolean hasFinished();
    5.11  
    5.12 +  /**
    5.13 +   * Returns capability string that is implied by this command class.
    5.14 +   * MAY return null if the command is required by the NNTP standard.
    5.15 +   */
    5.16 +  String impliedCapability();
    5.17 +
    5.18    boolean isStateful();
    5.19  
    5.20    String[] getSupportedCommandStrings();
     6.1 --- a/org/sonews/daemon/command/GroupCommand.java	Fri Aug 21 17:40:54 2009 +0200
     6.2 +++ b/org/sonews/daemon/command/GroupCommand.java	Mon Aug 24 13:00:05 2009 +0200
     6.3 @@ -61,6 +61,12 @@
     6.4    }
     6.5  
     6.6    @Override
     6.7 +  public String impliedCapability()
     6.8 +  {
     6.9 +    return null;
    6.10 +  }
    6.11 +
    6.12 +  @Override
    6.13    public boolean isStateful()
    6.14    {
    6.15      return true;
     7.1 --- a/org/sonews/daemon/command/HelpCommand.java	Fri Aug 21 17:40:54 2009 +0200
     7.2 +++ b/org/sonews/daemon/command/HelpCommand.java	Mon Aug 24 13:00:05 2009 +0200
     7.3 @@ -40,6 +40,12 @@
     7.4    }
     7.5  
     7.6    @Override
     7.7 +  public String impliedCapability()
     7.8 +  {
     7.9 +    return null;
    7.10 +  }
    7.11 +
    7.12 +  @Override
    7.13    public boolean isStateful()
    7.14    {
    7.15      return true;
     8.1 --- a/org/sonews/daemon/command/ListCommand.java	Fri Aug 21 17:40:54 2009 +0200
     8.2 +++ b/org/sonews/daemon/command/ListCommand.java	Mon Aug 24 13:00:05 2009 +0200
     8.3 @@ -50,6 +50,12 @@
     8.4    }
     8.5  
     8.6    @Override
     8.7 +  public String impliedCapability()
     8.8 +  {
     8.9 +    return null;
    8.10 +  }
    8.11 +
    8.12 +  @Override
    8.13    public boolean isStateful()
    8.14    {
    8.15      return false;
     9.1 --- a/org/sonews/daemon/command/ListGroupCommand.java	Fri Aug 21 17:40:54 2009 +0200
     9.2 +++ b/org/sonews/daemon/command/ListGroupCommand.java	Mon Aug 24 13:00:05 2009 +0200
     9.3 @@ -46,6 +46,12 @@
     9.4    }
     9.5  
     9.6    @Override
     9.7 +  public String impliedCapability()
     9.8 +  {
     9.9 +    return null;
    9.10 +  }
    9.11 +
    9.12 +  @Override
    9.13    public boolean isStateful()
    9.14    {
    9.15      return false;
    10.1 --- a/org/sonews/daemon/command/ModeReaderCommand.java	Fri Aug 21 17:40:54 2009 +0200
    10.2 +++ b/org/sonews/daemon/command/ModeReaderCommand.java	Mon Aug 24 13:00:05 2009 +0200
    10.3 @@ -44,6 +44,12 @@
    10.4    }
    10.5  
    10.6    @Override
    10.7 +  public String impliedCapability()
    10.8 +  {
    10.9 +    return null;
   10.10 +  }
   10.11 +
   10.12 +  @Override
   10.13    public boolean isStateful()
   10.14    {
   10.15      return false;
    11.1 --- a/org/sonews/daemon/command/NewGroupsCommand.java	Fri Aug 21 17:40:54 2009 +0200
    11.2 +++ b/org/sonews/daemon/command/NewGroupsCommand.java	Mon Aug 24 13:00:05 2009 +0200
    11.3 @@ -44,6 +44,12 @@
    11.4    }
    11.5  
    11.6    @Override
    11.7 +  public String impliedCapability()
    11.8 +  {
    11.9 +    return null;
   11.10 +  }
   11.11 +
   11.12 +  @Override
   11.13    public boolean isStateful()
   11.14    {
   11.15      return false;
    12.1 --- a/org/sonews/daemon/command/NextPrevCommand.java	Fri Aug 21 17:40:54 2009 +0200
    12.2 +++ b/org/sonews/daemon/command/NextPrevCommand.java	Mon Aug 24 13:00:05 2009 +0200
    12.3 @@ -46,6 +46,12 @@
    12.4    }
    12.5  
    12.6    @Override
    12.7 +  public String impliedCapability()
    12.8 +  {
    12.9 +    return null;
   12.10 +  }
   12.11 +
   12.12 +  @Override
   12.13    public boolean isStateful()
   12.14    {
   12.15      return false;
    13.1 --- a/org/sonews/daemon/command/OverCommand.java	Fri Aug 21 17:40:54 2009 +0200
    13.2 +++ b/org/sonews/daemon/command/OverCommand.java	Mon Aug 24 13:00:05 2009 +0200
    13.3 @@ -124,6 +124,12 @@
    13.4    }
    13.5  
    13.6    @Override
    13.7 +  public String impliedCapability()
    13.8 +  {
    13.9 +    return null;
   13.10 +  }
   13.11 +
   13.12 +  @Override
   13.13    public boolean isStateful()
   13.14    {
   13.15      return false;
    14.1 --- a/org/sonews/daemon/command/PostCommand.java	Fri Aug 21 17:40:54 2009 +0200
    14.2 +++ b/org/sonews/daemon/command/PostCommand.java	Mon Aug 24 13:00:05 2009 +0200
    14.3 @@ -71,6 +71,12 @@
    14.4    }
    14.5  
    14.6    @Override
    14.7 +  public String impliedCapability()
    14.8 +  {
    14.9 +    return null;
   14.10 +  }
   14.11 +
   14.12 +  @Override
   14.13    public boolean isStateful()
   14.14    {
   14.15      return true;
    15.1 --- a/org/sonews/daemon/command/QuitCommand.java	Fri Aug 21 17:40:54 2009 +0200
    15.2 +++ b/org/sonews/daemon/command/QuitCommand.java	Mon Aug 24 13:00:05 2009 +0200
    15.3 @@ -43,6 +43,12 @@
    15.4    }
    15.5  
    15.6    @Override
    15.7 +  public String impliedCapability()
    15.8 +  {
    15.9 +    return null;
   15.10 +  }
   15.11 +
   15.12 +  @Override
   15.13    public boolean isStateful()
   15.14    {
   15.15      return false;
    16.1 --- a/org/sonews/daemon/command/StatCommand.java	Fri Aug 21 17:40:54 2009 +0200
    16.2 +++ b/org/sonews/daemon/command/StatCommand.java	Mon Aug 24 13:00:05 2009 +0200
    16.3 @@ -44,6 +44,12 @@
    16.4    }
    16.5  
    16.6    @Override
    16.7 +  public String impliedCapability()
    16.8 +  {
    16.9 +    return null;
   16.10 +  }
   16.11 +
   16.12 +  @Override
   16.13    public boolean isStateful()
   16.14    {
   16.15      return false;
    17.1 --- a/org/sonews/daemon/command/UnsupportedCommand.java	Fri Aug 21 17:40:54 2009 +0200
    17.2 +++ b/org/sonews/daemon/command/UnsupportedCommand.java	Mon Aug 24 13:00:05 2009 +0200
    17.3 @@ -46,6 +46,12 @@
    17.4    }
    17.5  
    17.6    @Override
    17.7 +  public String impliedCapability()
    17.8 +  {
    17.9 +    return null;
   17.10 +  }
   17.11 +
   17.12 +  @Override
   17.13    public boolean isStateful()
   17.14    {
   17.15      return false;
    18.1 --- a/org/sonews/daemon/command/XDaemonCommand.java	Fri Aug 21 17:40:54 2009 +0200
    18.2 +++ b/org/sonews/daemon/command/XDaemonCommand.java	Mon Aug 24 13:00:05 2009 +0200
    18.3 @@ -55,6 +55,12 @@
    18.4    }
    18.5  
    18.6    @Override
    18.7 +  public String impliedCapability()
    18.8 +  {
    18.9 +    return null;
   18.10 +  }
   18.11 +
   18.12 +  @Override
   18.13    public boolean isStateful()
   18.14    {
   18.15      return false;
    19.1 --- a/org/sonews/daemon/command/XPatCommand.java	Fri Aug 21 17:40:54 2009 +0200
    19.2 +++ b/org/sonews/daemon/command/XPatCommand.java	Mon Aug 24 13:00:05 2009 +0200
    19.3 @@ -91,6 +91,12 @@
    19.4    }
    19.5  
    19.6    @Override
    19.7 +  public String impliedCapability()
    19.8 +  {
    19.9 +    return null;
   19.10 +  }
   19.11 +
   19.12 +  @Override
   19.13    public boolean isStateful()
   19.14    {
   19.15      return false;
    20.1 --- a/org/sonews/storage/StorageProvider.java	Fri Aug 21 17:40:54 2009 +0200
    20.2 +++ b/org/sonews/storage/StorageProvider.java	Mon Aug 24 13:00:05 2009 +0200
    20.3 @@ -19,7 +19,7 @@
    20.4  package org.sonews.storage;
    20.5  
    20.6  /**
    20.7 - *
    20.8 + * Provides access to storage backend instances.
    20.9   * @author Christian Lins
   20.10   * @since sonews/1.0
   20.11   */