m.c.m.proxyma.context
Class ProxyFolderBean

java.lang.Object
  extended by m.c.m.proxyma.context.ProxyFolderBean
All Implemented Interfaces:
java.io.Serializable

public class ProxyFolderBean
extends java.lang.Object
implements java.io.Serializable

This class is the bean that represents a remote destination for the reverse proxy engine. It is a data-object and countains all the configuration needed by the ProxymaCore to achieve its work.

NOTE: this software is released under GPL License. See the LICENSE of this distribution for more informations.

Version:
$Id: ProxyFolderBean.java 176 2010-07-03 09:02:14Z marcolinuz $
Author:
Marco Casavecchia Morganti (marcolinuz) [marcolinuz-at-gmail.com]
See Also:
Serialized Form

Constructor Summary
ProxyFolderBean(java.lang.String folderName, java.lang.String destination, ProxymaContext context)
          Default constructor for this class it builds a destinationAsString.
 
Method Summary
 java.lang.String getCacheProvider()
          Standard getter method to obtain the active cache provider class name
 java.lang.String getDestinationAsString()
          Standard getter method for the destination as String
 java.net.URL getDestinationAsURL()
          Standard getter method for the destination as URL
 java.lang.String getFolderName()
          Standard getter method for the folderName
 int getMaxPostSize()
          Standard getter method for the max POST size attribute
 java.util.Collection<java.lang.String> getPreprocessors()
          Obtain a collection of preprocessor class names registered for the proxy folder
 java.lang.String getRetriver()
          Standard getter method to obtain the active resource retriver class name
 java.lang.String getSerializer()
          Standard getter method to obtain the active serializer class name
 java.util.Collection<java.lang.String> getTransformers()
          Obtain a collection of transformers class names registered for the proxy folder
 java.lang.String getURLEncodedFolderName()
          Standard getter method for the URL encoded version of the folderName
 boolean isEnabled()
          Standard getter method to know if the proxy folder is enabled
 void registerPreprocessor(java.lang.String preprocessorClassName)
          Register a new preprocessor class name for this folder.
 void registerTransformer(java.lang.String transformerClassName)
          Register a new transformer class name for this folder.
 void setCacheProvider(java.lang.String cacheProviderClassName)
          Standard setter method to set the class name of the current active cache provider.
 void setDestination(java.lang.String destination)
          Standard setter method for destinationAsString
 void setEnabled(boolean enabled)
          Standard setter method to set the status of the proxy folder
 void setFolderName(java.lang.String newFolderName)
          Standard setter method for folderName.
 void setMaxPostSize(int maxPostSize)
          Standard setter method for the max POST size attribute
 void setRetriver(java.lang.String retriverClassName)
          Standard setter method to set the class name of the current resurce retriver.
 void setSerializer(java.lang.String serializerClassName)
          Standard setter method to set the class name of the current serializer.
 void unregisterPreprocessor(java.lang.String preprocessorClassName)
          Unregister a preprocessor class name for this folder.
 void unregisterTransformer(java.lang.String transformerClassName)
          Unregister a transformer class name for this folder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyFolderBean

public ProxyFolderBean(java.lang.String folderName,
                       java.lang.String destination,
                       ProxymaContext context)
                throws org.apache.commons.lang.NullArgumentException,
                       java.lang.IllegalArgumentException,
                       java.io.UnsupportedEncodingException
Default constructor for this class it builds a destinationAsString. NOTE: The folder is not ready to work as it is created. Actually, it needs to be configured with at least a valid resource retriver and a valid serializer.

Parameters:
FolderName - the path (and name) of the proxy folder.
destinationAsString - the destinationAsString URI to masquerade
context - the proxyma context where to get logger settings.
Throws:
org.apache.commons.lang.NullArgumentException - if some parameter is null
java.lang.IllegalArgumentException - if the folder name or the destinationAsString parameter are invalid or malformed
java.io.UnsupportedEncodingException - if the default encoding charset specified on the configuration is not supported.
Method Detail

getFolderName

public java.lang.String getFolderName()
Standard getter method for the folderName

Returns:
the folderName

getURLEncodedFolderName

