|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.servlet.connectionMethods.Channel
Everything there is to store about a channel.
ChannelTable
,
ConnectionMethod
,
StandardConnectionMethod
Field Summary | |
protected java.util.Vector |
filterIDs
|
Constructor Summary | |
Channel()
|
Method Summary | |
void |
addFilter(java.lang.String filterID)
Add a new filter to the stack of filters. |
static int |
compareURLPrefixes(java.lang.String a,
java.lang.String b)
Compare two URL prefixes in terms of specificity. |
void |
disable()
Set the channel enabled state to false. |
void |
enable()
Set the channel enabled state to true. |
java.lang.String |
getChannelID()
Get the channel ID. |
java.util.Date |
getCreateTime()
Return the time when this channel was created. |
boolean |
getEnabled()
Return the channel enabled state. |
java.util.Date |
getEnabledDisabledTime()
Return the time when enable() , disable() ,
or setEnabled() was last called. |
java.lang.String[] |
getFilterIDs()
Returns an array of Strings, the filter names. |
long |
getRequestCount()
Return the request count. |
java.lang.String |
getServletID()
Get the servlet ID. |
java.lang.String |
getURLPrefix()
Get the URL prefix. |
void |
incrRequestCount()
Increment the request count. |
void |
removeFilter(java.lang.String filterID)
Remove a filter to the stack of filters. |
void |
resetRequestCount()
Reset the request count. |
void |
setChannelID(java.lang.String channelID)
Set the channel ID. |
void |
setEnabled(boolean enabled)
Set the channel enabled state. |
void |
setRequestCount(long count)
Set the request count. |
void |
setServletID(java.lang.String servletID)
Set the servlet ID. |
void |
setURLPrefix(java.lang.String urlPrefix)
Set the URL prefix. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector filterIDs
Constructor Detail |
public Channel()
Method Detail |
public void setChannelID(java.lang.String channelID)
channelID
- The channel ID.public java.lang.String getChannelID()
public void setURLPrefix(java.lang.String urlPrefix)
urlPrefix
- The URL prefix.public java.lang.String getURLPrefix()
public void setServletID(java.lang.String servletID)
servletID
- The servlet ID.public java.lang.String getServletID()
public void setEnabled(boolean enabled)
enabled
- True to enable, false to disable.public void enable()
public void disable()
public boolean getEnabled()
public java.util.Date getCreateTime()
public java.util.Date getEnabledDisabledTime()
enable()
, disable()
,
or setEnabled()
was last called. Channels start off
disabled, and this value starts off
with the same value as getCreateTime()
public void addFilter(java.lang.String filterID) throws ConnectionMethodException
filterID
- The symbolic name to use to refer to this filter.
ConnectionMethodException
- If the name is already in use.public void removeFilter(java.lang.String filterID) throws ConnectionMethodException
addFilter()
.
filterID
- The symbolic name of the filter to remove.
ConnectionMethodException
- If the name is not found.public java.lang.String[] getFilterIDs()
public void setRequestCount(long count)
count
- The request count.public void resetRequestCount()
public void incrRequestCount()
public long getRequestCount()
public static int compareURLPrefixes(java.lang.String a, java.lang.String b)
This comparison can be used to sort channels into the order that
should be used for matching request URLs. When a request comes in,
it's URL is extracted. Then the list of URL prefixes is searched.
The first one that matches the beginning of the request URL is
found. This channel then recieves the request. The list of URL
prefixes should be sorted via this comparison operator. This will
ensure, for example, that /admin/
is examined before
/
is. If they were compared in the other order, the
/
would always match, and the channel associated with
/admin/
would never get any requests.
The URL prefixes are sorted based on the number of directory separator characters they have. More separators means the prefix is more specific. If two prefixes have the same number of directory components, then the one with the longer final path element is considered more specific. If the final path components are the same length, the strings are considered equal.
Here is an example of a resulting search order using this method:
/app1/a/b/c/d/e/ /app2/longer-name/but-less-path/elements/ /demo/free/supersavers/ /demo/free/supersavers /demo/free/super /index.html /index / index.html index "" (the empty string)Note that the empty string always comes last, and it matches all incoming URLs.
|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |