GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

adaptor.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <GATCPI.h>

Include dependency graph for fileops/adaptor.c:

Include dependency graph

Go to the source code of this file.

Compounds

struct  GATFileOpsAdaptor_Data
struct  GATFileOpsInstance_Data

Defines

#define COPY_COMMAND   "/bin/cp"
#define MOVE_COMMAND   "/bin/mv"
#define REMOVE_COMMAND   "/bin/rm -f"
#define __countof(x)   (sizeof(x)/sizeof(x[0]))
#define METRIC_FILE_COPIED   0
#define METRIC_FILE_MOVED   1
#define METRIC_FILE_DELETED   2
#define METRIC_FILE_SIZE   3

Typedefs

typedef GATFileOpsAdaptor_Data GATFileOpsAdaptor_Data
typedef GATFileOpsInstance_Data GATFileOpsInstance_Data

Functions

void fileops_adaptor_FileCPI_Destroy (void *data)
 fileops_adaptor_FileCPI_Destroy Destroy the adaptor-provided data object on GATFileCPI destruction.

GATResult fileops_adaptor_FileCPI_ServiceActions (void *data, GATFileCPI_Instance *instance_data, GATTimePeriod_const timeout)
 fileops_adaptor_FileCPI_ServiceActions

GATResult fileops_adaptor_FileCPI_CreateInstance (void *data, GATFileCPI_Instance *instance_data)
 fileops_adaptor_FileCPI_CreateInstance Create a new CPI object instance.

void fileops_adaptor_FileCPI_DestroyInstance (void *data, GATFileCPI_Instance *instance_data)
 fileops_adaptor_FileCPI_DestroyInstance Destroy a CPI object instance.

GATResult fileops_adaptor_FileCPI_CloneInstance (void *data, GATFileCPI_Instance const *instance_data, GATFileCPI_Instance *new_instance_data)
 fileops_adaptor_FileCPI_CloneInstance Clone a CPI object instance.

GATResult fileops_adaptor_FileCPI_EqualsInstance (void *data, GATFileCPI_Instance const *lhs, GATFileCPI_Instance const *rhs, GATBool *isequal)
 fileops_adaptor_FileCPI_EqualsInstance Clone a CPI object instance.

GATResult fileops_adaptor_FileCPI_Serialise (GATFileCPI cpi, GATFileCPI_Instance const *instance_data, GATObject stream, GATBool clear_dirty)
 fileops_adaptor_FileCPI_Serialise

GATResult fileops_adaptor_FileCPI_DeSerialise (GATFileCPI cpi, GATObject stream, GATFileCPI_Instance *instance_data)
 fileops_adaptor_FileCPI_DeSerialise

GATResult fileops_adaptor_FileCPI_Copy (void *data, GATFileCPI_Instance const *instance_data, GATLocation_const targetLocation, GATFileMode mode)
 fileops_adaptor_FileCPI_Copy Copy a file from one location to another.

GATResult fileops_adaptor_FileCPI_Move (void *data, GATFileCPI_Instance const *instance_data, GATLocation_const targetLocation, GATFileMode mode)
 fileops_adaptor_FileCPI_Move Move a file from one location to another.

GATResult fileops_adaptor_FileCPI_Delete (void *data, GATFileCPI_Instance const *instance_data)
 fileops_adaptor_FileCPI_Delete Delete a file.

GATResult fileops_adaptor_FileCPI_IsReadable (void *data, GATFileCPI_Instance const *instance_data)
 fileops_adaptor_FileCPI_IsReadable Tests a GATFile test for its readability.

GATResult fileops_adaptor_FileCPI_IsWritable (void *data, GATFileCPI_Instance const *instance_data)
 fileops_adaptor_FileCPI_IsWritable Tests a GATFile test for its writability.

GATResult fileops_adaptor_FileCPI_GetLength (void *data, GATFileCPI_Instance const *instance_data, unsigned long *length)
 fileops_adaptor_FileCPI_GetLength Returns the size of a GATFile.

