org.jboss.dna.connector.federation
Class FederatedRepositorySource

java.lang.Object
  extended by org.jboss.dna.connector.federation.FederatedRepositorySource
All Implemented Interfaces:
Serializable, Referenceable, ObjectFactory, RepositorySource

@ThreadSafe
public class FederatedRepositorySource
extends Object
implements RepositorySource, ObjectFactory

Author:
Randall Hauch
See Also:
Serialized Form

Field Summary
static String DEFAULT_CONFIGURATION_SOURCE_PATH
           
static int DEFAULT_RETRY_LIMIT
          The default limit is 0 for retrying connection calls to the underlying source.
 
Constructor Summary
FederatedRepositorySource()
          Create a new instance of the source, which must still be properly initialized with a repository name.
FederatedRepositorySource(String repositoryName)
          Create a new instance of the source with the required repository name and federation service.
 
Method Summary
 boolean equals(Object obj)
          
 RepositorySourceCapabilities getCapabilities()
          Get the capabilities for this source.
 String getConfigurationSourceName()
          Get the name in JNDI of a RepositorySource instance that should be used by the federated repository as the configuration repository.
 String getConfigurationSourcePath()
          Get the path in the source that will be subgraph below the /dna:system branch of the repository.
 String getConfigurationWorkspaceName()
          Set the name of the workspace in the source used by the federated repository as the configuration repository.
 RepositoryConnection getConnection()
          Get a connection from this source.
 String getName()
          Get the name for this repository source.
 Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment)
          
 String getPassword()
          Get the password that should be used when authenticating and creating connections.
 Reference getReference()
          
 RepositoryContext getRepositoryContext()
           
 String getRepositoryName()
          Get the name of the federated repository.
 int getRetryLimit()
          Get the maximum number of retries that may be performed on a given operation when using connections created by this source.
 String getSecurityDomain()
          Get the name of the security domain that should be used by JAAS to identify the application or security context.
 String getUsername()
          Get the username that should be used when authenticating and creating connections.
 int hashCode()
          
 void initialize(RepositoryContext context)
          Initialize this source to use the supplied RepositoryContext, from which this source can obtain connections to other sources as well as execution contexts.
 void setConfigurationSourceName(String sourceName)
          Get the name of a RepositorySource instance that should be used by the federated repository as the configuration repository.
 void setConfigurationSourcePath(String pathInSourceToConfigurationRoot)
          Set the path in the source that will be subgraph below the /dna:system branch of the repository.
 void setConfigurationWorkspaceName(String workspaceName)
          Set the name of the workspace in the source used by the federated repository as the configuration repository.
 void setName(String sourceName)
          Set the name of this source.
 void setPassword(String password)
          Get the password that should be used when authenticating and creating connections.
 void setRepositoryName(String repositoryName)
          Get the name of the federated repository.
 void setRetryLimit(int limit)
          Set the maximum number of retries that may be performed on a given operation when using connections created by this source.
 void setSecurityDomain(String securityDomain)
          Set the name of the security domain that should be used by JAAS to identify the application or security context.
 void setUsername(String username)
          Set the username that should be used when authenticating and creating connections.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_RETRY_LIMIT

public static final int DEFAULT_RETRY_LIMIT
The default limit is 0 for retrying connection calls to the underlying source.

See Also:
Constant Field Values

DEFAULT_CONFIGURATION_SOURCE_PATH

public static final String DEFAULT_CONFIGURATION_SOURCE_PATH
See Also:
Constant Field Values
Constructor Detail

FederatedRepositorySource

public FederatedRepositorySource()
Create a new instance of the source, which must still be properly initialized with a repository name.


FederatedRepositorySource

public FederatedRepositorySource(String repositoryName)
Create a new instance of the source with the required repository name and federation service.

Parameters:
repositoryName - the repository name
Throws:
IllegalArgumentException - if the federation service is null or the repository name is null or blank
Method Detail

initialize

public void initialize(RepositoryContext context)
                throws RepositorySourceException
Initialize this source to use the supplied RepositoryContext, from which this source can obtain connections to other sources as well as execution contexts.

Specified by:
initialize in interface RepositorySource
Throws:
RepositorySourceException
See Also:
RepositorySource.initialize(org.jboss.dna.graph.connector.RepositoryContext)

getRepositoryContext

public RepositoryContext getRepositoryContext()
Returns:
repositoryContext

getName

public String getName()
Get the name for this repository source.

Specified by:
getName in interface RepositorySource
Returns:
the name; never null or empty

setName

public void setName(String sourceName)
Set the name of this source.

This is a required property.

Parameters:
sourceName - the name of this repository source
See Also:
setConfigurationSourceName(String), setConfigurationSourcePath(String), setPassword(String), setUsername(String), setRepositoryName(String), setPassword(String), setUsername(String), setName(String)

getRetryLimit

public int getRetryLimit()
Get the maximum number of retries that may be performed on a given operation when using connections created by this source. This value does not constitute a minimum number of retries; in fact, the connection user is not required to retry any operations.

Specified by:
getRetryLimit in interface RepositorySource
Returns:
the maximum number of allowable retries, or 0 if the source has no limit
See Also:
RepositorySource.getRetryLimit()

setRetryLimit

