org.eclipse.corona.model.container
Class ContainerHelpers

java.lang.Object
  extended by org.eclipse.corona.model.container.ContainerHelpers

public class ContainerHelpers
extends java.lang.Object

This class is intended to add some convinient methods to work with container


Constructor Summary
ContainerHelpers()
           
 
Method Summary
static RepositoryConnectionParameters getConnParamsByAccessType(RepositoryConfiguration repoConf, java.lang.String accessType)
          Finds a repository connection params with specified access type.
static RepositoryConnectionParameters getConnParamsByAccessType(RepositoryDescriptor repo, java.lang.String accessType)
          Finds a repository connection params with specified access type.
static RepositoryConfiguration getDefaultConfiguration(RepositoryDescriptor repo)
          Get the default configuration from the specified repository confiuration descriptor.
static java.util.List getReposiotriesByContentType(ContextContainer container, java.lang.String contentType)
          Obtains a repositories by its type.
static java.util.List getRepositories(ContextContainer container)
          Gets a list of repositories for a context container.
static java.util.List getRepositoryConfigurations(RepositoryDescriptor repo)
          Gets a list of repository configurations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerHelpers

public ContainerHelpers()
Method Detail

getRepositories

public static java.util.List getRepositories(ContextContainer container)
Gets a list of repositories for a context container. It ensures that null will never be returned.

Parameters:
container - The container from which repositories are taken.
Returns:
The list of RepositoryDescriptor, or empty list, but never null.

getReposiotriesByContentType

public static java.util.List getReposiotriesByContentType(ContextContainer container,
                                                          java.lang.String contentType)
Obtains a repositories by its type.

Parameters:
container - The container from which the repository will be taken.
contentType - The repository content type.
Returns:
The list RepositoryDescriptor with given content type. The list is empty if not found.

getRepositoryConfigurations

public static java.util.List getRepositoryConfigurations(RepositoryDescriptor repo)
Gets a list of repository configurations. It ensures that null will never be returned.

Parameters:
repo - The repository from which repository configurations are taken.
Returns:
The list of repositiory configuration, or empty list, but never null.

getConnParamsByAccessType

public static RepositoryConnectionParameters getConnParamsByAccessType(RepositoryDescriptor repo,
                                                                       java.lang.String accessType)
Finds a repository connection params with specified access type.

Parameters:
repo - The repository.
accessType - The requested access type.
Returns:
The matching connection params or null if not found.

getConnParamsByAccessType

public static RepositoryConnectionParameters getConnParamsByAccessType(RepositoryConfiguration repoConf,
                                                                       java.lang.String accessType)
Finds a repository connection params with specified access type.

Parameters:
repoConf - The repository configuration to look for.
accessType - The requested access type.
Returns:
The matching connection params or null if not found.

getDefaultConfiguration

public static RepositoryConfiguration getDefaultConfiguration(RepositoryDescriptor repo)
Get the default configuration from the specified repository confiuration descriptor.

Parameters:
repo - The repository descriptor for the respository.
Returns:
An instance of RepositoryConfiguration for the default configuration. null is returned if no default configuration specified.

Copyright 2006 IBM Corporation and others.
All Rights Reserved.