org.apache.wsrp4j.persistence.xml.driver
Class ClientPersistentInformationProviderImpl

java.lang.Object
  extended byorg.apache.wsrp4j.persistence.xml.driver.ClientPersistentInformationProviderImpl
All Implemented Interfaces:
ClientPersistentInformationProvider, PersistentInformationProvider

public class ClientPersistentInformationProviderImpl
extends java.lang.Object
implements ClientPersistentInformationProvider

Consumer: This class holds the information for persistent file handling centrally. It creates the persistent file store directory on demand and returns PersistentFileInformation objects, filled with directory and file name information, based on the request. The file system structure looks like: 1) the CONSUMER case: ./persistence/*.xml (contains the mapping XML files) ./persistence/portlets/*.xml (contains object XML files) ./persistence/pages/*.xml (contains object XML files) ./persistence/users/*.xml (contains object XML files) ./persistence/producers/*.xml (contains object XML files)

Version:
$Id: ClientPersistentInformationProviderImpl.java,v 1.4 2005/08/10 14:59:56 cziegeler Exp $
Author:
Ralf Altrichter

Field Summary
private  ClientPersistentInformationProvider _persistentInfoProvider
           
private static java.lang.String CONSUMER_PERSISTENTSTORE
           
private static java.lang.String FILE_EXTENSION
           
private  Logger logger
           
private static java.lang.String PAGE_MAPPING
           
private static java.lang.String PAGES
           
private static java.lang.String PERSISTENT_DIR
           
private static java.lang.String PORTLET_MAPPING
           
private static java.lang.String PORTLETS
           
private static java.lang.String PRODUCER_MAPPING
           
private static java.lang.String PRODUCERS
           
private static java.lang.String ROOT_DIR
           
private static java.lang.String SEPARATOR
           
private static java.lang.String USER_MAPPING
           
private static java.lang.String USERS
           
 
Constructor Summary
private ClientPersistentInformationProviderImpl()
          Private constructor Creates the persistent file store directories dependent on the configured persistent store directory in the consumer properties file.
 
Method Summary
static ClientPersistentInformationProvider create()
          Static construction of the PersistentInformationProvider
private  java.lang.String getMappingFile(java.lang.String mappingBaseName)
          Compute the path to the mapping file from the root plus the name of the mapping file
 PersistentInformation getPersistentInformation(ConsumerPortletContextList consumerPortletContextList)
          Returns the persistent file information for the ConsumerPortletContext
 PersistentInformation getPersistentInformation(PageList pageList)
          Returns the persistent file information for the Page
 PersistentInformation getPersistentInformation(PortletList portletList)
          Returns the persistent file information for the Portlet
 PersistentInformation getPersistentInformation(ProducerList producerList)
          Returns the persistent file information for the producers
 PersistentInformation getPersistentInformation(UserList userList)
          Returns the persistent file information for the user
private  java.lang.String getStoreDirectory(java.lang.String subDirectory)
          Returns the store directory with the given sub directory
private  void makeStoreSubDir(java.lang.String subDirectory)
          Creates the store directory with the given sub directory name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_persistentInfoProvider

private ClientPersistentInformationProvider _persistentInfoProvider

CONSUMER_PERSISTENTSTORE

private static final java.lang.String CONSUMER_PERSISTENTSTORE
See Also:
Constant Field Values

logger

private Logger logger

PORTLETS

private static final java.lang.String PORTLETS
See Also:
Constant Field Values

USERS

private static final java.lang.String USERS
See Also:
Constant Field Values

PAGES

private static final java.lang.String PAGES
See Also:
Constant Field Values

PRODUCERS

private static final java.lang.String PRODUCERS
See Also:
Constant Field Values

PORTLET_MAPPING

private static final java.lang.String PORTLET_MAPPING
See Also:
Constant Field Values

PAGE_MAPPING

private static final java.lang.String PAGE_MAPPING
See Also:
Constant Field Values

USER_MAPPING

private static final java.lang.String USER_MAPPING
See Also:
Constant Field Values

PRODUCER_MAPPING

private static final java.lang.String PRODUCER_MAPPING
See Also:
Constant Field Values

ROOT_DIR

private static java.lang.String ROOT_DIR

FILE_EXTENSION

private static java.lang.String FILE_EXTENSION

PERSISTENT_DIR

private static java.lang.String PERSISTENT_DIR

SEPARATOR

private static java.lang.String SEPARATOR
Constructor Detail

ClientPersistentInformationProviderImpl

private ClientPersistentInformationProviderImpl()
Private constructor Creates the persistent file store directories dependent on the configured persistent store directory in the consumer properties file. If no persistent store directory was specified, the current runtime directory will be used as the root directory.

Method Detail

create

public static ClientPersistentInformationProvider create()
Static construction of the PersistentInformationProvider


getStoreDirectory

private java.lang.String getStoreDirectory(java.lang.String subDirectory)
Returns the store directory with the given sub directory

Parameters:
subDirectory - String sub directory
Returns:
String store directory

makeStoreSubDir

private void makeStoreSubDir(java.lang.String subDirectory)
Creates the store directory with the given sub directory name

Parameters:
subDirectory - String sub directory

getMappingFile

private java.lang.String getMappingFile(java.lang.String mappingBaseName)
Compute the path to the mapping file from the root plus the name of the mapping file

Parameters:
mappingBaseName - String mapping file base name without extension
Returns:
String fully qualified mapping file name with extension

getPersistentInformation

public PersistentInformation getPersistentInformation(PortletList portletList)
Returns the persistent file information for the Portlet

Specified by:
getPersistentInformation in interface ClientPersistentInformationProvider
Parameters:
portletList -
Returns:
PersistentInformation

getPersistentInformation

public PersistentInformation getPersistentInformation(PageList pageList)
Returns the persistent file information for the Page

Specified by:
getPersistentInformation in interface ClientPersistentInformationProvider
Parameters:
pageList -
Returns:
PersistentInformation

getPersistentInformation

public PersistentInformation getPersistentInformation(UserList userList)
Returns the persistent file information for the user

Specified by:
getPersistentInformation in interface ClientPersistentInformationProvider
Parameters:
userList -
Returns:
PersistentInformation

getPersistentInformation

public PersistentInformation getPersistentInformation(ProducerList producerList)
Returns the persistent file information for the producers

Specified by:
getPersistentInformation in interface ClientPersistentInformationProvider
Parameters:
producerList -
Returns:
PersistentInformation

getPersistentInformation

public PersistentInformation getPersistentInformation(ConsumerPortletContextList consumerPortletContextList)
Returns the persistent file information for the ConsumerPortletContext

Specified by:
getPersistentInformation in interface ClientPersistentInformationProvider
Parameters:
consumerPortletContextList - ConsumerPortletContextList
Returns:
PersistentInformation


--