Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.nntp
Class NNTPServerConfig

java.lang.Object
  extended by com.jivesoftware.forum.nntp.NNTPServerConfig

public class NNTPServerConfig
extends java.lang.Object

The configuration settings for server behavior when article reading (POST) and writing (ARTICLE).


Method Summary
 java.lang.String getAnonymousUsername()
          Retrieves the author name for users without viewable user information.
 java.lang.String getDefaultSubject()
          Returns the default subject, which is the subject that will be used if a user does not provide a subject when posting through NNTP.
 java.lang.String getEmptyListGroupName()
          Obtain the name of the news group to return for 'empty' responses to the LIST command.
 java.lang.String getGlobalMessageFooter()
           
static NNTPServerConfig getInstance()
           
 int getMaxHeaderLength()
          Obtains the maximum lenght of a header line before it is folded.
 java.lang.String getMimeCharacterEncoding()
          Obtain the MIME character encoding name that should be used when encoding outgoing message bodies.
 java.nio.charset.Charset getMimeCharset()
          Obtain the MIME character encoder that should be used when encoding outgoing message bodies.
 java.lang.String getMimeIntro()
          Retrieves the mime introductory text.
 java.lang.String getName()
          Retrieves the name of the server.
 int getWriteBufferSize()
          Obtains the size of the write buffer used for the server when generating articles to be posted.
 boolean isAttachmentsAllowed()
          Returns true if attachments will be sent/received from clients.
 boolean isCrossPostingAllowed()
          Returns true if cross-posting is allowed.
 boolean isEmptyList()
          Obtain flag indicating if the LIST and NEWGROUPS command should return an empty response.
 boolean isEmptyNewNews()
          Obtain a flag indicating if the NEWNEWS command should return an empty response.
 void setAnonymousUsername(java.lang.String username)
          Sets the string to use when identifying an author that doesn't have any viewable user information.
 void setAttachmentsAllowed(boolean allowed)
          Enables the server to send/receive attachments from clients.
 void setCrossPostingAllowed(boolean allowed)
          Enables or disables cross-posting.
 void setDefaultSubject(java.lang.String subject)
          Sets the default subject, which is the subject that will be used if a user does not provide a subject when posting through NNTP.
 void setEmptyList(boolean list)
          Set the empty list configuration of this server.
 void setEmptyListGroupName(java.lang.String newName)
          Sets the name of the group to return on empty LIST responses.
 void setEmptyNewNews(boolean newNews)
          Set the empty newnews configuration for this server.
 void setGlobalMessageFooter(java.lang.String messageFooter)
           
 void setMaxHeaderLength(int headerLength)
          Sets the maximum length of a header line before it is folded.
 void setMimeIntro(java.lang.String intro)
          Sets the introductory text that is placed above a MIME multi-part body.
 void setName(java.lang.String hostName)
          Sets the name of the server.
 void setWriteBufferSize(int size)
          Sets the size of the write buffer used for the server when generating articles to be posted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static NNTPServerConfig getInstance()

getName

public java.lang.String getName()
Retrieves the name of the server.

Returns:
the host name of the NNTP server

setName

public void setName(java.lang.String hostName)
Sets the name of the server. This string is used for generating Message-Id strings containing names of the form <unique-key@server.name.com>.

Parameters:
hostName - the new host name to use for the NNTP server

setAnonymousUsername

public void setAnonymousUsername(java.lang.String username)
Sets the string to use when identifying an author that doesn't have any viewable user information. The format is typically 'Anonymous <>' although any string that is a legal RFC822 address is ok.

Parameters:
username - the new RFC822 address for users without any info

getAnonymousUsername

public java.lang.String getAnonymousUsername()
Retrieves the author name for users without viewable user information.

Returns:
the RFC822 address for users without any info

setMimeIntro

public void setMimeIntro(java.lang.String intro)
Sets the introductory text that is placed above a MIME multi-part body. The MIME intro is only seen by users with readers that don't understand MIME. The plain text message should explain what MIME is, and why they are seeing possibly illegible information instead of the actual message content. Leaving the setting blank uses the default setting. It is highly recommended this text be in plain, us-ascii for maximum readability.

Parameters:
intro - the introductory text to insert

getMimeIntro

public java.lang.String getMimeIntro()
Retrieves the mime introductory text.

Returns:
the mime introductory text

setWriteBufferSize

public void setWriteBufferSize(int size)
Sets the size of the write buffer used for the server when generating articles to be posted. The buffer should be big enough to accomodate most short messages but small enough that one buffer per connection in memory does not cause excessive resource consumption. The default is 1024 bytes.

