org.apache.manifoldcf.crawler.repository
Class RepositoryConnection

java.lang.Object
  extended by org.apache.manifoldcf.crawler.repository.RepositoryConnection
All Implemented Interfaces:
IRepositoryConnection

public class RepositoryConnection
extends java.lang.Object
implements IRepositoryConnection

An instance of this class represents a persistently-stored repository connection description. This is the paper object meant for editing and manipulation.


Nested Class Summary
protected static class RepositoryConnection.ThrottleItem
          Throttle item class.
 
Field Summary
static java.lang.String _rcsid
           
protected  java.lang.String authorityName
           
protected  java.lang.String className
           
protected  ConfigParams configParams
           
protected  java.lang.String description
           
protected  boolean isNew
           
protected  int maxCount
           
protected  java.lang.String name
           
protected  java.util.HashMap throttles
           
 
Constructor Summary
RepositoryConnection()
          Constructor.
 
Method Summary
 void addThrottleValue(java.lang.String match, java.lang.String description, float throttle)
          Add a throttle value.
 void clearThrottleValues()
          Clear all throttle values.
 void deleteThrottleValue(java.lang.String match)
          Delete a throttle.
 RepositoryConnection duplicate()
          Clone this object.
 java.lang.String getACLAuthority()
          Get the ACL authority name.
 java.lang.String getClassName()
          Get the class name.
 ConfigParams getConfigParams()
          Get the configuration parameters.
 java.lang.String getDescription()
          Get description.
 boolean getIsNew()
          Get 'isnew' condition.
 int getMaxConnections()
          Get the maximum size of the connection pool.
 java.lang.String getName()
          Get name.
 java.lang.Float getThrottle()
          Get the maximum number of document fetches per millisecond.
 java.lang.String getThrottleDescription(java.lang.String match)
          Get the description for a throttle.
 java.lang.String[] getThrottles()
          Get throttles.
 float getThrottleValue(java.lang.String match)
          Get the throttle value for a throttle.
 void setACLAuthority(java.lang.String authorityName)
          Set the ACL authority name.
 void setClassName(java.lang.String className)
          Set the class name.
 void setDescription(java.lang.String description)
          Set description.
 void setIsNew(boolean isnew)
          Set 'isnew' condition.
 void setMaxConnections(int maxCount)
          Set the maximum size of the connection pool.
 void setName(java.lang.String name)
          Set name.
 void setThrottle(java.lang.Float rate)
          Set the maximum number of document fetches per millisecond.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rcsid

public static final java.lang.String _rcsid
See Also:
Constant Field Values

isNew

protected boolean isNew

name

protected java.lang.String name

description

protected java.lang.String description

className

protected java.lang.String className

authorityName

protected java.lang.String authorityName

configParams

protected ConfigParams configParams

maxCount

protected int maxCount

throttles

protected java.util.HashMap throttles
Constructor Detail

RepositoryConnection

public RepositoryConnection()
Constructor.

Method Detail

duplicate

public RepositoryConnection duplicate()
Clone this object.

Returns:
the cloned object.

setIsNew

public void setIsNew(boolean isnew)
Set 'isnew' condition.

Specified by:
setIsNew in interface IRepositoryConnection
Parameters:
isnew - true if this is a new instance.

getIsNew

public boolean getIsNew()
Get 'isnew' condition.

Specified by:
getIsNew in interface IRepositoryConnection
Returns:
true if this is a new connection, false otherwise.

setName

public void setName(java.lang.String name)
Set name.

Specified by:
setName in interface IRepositoryConnection
Parameters:
name - is the name.

getName

public java.lang.String getName()
Get name.

Specified by:
getName in interface IRepositoryConnection
Returns:
the name

setDescription

public void setDescription(java.lang.String description)
Set description.

Specified by:
setDescription in interface IRepositoryConnection
Parameters:
description - is the description.

getDescription

public java.lang.String getDescription()
Get description.

Specified by:
getDescription in interface IRepositoryConnection
Returns:
the description

setClassName

public void setClassName(java.lang.String className)
Set the class name.

Specified by:
setClassName in interface IRepositoryConnection
Parameters:
className - is the class name.

getClassName

public java.lang.String getClassName()
Get the class name.

Specified by:
getClassName in interface IRepositoryConnection
Returns:
the class name

setACLAuthority

public void setACLAuthority(java.lang.String authorityName)
Set the ACL authority name.

Specified by:
setACLAuthority in interface IRepositoryConnection
Parameters:
authorityName - is the ACL authority name.

getACLAuthority

public java.lang.String getACLAuthority()
Get the ACL authority name.

Specified by:
getACLAuthority in interface IRepositoryConnection
Returns:
the ACL authority name.

getConfigParams

public ConfigParams getConfigParams()
Get the configuration parameters.

Specified by:
getConfigParams in interface IRepositoryConnection
Returns:
the map. Can be modified.

setMaxConnections

public void setMaxConnections(int maxCount)
Set the maximum size of the connection pool.

Specified by:
setMaxConnections in interface IRepositoryConnection
Parameters:
maxCount - is the maximum connection count per JVM.

getMaxConnections

public int getMaxConnections()
Get the maximum size of the connection pool.

Specified by:
getMaxConnections in interface IRepositoryConnection
Returns:
the maximum size.

clearThrottleValues

public void clearThrottleValues()
Clear all throttle values.

Specified by:
clearThrottleValues in interface IRepositoryConnection

addThrottleValue

public void addThrottleValue(java.lang.String match,
                             java.lang.String description,
                             float throttle)
Add a throttle value.

Specified by:
addThrottleValue in interface IRepositoryConnection
Parameters:
description - is the throttle description.
match - is the regexp to be applied to the bin names.
throttle - is the fetch rate to use, in fetches per millisecond.

deleteThrottleValue

public void deleteThrottleValue(java.lang.String match)
Delete a throttle.

Specified by:
deleteThrottleValue in interface IRepositoryConnection
Parameters:
match - is the regexp describing the throttle to be removed.

getThrottles

public java.lang.String[] getThrottles()
Get throttles. This will return a list of match strings, ordered by description and then match string.

Specified by:
getThrottles in interface IRepositoryConnection
Returns:
the ordered list of throttles.

getThrottleDescription

public java.lang.String getThrottleDescription(java.lang.String match)
Get the description for a throttle.

Specified by:
getThrottleDescription in interface IRepositoryConnection
Parameters:
match - describes the throttle.
Returns:
the description.

getThrottleValue

public float getThrottleValue(java.lang.String match)
Get the throttle value for a throttle.

Specified by:
getThrottleValue in interface IRepositoryConnection
Parameters:
match - describes the throttle.
Returns:
the throttle value, in fetches per millisecond.

setThrottle

public void setThrottle(java.lang.Float rate)
Set the maximum number of document fetches per millisecond.

Specified by:
setThrottle in interface IRepositoryConnection
Parameters:
rate - is the rate, in fetches/millisecond.

getThrottle

public java.lang.Float getThrottle()
Get the maximum number of document fetches per millisecond.

Specified by:
getThrottle in interface IRepositoryConnection
Returns:
fetches/ms, or null if there is no throttle.