GATResult fileops_adaptor_FileCPI_LastWriteTime (void *data, GATFileCPI_Instance const *instance_data, GATTime *lw_time)
 fileops_adaptor_FileCPI_LastWriteTime Returns the last write time of a GATFile.

GATResult fileops_adaptor_FileCPI_GetMetrics (void *data, GATFileCPI_Instance const *instance_data, GATList_GATMetric *metrics)
 fileops_adaptor_FileCPI_GetMetrics

GATResult fileops_adaptor_FileCPI_GetMetricEvent (void *data, GATFileCPI_Instance const *instance_data, GATMetric metric, GATMetricEvent *event)
 fileops_adaptor_FileCPI_GetMetricEvent

GATResult fileops_adaptor_get_file_size (void *data, GATType type, void *buffer, GATuint32 size)
 fileops_adaptor_get_file_size

char * fileops_get_table_entry (GATTable_const table, char const *key)
 fileops_get_table_entry Get a table entry

GATResult fileops_copy_config (GATTable internal_data, GATTable_const system_config, GATTable_const instance_config, char const *key, char const *default_value)
 fileops_copy_config Extract configuration data from the config tables

GATResult fileops_adaptor_FireCopiedEvent (GATContext context, GATMonitorable_Impl monitorable, GATObject_const source, char const *name)
 fileops_adaptor_FireCopiedEvent

GATResult fileops_adaptor_FireMovedEvent (GATContext context, GATMonitorable_Impl monitorable, GATObject_const source, char const *name)
 fileops_adaptor_FireMovedEvent

GATResult fileops_adaptor_FireDeletedEvent (GATContext context, GATMonitorable_Impl monitorable, GATObject_const source, char const *name)
 fileops_adaptor_FireDeletedEvent

GATFileOpsAdaptor_DataGATFileOpsAdaptor_Data_Create ()
 GATFileOpsAdaptor_Data_Create This helper creates an instance of a GATFileOpsAdaptor_Data object.

void GATFileOpsAdaptor_Data_Destroy (GATFileOpsAdaptor_Data *)
 GATFileOpsAdaptor_Data_Destroy This helper destroys an instance of a GATFileOpsAdaptor_Data object.

GATResult fileops_adaptor_register (GATContext error_context, GATRegistry registry, GATTable_const system_config, GATTable_const instance_config, void *token)
 fileops_adaptor_register Registers all CPIs this adaptor provides.


Variables

GATStaticMetric metric_data []


Define Documentation

#define COPY_COMMAND   "/bin/cp"
 

Definition at line 43 of file fileops/adaptor.c.

Referenced by fileops_adaptor_register().

#define MOVE_COMMAND   "/bin/mv"
 

Definition at line 44 of file fileops/adaptor.c.

Referenced by fileops_adaptor_register().

#define REMOVE_COMMAND   "/bin/rm -f"
 

Definition at line 45 of file fileops/adaptor.c.

Referenced by fileops_adaptor_register().

#define __countof      (sizeof(x)/sizeof(x[0]))
 

Definition at line 47 of file fileops/adaptor.c.

#define METRIC_FILE_COPIED   0
 

Definition at line 221 of file fileops/adaptor.c.

Referenced by fileops_adaptor_FireCopiedEvent().

#define METRIC_FILE_MOVED   1
 

Definition at line 222 of file fileops/adaptor.c.

Referenced by fileops_adaptor_FireMovedEvent().

#define METRIC_FILE_DELETED   2
 

Definition at line 223 of file fileops/adaptor.c.

Referenced by fileops_adaptor_FireDeletedEvent().

#define METRIC_FILE_SIZE   3
 

Definition at line 224 of file fileops/adaptor.c.

Referenced by fileops_adaptor_FileCPI_GetMetricEvent().


Typedef Documentation

typedef struct GATFileOpsAdaptor_Data GATFileOpsAdaptor_Data
 

typedef struct GATFileOpsInstance_Data GATFileOpsInstance_Data
 


