eZ Publish Community Project (Legacy Stack) 2013.4
Interface

eZClusterEventListener

interface eZClusterEventListener

Interface to be implemented by any cluster event listener

Methods

void initialize()

Initializes the listener.

array|false loadMetadata(string $filepath)

Returns metadata array for $filepath, as supported by cluster.

void storeMetadata(array $metadata)

Updates a file's metadata

array|false fileExists(string $filepath)

Checks if a file exists on the cluster.

void deleteFile(string $filepath)

Deletes $filepath

void deleteByLike(string $like)

Notifies of a deleteByLike operation

void deleteByWildcard(string $wildcard)

Notifies of a deleteByWildcard operation

void deleteByDirList(array $dirList, string $commonPath, string $commonSuffix)

Notifies of a deleteByDirList operation

void deleteByNametrunk(string $nametrunk)

Deletes all files matching the provided $nametrunk string

Details

at line 21
public void initialize()

Initializes the listener.

Here you may sets various options depending on your needs.

Return Value

void

at line 39
public array|false loadMetadata(string $filepath)

Returns metadata array for $filepath, as supported by cluster.

This array must have following keys : - name - nametrunk (name trunk for the entry, if none, equals to "name") - namehash (md5 hash of "name") - scope - datatype - mtime (integer) - expired (integer, 0/1)

If no metadata is available, this method must return false

Parameters

string $filepath

Return Value

array|false

at line 47
public void storeMetadata(array $metadata)

Updates a file's metadata

Parameters

array $metadata Same array as {@link eZClusterEventListener::loadMetadata()}

Return Value

void

at line 64
public array|false fileExists(string $filepath)

Checks if a file exists on the cluster.

If file does exist, this method must return an array (numeric indexes) containing following data: - name - mtime

return array( 'filename.txt', 1329921039 );

Returns false if file doesn't exist

Parameters

string $filepath

Return Value

array|false

at line 72
public void deleteFile(string $filepath)

Deletes $filepath

Parameters

string $filepath

Return Value

void

at line 80
public void deleteByLike(string $like)

Notifies of a deleteByLike operation

Parameters

string $like

Return Value

void

at line 88
public void deleteByWildcard(string $wildcard)

Notifies of a deleteByWildcard operation

Parameters

string $wildcard

Return Value

void

at line 98
public void deleteByDirList(array $dirList, string $commonPath, string $commonSuffix)

Notifies of a deleteByDirList operation

Parameters

array $dirList
string $commonPath
string $commonSuffix

Return Value

void

at line 106
public void deleteByNametrunk(string $nametrunk)

Deletes all files matching the provided $nametrunk string

Parameters

string $nametrunk

Return Value

void