Parameters:
size - the size of the write buffer in bytes

getWriteBufferSize

public int getWriteBufferSize()
Obtains the size of the write buffer used for the server when generating articles to be posted.

Returns:
the size of the write buffer in bytes

setMaxHeaderLength

public void setMaxHeaderLength(int headerLength)
Sets the maximum length of a header line before it is folded. Headers must not be longer than the longest NNTP allowed line of 512 characters, and is typically set to 80 characters for compatibility with text-based readers.

Parameters:
headerLength - the length of the longest allowed header line in bytes.

getMaxHeaderLength

public int getMaxHeaderLength()
Obtains the maximum lenght of a header line before it is folded.

Returns:
the length of the longest allowed header line in bytes

isAttachmentsAllowed

public boolean isAttachmentsAllowed()
Returns true if attachments will be sent/received from clients.

Returns:
true if attachments will be sent/received from clients.

setAttachmentsAllowed

public void setAttachmentsAllowed(boolean allowed)
Enables the server to send/receive attachments from clients. If false, attachments from clients will be ignored, and attachments on forum messages will not be sent to clients.

Parameters:
allowed - true if attachments will be sent/received from clients.

isCrossPostingAllowed

public boolean isCrossPostingAllowed()
Returns true if cross-posting is allowed.

Returns:
true if cross-posting is allowed.

setCrossPostingAllowed

public void setCrossPostingAllowed(boolean allowed)
Enables or disables cross-posting. When disabled, messages sent to multiple groups will be rejected.

Parameters:
allowed - true if cross-posting should be enabled.

getMimeCharacterEncoding

public java.lang.String getMimeCharacterEncoding()
Obtain the MIME character encoding name that should be used when encoding outgoing message bodies.

Returns:
The character encoding to use (MIME version of charset name)

getMimeCharset

public java.nio.charset.Charset getMimeCharset()
Obtain the MIME character encoder that should be used when encoding outgoing message bodies.

Returns:
The character encoder to use

getDefaultSubject

public java.lang.String getDefaultSubject()
Returns the default subject, which is the subject that will be used if a user does not provide a subject when posting through NNTP. The default value is an empty string.

Returns:
the default subject.

setDefaultSubject

public void setDefaultSubject(java.lang.String subject)
Sets the default subject, which is the subject that will be used if a user does not provide a subject when posting through NNTP.

Parameters:
subject - the default subject.

getGlobalMessageFooter

public java.lang.String getGlobalMessageFooter()

setGlobalMessageFooter

public void setGlobalMessageFooter(java.lang.String messageFooter)

isEmptyList

public boolean isEmptyList()
Obtain flag indicating if the LIST and NEWGROUPS command should return an empty response. On systems with extrememly large numbers of groups, clients may be configured manually or via scripts/plug-ins for the groups that should be subscribed. Using an empty LIST and NEWNEWS response maintains NNTP compliance while preventing improperly configured clients from running the LIST and NEWNEWS commands and consuming resources.

If getEmptyListGroupName() returns a non-null value, and isEmptyList() is true, the response to LIST will contain that group. This is useful for returning a support or help group rather than no groups at all.

Returns:
true if the LIST command should be empty.

setEmptyList

public void setEmptyList(boolean list)
Set the empty list configuration of this server.

Parameters:
list - true if the LIST command should return an empty response.

isEmptyNewNews

public boolean isEmptyNewNews()
Obtain a flag indicating if the NEWNEWS command should return an empty response. The NEWNEWS command can be extremely computationally expensive if the scope of the command is too broad (e.g. NEWNEWS *). Most modern news clients do not use this command, instead relying on their own, locally cached 'subscription' list and article numbers returned from the group commands. Thus returning an empty response will, at most, cause some clients to fail to detect new news posts until the group is selected.

Returns:
true if the NEWNEWS command should return an empty response.

setEmptyNewNews

public void setEmptyNewNews(boolean newNews)
Set the empty newnews configuration for this server.

Parameters:
newNews - true if the NEWNEWS command should return an empty response.

getEmptyListGroupName

public java.lang.String getEmptyListGroupName()
Obtain the name of the news group to return for 'empty' responses to the LIST command. If the result is null or empty, no groups will be used. If the group name is not null, that group is the one returned for the 'empty' LIST response.

Returns:
the name of the group to return on empty LIST commands or an empty string for no group

setEmptyListGroupName

public void setEmptyListGroupName(java.lang.String newName)
Sets the name of the group to return on empty LIST responses.

Parameters:
newName - the name of the group to return on empty LIST responses or an empty string for no group

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.