org.jboss.dna.connector.svn
Class SvnRepositorySource

java.lang.Object
  extended by org.jboss.dna.graph.connector.path.AbstractPathRepositorySource
      extended by org.jboss.dna.connector.svn.SvnRepositorySource
All Implemented Interfaces:
Serializable, Referenceable, ObjectFactory, PathRepositorySource, RepositorySource

@ThreadSafe
public class SvnRepositorySource
extends AbstractPathRepositorySource
implements ObjectFactory

The RepositorySource for the connector that exposes an area of the local/remote svn repository as content in a repository. This source considers a workspace name to be the path to the directory on the repository's root directory location that represents the root of that workspace. New workspaces can be created, as long as the names represent valid paths to existing directories.

See Also:
Serialized Form

Field Summary
static boolean DEFAULT_SUPPORTS_UPDATES
          This source supports udpates by default, but each instance may be configured to be read-only or updateable}.
 
Fields inherited from class org.jboss.dna.graph.connector.path.AbstractPathRepositorySource
DEFAULT_CACHE_POLICY, DEFAULT_RETRY_LIMIT, DEFAULT_ROOT_NODE_UUID
 
Constructor Summary
SvnRepositorySource()
          Create a repository source instance.
 
Method Summary
 boolean areUpdatesAllowed()
          Get whether this source allows updates.
 boolean equals(Object obj)
          
 RepositorySourceCapabilities getCapabilities()
          Get the capabilities for this source.
 RepositoryConnection getConnection()
          Get a connection from this source.
 String getDefaultWorkspaceName()
          Get the path to the existing directory that should be used for the default workspace.
 Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment)
          
 String getPassword()
           
 String[] getPredefinedWorkspaceNames()
          Gets the names of the workspaces that are available when this source is created.
 Reference getReference()
          
 String getRepositoryRootUrl()
           
 boolean getSupportsUpdates()
          Get whether this source supports updates.
 String getUsername()
           
 int hashCode()
           
 boolean isCreatingWorkspacesAllowed()
          Get whether this source allows workspaces to be created dynamically.
 void setCreatingWorkspacesAllowed(boolean allowWorkspaceCreation)
          Set whether this source allows workspaces to be created dynamically.
 void setDefaultWorkspaceName(String pathToDirectoryForDefaultWorkspace)
          Set the file system path to the existing directory that should be used for the default workspace.
 void setPassword(String password)
           
 void setPredefinedWorkspaceNames(String[] predefinedWorkspaceNames)
          Sets the names of the workspaces that are available when this source is created.
 void setRepositoryRootUrl(String url)
          Set the url for the subversion repository.
 void setUpdatesAllowed(boolean allowUpdates)
          Set whether this source allows updates to data within workspaces
 void setUsername(String username)
           
 
Methods inherited from class org.jboss.dna.graph.connector.path.AbstractPathRepositorySource
close, getCachePolicy, getName, getPathRepositoryCache, getRepositoryContext, getRetryLimit, getRootNodeUuid, initialize, setCachePolicy, setName, setRetryLimit, setRootNodeUuid
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SUPPORTS_UPDATES

public static final boolean DEFAULT_SUPPORTS_UPDATES
This source supports udpates by default, but each instance may be configured to be read-only or updateable}.

See Also:
Constant Field Values
Constructor Detail

SvnRepositorySource

public SvnRepositorySource()
Create a repository source instance.

Method Detail

getCapabilities

public RepositorySourceCapabilities getCapabilities()
Get the capabilities for this source.

Specified by:
getCapabilities in interface RepositorySource
Returns:
the capabilities for this source; never null
See Also:
RepositorySource.getCapabilities()

getRepositoryRootUrl

public String getRepositoryRootUrl()
Returns:
the url

setRepositoryRootUrl

public void setRepositoryRootUrl(String url)
Set the url for the subversion repository.

Parameters:
url - - the url location.
Throws:
IllegalArgumentException - If svn url is null or empty

getUsername

public String getUsername()

setUsername

public void setUsername(String username)
Parameters:
username -

getPassword

public String getPassword()

setPassword

public void setPassword(String password)
Parameters:
password -

getSupportsUpdates

public boolean getSupportsUpdates()
Get whether this source supports updates.

