Common
[ class tree: Common ] [ index: Common ] [ all elements ]

Class: MapInfoCache

Source Location: /common/MapInfoCache.php

Class Overview


Class to manage the caching of the MapInfo server returned value.


Author(s):

Variables

Methods


Child classes:

ClientMapInfoCache
Client side MapInfo cache implementation
ServerMapInfoCache
Server side MapInfo cache implementation

Class Details

[line 30]
Class to manage the caching of the MapInfo server returned value.



Tags:

abstract:  
author:  Sylvain Pasche <sylvain.pasche@camptocamp.com>


[ Top ]


Class Variables

$cacheTimestamp =

[line 50]



Tags:

access:  private

Type:   int


[ Top ]

$config =

[line 40]



Tags:

access:  private

Type:   Config


[ Top ]

$log =

[line 35]



Tags:

access:  private

Type:   Logger


[ Top ]

$mapId =

[line 45]



Tags:

access:  private

Type:   string


[ Top ]



Class Methods


constructor __construct [line 56]

MapInfoCache __construct( Config $config, mixed $mapId)

Constructor



Tags:

access:  public


Overridden in child classes as:

ClientMapInfoCache::__construct()
Constructor
ServerMapInfoCache::__construct()
Constructor

Parameters:

Config   $config  

[ Top ]

method cacheMapInfo [line 96]

MapInfo cacheMapInfo( string 0)

Writes MapInfo cache file and returns MapInfo. It can be used by implementing classes to refill the cache when not valid anymore.



Tags:

return:  MapInfo
access:  protected


Parameters:

string   0   mapId

[ Top ]

method computeMapInfo [line 77]

MapInfo computeMapInfo( )

Method called to fetch the Mapinfo. On the client, it will issue a SOAP request, and on the server, it will build the structure out of configuration files.



Tags:

abstract:  
access:  protected


Overridden in child classes as:

ClientMapInfoCache::computeMapInfo()
ServerMapInfoCache::computeMapInfo()

[ Top ]

method getCacheTimestamp [line 139]

int getCacheTimestamp( )

Returns the timestamp of the last MapInfo from cache



Tags:

return:  the timestamp of the cached MapInfo, or null if not read from cache
access:  protected


[ Top ]

method getMapId [line 67]

string getMapId( )

Returns the current mapId



Tags:

access:  protected


[ Top ]

method getMapInfo [line 159]

MapInfo getMapInfo( string 0)

Returns MapInfo using cache



Tags:

return:  MapInfo
access:  public


Parameters:

string   0   mapId

[ Top ]

method getMapInfoFile [line 84]

MapInfo getMapInfoFile( string 0)

Gets MapInfo cache file name



Tags:

return:  MapInfo
access:  private


Parameters:

string   0   mapId

[ Top ]

method isCacheValid [line 150]

boolean isCacheValid( )

This method may be overrided by sublclasses to assert the validity if the MapInfo object read from cache (typically by comparing the timestamp field: see getCacheTimestamp() ). If it returns false, The MapInfo will be requested again, and put into the cache.



Tags:

return:  true if the cache is still valid
access:  protected


Overridden in child classes as:

ServerMapInfoCache::isCacheValid()

[ Top ]

method readCachedMapInfo [line 114]

MapInfo readCachedMapInfo( string 0)

Reads MapInfo from file and unserializes it



Tags:

return:  MapInfo
access:  private


Parameters:

string   0   mapId

[ Top ]

method skipCache [line 129]

boolean skipCache( )

Returns true if cache is disabled. It can be used by implementing classes to check if they should skip the caching.



Tags:

access:  protected


[ Top ]


Documentation generated on Wed, 6 Apr 2005 12:06:48 +0200 by phpDocumentor 1.3.0RC3