omero.grid.monitors package

Module contents

class omero.grid.monitors.EventInfo(fileId='', type=Create)

Bases: object

The id and type of an event. The file’s basename is included for convenience, other stats are not included since they may be unavailable for some event types.

_EventInfo__compare(other)
class omero.grid.monitors.EventType(_n, _v)

Bases: Ice.EnumBase

Enumeration for Monitor event types returned.

Create, event is file or directory creation. Modify, event is file or directory modification. Delete, event is file or directory deletion. System, used to flag a system notification, info in fileId.

Create = Create
Delete = Delete
Modify = Modify
System = System
_enumerators = {0: Create, 1: Modify, 2: Delete, 3: System}
classmethod valueOf(_n)
class omero.grid.monitors.FileServer

Bases: Ice.Object

_ice_type = <IcePy.TypeInfo object>
_op_fileExists = <IcePy.Operation object>
_op_getATime = <IcePy.Operation object>
_op_getBaseName = <IcePy.Operation object>
_op_getBulkDirectory = <IcePy.Operation object>
_op_getCTime = <IcePy.Operation object>
_op_getDirectory = <IcePy.Operation object>
_op_getMTime = <IcePy.Operation object>
_op_getOwner = <IcePy.Operation object>
_op_getSHA1 = <IcePy.Operation object>
_op_getSize = <IcePy.Operation object>
_op_getStats = <IcePy.Operation object>
_op_isDir = <IcePy.Operation object>
_op_isFile = <IcePy.Operation object>
_op_readBlock = <IcePy.Operation object>
fileExists(fileId, current=None)

Query the existence of a file

An exception will be raised if the method fails to determine the existence.

Arguments:
fileId, see above.
Returns:
existence of file.
Exceptions:
omero::OmeroFSError
getATime(fileId, current=None)

Get atime of a file

An exception will be raised if the file no longer exists or is inaccessible.

Arguments:
fileId, see above.
Returns:
atime of file (float).
Exceptions:
omero::OmeroFSError
getBaseName(fileId, current=None)

Get base name of a file, this is the name stripped of any path, e.g. file.ext

An exception will be raised if the file no longer exists or is inaccessible.

Arguments:
fileId, see above.
Returns:
base name.
Exceptions:
omero::OmeroFSError
getBulkDirectory(absPath, filter, current=None)

Get an absolute directory from an OMERO.fs server.

The returned list will contain the file stats for each directory entry.

An exception will be raised if the path does not exist or is inaccessible to the OMERO.fs server. An exception will be raised if directory list cannot be returned for any other reason.

Arguments:
absPath, an absolute path on the monitor’s watch path (string). filter, a filter to apply to the listing, cf. ls (string).
Returns:
a directory listing (FileStatsList).
Exceptions:
omero::OmeroFSError
getCTime(fileId, current=None)

Get ctime of a file

An exception will be raised if the file no longer exists or is inaccessible.

Arguments:
fileId, see above.
Returns:
ctime of file (float).
Exceptions:
omero::OmeroFSError
getDirectory(absPath, filter, current=None)

Get an absolute directory from an OMERO.fs server.

The returned list will contain just the file names for each directory entry.

An exception will be raised if the path does not exist or is inaccessible to the OMERO.fs server. An exception will be raised if directory list cannot be returned for any other reason.

Arguments:
absPath, an absolute path on the monitor’s watch path (string). filter, a filter to apply to the listing, cf. ls (string).
Returns:
a directory listing (Ice::StringSeq).
Exceptions:
omero::OmeroFSError
getMTime(fileId, current=None)

Get mtime of a file

An exception will be raised if the file no longer exists or is inaccessible.

Arguments:
fileId, see above.
Returns:
mtime of file (float).
Exceptions:
omero::OmeroFSError
getOwner(fileId, current=None)

Get owner of a file

An exception will be raised if the file no longer exists or is inaccessible.

Arguments:
fileId, see above.
Returns:
owner of file (string).
Exceptions:
omero::OmeroFSError
getSHA1(fileId, current=None)

Get SHA1 of a file

An exception will be raised if the file no longer exists or is inaccessible. An exception will be raised if the SHA1 cannot be generated for any reason.

Arguments:
fileId, see above.
Returns:
SHA1 hex hash digest of file (string).
Exceptions:
omero::OmeroFSError
getSize(fileId, current=None)

Get size of a file in bytes

An exception will be raised if the file no longer exists or is inaccessible.

