- public class Alias
- extends klentry
- implements javax.servlet.ServletConfig
Represents a vqServer alias.
Implements javax.servlet.ServletConfig.
Warning: the key field is used to store the name of the
alias and should not be modified directly. Use setName() and getName()
instead.
- See Also:
- javax.servlet.ServletConfig
REDIRECT- In an alias's action field, this constant specifies that matching requests will
result in a redirection response.
RUNCGI- In an alias's action field, this constant specifies that matching requests will
invoke a CGI script.
RUNSERVLET- In an alias's action field, this constant specifies that matching requests will
invoke a servlet.
SERVEFILE- In an alias's action field, this constant specifies that matching requests will
result in a file being served.
Alias()
- Creates a new alias.
getAction()
- Returns an integer corresponding to the action for the alias.
getDefaultFile()
- Returns the default file.
getDirListAllowed()
- Returns true if directory listings are enabled for the alias.
getFilter()
- Returns the (list of) filter servlet specification(s) associated with
the alias.
getInitParameter(String)
- Returns the value of the initialisation parameter specified or null
if an initialisation parameter with this name does not exist.
getInitParameterNames()
- Returns an enumeration of the initialization
parameters for the alias.
getInitParameters()
- Returns the alias's initialisation parameters
which can be maniplulated
and modified using kvlist methods.
getName()
- Returns the name of the alias.
getNeverDestroy()
- Returns the never destroy setting of the alias.
getPath()
- Returns the real name of the alias.
getPreload()
- Returns the preload setting of the alias.
getReadAcl()
- Returns the read ACL of the alias.
getServletContext()
- Returns the ServletContext for the alias.
getWriteAcl()
- Returns the write ACL of the alias.
kill()
- Kills the alias.
save(vqos)
- Writes the alias to the output stream specified in vqServer .cfg file format.
setAction(int)
- Sets the action associated with the alias.
setDefaultFile(String)
- Sets the default file to the file name specified.
setDirListAllowed(boolean)
- Enables or disables directory listings for the alias.
setFilter(String)
- Sets the (list of) filter servlet specification(s) associated with the alias.
setName(String)
- Sets the name of the alias to the value specified.
setNeverDestroy(boolean)
- Sets the never destroy setting for the alias.
setPath(String)
- Sets the real name or path of the alias to the value specified.
setPreload(boolean)
- Sets the preload setting for the alias.
setReadAcl(Acl)
- Sets the read ACL of the alias.
setWriteAcl(Acl)
- Sets the write ACL of the alias.
RUNSERVLET
public static final int RUNSERVLET
In an alias's action field, this constant specifies that matching requests will
invoke a servlet.
REDIRECT
public static final int REDIRECT
In an alias's action field, this constant specifies that matching requests will
result in a redirection response.
SERVEFILE
public static final int SERVEFILE
In an alias's action field, this constant specifies that matching requests will
result in a file being served.
RUNCGI
public static final int RUNCGI
In an alias's action field, this constant specifies that matching requests will
invoke a CGI script.
Alias
public Alias()
Creates a new alias.
kill
public void kill()
Kills the alias.
Warning: do not invoke this method if the alias is a
member of a list.
- Overrides:
- kill in class klentry
save
public void save(vqos os) throws java.io.IOException
Writes the alias to the output stream specified in vqServer .cfg file format.
- Overrides:
- save in class klentry
getServletContext
public javax.servlet.ServletContext getServletContext()
Returns the ServletContext for the alias. This is actually the
HttpServer to which the alias belongs and can be cast accordingly.
A ServletConfig method.
getInitParameter
public java.lang.String getInitParameter(java.lang.String name)
Returns the value of the initialisation parameter specified or null
if an initialisation parameter with this name does not exist.
A ServletConfig method.
- Parameters:
name
- the parameter name
getInitParameterNames
public java.util.Enumeration getInitParameterNames()
Returns an enumeration of the initialization
parameters for the alias.
A ServletConfig method.
getInitParameters
public Parameters getInitParameters()
Returns the alias's initialisation parameters
which can be maniplulated
and modified using kvlist methods.
getName
public java.lang.String getName()
Returns the name of the alias.
The name of the alias is the string which is compared to
the names of files requested by client browsers.
setName
public void setName(java.lang.String name)
Sets the name of the alias to the value specified.
The name is checked
and modified according to vqServer's standard rules.
If the alias belongs to an HttpServer the server's aliases are reordered
automatically.
getPath
public java.lang.String getPath()
Returns the real name of the alias.
This is used to translate a requested file name into an actual file name.
setPath
public void setPath(java.lang.String thePath)
Sets the real name or path of the alias to the value specified.
The path is checked
and modified according to vqServer's standard rules and this
method may result in a change in the alias's name.
getDefaultFile
public java.lang.String getDefaultFile()
Returns the default file. This is the file which is sent if a request
corresponds to a directory.
setDefaultFile
public void setDefaultFile(java.lang.String theFile)
Sets the default file to the file name specified.
getAction
public int getAction()
Returns an integer corresponding to the action for the alias.
The value returned will be one of RUNSERVLET, REDIRECT, SERVEFILE and RUNCGI.
setAction
public void setAction(int theAction)
Sets the action associated with the alias.
The parameter must be one of be one of RUNSERVLET, REDIRECT, SERVEFILE and RUNCGI.
getFilter
public java.lang.String getFilter()
Returns the (list of) filter servlet specification(s) associated with
the alias.
setFilter
public void setFilter(java.lang.String theFilter)
Sets the (list of) filter servlet specification(s) associated with the alias.
getDirListAllowed
public boolean getDirListAllowed()
Returns true if directory listings are enabled for the alias.
setDirListAllowed
public void setDirListAllowed(boolean allowed)
Enables or disables directory listings for the alias.
getPreload
public boolean getPreload()
Returns the preload setting of the alias.
If this is true (and the alias corresponds to a single servlet)
the servlet will be initialised when vqServer starts.
setPreload
public void setPreload(boolean newSetting)
Sets the preload setting for the alias.
getNeverDestroy
public boolean getNeverDestroy()
Returns the never destroy setting of the alias.
If this is true (and the alias corresponds to a single servlet)
the servlet will never be destroyed because the number of
initialsed servlets excedes vqServer's maximum servlets
setting.
setNeverDestroy
public void setNeverDestroy(boolean newSetting)
Sets the never destroy setting for the alias.
getReadAcl
public Acl getReadAcl()
Returns the read ACL of the alias. null means that anyone can
submit a request corresponding to the alias. Warning: if the alias is read
from a .cfg file this method returns null until console.init() is called.
setReadAcl
public void setReadAcl(Acl theAcl)
Sets the read ACL of the alias.
The ACL must be a member of an ACLs before this method is invoked.
getWriteAcl
public Acl getWriteAcl()
Returns the write ACL of the alias. null means that anyone can
save files (using the HTTP PUT method) corresponding to the alias. Warning: if the alias is read
from a .cfg file this method returns null until console.init() is called.
setWriteAcl
public void setWriteAcl(Acl theAcl)
Sets the write ACL of the alias.
The ACL must be a member of an ACLs before this method is invoked.