Function Documentation

void fileops_adaptor_FileCPI_Destroy void *    data [static]
 

fileops_adaptor_FileCPI_Destroy Destroy the adaptor-provided data object on GATFileCPI destruction.

When the GATFileCPI object created in this adaptor's _register function is destroyed, this function is invoked to allow the adaptor to cleanup.

Parameters:
data  Adaptor-provided data object.

Definition at line 358 of file fileops/adaptor.c.

References data, and GATFileOpsAdaptor_Data_Destroy().

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FileCPI_ServiceActions void *    data,
GATFileCPI_Instance   instance_data,
GATTimePeriod_const    timeout
[static]
 

fileops_adaptor_FileCPI_ServiceActions

The function fileops_adaptor_FileCPI_ServiceActions is called, whenever the client calls GATContext_ServiceActions. This function is called for every created object. This function should be used to update all instance specific data, which may have been changed asynchronously or to fire pending events.

Parameters:
data  Adaptor-provided data object.
instance_data  The instance data of this CPI object
timeout  This may be a 0 timeout to indicate no timeout at all, or a specific time length.
Returns:
An error code.

Definition at line 381 of file fileops/adaptor.c.

References data, GAT_NOTIMPL, and GATTimePeriod_const.

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FileCPI_CreateInstance void *    adaptor_data,
GATFileCPI_Instance   data
[static]
 

fileops_adaptor_FileCPI_CreateInstance Create a new CPI object instance.

Adaptor implementation of create instance capability.

This function gets called for every created object instance. The adaptor may provide some arbitrary instance data, which is to be stored inside the provided data structure (there is an instance_data member, which hold this adaptor provided object instance data). This overall data structure is handed back to the adaptor on every function call always as the second parameter.

Parameters:
adaptor_data  Adaptor-provided data object.
data  The pointer to the data structure containing at least the constructor provided data items and a member instance_data, which may be used by the adaptor to store CPI instance specific data.
Returns:
An error code.

Definition at line 406 of file fileops/adaptor.c.

References data, GAT_INVALID_PARAMETER, GAT_SUCCESS, GATResult, and GATFileCPI_Instance::instance_data.

Referenced by fileops_adaptor_register().

void fileops_adaptor_FileCPI_DestroyInstance void *    adaptor_data,
GATFileCPI_Instance   data
[static]
 

fileops_adaptor_FileCPI_DestroyInstance Destroy a CPI object instance.

Adaptor implementation of destroy instance capability.

Parameters:
data  Adaptor-provided data object.
instance_data  The instance data of the CPI object to destroy.

Definition at line 427 of file fileops/adaptor.c.

References assert, data, and GATFileCPI_Instance::instance_data.

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FileCPI_CloneInstance void *    adaptor_data,
GATFileCPI_Instance const *    data,
GATFileCPI_Instance   new_data
[static]
 

fileops_adaptor_FileCPI_CloneInstance Clone a CPI object instance.

Adaptor implementation of the clone instance capability.

Parameters:
data  Adaptor-provided data object.
instance_data  The instance data of this CPI object
new_instance_data  The pointer to the variable, where the instance data of the cloned CPI object is to be returned to.
Returns:
An error code.

Definition at line 446 of file fileops/adaptor.c.

References data, GAT_INVALID_PARAMETER, GAT_SUCCESS, GATResult, and GATFileCPI_Instance::instance_data.

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FileCPI_EqualsInstance void *    adaptor_data,
GATFileCPI_Instance const *    lhs,
GATFileCPI_Instance const *    rhs,
GATBool   isequal
[static]
 

fileops_adaptor_FileCPI_EqualsInstance Clone a CPI object instance.

Adaptor implementation of the clone instance capability.

Parameters:
data  Adaptor-provided data object.
lhs  The instance data of the left CPI object.
rhs  The instance data of the right CPI object.
isequal  The pointer to the variable, where the result is to be returned to.
Returns:
An error code.

Definition at line 473 of file fileops/adaptor.c.

References GAT_INVALID_PARAMETER, GAT_SUCCESS, GATBool, GATResult, and GATTrue.

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FileCPI_Serialise GATFileCPI    cpi,
GATFileCPI_Instance const *    instance_data,
GATObject    stream,
GATBool    clear_dirty
[static]
 

fileops_adaptor_FileCPI_Serialise

The function fileops_adaptor_FileCPI_Serialise is called by the GAT engine, whenever the client requested a Serialise operation on the corresponding GATFile object. The function should serialise into the given stream all the instance specific data of the object.

Parameters:
data  Adaptor-provided data object.
instance_data  The instance data of this CPI object.
stream  The GATSTream object to use for serialisation of the instance data.
clear_dirty  This flag defines, whether the dirty flag of saved dependent objects is to be cleared.
Returns:
An error code

Definition at line 508 of file fileops/adaptor.c.

References cpi, GAT_SUCCESS, GATBool, and GATResult.

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FileCPI_DeSerialise GATFileCPI    cpi,
GATObject    stream,
GATFileCPI_Instance   instance_data
[static]
 

fileops_adaptor_FileCPI_DeSerialise

The function fileops_adaptor_FileCPI_DeSerialise is called by the GATEngine, whenever the client requested a DeSerialise operation for a GATFile object. The function should deserialise all the instance specific data of the object from the given stream.

Parameters:
data  Adaptor-provided data object.
stream  The GATSTream object to use for de-serialisation of the instance data.
instance_data  The instance data of this CPI object.
Returns:
An error code

Definition at line 533 of file fileops/adaptor.c.

References cpi, GAT_INVALID_PARAMETER, GAT_SUCCESS, GATResult, and GATFileCPI_Instance::instance_data.

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FileCPI_Copy void *    adaptor_data,
GATFileCPI_Instance const *    data,
GATLocation_const    targetLocation,
GATFileMode    mode
[static]
 

fileops_adaptor_FileCPI_Copy Copy a file from one location to another.

Adaptor implementation of file copy capability.

Parameters:
data  Adaptor-provided data object.
instance_data  The instance data of this CPI object
targetLocation  Location to copy file to.
Returns:
An error code.

Definition at line 561 of file fileops/adaptor.c.

References GATFileOpsAdaptor_Data::config_data, GATFileCPI_Instance::context, data, fileops_adaptor_FireCopiedEvent(), fileops_get_table_entry(), GAT_CREATE_STATUS, GAT_FAIL, GAT_FILEOPEN_ERROR, GAT_MEMORYFAILURE, GAT_RETURN_STATUS, GAT_USES_STATUS, GATFileMode, GATFileMode_Overwrite, GATLocation_const, GATLocation_ToString(), GATFileCPI_Instance::location, GATFileCPI_Instance::monitorable, and GATFileCPI_Instance::source.

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FileCPI_Move void *    adaptor_data,
GATFileCPI_Instance const *    data,
GATLocation_const    targetLocation,
GATFileMode    mode
[static]
 

fileops_adaptor_FileCPI_Move Move a file from one location to another.

Adaptor implementation of file move capability.

Parameters:
data  Adaptor-provided data object.
instance_data  The instance data of this CPI object
targetLocation  Location to copy file to.
Returns:
An error code.

Definition at line 646 of file fileops/adaptor.c.

References GATFileOpsAdaptor_Data::config_data, GATFileCPI_Instance::context, data, fileops_adaptor_FireMovedEvent(), fileops_get_table_entry(), GAT_CREATE_STATUS, GAT_FAIL, GAT_FILEOPEN_ERROR, GAT_MEMORYFAILURE, GAT_RETURN_STATUS, GAT_USES_STATUS, GATFileMode, GATFileMode_Overwrite, GATLocation_const, GATLocation_ToString(), GATFileCPI_Instance::location, GATFileCPI_Instance::monitorable, and GATFileCPI_Instance::source.

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FileCPI_Delete void *    adaptor_data,
GATFileCPI_Instance const *    data
[static]
 

fileops_adaptor_FileCPI_Delete Delete a file.

Adaptor implementation of file delete capability.

Parameters:
data  Adaptor-provided data object.
instance_data  The instance data of this CPI object
Returns:
An error code.

Definition at line 728 of file fileops/adaptor.c.

References GATFileOpsAdaptor_Data::config_data, GATFileCPI_Instance::context, data, fileops_adaptor_FireDeletedEvent(), fileops_get_table_entry(), GAT_CREATE_STATUS, GAT_FAIL, GAT_MEMORYFAILURE, GAT_RETURN_STATUS, GAT_USES_STATUS, GATLocation_ToString(), GATFileCPI_Instance::location, GATFileCPI_Instance::monitorable, and GATFileCPI_Instance::source.

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FileCPI_IsReadable void *    adaptor_data,
GATFileCPI_Instance const *    data
[static]
 

fileops_adaptor_FileCPI_IsReadable Tests a GATFile test for its readability.

Adaptor implementation of the is_readable capability.

Parameters:
data  Adaptor-provided data object.
instance_data  The instance data of this CPI object
Returns:
An error code.

Definition at line 796 of file fileops/adaptor.c.

References GATFileCPI_Instance::context, data, GAT_CREATE_STATUS, GAT_FALSE, GAT_FILEOPEN_ERROR, GAT_MEMORYFAILURE, GAT_RETURN_STATUS, GAT_SUCCESS, GAT_USES_STATUS, GATLocation_ToString(), and GATFileCPI_Instance::location.

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FileCPI_IsWritable void *    adaptor_data,
GATFileCPI_Instance const *    data
[static]
 

fileops_adaptor_FileCPI_IsWritable Tests a GATFile test for its writability.

Adaptor implementation of the is_writable capability.

Parameters:
data  Adaptor-provided data object.
instance_data  The instance data of this CPI object
Returns:
An error code.

Definition at line 836 of file fileops/adaptor.c.

References GATFileCPI_Instance::context, data, GAT_CREATE_STATUS, GAT_FALSE, GAT_FILEOPEN_ERROR, GAT_MEMORYFAILURE, GAT_RETURN_STATUS, GAT_SUCCESS, GAT_USES_STATUS, GATLocation_ToString(), and GATFileCPI_Instance::location.

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FileCPI_GetLength void *    adaptor_data,
GATFileCPI_Instance const *    data,
unsigned long *    length
[static]
 

fileops_adaptor_FileCPI_GetLength Returns the size of a GATFile.

Adaptor implementation of the get_length capability.

Parameters:
data  Adaptor-provided data object.
instance_data  The instance data of this CPI object.
length  The pointer to the variable, which receives the current size of the inspected file.
Returns:
An error code.

Definition at line 878 of file fileops/adaptor.c.

References GATFileCPI_Instance::context, data, GAT_CREATE_STATUS, GAT_FILEOPEN_ERROR, GAT_INVALID_PARAMETER, GAT_MEMORYFAILURE, GAT_RETURN_STATUS, GAT_USES_STATUS, GATLocation_ToString(), and GATFileCPI_Instance::location.

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FileCPI_LastWriteTime void *    adaptor_data,
GATFileCPI_Instance const *    data,
GATTime   lw_time
[static]
 

fileops_adaptor_FileCPI_LastWriteTime Returns the last write time of a GATFile.

Adaptor implementation of the get_lastwritetime capability.

Parameters:
data  Adaptor-provided data object.
instance_data  The instance data of this CPI object.
lw_time  The pointer to the variable, which receives the last write time of the inspected file.
Returns:
An error code.

Definition at line 927 of file fileops/adaptor.c.

References GATFileCPI_Instance::context, data, GAT_CREATE_STATUS, GAT_FILEOPEN_ERROR, GAT_INVALID_PARAMETER, GAT_MEMORYFAILURE, GAT_RETURN_STATUS, GAT_USES_STATUS, GATLocation_ToString(), GATTime_Create(), and GATFileCPI_Instance::location.

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FileCPI_GetMetrics void *    data,
GATFileCPI_Instance const *    instance_data,
GATList_GATMetric *    metrics
[static]
 

fileops_adaptor_FileCPI_GetMetrics

The function fileops_adaptor_FileCPI_GetMetrics should return a list of GATMetric objects supported by this adaptor. I.e. the adaptor is capable to fire GATMetricEvents for the returned metrics. This list should include all the supported metrics, event like and continuous ones.

Parameters:
data  Adaptor-provided data object.
instance_data  Instance data for the CPI provider object.
metrics  The pointer to the variable, which receives the returned list of metrics.
Returns:
An error code.

Definition at line 980 of file fileops/adaptor.c.

References __countof, data, and GATMetric_CreateListOfMetrics().

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FileCPI_GetMetricEvent void *    data,
GATFileCPI_Instance const *    instance_data,
GATMetric    metric,
GATMetricEvent   event
[static]
 

fileops_adaptor_FileCPI_GetMetricEvent

The function fileops_adaptor_FileCPI_GetMetricEvent should return the GATMetricEvent associated with the given continuous metric. This function gets called for continuous metrics only, since returning the metric event object to the caller is th only way for the client to get access to it.

Parameters:
data  Adaptor-provided data object.
instance_data  Instance data for the CPI provider object.
metric  The metric instance describing the metric event to return. This metric should be equivalent to one of the metrics returned by our own GetMetrics CPI function (see above). If this is another (not known to us metric), an error should be returned.
event  The pointer to the variable, which receives the metric event to return.
Returns:
An error code.

Definition at line 1006 of file fileops/adaptor.c.

References GATFileCPI_Instance::context, data, fileops_adaptor_get_file_size(), GAT_CREATE_STATUS, GAT_CURRENT_STATUS, GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_MEMORYFAILURE, GAT_RETURN_STATUS, GAT_SUCCEEDED, GAT_USES_STATUS, GATBool, GATFalse, GATMetric, GATMetric_CreateMetric(), GATMetric_Destroy(), GATMetric_Equals(), GATMetricEvent_Create_Continuous(), GATMetricEvent_Destroy(), GATTrue, GATFileCPI_Instance::location, METRIC_FILE_SIZE, and GATFileCPI_Instance::source.

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_get_file_size void *    data,
GATType    type,
void *    buffer,
GATuint32    size
[static]
 

fileops_adaptor_get_file_size

The function fileops_adaptor_get_file_size has to return the size of the referenced file. This function gets called, whenever the client code tries to retrieve the value associated with the corresponding GATMetricEvent.

Definition at line 1305 of file fileops/adaptor.c.

References data, GAT_FILEOPEN_ERROR, GAT_INVALID_PARAMETER, GAT_MEMORYFAILURE, GAT_SUCCESS, GATint32, GATLocation_ToString(), GATResult, GATType, GATType_GATuint32, GATuint32, and size.

Referenced by fileops_adaptor_FileCPI_GetMetricEvent().

char * fileops_get_table_entry GATTable_const    table,
char const *    key
[static]
 

fileops_get_table_entry Get a table entry

Retrieve the data from a table, which is associated with a given key.

Parameters:
table  The table from which the data is to be retrieved
key  The key to look for
Returns:
The actual data or 0 (zero), if no data was found. Note, that the returned data is to be freed by the caller.

Definition at line 1078 of file fileops/adaptor.c.

References GATTable_const, and GATTable_Get_String().

Referenced by fileops_adaptor_FileCPI_Copy(), fileops_adaptor_FileCPI_Delete(), fileops_adaptor_FileCPI_Move(), and fileops_copy_config().

GATResult fileops_copy_config GATTable    internal_data,
GATTable_const    system_config,
GATTable_const    instance_config,
char const *    key,
char const *    default_value
[static]
 

fileops_copy_config Extract configuration data from the config tables

The function fileops_copy_config tries to find the data associated with the given key first in the supplied instance_config table and if not found in the supplied system_config table. If it isn't found either, it uses the supplied default value. The recovered data is stored into the internal_data table.

Parameters:
internal_data  The table, where the recovered data is to be stored in
system_config  The system configuration table
instance_config  The instance specific configuration table
key  The key for which the associated data is to be searched
default_value  The value to be used, if no entries in the configuration tables was found
Returns:
A GAT error code.

Definition at line 1117 of file fileops/adaptor.c.

References fileops_get_table_entry(), GAT_FAIL, GATResult, GATTable_Add_String(), and GATTable_const.

Referenced by fileops_adaptor_register().

GATResult fileops_adaptor_FireCopiedEvent GATContext    context,
GATMonitorable_Impl    monitorable,
GATObject_const    source,
char const *    name
[static]
 

fileops_adaptor_FireCopiedEvent

The function fileops_adaptor_FireCopiedEvent fires a 'file copied' event to all registered metric listeners.

Definition at line 1182 of file fileops/adaptor.c.

References GAT_CREATE_STATUS, GAT_CURRENT_STATUS, GAT_MEMORYFAILURE, GAT_RETURN_STATUS, GAT_SUCCEEDED, GAT_USES_STATUS, GATMetric, GATMetric_CreateMetric(), GATMetric_Destroy(), GATMetricEvent_Create_EventLike(), GATMetricEvent_Destroy(), GATMonitorable_Impl_FireEvent(), GATObject_const, GATuint32, METRIC_FILE_COPIED, and name.

Referenced by fileops_adaptor_FileCPI_Copy().

GATResult fileops_adaptor_FireMovedEvent GATContext    context,
GATMonitorable_Impl    monitorable,
GATObject_const    source,
char const *    name
[static]
 

fileops_adaptor_FireMovedEvent

The function fileops_adaptor_FireMovedEvent fires a 'file moved' event to all registered metric listeners.

Definition at line 1222 of file fileops/adaptor.c.

References GAT_CREATE_STATUS, GAT_CURRENT_STATUS, GAT_MEMORYFAILURE, GAT_RETURN_STATUS, GAT_SUCCEEDED, GAT_USES_STATUS, GATMetric, GATMetric_CreateMetric(), GATMetric_Destroy(), GATMetricEvent_Create_EventLike(), GATMetricEvent_Destroy(), GATMonitorable_Impl_FireEvent(), GATObject_const, GATuint32, METRIC_FILE_MOVED, and name.

Referenced by fileops_adaptor_FileCPI_Move().

GATResult fileops_adaptor_FireDeletedEvent GATContext    context,
GATMonitorable_Impl    monitorable,
GATObject_const    source,
char const *    name
[static]
 

fileops_adaptor_FireDeletedEvent

The function fileops_adaptor_FireDeletedEvent fires a 'file deleted' event to all registered metric listeners.

Definition at line 1262 of file fileops/adaptor.c.

References GAT_CREATE_STATUS, GAT_CURRENT_STATUS, GAT_MEMORYFAILURE, GAT_RETURN_STATUS, GAT_SUCCEEDED, GAT_USES_STATUS, GATMetric, GATMetric_CreateMetric(), GATMetric_Destroy(), GATMetricEvent_Create_EventLike(), GATMetricEvent_Destroy(), GATMonitorable_Impl_FireEvent(), GATObject_const, GATuint32, METRIC_FILE_DELETED, and name.

Referenced by fileops_adaptor_FileCPI_Delete().

GATFileOpsAdaptor_Data * GATFileOpsAdaptor_Data_Create   [static]
 

GATFileOpsAdaptor_Data_Create This helper creates an instance of a GATFileOpsAdaptor_Data object.

Returns:
The newly created and initialized GATFileOpsAdaptor_Data object.

Definition at line 1145 of file fileops/adaptor.c.

References GATFileOpsAdaptor_Data::config_data, data, and GATTable_Create().

Referenced by fileops_adaptor_register().

void GATFileOpsAdaptor_Data_Destroy GATFileOpsAdaptor_Data   data [static]
 

GATFileOpsAdaptor_Data_Destroy This helper destroys an instance of a GATFileOpsAdaptor_Data object.

Parameters:
The  GATFileOpsAdaptor_Data object to destroy

Definition at line 1167 of file fileops/adaptor.c.

References GATFileOpsAdaptor_Data::config_data, data, and GATTable_Destroy().

Referenced by fileops_adaptor_FileCPI_Destroy(), and fileops_adaptor_register().

GATResult fileops_adaptor_register GATContext    error_context,
GATRegistry    registry,
GATTable_const    system_config,
GATTable_const    instance_config,
void *    token
 

fileops_adaptor_register Registers all CPIs this adaptor provides.

This function is invoked by the loader in the GATEngine when an instance of this adaptor is loaded. Each instance has its own private configuration table.

For every CPI provided the adapter has to hand all the corresponding function pointers to the engine to allow to be called back under certain circumstances. Additionally the adaptor may allocate some private data for every loaded instance. This data is handed back to the adaptor as the first parameter to each of the subsequently called functions.

Parameters:
registry  The registry the adaptor should register its CPIs with.
system_config  The system configuration table.
instance_config  The configuration table for this instance.
token  An arbitrary token used by the loader to identify this adaptor instance
Returns:
An error code.

Definition at line 253 of file fileops/adaptor.c.

References GATFileCPI_Data::clone_instance, GATFileOpsAdaptor_Data::config_data, GATFileCPI_Data::copy, COPY_COMMAND, cpi, GATFileCPI_Data::create_instance, GATFileCPI_Data::data, GATFileCPI_Data::deserialise, GATFileCPI_Data::destroy, GATFileCPI_Data::destroy_instance, GATFileCPI_Data::equals_instance, fileops_adaptor_FileCPI_CloneInstance(), fileops_adaptor_FileCPI_Copy(), fileops_adaptor_FileCPI_CreateInstance(), fileops_adaptor_FileCPI_Delete(), fileops_adaptor_FileCPI_DeSerialise(), fileops_adaptor_FileCPI_Destroy(), fileops_adaptor_FileCPI_DestroyInstance(), fileops_adaptor_FileCPI_EqualsInstance(), fileops_adaptor_FileCPI_GetLength(), fileops_adaptor_FileCPI_GetMetricEvent(), fileops_adaptor_FileCPI_GetMetrics(), fileops_adaptor_FileCPI_IsReadable(), fileops_adaptor_FileCPI_IsWritable(), fileops_adaptor_FileCPI_LastWriteTime(), fileops_adaptor_FileCPI_Move(), fileops_adaptor_FileCPI_Serialise(), fileops_adaptor_FileCPI_ServiceActions(), fileops_copy_config(), GAT_MEMORYFAILURE, GAT_SUCCESS, GAT_UNKNOWN_VERSION, GATFileCPI_Create(), GATFileCPI_Destroy(), GATFILECPI_VERSION, GATFileOpsAdaptor_Data_Create(), GATFileOpsAdaptor_Data_Destroy(), GATPreferences_Add(), GATPreferences_Create(), GATPreferences_Destroy(), GATResult, GATTable_const, GATVERSION_ISCOMPATIBLE, GATFileCPI_Data::get_metric_event, GATFileCPI_Data::get_metrics, GATFileCPI_Data::isreadable, GATFileCPI_Data::iswritable, GATFileCPI_Data::lastwritetime, GATFileCPI_Data::length, GATFileCPI_Data::move, MOVE_COMMAND, GATFileCPI_Data::remove, REMOVE_COMMAND, GATFileCPI_Data::serialise, GATFileCPI_Data::service_actions, and token.


Variable Documentation

GATStaticMetric metric_data[] [static]
 

Definition at line 181 of file fileops/adaptor.c.