org.mmbase.jumpers
Class Jumpers

Package class diagram package Jumpers
java.lang.Object
  extended by org.mmbase.util.functions.FunctionProvider
      extended by org.mmbase.module.core.MMTable
          extended by org.mmbase.module.core.MMObjectBuilder
              extended by org.mmbase.jumpers.Jumpers
All Implemented Interfaces:
EventListener, NodeEventListener, RelationEventListener

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 JumpersFilter.
The jumpers builder can be configured using two properties:


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:
$Id: Jumpers.java 41899 2010-04-13 14:13:34Z michiel $
Author:
Daniel Ockeloen, Pierre van Rooden (javadocs), Marcel Maatkamp, VPRO Digitaal
Application:
Tools, Jumpers

Field Summary
protected  Cache<String,String> jumpCache
          Cache for URL jumpers.
protected static String jumperNotFoundURL
          Default redirect if no jumper can be found.
 
Fields inherited from class org.mmbase.module.core.MMObjectBuilder
AGE_PARAMETERS, broadCastChanges, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, EVENT_TYPE_LOCAL, EVENT_TYPE_REMOTE, FIELD_NUMBER, FIELD_OBJECT_TYPE, FIELD_OWNER, fields, genericBlobCache, getFunctionsFunction, GUI_INDICATOR, GUI_PARAMETERS, guiFunction, infoFunction, internalVersion, nodeCache, oType, pluralNames, searchAge, singularNames, SYSTEM_OWNER, TEMPNODE_DEFAULT_SIZE, TMP_FIELD_EXISTS, TMP_FIELD_NUMBER, virtual, WRAP_PARAMETERS, wrapFunction
 
Fields inherited from class org.mmbase.module.core.MMTable
maxNodesFromQuery, mmb, storageConnector, tableName
 
Fields inherited from class org.mmbase.util.functions.FunctionProvider
functions, getFunctions
 
Constructor Summary
Jumpers()
           
 
Method Summary
 void delJumpCache(String key)
          Removes a specified key from the cache.
 void delJumpCache(String number, boolean nodeLocalChanged)
           
protected  Object executeFunction(MMObjectNode node, String function, List arguments)
           
 String getGUIIndicator(MMObjectNode node, Parameters args)
           
 String getIDJumper(String key)
           
 String getJump(String key)
           
 String getJump(String key, boolean reload)
          Retrieves a jumper for a specified key.
 String getJump(StringTokenizer tok)
          Retrieves a jumper for a specified key.
 String getJump(StringTokenizer tok, boolean reload)
           
 boolean init()
          Initializes the builder.
 void notify(NodeEvent event)
           
 
Methods inherited from class org.mmbase.module.core.MMObjectBuilder
addEventListener, addField, addLocalObserver, addRemoteObserver, broadcastChanges, checkAddTmpField, clearBlobCache, commit, create, createAlias, createAlias, createIfNotExists, delete, equals, equals, executeFunction, fieldLocalChanged, getAncestors, getBlobCache, getClassName, getConfigFile, getConfigResource, getDataTypeCollector, getDBState, getDBType, getDefaultTeaser, getDefaultUrl, getDescendants, getDescription, getDescription, getDescriptions, getEmptyNode, getField, getFieldNames, getFields, getFields, getFunction, getFunctionParameters, getFunctions, getGUIIndicator, getGUIIndicator, getHTML, getInitParameter, getInitParameters, getInitParameters, getInternalVersion, getList, getLocaleGUIIndicator, getLocaleGUIIndicator, getMachineName, getMaintainer, getNewNode, getNewTmpNode, getNextField, getNextField, getNode, getNode, getNode, getNodeFromCache, getNodeGUIIndicator, getNumber, getObjectType, getObjectValue, getParentBuilder, getPluralName, getPluralName, getPluralNames, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedInputStream, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getTmpNode, getURLEncode, getValue, getVersion, getWAP, getXMLPath, hasField, hashCode, hashCode, hostname_function, insert, insert, isExtensionOf, isNodeCached, isNull, isVirtual, loadInitParameters, newFunctionInstance, nodeLocalChanged, nodeRemoteChanged, notify, preCommit, process, removeEventListener, removeField, removeLocalObserver, removeNode, removeRelations, removeRemoteObserver, removeSyncNodes, replace, safeCache, sendFieldChangeSignal, setDefaults, setDescription, setDescriptions, setFields, setInitParameter, setMaintainer, setPluralNames, setSearchAge, setSingularNames, setUniqueValue, setUniqueValue, setValue, setValue, setVersion, setXMLPath, shutdown, testValidData, toString, toString, update, updateFields, wrap
 
Methods inherited from class org.mmbase.module.core.MMTable
count, count, created, getFullTableName, getMMBase, getNode, getNodes, getNodes, getNodes, getNodeType, getStorageConnector, getTableName, search, searchVector, setMMBase, setTableName, size
 
Methods inherited from class org.mmbase.util.functions.FunctionProvider
addFunction, createParameters, getFunction, getFunctions, getFunctionValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

jumpCache

protected Cache<String,String> jumpCache
Cache for URL jumpers.


jumperNotFoundURL

protected static 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.

Constructor Detail

Jumpers

public Jumpers()
Method Detail

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 String getGUIIndicator(MMObjectNode node,
                              Parameters args)
Overrides:
getGUIIndicator in class MMObjectBuilder
Since:
MMBase-1.7.1

getJump

public String getJump(StringTokenizer tok)
Retrieves a jumper for a specified key.

Parameters:
tok - the tokenizer, in which the first token is the key to search for.
Returns:
the found alternate url.

getJump

public String getJump(StringTokenizer tok,
                      boolean reload)

getJump

public String getJump(String key)

getIDJumper

public String getIDJumper(String key)

delJumpCache

public void delJumpCache(String key)
Removes a specified key from the cache.

Parameters:
key - the key to remove

delJumpCache

public void delJumpCache(String number,
                         boolean nodeLocalChanged)

getJump

public String getJump(String key,
                      boolean reload)
Retrieves a jumper for a specified key.

Parameters:
key - the key to search for.
Returns:
the found alternate url.

notify

public void notify(NodeEvent event)
Specified by:
notify in interface NodeEventListener
Overrides:
notify in class MMObjectBuilder

executeFunction

protected Object executeFunction(MMObjectNode node,
                                 String function,
                                 List arguments)
Overrides:
executeFunction in class MMObjectBuilder


MMBase Jumpers 2.0-SNAPSHOT - 2013-03-30T06:45