Arguments:
fileId, see above.
Returns:
byte size of file (long).
Exceptions:
omero::OmeroFSError
getStats(fileId, current=None)

Get all FileStats of a file

An exception will be raised if the file no longer exists or is inaccessible.

Arguments:
fileId, see above.
Returns:
file stats (FileStats).
Exceptions:
omero::OmeroFSError
ice_id(current=None)
ice_ids(current=None)
static ice_staticId()
isDir(fileId, current=None)

Query whether file is a directory

An exception will be raised if the file no longer exists or is inaccessible.

Arguments:
fileId, see above.
Returns:
true is directory (bool).
Exceptions:
omero::OmeroFSError
isFile(fileId, current=None)

Query whether file is a file

An exception will be raised if the file no longer exists or is inaccessible.

Arguments:
fileId, see above.
Returns:
true if file (bool).
Exceptions:
omero::OmeroFSError
readBlock(fileId, offset, size, current=None)

readBlock should open, read size bytes from offset and then close the file.

An exception will be raised if the file no longer exists or is inaccessible. An exception will be raised if the file read fails for any other reason.

Arguments:
fileId, see above. offset, byte offset into file from where read should begin (long). size, number of bytes that should be read (int).
Returns:
byte sequence of upto size bytes.
Exceptions:
omero::OmeroFSError
class omero.grid.monitors.FileServerPrx

Bases: IcePy.ObjectPrx

Get an absolute directory from an OMERO.fs server.

The returned list will contain just the file names for each directory entry.

An exception will be raised if the path does not exist or is inaccessible to the OMERO.fs server. An exception will be raised if directory list cannot be returned for any other reason.

Arguments:
absPath, an absolute path on the monitor’s watch path (string). filter, a filter to apply to the listing, cf. ls (string).
Returns:
a directory listing (Ice::StringSeq).
Exceptions:
omero::OmeroFSError
begin_fileExists(fileId, _response=None, _ex=None, _sent=None, _ctx=None)
begin_getATime(fileId, _response=None, _ex=None, _sent=None, _ctx=None)
begin_getBaseName(fileId, _response=None, _ex=None, _sent=None, _ctx=None)
begin_getBulkDirectory(absPath, filter, _response=None, _ex=None, _sent=None, _ctx=None)
begin_getCTime(fileId, _response=None, _ex=None, _sent=None, _ctx=None)
begin_getDirectory(absPath, filter, _response=None, _ex=None, _sent=None, _ctx=None)
begin_getMTime(fileId, _response=None, _ex=None, _sent=None, _ctx=None)
begin_getOwner(fileId, _response=None, _ex=None, _sent=None, _ctx=None)
begin_getSHA1(fileId, _response=None, _ex=None, _sent=None, _ctx=None)
begin_getSize(fileId, _response=None, _ex=None, _sent=None, _ctx=None)
begin_getStats(fileId, _response=None, _ex=None, _sent=None, _ctx=None)
begin_isDir(fileId, _response=None, _ex=None, _sent=None, _ctx=None)
begin_isFile(fileId, _response=None, _ex=None, _sent=None, _ctx=None)
begin_readBlock(fileId, offset, size, _response=None, _ex=None, _sent=None, _ctx=None)
static checkedCast(proxy, facetOrCtx=None, _ctx=None)
end_fileExists(_r)
end_getATime(_r)
end_getBaseName(_r)
end_getBulkDirectory(_r)
end_getCTime(_r)
end_getDirectory(_r)
end_getMTime(_r)
end_getOwner(_r)
end_getSHA1(_r)
end_getSize(_r)
end_getStats(_r)
end_isDir(_r)
end_isFile(_r)
end_readBlock(_r)
fileExists(fileId, _ctx=None)
getATime(fileId, _ctx=None)
getBaseName(fileId, _ctx=None)
getBulkDirectory(absPath, filter, _ctx=None)
getCTime(fileId, _ctx=None)
getDirectory(absPath, filter, _ctx=None)
getMTime(fileId, _ctx=None)
getOwner(fileId, _ctx=None)
getSHA1(fileId, _ctx=None)
getSize(fileId, _ctx=None)
getStats(fileId, _ctx=None)
isDir(fileId, _ctx=None)
isFile(fileId, _ctx=None)
readBlock(fileId, offset, size, _ctx=None)
static uncheckedCast(proxy, facet=None)
class omero.grid.monitors.FileStats(baseName='', owner='', size=0, mTime=0.0, cTime=0.0, aTime=0.0, type=File)

