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)
| Fields inherited from class org.mmbase.module.core.MMObjectBuilder |
broadcastChanges, className, database, debug, description, descriptions, fields, NODE_MAX_SIZE, nodeCache, obj2type, OBJ2TYPE_MAX_SIZE, oType, replaceCache, 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, debug, deleteNodeCache, executeFunction, fieldLocalChanged, getAge, getAliasedNode, getCacheNumbers, getCacheSize, getCacheSize, getClassName, getDBByte, getDBKey, getDBState, getDBText, getDBType, getDefaultTeaser, getDefaultUrl, getDescription, getDescriptions, getDutchSName, getEditFields, getField, getFieldNames, getFields, getFullTableName, getFunctionParameters, getGUIIndicator, getHardNode, getHardNode, getHTML, getInitParameter, getInitParameters, getList, getMachineName, getMaintainer, getNewNode, getNewTmpNode, getNextField, getNode, getNode, getNode, getNode, getNodeType, getNumberFromName, getPluralName, getPluralName, getPluralNames, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getSortedFields, getSortedListFields, getTableName, getTmpNode, getURLEncode, getValue, getVersion, getWAP, getXMLPath, getXMLSetup, hostname_function, init_obj2type, insert, insert, insertDone, isNodeCached, isVirtual, isXMLConfig, preCommit, preEdit, process, putTmpNode, readSearchResults, removeField, removeNode, removeRelations, removeTmpNode, replace, safeCache, safeCommit, safeInsert, search, search, search, searchIn, searchIn, searchIn, searchNumbers, searchVector, searchVector, searchVector, searchVector, searchVectorIn, searchVectorIn, searchVectorIn, searchVectorIn, searchWithWhere, sendFieldChangeSignal, setClassName, setDBLayout_xml, setDBLayout, setDebug, setDefaults, setDescription, setDescriptions, setDutchSName, setInitParameter, setMaintainer, setMMBase, setPluralNames, setSearchAge, setSingularNames, setTableName, setValue, setValue, setVersion, setXmlConfig, setXMLPath, setXMLValues, signalNewObject, testValidData, toXML, waitUntilNodeChanged, wrap |
| Methods inherited from class org.mmbase.module.core.MMTable |
size |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 2002