|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.main.CmsContextInfo
Contains user information for automated creation of a
CmsRequestContext
during system runtime.
Field Summary | |
static java.lang.String |
LOCALHOST
Localhost ip used in fallback cases. |
Constructor Summary | |
CmsContextInfo()
Creates a new instance, initializing the variables with some reasonable default values. |
|
CmsContextInfo(CmsRequestContext requestContext)
Creates a new instance with all context variables initialized from the given request context. |
|
CmsContextInfo(CmsUser user,
CmsProject project,
java.lang.String requestedUri,
java.lang.String siteRoot,
java.util.Locale locale,
java.lang.String encoding,
java.lang.String remoteAddr)
Creates a new instance with all context variables initialized. |
|
CmsContextInfo(java.lang.String userName)
Creates a new instance, initializing the user name as provided and all other vaiables with the same default values as in CmsContextInfo() . |
|
CmsContextInfo(java.lang.String userName,
java.lang.String projectName,
java.lang.String requestedUri,
java.lang.String siteRoot,
java.lang.String localeName,
java.lang.String encoding,
java.lang.String remoteAddr)
Creates a new instance with all context variables initialized. |
Method Summary | |
protected void |
checkFrozen()
Checks if this context info configuration is frozen. |
java.lang.Object |
clone()
Creates a clone of this context info object. |
void |
freeze()
Finalizes (freezes) the configuration of this context information. |
java.lang.String |
getEncoding()
Returns the encoding. |
java.util.Locale |
getLocale()
Returns the locale. |
java.lang.String |
getLocaleName()
Returns the locale name. |
CmsProject |
getProject()
Returns the project, or null if the project
has not been configured. |
java.lang.String |
getProjectName()
Returns the project name. |
java.lang.String |
getRemoteAddr()
Returns the remote ip address. |
java.lang.String |
getRequestedUri()
Returns the requested uri. |
java.lang.String |
getSiteRoot()
Returns the siteroot. |
CmsUser |
getUser()
Returns the user, or null if the user
has not been configured. |
java.lang.String |
getUserName()
Returns the username. |
void |
setEncoding(java.lang.String encoding)
Sets the encoding. |
void |
setLocale(java.util.Locale locale)
Sets the locale. |
void |
setLocaleName(java.lang.String localeName)
Sets the locale name. |
void |
setProjectName(java.lang.String projectName)
Sets the project name. |
void |
setRemoteAddr(java.lang.String remoteAddr)
Sets the remote ip address. |
void |
setRequestedUri(java.lang.String requestedUri)
Sets the requested uri. |
void |
setSiteRoot(java.lang.String siteRoot)
Sets the siteroot. |
void |
setUserName(java.lang.String userName)
Sets the username. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String LOCALHOST
Constructor Detail |
public CmsContextInfo()
The default values are:
public CmsContextInfo(CmsRequestContext requestContext)
requestContext
- the request context to initialize this context info withpublic CmsContextInfo(CmsUser user, CmsProject project, java.lang.String requestedUri, java.lang.String siteRoot, java.util.Locale locale, java.lang.String encoding, java.lang.String remoteAddr)
user
- the user to create the context withproject
- the project to create the context withrequestedUri
- the request URI to create the context withsiteRoot
- the site root to create the context withlocale
- the locale to create the context withencoding
- the encoding to create the context withremoteAddr
- the remote ip address to create the context withpublic CmsContextInfo(java.lang.String userName)
CmsContextInfo()
.
userName
- the user name to create the context withCmsContextInfo()
public CmsContextInfo(java.lang.String userName, java.lang.String projectName, java.lang.String requestedUri, java.lang.String siteRoot, java.lang.String localeName, java.lang.String encoding, java.lang.String remoteAddr)
userName
- the user name to create the context withprojectName
- the project name to create the context withrequestedUri
- the request URI to create the context withsiteRoot
- the site root to create the context withlocaleName
- the locale name to create the context withencoding
- the encoding to create the context withremoteAddr
- the remote ip address to create the context withMethod Detail |
public java.lang.Object clone()
Object.clone()
public void freeze()
After this entry has been frozen, any attempt to change the
configuration of this context info with one of the "set..." methods
will lead to a RuntimeException
.
public java.lang.String getEncoding()
public java.util.Locale getLocale()
public java.lang.String getLocaleName()
public CmsProject getProject()
null
if the project
has not been configured.If the project has not been configured, at last the project name will be available.
getProjectName()
public java.lang.String getProjectName()
getProject()
public java.lang.String getRemoteAddr()
public java.lang.String getRequestedUri()
public java.lang.String getSiteRoot()
public CmsUser getUser()
null
if the user
has not been configured.If the user has not been configured, at last the user name will be available.
getUserName()
public java.lang.String getUserName()
getUser()
public void setEncoding(java.lang.String encoding)
encoding
- the encoding to setpublic void setLocale(java.util.Locale locale)
Setting the locale name will override the currently selected locale and vice-versa. The locale name and the locale will always match.
locale
- the locale to setsetLocaleName(String)
public void setLocaleName(java.lang.String localeName)
Setting the locale name will override the currently selected locale and vice-versa. The locale name and the locale will always match.
localeName
- the locale name to setsetLocale(Locale)
public void setProjectName(java.lang.String projectName)
projectName
- the project name to setpublic void setRemoteAddr(java.lang.String remoteAddr)
remoteAddr
- the remote ip addresspublic void setRequestedUri(java.lang.String requestedUri)
requestedUri
- the requested uri to setpublic void setSiteRoot(java.lang.String siteRoot)
siteRoot
- the siteroot to setpublic void setUserName(java.lang.String userName)
userName
- the username to setprotected void checkFrozen() throws CmsRuntimeException
CmsRuntimeException
- in case the configuration is already frozen
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |