org.jboss.dna.connector.federation
Class FederatedWorkspace

java.lang.Object
  extended by org.jboss.dna.connector.federation.FederatedWorkspace
All Implemented Interfaces:
Comparable<FederatedWorkspace>

@Immutable
public class FederatedWorkspace
extends Object
implements Comparable<FederatedWorkspace>

The configuration of a federated repository. workspace The configuration defines, among other things, the set of source projections in the federated workspace that each specify how and where content from a source is federated into the unified workspace.

Author:
Randall Hauch

Constructor Summary
FederatedWorkspace(String workspaceName, Projection cacheProjection, Iterable<Projection> sourceProjections, CachePolicy cachePolicy)
          Create a configuration for a federated workspace.
FederatedWorkspace(String workspaceName, Projection cacheProjection, Iterable<Projection> sourceProjections, CachePolicy cachePolicy, MergeStrategy mergeStrategy)
          Create a configuration for a federated workspace.
 
Method Summary
 int compareTo(FederatedWorkspace that)
          
 boolean contains(String sourceName, String workspaceName)
          Determine whether this workspace has a projection supplied contribution
 boolean equals(Object obj)
          
 CachePolicy getCachePolicy()
          Get the cache policy for this workspace
 Projection getCacheProjection()
          Get the projection that defines the cache for this repository.
 MergeStrategy getMergingStrategy()
          Get the merging strategy used for this workspace
 String getName()
          Get the name of this repository
 Problems getProblems()
          Return the problem associated with this configuration.
 List<Projection> getProjectionsFor(String sourceName)
          Return the unmodifiable list of projections for the source name.
 List<Projection> getSourceProjections()
          Return the unmodifiable list of source projections.
 int hashCode()
          
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FederatedWorkspace

public FederatedWorkspace(String workspaceName,
                          Projection cacheProjection,
                          Iterable<Projection> sourceProjections,
                          CachePolicy cachePolicy)
Create a configuration for a federated workspace.

Parameters:
workspaceName - the name of the federated workspace; may not be null
cacheProjection - the projection used for the cache; may not be null
sourceProjections - the source projections; may not be null
cachePolicy - the cache policy for this workspace; may be null if there is no policy
Throws:
IllegalArgumentException - if the name is null or is blank

FederatedWorkspace

public FederatedWorkspace(String workspaceName,
                          Projection cacheProjection,
                          Iterable<Projection> sourceProjections,
                          CachePolicy cachePolicy,
                          MergeStrategy mergeStrategy)
Create a configuration for a federated workspace.

Parameters:
workspaceName - the name of the federated workspace; may not be null
cacheProjection - the projection used for the cache; may not be null
sourceProjections - the source projections; may not be null
cachePolicy - the cache policy for this workspace; may be null if there is no policy
mergeStrategy - the strategy that should be used to merge nodes, or null if the strategy should be chosen based automatically based upon the number of sources used by the projections
Throws:
IllegalArgumentException - if the name is null or is blank
Method Detail

getName

public String getName()
Get the name of this repository

Returns:
name

getCachePolicy

public CachePolicy getCachePolicy()
Get the cache policy for this workspace

Returns:
the workspace's cache policy; may be null

getMergingStrategy

public MergeStrategy getMergingStrategy()
Get the merging strategy used for this workspace

Returns:
the workspace's merging strategy; never null

getProblems

public Problems getProblems()
Return the problem associated with this configuration. These problems may change at any time, although the returned Problems object is thread-safe.

Returns:
the thread-safe problems for this configuration

getCacheProjection

public Projection getCacheProjection()
Get the projection that defines the cache for this repository. This projection does not exist in the list of source projections.

Returns:
the region used for caching; never null

getSourceProjections

public List<Projection> getSourceProjections()
Return the unmodifiable list of source projections.

Returns:
the source projections; never null and never empty

getProjectionsFor

public List<Projection> getProjectionsFor(String sourceName)
Return the unmodifiable list of projections for the source name.

Parameters:
sourceName - the name of the source
Returns:
the list of projections for this source, or null if there are none

contains

public boolean contains(String sourceName,
                        String workspaceName)
Determine whether this workspace has a projection supplied contribution

Parameters:
sourceName - the name of the source
workspaceName - the name of the workspace
Returns:
true if this workspace contains a projection that uses the supplied source and workspace

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

compareTo

public int compareTo(FederatedWorkspace that)

Specified by:
compareTo in interface Comparable<FederatedWorkspace>
See Also:
Comparable.compareTo(java.lang.Object)


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