Bases: object

File stats.

What stats are likely to be needed? Could this struct be trimmed down or does it need any further attributes?

class omero.grid.monitors.FileType(_n, _v)

Bases: Ice.EnumBase

Dir = Dir
File = File
Mount = Mount
Unknown = Unknown
_enumerators = {0: File, 1: Dir, 2: Link, 3: Mount, 4: Unknown}
classmethod valueOf(_n)
class omero.grid.monitors.MonitorClient

Bases: Ice.Object

This interface must be implemented by a client that wishes to subscribe to an OMERO.fs server.

_ice_type = <IcePy.TypeInfo object>
_op_fsEventHappened = <IcePy.Operation object>
fsEventHappened(id, el, current=None)

Callback, called by the monitor upon the proxy of the OMERO.fs client.

Arguments:
id, monitor Id from which the event was reported (string). el, list of events (EventList).
Returns:
no explicit return value.
ice_id(current=None)
ice_ids(current=None)
static ice_staticId()
class omero.grid.monitors.MonitorClientPrx

Bases: IcePy.ObjectPrx

Callback, called by the monitor upon the proxy of the OMERO.fs client.

Arguments:
id, monitor Id from which the event was reported (string). el, list of events (EventList).
Returns:
no explicit return value.
begin_fsEventHappened(id, el, _response=None, _ex=None, _sent=None, _ctx=None)
static checkedCast(proxy, facetOrCtx=None, _ctx=None)
end_fsEventHappened(_r)
fsEventHappened(id, el, _ctx=None)
static uncheckedCast(proxy, facet=None)
class omero.grid.monitors.MonitorServer

Bases: Ice.Object

_ice_type = <IcePy.TypeInfo object>
_op_createMonitor = <IcePy.Operation object>
_op_destroyMonitor = <IcePy.Operation object>
_op_getMonitorState = <IcePy.Operation object>
_op_startMonitor = <IcePy.Operation object>
_op_stopMonitor = <IcePy.Operation object>
createMonitor(mType, eTypes, pMode, pathString, whitelist, blacklist, timeout, blockSize, ignoreSysFiles, ignoreDirEvents, platformCheck, proxy, current=None)

Create a monitor of events.

A exception will be raised if the event type or path mode is not supported by the Monitor implementation for a given OS. An exception will be raised if the path does not exist or is inaccessible to the monitor. An exception will be raised if a monitor cannot be created for any other reason.

Arguments:
mType, type of monitor to create (MonitorType). eTypes, a sequence of watch event type to monitor (WatchEventTypeList). pathString, full path of directory of interest (string). whitelist, list of files or extensions of interest (Ice::StringSeq). blacklist, list of directories, files or extensions that are not of interest (Ice::StringSeq). pMode, path mode of monitor (PathMode). proxy, a proxy of the client to which notifications will be sent (MonitorClient*). timeout, time in seconds fo monitor to time out (float). blockSize, the number of events to pack into each notification (int). ignoreSysFiles, ignore system files or not (bool). ignoreDirEvents, ignore directory events (bool). platformCheck, if true strictly check platform (bool).
Returns:
monitorId, a uuid1 (string).
Exceptions:
omero::OmeroFSError
destroyMonitor(id, current=None)

Destroy an existing monitor.

Attempting to destroy a monitor that is running will try to first stop the monitor and then destroy it. An exception will be raised if the id does not correspond to an existing monitor. An exception will be raised if a monitor cannot be destroyed (or stopped and destroyed) for any other reason, in this case the monitor’s state cannot be assumed.

Arguments:
id, monitor id (string).
Returns:
no explicit return value.
Exceptions:
omero::OmeroFSError
getMonitorState(id, current=None)

Get the state of an existing monitor.

An exception will be raised if the id does not correspond to an existing monitor.

Arguments:
id, monitor id (string).
Returns:
the monitor state (MonitorState).
Exceptions:
omero::OmeroFSError
ice_id(current=None)
ice_ids(current=None)
static ice_staticId()
startMonitor(id, current=None)

Start an existing monitor.

An exception will be raised if the id does not correspond to an existing monitor. An exception will be raised if a monitor cannot be started for any other reason, in this case the monitor’s state cannot be assumed.

Arguments:
id, monitor id (string).
Returns:
no explicit return value.
Exceptions:
omero::OmeroFSError
stopMonitor(id, current=None)

