scone.netobjects
Class LinkCache

java.lang.Object
  extended by scone.netobjects.LinkCache
All Implemented Interfaces:
TableRecordCacheInterface

public class LinkCache
extends java.lang.Object
implements TableRecordCacheInterface

caches the links table from the database and provides means to update the database

Author:
Harald Weinreich, Volkert Buchmann

Field Summary
protected static CacheTable cache
           
static java.lang.Object lock
           
 
Constructor Summary
LinkCache()
           
 
Method Summary
static void clean()
           
static java.lang.String createKey(java.lang.String fromId, java.lang.String toId, java.lang.String fragment)
          Create a unique key for links
static Link get(NetNode from, NetNode to, java.lang.String fragment)
          returns the link defined in from, ponting to to
static Link get(NetNode from, NetNode to, java.lang.String fragment, adc.parser.HtmlTag tag)
          returns the link defined in from, ponting to to
static Link get(NetNode from, NetNode to, java.lang.String fragment, adc.parser.HtmlTag tag, boolean persistent)
          returns the link defined in from, ponting to to
static Link getById(java.lang.String id)
          returns the link specified by the id
static int getLinkCount(java.lang.String sqlClause)
          This method returns a number of Links to a given query string.
static java.util.Vector getLinks(java.lang.String sqlClause)
          This method returns a Vector of Links to a given query.
static LinkVector getLinksFrom(NetNode from)
          returns the links defined in from
static LinkVector getLinksTo(NetNode to)
          returns the links pointing to to
static void init(int timeTillCleanUp, int gcType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected static CacheTable cache

lock

public static java.lang.Object lock
Constructor Detail

LinkCache

public LinkCache()
Method Detail

init

public static void init(int timeTillCleanUp,
                        int gcType)

getLinksFrom

public static LinkVector getLinksFrom(NetNode from)
returns the links defined in from

Parameters:
from - the NetNode
Returns:
the links

getLinksTo

public static LinkVector getLinksTo(NetNode to)
returns the links pointing to to

Parameters:
to - the NetNode
Returns:
the links

getLinks

public static java.util.Vector getLinks(java.lang.String sqlClause)
This method returns a Vector of Links to a given query.

Parameters:
sqlClause - The where clause for the query string.

getLinkCount

public static int getLinkCount(java.lang.String sqlClause)
This method returns a number of Links to a given query string.

Parameters:
sqlClause - The where clause for the query string.
Returns:
The number of links in the Database.

get

public static Link get(NetNode from,
                       NetNode to,
                       java.lang.String fragment,
                       adc.parser.HtmlTag tag)
returns the link defined in from, ponting to to

Parameters:
from - the defining node
to - the linked node
fragment - the fragment
tag - the defining tag, used to fill new link objects with infos.
Returns:
the link

get

public static Link get(NetNode from,
                       NetNode to,
                       java.lang.String fragment)
returns the link defined in from, ponting to to

Parameters:
from - the defining node
to - the linked node
fragment - the fragment
Returns:
the link

get

public static Link get(NetNode from,
                       NetNode to,
                       java.lang.String fragment,
                       adc.parser.HtmlTag tag,
                       boolean persistent)
returns the link defined in from, ponting to to

Parameters:
from - the defining node
to - the linked node
fragment - the fragment
tag - the defining tag
persistent - shall the NetNode be made persistent?
true: yes, now,
false: no never.
For deferred DB persistency call get-method without boolean parameter.
Returns:
the link

getById

public static Link getById(java.lang.String id)
returns the link specified by the id

Parameters:
id - the id
Returns:
the link

createKey

public static java.lang.String createKey(java.lang.String fromId,
                                         java.lang.String toId,
                                         java.lang.String fragment)
Create a unique key for links


clean

public static void clean()