org.mmbase.module.builders
Class Jumpers
java.lang.Object
|
+--org.mmbase.module.core.MMTable
|
+--org.mmbase.module.core.MMObjectBuilder
|
+--org.mmbase.module.builders.Jumpers
- public class Jumpers
- extends MMObjectBuilder
Maintains jumpers for redirecting urls.
The data stored in this builder is used to redirect urls based ons a specific key.
The jumpers builder is called from the servjumpers servlet.
The jumpers builder can be configured using two properties:
JumperCacheSize determines the size of the jumper cache (in nr of items).
The default size is 1000.
JumperNotFoundURL Determines the default url (such as a home page or error page)
when no jumper is found. If not specified nothing will be done if no jumper is found.
XXX:Note that this builder is called directly from a servlet, and may therefor
be bound to the cloud context rather than a cloud.
This would mean that in a multi-cloud environment, this builder will be shared.
- Version:
- 24 Apr 2001
- Author:
- Daniel Ockeloen, Pierre van Rooden (javadocs)
|
Field Summary |
protected org.mmbase.module.builders.JumpersCache |
jumpCache
Cache for URL jumpers. |
protected static java.lang.String |
jumperNotFoundURL
Default redirect if no jumper can be found. |
| Fields inherited from class org.mmbase.module.core.MMObjectBuilder |
broadcastChanges, database, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, fields, nodeCache, obj2type, OBJ2TYPE_MAX_SIZE, oType, REPLACE_CACHE, searchAge, sortedDBLayout, TEMPNODE_DEFAULT_SIZE, TemporaryNodes, virtual |
|
Method Summary |
void |
delJumpCache(java.lang.String key)
Removes a specified key from the cache. |
java.lang.String |
getGUIIndicator(java.lang.String field,
MMObjectNode node)
What should a GUI display for this node/field combo. |
java.lang.String |
getJump(java.lang.String key)
Retrieves a jumper for a specified key. |
java.lang.String |
getJump(java.util.StringTokenizer tok)
Retrieves a jumper for a specified key. |
boolean |
init()
Initializes the builder. |
boolean |
nodeChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
Clears the jump cache if a jumper was added, removed, or changed. |
boolean |
nodeLocalChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
Handles changes made to a node by this server. |
boolean |
nodeRemoteChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
Handles changes made to a node by a remote server. |
| Methods inherited from class org.mmbase.module.core.MMObjectBuilder |
addField, addLocalObserver, addRemoteObserver, buildSet, checkAddTmpField, commit, convertMMNode2SQL, count, create, createAlias, created, deleteNodeCache, drop, equals, equals, executeFunction, executeFunction, fieldLocalChanged, getAge, getAliasedNode, getAncestors, getCacheNumbers, getCacheSize, getCacheSize, getClassName, getConfigFile, getDBByte, getDBKey, getDBState, getDBText, getDBType, getDefaultTeaser, getDefaultUrl, getDescendants, getDescription, getDescription, getDescriptions, getEditFields, getField, getFieldNames, getFields, getFields, getFullTableName, getFunctionParameters, getGUIIndicator, getHardNode, getHardNode, getHTML, getInitParameter, getInitParameters, getList, getLocaleGUIIndicator, getLocaleGUIIndicator, getMachineName, getMaintainer, getNewNode, getNewTmpNode, getNextField, getNextField, getNode, getNode, getNode, getNode, getNodes, getNodeType, getNumberFromName, getObjectType, getObjectValue, getParentBuilder, getPluralName, getPluralName, getPluralNames, getQuery, getQuery, getQuery, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getSortedFields, getSortedListFields, getTableName, getTmpNode, getURLEncode, getValue, getVersion, getWAP, getXMLPath, hashCode, hostname_function, insert, insert, insertDone, isExtensionOf, isNodeCached, isVirtual, preCommit, preEdit, process, putTmpNode, readSearchResults, removeField, removeNode, removeRelations, removeTmpNode, replace, safeCache, safeCommit, safeInsert, search, search, search, searchIn, searchIn, searchIn, searchList, searchList, searchNumbers, searchVector, searchVector, searchVector, searchVector, searchVectorIn, searchVectorIn, searchVectorIn, searchVectorIn, searchWithWhere, sendFieldChangeSignal, setDBLayout_xml, setDefaults, setDescription, setDescriptions, setInitParameter, setMaintainer, setMMBase, setParentBuilder, setPluralNames, setSearchAge, setSingularNames, setTableName, setValue, setValue, setVersion, setXMLPath, setXMLValues, signalNewObject, testValidData, toString, toString, toXML, updateFields, waitUntilNodeChanged, wrap |
| Methods inherited from class org.mmbase.module.core.MMTable |
size |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
jumpCache
protected org.mmbase.module.builders.JumpersCache jumpCache
- Cache for URL jumpers.
jumperNotFoundURL
protected static java.lang.String jumperNotFoundURL
- Default redirect if no jumper can be found.
If this field is
null, a url will not be 'redirected' if the
search for a jumper failed. This may cause a 404 error on your server if
the path specified is unavailable.
However, you may need it if other servlets rely on specific paths
that would otherwise be caught by the jumper servlet.
The value fo this field is set using the JumperNotFoundURL
property in the builder configuration file.
Jumpers
public Jumpers()
init
public boolean init()
- Initializes the builder.
Determines the jumper cache size, and initializes it.
Also determines the default jumper url.
- Overrides:
init in class MMObjectBuilder
- Returns:
- always
true
getGUIIndicator
public java.lang.String getGUIIndicator(java.lang.String field,
MMObjectNode node)
- Description copied from class:
MMObjectBuilder
- What should a GUI display for this node/field combo.
Default is null (indicating to display the field as is)
Override this to display your own choice.
- Overrides:
getGUIIndicator in class MMObjectBuilder
- Following copied from class:
org.mmbase.module.core.MMObjectBuilder
- Parameters:
node - The node to displayfield - the name field of the field to display- Returns:
- the display of the node's field as a
String, null if not specified
getJump
public java.lang.String getJump(java.util.StringTokenizer tok)
- Retrieves a jumper for a specified key.
- Parameters:
tok - teh tokenizer, in which the first token is the key to search for.- Returns:
- the found alternate url.
delJumpCache
public void delJumpCache(java.lang.String key)
- Removes a specified key from the cache.
- Parameters:
key - the key to remove
getJump
public java.lang.String getJump(java.lang.String key)
- Retrieves a jumper for a specified key.
- Parameters:
key - the key to search for.- Returns:
- the found alternate url.
nodeRemoteChanged
public boolean nodeRemoteChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
- Handles changes made to a node by a remote server.
- Overrides:
nodeRemoteChanged in class MMObjectBuilder
- Parameters:
machine - Name of the machine that changed the node.number - the number of the node that was added, removed, or changed.builder - the name of the builder of the changed node (should be 'jumpers')ctype - the type of change
nodeLocalChanged
public boolean nodeLocalChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
- Handles changes made to a node by this server.
- Overrides:
nodeLocalChanged in class MMObjectBuilder
- Parameters:
machine - Name of the machine that changed the node.number - the number of the node that was added, removed, or changed.builder - the name of the builder of the changed node (should be 'jumpers')ctype - the type of change
nodeChanged
public boolean nodeChanged(java.lang.String machine,
java.lang.String number,
java.lang.String builder,
java.lang.String ctype)
- Clears the jump cache if a jumper was added, removed, or changed.
- Parameters:
machine - Name of the machine that changed the node.number - the number of the node that was added, removed, or changed.builder - the name of the builder of the changed node (should be 'jumpers')ctype - the type of change
MMBase build 1.6.5.20030923