|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object m.c.m.proxyma.context.ProxymaContext
public class ProxymaContext
This class is the main context for an instance of Proxyma. Multiple instance of proxyma are allowed to run into a single VM. It countains the logic to access and get parameters form a required configuration logFile.
NOTE: this software is released under GPL License. See the LICENSE of this distribution for more informations.
Constructor Summary | |
---|---|
ProxymaContext(java.lang.String contextName,
java.lang.String contextBaseURI,
java.lang.String configurationFile,
java.lang.String logsDirectoryPath)
Default constructor for this Class |
Method Summary | |
---|---|
void |
addProxyFolder(ProxyFolderBean proxyFolder)
Add a new ProxyFolder to the context. |
java.lang.String |
getDefaultEncoding()
Get the default encoding charset used to encode/decode URLs and to parse html files. |
java.util.logging.Logger |
getLogger()
Get the logger for this context instance. |
java.lang.String |
getLogLevel()
Standard getter method to obtain the current log level. |
java.lang.String |
getLogsDirectoryPath()
Returns the path of the logs directory for this context. |
java.util.Collection<java.lang.String> |
getMultiValueParameter(java.lang.String parameterXPath)
Get a list of values for a parameter from the configuration |
java.lang.String |
getName()
Get the name of this ccontext |
java.util.Collection<ProxyFolderBean> |
getProxyFolderByDestinationHost(java.lang.String proxyFolderDestinationHost)
Get a proxy folder by folder name (if exists) |
ProxyFolderBean |
getProxyFolderByURLEncodedName(java.lang.String proxyFolderURLEncodedName)
Get a proxy folder by folder name (if exists) |
java.util.Collection<ProxyFolderBean> |
getProxyFoldersAsCollection()
Get a collection of all the proxy folders into the context |
int |
getProxyFoldersCount()
Returns the number of proxy folders handled by the context. |
java.lang.String |
getProxymaContextBasePath()
Get the contextPath for this context |
java.lang.String |
getProxymaVersion()
Get the curren relese nubler of Proxyma-core library |
java.lang.String |
getSingleValueParameter(java.lang.String parameterXPath)
Get a single value paramenter from the configuration |
void |
removeProxyFolder(ProxyFolderBean proxyFolder)
Remove a ProxyFolder from the context |
java.lang.String |
setLogLevel(java.lang.String logLevel)
Standard setter method to set the new log level to use at run time. |
protected void |
updateFolderDestinationIndex(java.net.URL oldDestination,
ProxyFolderBean theFolder)
Updates Context Destination Indexes. |
protected void |
updateFolderURLEncodedIndex(java.lang.String oldURLEncodedName,
ProxyFolderBean theFolder)
Updates Context URLEncoded Indexes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProxymaContext(java.lang.String contextName, java.lang.String contextBaseURI, java.lang.String configurationFile, java.lang.String logsDirectoryPath)
contextName
- the name of the context to createcontextBaseURI
- Base URI of the contextconfigurationFile
- proxyma configuration file to loadlogsDirectoryPath
- directory where to write all the logsMethod Detail |
---|
public ProxyFolderBean getProxyFolderByURLEncodedName(java.lang.String proxyFolderURLEncodedName)
proxyFolderURLEncodedName
- the wanted ProxyFolderBean
public java.util.Collection<ProxyFolderBean> getProxyFolderByDestinationHost(java.lang.String proxyFolderDestinationHost)
proxyFolderURLEncodedName
- the wanted ProxyFolderBean
public void addProxyFolder(ProxyFolderBean proxyFolder) throws java.lang.IllegalArgumentException, org.apache.commons.lang.NullArgumentException
proxyFolder
- the ProxyFolderBean to add
java.lang.IllegalArgumentException
- if the context is already registered
org.apache.commons.lang.NullArgumentException
- if the argument is nullpublic void removeProxyFolder(ProxyFolderBean proxyFolder) throws java.lang.IllegalArgumentException, org.apache.commons.lang.NullArgumentException
proxyFolder
- the proxyFolder to remove.
java.lang.IllegalArgumentException
- if the context doesn't exist
org.apache.commons.lang.NullArgumentException
- if the argument is nullprotected void updateFolderURLEncodedIndex(java.lang.String oldURLEncodedName, ProxyFolderBean theFolder)
theFolder
- the folder that has jus been updatedprotected void updateFolderDestinationIndex(java.net.URL oldDestination, ProxyFolderBean theFolder)
theFolder
- the folder that has jus been updatedpublic java.util.Collection<ProxyFolderBean> getProxyFoldersAsCollection()
public int getProxyFoldersCount()
public java.lang.String getSingleValueParameter(java.lang.String parameterXPath)
parameterName
- the parameter name
ParameterTags
public java.util.Collection<java.lang.String> getMultiValueParameter(java.lang.String parameterXPath)
parameterName
- the parameter name
java.lang.IllegalArgumentException
- if the parameter is not a single value parameter.ParameterTags
public java.lang.String getLogLevel()
public java.lang.String setLogLevel(java.lang.String logLevel)
the
- new log level as defined into the java standard Logger.
Possible values are: SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALLpublic java.util.logging.Logger getLogger()
public java.lang.String getName()
public java.lang.String getDefaultEncoding()
public java.lang.String getProxymaVersion()
public java.lang.String getProxymaContextBasePath()
public java.lang.String getLogsDirectoryPath()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |