|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opencms.main.CmsContextInfo
public class CmsContextInfo
Contains user information for automated creation of a
CmsRequestContext during system runtime.
| Field Summary | |
|---|---|
static 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,
String requestedUri,
String siteRoot,
Locale locale,
String encoding,
String remoteAddr)
Creates a new instance with all context variables initialized. |
|
CmsContextInfo(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(String userName,
String projectName,
String requestedUri,
String siteRoot,
String localeName,
String encoding,
String remoteAddr)
Creates a new instance with all context variables initialized. |
|
| Method Summary | |
|---|---|
protected void |
checkFrozen()
Checks if this context info configuration is frozen. |
Object |
clone()
Creates a clone of this context info object. |
void |
freeze()
Finalizes (freezes) the configuration of this context information. |
String |
getEncoding()
Returns the encoding. |
Locale |
getLocale()
Returns the locale. |
String |
getLocaleName()
Returns the locale name. |
CmsProject |
getProject()
Returns the project, or null if the project
has not been configured. |
String |
getProjectName()
Returns the project name. |
String |
getRemoteAddr()
Returns the remote ip address. |
String |
getRequestedUri()
Returns the requested uri. |
String |
getSiteRoot()
Returns the siteroot. |
CmsUser |
getUser()
Returns the user, or null if the user
has not been configured. |
String |
getUserName()
Returns the username. |
void |
setEncoding(String encoding)
Sets the encoding. |
void |
setLocale(Locale locale)
Sets the locale. |
void |
setLocaleName(String localeName)
Sets the locale name. |
void |
setProjectName(String projectName)
Sets the project name. |
void |
setRemoteAddr(String remoteAddr)
Sets the remote ip address. |
void |
setRequestedUri(String requestedUri)
Sets the requested uri. |
void |
setSiteRoot(String siteRoot)
Sets the siteroot. |
void |
setUserName(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 String LOCALHOST
| Constructor Detail |
|---|
public CmsContextInfo()
The default values are:
public CmsContextInfo(CmsRequestContext requestContext)
requestContext - the request context to initialize this context info with
public CmsContextInfo(CmsUser user,
CmsProject project,
String requestedUri,
String siteRoot,
Locale locale,
String encoding,
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(String userName)
CmsContextInfo().
userName - the user name to create the context withCmsContextInfo()
public CmsContextInfo(String userName,
String projectName,
String requestedUri,
String siteRoot,
String localeName,
String encoding,
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 with| Method Detail |
|---|
public Object clone()
clone in class ObjectObject.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 String getEncoding()
public Locale getLocale()
public 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 String getProjectName()
getProject()public String getRemoteAddr()
public String getRequestedUri()
public 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 String getUserName()
getUser()public void setEncoding(String encoding)
encoding - the encoding to setpublic void setLocale(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(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(String projectName)
projectName - the project name to setpublic void setRemoteAddr(String remoteAddr)
remoteAddr - the remote ip addresspublic void setRequestedUri(String requestedUri)
requestedUri - the requested uri to setpublic void setSiteRoot(String siteRoot)
siteRoot - the siteroot to setpublic void setUserName(String userName)
userName - the username to set
protected 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 | |||||||||