EGEE
Main Page | File List | Globals

delegation-simple.h File Reference

#include <time.h>

Go to the source code of this file.

Defines

#define GLITE_DELEGATION_SD_TYPE   "org.glite.Delegation"
#define GLITE_DELEGATION_SD_ENV   "GLITE_SD_DELEGATION_TYPE"

Typedefs

typedef _glite_delegation_ctx glite_delegation_ctx

Functions

glite_delegation_ctxglite_delegation_new (const char *endpoint)
 Allocates a new delegation context.

void glite_delegation_free (glite_delegation_ctx *ctx)
 Destroys a fireman context.

const char * glite_delegation_get_endpoint (glite_delegation_ctx *ctx)
 Get the current endpoint.

char * glite_delegation_get_error (glite_delegation_ctx *ctx)
 Gets the error message for the last failed operation.

int glite_delegation_delegate (glite_delegation_ctx *ctx, const char *delegationID, int expiration, int force)
 Delegate a local credential to the remote service.

int glite_delegation_info (glite_delegation_ctx *ctx, const char *delegationID, time_t *expiration)
 Get the expiration time.

int glite_delegation_destroy (glite_delegation_ctx *ctx, const char *delegationID)
 Destroy the delegated credential.

char * glite_delegation_getInterfaceVersion (glite_delegation_ctx *ctx)
 Get service interface version.

char * glite_delegation_getVersion (glite_delegation_ctx *ctx)
 Get service implementation version.

char * glite_delegation_getServiceMetadata (glite_delegation_ctx *ctx, const char *key)
 Get service metadata for a given key.


Define Documentation

#define GLITE_DELEGATION_SD_ENV   "GLITE_SD_DELEGATION_TYPE"
 

Definition at line 39 of file delegation-simple.h.

#define GLITE_DELEGATION_SD_TYPE   "org.glite.Delegation"
 

Definition at line 36 of file delegation-simple.h.


Typedef Documentation

typedef struct _glite_delegation_ctx glite_delegation_ctx
 

Definition at line 29 of file delegation-simple.h.


Function Documentation

int glite_delegation_delegate glite_delegation_ctx ctx,
const char *  delegationID,
int  expiration,
int  force
 

Delegate a local credential to the remote service.

If forced, then it will try to renew an existing delegated credential.

Parameters:
ctx The global context.
delegationID The id used to identify the delegation process and the resulting delegated credentials in the server.
expiration Desired expritation time in minutes.
force Force the delegation, even if there is a valid credential.
Returns:
0 if OK, -1 in case of error

int glite_delegation_destroy glite_delegation_ctx ctx,
const char *  delegationID
 

Destroy the delegated credential.

Parameters:
ctx The global context.
delegationID The id used to identify the delegation process and the resulting delegated credentials in the server.
Returns:
0 if ok, -1 in case of error

void glite_delegation_free glite_delegation_ctx ctx  ) 
 

Destroys a fireman context.

Parameters:
ctx The global context.

const char* glite_delegation_get_endpoint glite_delegation_ctx ctx  ) 
 

Get the current endpoint.

Parameters:
ctx The global context.
Returns:
the current endpoint used by the fireman context.

char* glite_delegation_get_error glite_delegation_ctx ctx  ) 
 

Gets the error message for the last failed operation.

The returned pointer is valid only till the next call to any of the library's functions with the same context pointer.

Parameters:
ctx The global context.
Returns:
the error message.

char* glite_delegation_getInterfaceVersion glite_delegation_ctx ctx  ) 
 

Get service interface version.

The returned string must be freed by the caller.

Parameters:
ctx The global context.
Returns:
The interface version string, or NULL in case of an error.

char* glite_delegation_getServiceMetadata glite_delegation_ctx ctx,
const char *  key
 

Get service metadata for a given key.

The key must not be NULL. The returned string must be freed by the caller.

Parameters:
ctx The global context.
key The key that's metadata we are looking for.
Returns:
The metadata string, or NULL, if there was an error.

char* glite_delegation_getVersion glite_delegation_ctx ctx  ) 
 

Get service implementation version.

The returned string must be freed by the caller.

Parameters:
ctx The global context.
Returns:
The implementation version string, or NULL in case of an error.

int glite_delegation_info glite_delegation_ctx ctx,
const char *  delegationID,
time_t *  expiration
 

Get the expiration time.

Parameters:
ctx The global context.
delegationID The id used to identify the delegation process and the resulting delegated credentials in the server.
expiration Expritation time.
Returns:
0 if OK, -1 in case of error

glite_delegation_ctx* glite_delegation_new const char *  endpoint  ) 
 

Allocates a new delegation context.

The context can be used to access only one service.

If the endpoint is not a URL (HTTP, HTTPS or HTTPG), then service discovery is used to locate the real service endpoint. In this case the 'endpoint' parameter is the input of the service discovery.

This mechanism is executed upon the first service specific usage of the context. After that point methods using the same context, from any other interface will return an error.

Parameters:
endpoint The name of the endpoint. Either an URL or a service name.
Returns:
the context or NULL if memory allocation has failed.
The gLite Project. All rights reserved.