p2ps.imp.peer.config
Class ResolverConfigImp

java.lang.Object
  extended byp2ps.imp.peer.config.ResolverConfigImp
All Implemented Interfaces:
PipeSchemes, ResolverConfig

public class ResolverConfigImp
extends java.lang.Object
implements ResolverConfig, PipeSchemes

Information about a resolver configuration

Version:
$Revision: 295 $
Author:
Ian Wang

Field Summary
 
Fields inherited from interface p2ps.peer.ResolverConfig
CLASS_NAME_TAG, INPUT_ENABLED_TAG, NAME_TAG, OURPUT_ENABLED_TAG, RESOLVER_CONFIG_TAG, SCHEME_TAG
 
Fields inherited from interface p2ps.pipe.PipeSchemes
P2PS_DISCOVERY, P2PS_MULTICAST, P2PS_SECURE, P2PS_STANDARD
 
Constructor Summary
ResolverConfigImp(ResolverConfig config)
          Constructs a clone of the specified ResolverConfig
ResolverConfigImp(java.lang.String classname)
          Creates a configuration for the resolver with the specified classname; input, output and discovery pipes are all enabled
ResolverConfigImp(java.lang.String classname, boolean inpipes, boolean outpipes)
          Creates a configuration for the resolver with the specified classname
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String[] getEnabledSchemes()
           
 java.lang.String getResolverClassName()
           
 Element getXMLElement()
          Outputs the ResolverConfig as an XML Element
 int hashCode()
           
 boolean isInputEnabled(java.lang.String scheme)
           
 boolean isOutputEnabled(java.lang.String scheme)
           
 void setSchemeEnabled(java.lang.String scheme, boolean input, boolean output)
          Sets input/output for the specified type as enabled/disabled
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResolverConfigImp

public ResolverConfigImp(java.lang.String classname)
Creates a configuration for the resolver with the specified classname; input, output and discovery pipes are all enabled


ResolverConfigImp

public ResolverConfigImp(ResolverConfig config)
Constructs a clone of the specified ResolverConfig


ResolverConfigImp

public ResolverConfigImp(java.lang.String classname,
                         boolean inpipes,
                         boolean outpipes)
Creates a configuration for the resolver with the specified classname

Parameters:
classname - the name of the resolver class
inpipes - a flag indicating whether standard input pipes are enabled
outpipes - a flag indicating whether standard output pipes are enabled
Method Detail

getResolverClassName

public java.lang.String getResolverClassName()
Specified by:
getResolverClassName in interface ResolverConfig
Returns:
the class name of the resolver

getEnabledSchemes

public java.lang.String[] getEnabledSchemes()
Specified by:
getEnabledSchemes in interface ResolverConfig
Returns:
an array of the enabled schemes

isInputEnabled

public boolean isInputEnabled(java.lang.String scheme)
Specified by:
isInputEnabled in interface ResolverConfig
Returns:
true if input is enabled for the specified scheme

isOutputEnabled

public boolean isOutputEnabled(java.lang.String scheme)
Specified by:
isOutputEnabled in interface ResolverConfig
Returns:
true if output is enabled for the specified scheme

setSchemeEnabled

public void setSchemeEnabled(java.lang.String scheme,
                             boolean input,
                             boolean output)
Sets input/output for the specified type as enabled/disabled

Specified by:
setSchemeEnabled in interface ResolverConfig

getXMLElement

public Element getXMLElement()
                      throws java.io.IOException
Outputs the ResolverConfig as an XML Element

Specified by:
getXMLElement in interface ResolverConfig
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()