Class Bans
package: net.jxta.myjxta.directive.util
public class Bans
Version:
$Id: Bans.java,v 1.1 2004/12/19 23:54:06 gonzo Exp $
Author:
james todd [gonzo at jxta dot org]
Field Summary
private List
private static Bans
Constructor Summary
protected
   Limits the instantiation of this class.
 
Method Summary
public void
addBan(String peer)
   Adds the supplied peer to the list of banned peers.
 
public void
addBans(List bans)
   Adds the supplied peer List to the list of banned peers.
 
public synchronized void
   Removes all peers List from the list of banned peers.
 
public List
   Returns the List of peer ids that have been banned in this session.
 
public static synchronized Bans
   Returns the handle to this singleton instance.
 
public boolean
isBanned(String peer)
   Returns true if the supplied peer id is banned, and false otherwise.
 
public boolean
   Returns true if the originator of the supplied DialogMessage is banned, and false otherwise.
 
public void
removeBan(String peer)
   Removes the supplied peer from the list of banned peers.
 
public void
removeBans(List bans)
   Removes the supplied peer List from the list of banned peers.
 
Field Detail
bans
private List bans = null

instance
private static Bans instance = null
Constructor Detail
Bans
protected Bans()
Limits the instantiation of this class.
Method Detail
addBan
public void addBan(String peer)
Adds the supplied peer to the list of banned peers.

addBans
public void addBans(List bans)
Adds the supplied peer List to the list of banned peers.
Parameters:
bans A List of Strings. Each element in the list is a peer id.

clearBans
public synchronized void clearBans()
Removes all peers List from the list of banned peers.

getBans
public List getBans()
Returns the List of peer ids that have been banned in this session.

getInstance
public static synchronized Bans getInstance()
Returns the handle to this singleton instance.

isBanned
public boolean isBanned(DialogMessage msg)
Returns true if the originator of the supplied DialogMessage is banned, and false otherwise.

isBanned
public boolean isBanned(String peer)
Returns true if the supplied peer id is banned, and false otherwise.

removeBan
public void removeBan(String peer)
Removes the supplied peer from the list of banned peers.

removeBans
public void removeBans(List bans)
Removes the supplied peer List from the list of banned peers.
Parameters:
bans A List of Strings. Each element in the list is a peer id.