public java.lang.String getURLEncodedFolderName()
Standard getter method for the URL encoded version of the folderName

Returns:
the URL encoded folderName

setFolderName

public void setFolderName(java.lang.String newFolderName)
                   throws org.apache.commons.lang.NullArgumentException,
                          java.lang.IllegalArgumentException,
                          java.io.UnsupportedEncodingException
Standard setter method for folderName.
Setting the folder name will set also the URLEncoded version of it.
Note: The foldername can't contain "/" characters.

Parameters:
folderName - the folder name to set
Throws:
org.apache.commons.lang.NullArgumentException - if some parameter is null
java.lang.IllegalArgumentException - if the folder name is not valid
java.io.UnsupportedEncodingException - if the default encoding charset specified on the configuration is not supported.

getDestinationAsString

public java.lang.String getDestinationAsString()
Standard getter method for the destination as String

Returns:
the destinationAsString

getDestinationAsURL

public java.net.URL getDestinationAsURL()
Standard getter method for the destination as URL

Returns:
the destinationAsString

setDestination

public void setDestination(java.lang.String destination)
Standard setter method for destinationAsString

Parameters:
destinationAsString - the remote destinationAsString for this folder
Throws:
org.apache.commons.lang.NullArgumentException - if some parameter is null
java.lang.IllegalArgumentException - if the destinationAsString parameter is a malformed URL

getMaxPostSize

public int getMaxPostSize()
Standard getter method for the max POST size attribute

Returns:
the current maximum accepted size for POST operations

setMaxPostSize

public void setMaxPostSize(int maxPostSize)
Standard setter method for the max POST size attribute

Parameters:
the - new maximum accepted size for POST operations

isEnabled

public boolean isEnabled()
Standard getter method to know if the proxy folder is enabled

Returns:
true if the folder is enabled, false otherwise.

setEnabled

public void setEnabled(boolean enabled)
Standard setter method to set the status of the proxy folder

Parameters:
true - enabled the folder, false disables it

getCacheProvider

public java.lang.String getCacheProvider()
Standard getter method to obtain the active cache provider class name

Returns:
the class name of the current cache provider.

setCacheProvider

public void setCacheProvider(java.lang.String cacheProviderClassName)
Standard setter method to set the class name of the current active cache provider.

Parameters:
the - class name of the new cache provider.

getRetriver

public java.lang.String getRetriver()
Standard getter method to obtain the active resource retriver class name

Returns:
the class name of the current resource retriver.

setRetriver

public void setRetriver(java.lang.String retriverClassName)
Standard setter method to set the class name of the current resurce retriver.

Parameters:
the - class name of the new resource retriver.

getSerializer

public java.lang.String getSerializer()
Standard getter method to obtain the active serializer class name

Returns:
the class name of the current serializer.

setSerializer

public void setSerializer(java.lang.String serializerClassName)
Standard setter method to set the class name of the current serializer.

Parameters:
the - class name of the new serializer.

registerPreprocessor

public void registerPreprocessor(java.lang.String preprocessorClassName)
Register a new preprocessor class name for this folder.

Parameters:
preprocessorClassName - the name of the class that implements the preprocessor to register

unregisterPreprocessor

public void unregisterPreprocessor(java.lang.String preprocessorClassName)
Unregister a preprocessor class name for this folder.

Parameters:
preprocessorClassName - the name of the class that implements the preprocessor to remove

getPreprocessors

public java.util.Collection<java.lang.String> getPreprocessors()
Obtain a collection of preprocessor class names registered for the proxy folder

Returns:
a Collection of class names.

registerTransformer

public void registerTransformer(java.lang.String transformerClassName)
Register a new transformer class name for this folder.

Parameters:
transformerClassName - the name of the class that implements the transformer to register

unregisterTransformer

public void unregisterTransformer(java.lang.String transformerClassName)
Unregister a transformer class name for this folder.

Parameters:
transformerClassName - the name of the class that implements the transformer to remove

getTransformers

public java.util.Collection<java.lang.String> getTransformers()
Obtain a collection of transformers class names registered for the proxy folder

Returns:
a Collection of class names.


Copyright © 2010. All Rights Reserved.