Stop an existing monitor.

Attempting to stop a monitor that is not running raises no exception. An exception will be raised if the id does not correspond to an existing monitor. An exception will be raised if a monitor cannot be stopped for any other reason, in this case the monitor’s state cannot be assumed.

Arguments:
id, monitor id (string).
Returns:
no explicit return value.
Exceptions:
omero::OmeroFSError
class omero.grid.monitors.MonitorServerPrx

Bases: IcePy.ObjectPrx

Create a monitor of events.

A exception will be raised if the event type or path mode is not supported by the Monitor implementation for a given OS. An exception will be raised if the path does not exist or is inaccessible to the monitor. An exception will be raised if a monitor cannot be created for any other reason.

Arguments:
mType, type of monitor to create (MonitorType). eTypes, a sequence of watch event type to monitor (WatchEventTypeList). pathString, full path of directory of interest (string). whitelist, list of files or extensions of interest (Ice::StringSeq). blacklist, list of directories, files or extensions that are not of interest (Ice::StringSeq). pMode, path mode of monitor (PathMode). proxy, a proxy of the client to which notifications will be sent (MonitorClient*). timeout, time in seconds fo monitor to time out (float). blockSize, the number of events to pack into each notification (int). ignoreSysFiles, ignore system files or not (bool). ignoreDirEvents, ignore directory events (bool). platformCheck, if true strictly check platform (bool).
Returns:
monitorId, a uuid1 (string).
Exceptions:
omero::OmeroFSError
begin_createMonitor(mType, eTypes, pMode, pathString, whitelist, blacklist, timeout, blockSize, ignoreSysFiles, ignoreDirEvents, platformCheck, proxy, _response=None, _ex=None, _sent=None, _ctx=None)
begin_destroyMonitor(id, _response=None, _ex=None, _sent=None, _ctx=None)
begin_getMonitorState(id, _response=None, _ex=None, _sent=None, _ctx=None)
begin_startMonitor(id, _response=None, _ex=None, _sent=None, _ctx=None)
begin_stopMonitor(id, _response=None, _ex=None, _sent=None, _ctx=None)
static checkedCast(proxy, facetOrCtx=None, _ctx=None)
createMonitor(mType, eTypes, pMode, pathString, whitelist, blacklist, timeout, blockSize, ignoreSysFiles, ignoreDirEvents, platformCheck, proxy, _ctx=None)
destroyMonitor(id, _ctx=None)
end_createMonitor(_r)
end_destroyMonitor(_r)
end_getMonitorState(_r)
end_startMonitor(_r)
end_stopMonitor(_r)
getMonitorState(id, _ctx=None)
startMonitor(id, _ctx=None)
stopMonitor(id, _ctx=None)
static uncheckedCast(proxy, facet=None)
class omero.grid.monitors.MonitorState(_n, _v)

Bases: Ice.EnumBase

Enumeration for Monitor state.

Stopped, a monitor exists but is not actively monitoring. Started, a monitor exists and is actively monitoring.

Started = Started
Stopped = Stopped
_enumerators = {0: Stopped, 1: Started}
classmethod valueOf(_n)
class omero.grid.monitors.MonitorType(_n, _v)

Bases: Ice.EnumBase

Inactivity = Inactivity
OneShot = OneShot
Persistent = Persistent
_enumerators = {0: Persistent, 1: OneShot, 2: Inactivity}
classmethod valueOf(_n)
class omero.grid.monitors.PathMode(_n, _v)

Bases: Ice.EnumBase

Enumeration for Monitor path modes.

Flat, monitor the specified directory but not its subdirectories. Recursive, monitor the specified directory and its subdirectories. Follow, monitor as Recursive but with new directories being added to the monitor if they are created.

Not all path modes may be implemented for a given operating system.

Flat = Flat
Follow = Follow
Recurse = Recurse
_enumerators = {0: Flat, 1: Recurse, 2: Follow}
classmethod valueOf(_n)
class omero.grid.monitors.WatchEventType(_n, _v)

Bases: Ice.EnumBase

Enumeration for event types to watch.

Create, notify on file creation only. Modify, notify on file modification only. Delete, notify on file deletion only. All, notify on all vents in the enumeration that apply to a given OS.

Not all event types may be implemented for a given operating system.

All = All
Creation = Creation
Deletion = Deletion
Modification = Modification
_enumerators = {0: Creation, 1: Modification, 2: Deletion, 3: All}
classmethod valueOf(_n)