Top Description Inners Fields Constructors Methods
org.apache.catalina.startup

public final Class UserConfig

extends Object
implements LifecycleListener
Class Inheritance
All Implemented Interfaces
org.apache.catalina.LifecycleListener
Imports
java.io.File, java.util.ArrayList, .Enumeration, .List, java.util.concurrent.ExecutorService, .Future, java.util.regex.Pattern, org.apache.catalina.Context, .Host, .Lifecycle, .LifecycleEvent, .LifecycleListener, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.res.StringManager

Startup event listener for a Host that configures Contexts (web applications) for all defined "users" who have a web application in a directory with the specified name in their home directories. The context path of each deployed application will be set to ~xxxxx, where xxxxx is the username of the owning user for that web application
Author
Craig R. McClanahan

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
pack-priv Pattern
allow

A regular expression defining user who deployment is allowed.

private String
configClass

The Java class name of the Context configuration class we should use.

private String
contextClass

The Java class name of the Context implementation we should use.

pack-priv Pattern
deny

A regular expression defining user who deployment is denied.

private String
directoryName

The directory name to be searched for within each user home directory.

private String
homeBase

The base directory containing user home directories.

private Host
host

The Host we are associated with.

private static final Log
private static final StringManager
sm

The string resources for this package.

private String
userClass

The Java class name of the user database class we should use.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
deploy()

Deploy a web application for any user who has a web application present in a directory with a specified name within their home directory.

private void
deploy(String
Username owning the application to be deployed
user
,
String
Home directory of this user
home
)

Deploy a web application for the specified user if they have such an application in the defined directory within their home directory.

public String

Returns:

the regular expression used to test for user who deployment is allowed.
getAllow
()

public String

Returns:

the Context configuration class name.
getConfigClass
()

public String

Returns:

the Context implementation class name.
getContextClass
()

public String

Returns:

the regular expression used to test for user who deployment is denied.
getDeny
()

public String

Returns:

the directory name for user web applications.
getDirectoryName
()

public String

Returns:

the base directory containing user home directories.
getHomeBase
()

public String

Returns:

the user database class name for this component.
getUserClass
()

private boolean

Returns:

true if this user is allowed to deploy, false otherwise
isDeployAllowed
(String user)

Test allow and deny rules for the provided user.

public void
lifecycleEvent(LifecycleEvent
The lifecycle event that has occurred
event
)

Implements org.apache.catalina.LifecycleListener.lifecycleEvent.

Process the START event for an associated Host.

public void
setAllow(String
The new allow expression
allow
)

Set the regular expression used to test for user who deployment is allowed.

public void
setConfigClass(String
The new Context configuration class name.
configClass
)

Set the Context configuration class name.

public void
setContextClass(String
The new Context implementation class name.
contextClass
)

Set the Context implementation class name.

public void
setDeny(String
The new deny expression
deny
)

Set the regular expression used to test for user who deployment is denied.

public void
setDirectoryName(String
The new directory name
directoryName
)

Set the directory name for user web applications.

public void
setHomeBase(String
The new base directory
homeBase
)

Set the base directory containing user home directories.

public void
setUserClass(String
The user database class name
userClass
)

Set the user database class name for this component.

private void
start()

Process a "start" event for this Host.

private void
stop()

Process a "stop" event for this Host.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allowback to summary
pack-priv Pattern allow

A regular expression defining user who deployment is allowed.

configClassback to summary
private String configClass

The Java class name of the Context configuration class we should use.

contextClassback to summary
private String contextClass

The Java class name of the Context implementation we should use.

denyback to summary
pack-priv Pattern deny

A regular expression defining user who deployment is denied.

directoryNameback to summary
private String directoryName

The directory name to be searched for within each user home directory.

homeBaseback to summary
private String homeBase

The base directory containing user home directories.

hostback to summary
private Host host

The Host we are associated with.

logback to summary
private static final Log log
smback to summary
private static final StringManager sm

The string resources for this package.

userClassback to summary
private String userClass

The Java class name of the user database class we should use.

Constructor Detail

UserConfigback to summary
public UserConfig()

Method Detail

deployback to summary
private void deploy()

Deploy a web application for any user who has a web application present in a directory with a specified name within their home directory.

deployback to summary
private void deploy(String user, String home)

Deploy a web application for the specified user if they have such an application in the defined directory within their home directory.

Parameters
user:String

Username owning the application to be deployed

home:String

Home directory of this user

getAllowback to summary
public String getAllow()
Returns:String

the regular expression used to test for user who deployment is allowed.

getConfigClassback to summary
public String getConfigClass()
Returns:String

the Context configuration class name.

getContextClassback to summary
public String getContextClass()
Returns:String

the Context implementation class name.

getDenyback to summary
public String getDeny()
Returns:String

the regular expression used to test for user who deployment is denied.

getDirectoryNameback to summary
public String getDirectoryName()
Returns:String

the directory name for user web applications.

getHomeBaseback to summary
public String getHomeBase()
Returns:String

the base directory containing user home directories.

getUserClassback to summary
public String getUserClass()
Returns:String

the user database class name for this component.

isDeployAllowedback to summary
private boolean isDeployAllowed(String user)

Test allow and deny rules for the provided user.

Returns:boolean

true if this user is allowed to deploy, false otherwise

lifecycleEventback to summary
public void lifecycleEvent(LifecycleEvent event)

Implements org.apache.catalina.LifecycleListener.lifecycleEvent.

Process the START event for an associated Host.

Parameters
event:LifecycleEvent

The lifecycle event that has occurred

Annotations
@Override
setAllowback to summary
public void setAllow(String allow)

Set the regular expression used to test for user who deployment is allowed.

Parameters
allow:String

The new allow expression

setConfigClassback to summary
public void setConfigClass(String configClass)

Set the Context configuration class name.

Parameters
configClass:String

The new Context configuration class name.

setContextClassback to summary
public void setContextClass(String contextClass)

Set the Context implementation class name.

Parameters
contextClass:String

The new Context implementation class name.

setDenyback to summary
public void setDeny(String deny)

Set the regular expression used to test for user who deployment is denied.

Parameters
deny:String

The new deny expression

setDirectoryNameback to summary
public void setDirectoryName(String directoryName)

Set the directory name for user web applications.

Parameters
directoryName:String

The new directory name

setHomeBaseback to summary
public void setHomeBase(String homeBase)

Set the base directory containing user home directories.

Parameters
homeBase:String

The new base directory

setUserClassback to summary
public void setUserClass(String userClass)

Set the user database class name for this component.

Parameters
userClass:String

The user database class name

startback to summary
private void start()

Process a "start" event for this Host.

stopback to summary
private void stop()

Process a "stop" event for this Host.

org.apache.catalina.startup back to summary

private Class UserConfig.DeployUserDirectory

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
private UserConfig
private String
private String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

configback to summary
private UserConfig config
homeback to summary
private String home
userback to summary
private String user

Constructor Detail

DeployUserDirectoryback to summary
pack-priv DeployUserDirectory(UserConfig config, String user, String home)

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override