Returns:
true if this source supports updates, or false if this source only supports reading content.

getDefaultWorkspaceName

public String getDefaultWorkspaceName()
Get the path to the existing directory that should be used for the default workspace. This path should be relative to the repository root URL. If the default is specified as a null String or is not a valid and resolvable path, this source will consider the default to be the current working directory of this virtual machine, as defined by the new File(".").

Specified by:
getDefaultWorkspaceName in interface PathRepositorySource
Returns:
the file system path to the directory representing the default workspace, or null if the default should be the current working directory

setDefaultWorkspaceName

public void setDefaultWorkspaceName(String pathToDirectoryForDefaultWorkspace)
Set the file system path to the existing directory that should be used for the default workspace. This path should be relative to the repository root URL. If the default is specified as a null String or is not a valid and resolvable path, this source will consider the default to be the current working directory of this virtual machine, as defined by the new File(".").

Parameters:
pathToDirectoryForDefaultWorkspace - the valid and resolvable file system path to the directory representing the default workspace, or null if the current working directory should be used as the default workspace

getPredefinedWorkspaceNames

public String[] getPredefinedWorkspaceNames()
Gets the names of the workspaces that are available when this source is created. Each workspace name corresponds to a path to a directory on the file system.

Returns:
the names of the workspaces that this source starts with, or null if there are no such workspaces
See Also:
setPredefinedWorkspaceNames(String[]), setCreatingWorkspacesAllowed(boolean)

setPredefinedWorkspaceNames

public void setPredefinedWorkspaceNames(String[] predefinedWorkspaceNames)
Sets the names of the workspaces that are available when this source is created. Each workspace name corresponds to a path to a directory on the file system.

Parameters:
predefinedWorkspaceNames - the names of the workspaces that this source should start with, or null if there are no such workspaces
See Also:
setCreatingWorkspacesAllowed(boolean), getPredefinedWorkspaceNames()

isCreatingWorkspacesAllowed

public boolean isCreatingWorkspacesAllowed()
Get whether this source allows workspaces to be created dynamically.

Returns:
true if this source allows workspaces to be created by clients, or false if the set of workspaces is fixed
See Also:
setPredefinedWorkspaceNames(String[]), getPredefinedWorkspaceNames(), setCreatingWorkspacesAllowed(boolean)

setCreatingWorkspacesAllowed

public void setCreatingWorkspacesAllowed(boolean allowWorkspaceCreation)
Set whether this source allows workspaces to be created dynamically.

Parameters:
allowWorkspaceCreation - true if this source allows workspaces to be created by clients, or false if the set of workspaces is fixed
See Also:
setPredefinedWorkspaceNames(String[]), getPredefinedWorkspaceNames(), isCreatingWorkspacesAllowed()

areUpdatesAllowed

public boolean areUpdatesAllowed()
Get whether this source allows updates.

Specified by:
areUpdatesAllowed in interface PathRepositorySource
Overrides:
areUpdatesAllowed in class AbstractPathRepositorySource
Returns:
true if this source allows updates by clients, or false if no updates are allowed
See Also:
setUpdatesAllowed(boolean)

setUpdatesAllowed

public void setUpdatesAllowed(boolean allowUpdates)
Set whether this source allows updates to data within workspaces

Specified by:
setUpdatesAllowed in interface PathRepositorySource
Parameters:
allowUpdates - true if this source allows updates to data within workspaces clients, or false if updates are not allowed.
See Also:
areUpdatesAllowed()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getReference

public Reference getReference()

Specified by:
getReference in interface Referenceable
See Also:
Referenceable.getReference()

getObjectInstance

public Object getObjectInstance(Object obj,
                                Name name,
                                Context nameCtx,
                                Hashtable<?,?> environment)
                         throws Exception

Specified by:
getObjectInstance in interface ObjectFactory
Throws:
Exception
See Also:
ObjectFactory.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable)

getConnection

public RepositoryConnection getConnection()
                                   throws RepositorySourceException
Get a connection from this source. Even though each RepositorySource need not be thread safe, this method should be safe to be called concurrently by multiple threads.

Specified by:
getConnection in interface RepositorySource
Returns:
a connection
Throws:
RepositorySourceException - if there is a problem obtaining a connection
See Also:
RepositorySource.getConnection()


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.