public void setRetryLimit(int limit)
Set the maximum number of retries that may be performed on a given operation when using connections created by this source. This value does not constitute a minimum number of retries; in fact, the connection user is not required to retry any operations.

Specified by:
setRetryLimit in interface RepositorySource
Parameters:
limit - the maximum number of allowable retries, or 0 if the source has no limit
See Also:
RepositorySource.setRetryLimit(int)

getConfigurationSourceName

public String getConfigurationSourceName()
Get the name in JNDI of a RepositorySource instance that should be used by the federated repository as the configuration repository.

This is a required property.

Returns:
the JNDI name of the RepositorySource instance that should be used for the configuration, or null if the federated repository instance is to be found in JNDI
See Also:
setConfigurationSourceName(String)

setConfigurationSourceName

public void setConfigurationSourceName(String sourceName)
Get the name of a RepositorySource instance that should be used by the federated repository as the configuration repository. The instance will be retrieved from the RepositoryConnectionFactory instance from the repository context supplied during initialization.

This is a required property.

Parameters:
sourceName - the name of the RepositorySource instance that should be used for the configuration, or null if the federated repository instance is to be found in JNDI
See Also:
getConfigurationSourceName(), setConfigurationSourcePath(String), setPassword(String), setUsername(String), setRepositoryName(String), setName(String)

getConfigurationWorkspaceName

public String getConfigurationWorkspaceName()
Set the name of the workspace in the source used by the federated repository as the configuration repository. If this workspace name is null, the default workspace as defined by that source will be used.

Returns:
the name of the configuration workspace, or null if the default workspace for the configuration source should be used

setConfigurationWorkspaceName

public void setConfigurationWorkspaceName(String workspaceName)
Set the name of the workspace in the source used by the federated repository as the configuration repository. If this workspace name is null, the default workspace as defined by that source will be used.

Parameters:
workspaceName - the name of the configuration workspace, or null if the default workspace for the configuration source should be used

getConfigurationSourcePath

public String getConfigurationSourcePath()
Get the path in the source that will be subgraph below the /dna:system branch of the repository.

This is a required property.

Returns:
the string array of projection rules, or null if the projection rules haven't yet been set or if the federated repository instance is to be found in JNDI
See Also:
setConfigurationSourcePath(String)

setConfigurationSourcePath

public void setConfigurationSourcePath(String pathInSourceToConfigurationRoot)
Set the path in the source that will be subgraph below the /dna:system branch of the repository.

This is a required property.

Parameters:
pathInSourceToConfigurationRoot - the path within the configuration source to the node that should be the root of the configuration information, or null if the path hasn't yet been set or if the federated repository instance is to be found in JNDI
See Also:
setConfigurationSourcePath(String), setConfigurationSourceName(String), setPassword(String), setUsername(String), setRepositoryName(String), setName(String)

getSecurityDomain

public String getSecurityDomain()
Get the name of the security domain that should be used by JAAS to identify the application or security context. This should correspond to the JAAS login configuration located within the JAAS login configuration file.

Returns:
securityDomain

setSecurityDomain

public void setSecurityDomain(String securityDomain)
Set the name of the security domain that should be used by JAAS to identify the application or security context. This should correspond to the JAAS login configuration located within the JAAS login configuration file.

Parameters:
securityDomain - Sets securityDomain to the specified value.

getRepositoryName

public String getRepositoryName()
Get the name of the federated repository.

This is a required property.

Returns:
the name of the repository
See Also:
setRepositoryName(String)

setRepositoryName

public void setRepositoryName(String repositoryName)
Get the name of the federated repository.

This is a required property.

Parameters:
repositoryName - the new name of the repository
Throws:
IllegalArgumentException - if the repository name is null, empty or blank
See Also:
getRepositoryName(), setConfigurationSourceName(String), setConfigurationSourcePath(String), setPassword(String), setUsername(String), setName(String)

getUsername

public String getUsername()
Get the username that should be used when authenticating and creating connections.

This is an optional property, required only when authentication is to be used.

Returns:
the username, or null if no username has been set or are not to be used
See Also:
setUsername(String)

setUsername

public void setUsername(String username)
Set the username that should be used when authenticating and creating connections.

This is an optional property, required only when authentication is to be used.

Parameters:
username - the username, or null if no username has been set or are not to be used
See Also:
getUsername(), setPassword(String), setConfigurationSourceName(String), setConfigurationSourcePath(String), setPassword(String), setRepositoryName(String), setName(String)

getPassword

public String getPassword()
Get the password that should be used when authenticating and creating connections.

This is an optional property, required only when authentication is to be used.

Returns:
the password, or null if no password have been set or are not to be used
See Also:
setPassword(String)

setPassword

public void setPassword(String password)
Get the password that should be used when authenticating and creating connections.

This is an optional property, required only when authentication is to be used.

Parameters:
password - the password, or null if no password have been set or are not to be used
See Also:
getPassword(), setConfigurationSourceName(String), setConfigurationSourcePath(String), setUsername(String), setRepositoryName(String), setName(String)

getConnection

public RepositoryConnection getConnection()
                                   throws RepositorySourceException
Get a connection from this source.

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

getReference

public Reference getReference()

Specified by:
getReference in interface Referenceable

getObjectInstance

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

Specified by:
getObjectInstance in interface ObjectFactory
Throws:
Exception

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

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()


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