# service group
[description]

## Files
file | axis2_svc_grp.h
## Typedefs
typedef struct axis2_svc_grp | axis2_svc_grp_t
## Functions
AXIS2_EXTERN void | axis2_svc_grp_free (axis2_svc_grp_t *svc_grp, const axutil_env_t *env)
AXIS2_EXTERN axis2_status_t | axis2_svc_grp_set_name (axis2_svc_grp_t *svc_grp, const axutil_env_t *env, const axis2_char_t *svc_grp_name)
AXIS2_EXTERN const axis2_char_t * | axis2_svc_grp_get_name (const axis2_svc_grp_t *svc_grp, const axutil_env_t *env)
AXIS2_EXTERN axis2_status_t | axis2_svc_grp_add_svc (axis2_svc_grp_t *svc_grp, const axutil_env_t *env, struct axis2_svc *svc)
AXIS2_EXTERN struct axis2_svc * | axis2_svc_grp_get_svc (const axis2_svc_grp_t *svc_grp, const axutil_env_t *env, const axutil_qname_t *svc_qname)
AXIS2_EXTERN axutil_hash_t * | axis2_svc_grp_get_all_svcs (const axis2_svc_grp_t *svc_grp, const axutil_env_t *env)
AXIS2_EXTERN axis2_status_t | axis2_svc_grp_remove_svc (axis2_svc_grp_t *svc_grp, const axutil_env_t *env, const axutil_qname_t *svc_qname)
AXIS2_EXTERN axis2_status_t | axis2_svc_grp_add_param (axis2_svc_grp_t *svc_grp, const axutil_env_t *env, axutil_param_t *param)
AXIS2_EXTERN axutil_param_t * | axis2_svc_grp_get_param (const axis2_svc_grp_t *svc_grp, const axutil_env_t *env, const axis2_char_t *name)
AXIS2_EXTERN axutil_array_list_t * | axis2_svc_grp_get_all_params (const axis2_svc_grp_t *svc_grp, const axutil_env_t *env)
AXIS2_EXTERN axis2_bool_t | axis2_svc_grp_is_param_locked (axis2_svc_grp_t *svc_grp, const axutil_env_t *env, const axis2_char_t *param_name)
AXIS2_EXTERN axis2_status_t | axis2_svc_grp_add_module_qname (axis2_svc_grp_t *svc_grp, const axutil_env_t *env, const axutil_qname_t *module_qname)
AXIS2_EXTERN struct axis2_conf * | axis2_svc_grp_get_parent (const axis2_svc_grp_t *svc_grp, const axutil_env_t *env)
AXIS2_EXTERN axis2_status_t | axis2_svc_grp_set_parent (axis2_svc_grp_t *svc_grp, const axutil_env_t *env, struct axis2_conf *parent)
AXIS2_EXTERN axis2_status_t | axis2_svc_grp_engage_module (axis2_svc_grp_t *svc_grp, const axutil_env_t *env, const axutil_qname_t *module_qname)
AXIS2_EXTERN axutil_array_list_t * | axis2_svc_grp_get_all_module_qnames (const axis2_svc_grp_t *svc_grp, const axutil_env_t *env)
AXIS2_EXTERN axis2_status_t | axis2_svc_grp_add_module_ref (axis2_svc_grp_t *svc_grp, const axutil_env_t *env, const axutil_qname_t *moduleref)
AXIS2_EXTERN axutil_array_list_t * | axis2_svc_grp_get_all_module_refs (const axis2_svc_grp_t *svc_grp, const axutil_env_t *env)
AXIS2_EXTERN struct axis2_svc_grp_ctx * | axis2_svc_grp_get_svc_grp_ctx (const axis2_svc_grp_t *svc_grp, const axutil_env_t *env, struct axis2_conf_ctx *parent)
AXIS2_EXTERN axutil_param_container_t * | axis2_svc_grp_get_param_container (const axis2_svc_grp_t *svc_grp, const axutil_env_t *env)
AXIS2_EXTERN axis2_svc_grp_t * | axis2_svc_grp_create (const axutil_env_t *env)
AXIS2_EXTERN axis2_svc_grp_t * | axis2_svc_grp_create_with_conf (const axutil_env_t *env, struct axis2_conf *conf)
AXIS2_EXTERN axis2_desc_t * | axis2_svc_grp_get_base (const axis2_svc_grp_t *svc_grp, const axutil_env_t *env)

## Detailed Description

service group represents the static structure of a service group in the Axis2 configuration. In Axis2 description hierarchy, a service group lives inside the configuration. service groups are configured in services.xml files located in the respective service group folders of the services folder in the repository. In services.xml file, services groups are declared at top level. A service group can have one or more services associated with it. Sometimes services.xml would not have a service group defined, but only a service. In such cases a service group with the same name as that of the service mentioned in services.xml would be created by the deployment engine and the service would be associated with that newly created service group. The deployment engine would create service group instances to represent those configured service groups in services.xml files and would store them in the configuration. service group encapsulates data on engaged module information and the service associated with service group.

## Typedef Documentation

typedef struct axis2_svc_grp axis2_svc_grp_t

Type name for struct axis2_svc_grp

## Function Documentation

AXIS2_EXTERN axis2_status_t axis2_svc_grp_add_module_qname | ( | axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env,
|  | const axutil_qname_t * | module_qname |
| ) |  |  |

Adds given module QName to list of module QNames.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct
  | module_name | pointer to module QName

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t axis2_svc_grp_add_module_ref | ( | axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env,
|  | const axutil_qname_t * | moduleref |
| ) |  |  |

Adds module reference.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct
  | moduleref | pointer to module QName

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t axis2_svc_grp_add_param | ( | axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env,
|  | axutil_param_t * | param |
| ) |  |  |

Adds parameter.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct
  | param | pointer to parameter, service group assumes ownership of parameter

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t axis2_svc_grp_add_svc | ( | axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env,
|  | struct axis2_svc * | svc |
| ) |  |  |

Adds given service to service group.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct
  | service | service to be added, service group assumes ownership of service

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_svc_grp_t* axis2_svc_grp_create | ( | const axutil_env_t * | env | ) |

Creates a service group struct instance.

Parameters:

  | env | pointer to environment struct

Returns:
  pointer to newly created service group

AXIS2_EXTERN axis2_svc_grp_t* axis2_svc_grp_create_with_conf | ( | const axutil_env_t * | env,
|  | struct axis2_conf * | conf |
| ) |  |  |

Creates service group with given configuration as the parent.

Parameters:

  | env | pointer to environment struct
  | conf | pointer to configuration, service group created does not assume ownership of configuration

Returns:
  pointer to newly created service group

AXIS2_EXTERN axis2_status_t axis2_svc_grp_engage_module | ( | axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env,
|  | const axutil_qname_t * | module_qname |
| ) |  |  |

Engages named module to service group. Engaging a module to service group would ensure that the same module would be engaged to all services within the group.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct
  | module_name | pointer to module QName

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN void axis2_svc_grp_free | ( | axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env |
| ) |  |  |

Frees service group.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct

Returns:
  void

AXIS2_EXTERN axutil_array_list_t* axis2_svc_grp_get_all_module_qnames | ( | const axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env |
| ) |  |  |

Gets all module QNames associated with service group.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct

Returns:
  pointer to array list containing all QNames, returns a reference, not a cloned copy

AXIS2_EXTERN axutil_array_list_t* axis2_svc_grp_get_all_module_refs | ( | const axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env |
| ) |  |  |

Gets all module references.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct

Returns:
  pointer to array list containing module reference, returns a reference, not a cloned copy

AXIS2_EXTERN axutil_array_list_t* axis2_svc_grp_get_all_params | ( | const axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env |
| ) |  |  |

Gets all parameters set on service group.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct

Returns:
  pointer to array list containing parameter, returns a reference, not a cloned copy

AXIS2_EXTERN axutil_hash_t* axis2_svc_grp_get_all_svcs | ( | const axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env |
| ) |  |  |

Gets all services associated with service group.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct

Returns:
  pointer to hash table containing all services, returns a reference, not a cloned copy

AXIS2_EXTERN axis2_desc_t* axis2_svc_grp_get_base | ( | const axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env |
| ) |  |  |

Gets base description.

Parameters:

  | svc_grp | pointer to message
  | env | pointer to environment struct

Returns:
  pointer to base description struct

AXIS2_EXTERN const axis2_char_t* axis2_svc_grp_get_name | ( | const axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env |
| ) |  |  |

Gets service group name.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct

Returns:
  service group name string

AXIS2_EXTERN axutil_param_t* axis2_svc_grp_get_param | ( | const axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env,
|  | const axis2_char_t * | name |
| ) |  |  |

Gets named parameter.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct
  | name | parameter name

Returns:
  pointer to named parameter if exists, else NULL. Returns a reference, not a cloned copy

AXIS2_EXTERN struct axis2_conf* axis2_svc_grp_get_parent | ( | const axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env |
| ) |  |  | `[read]`

Gets parent which is of type configuration.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct

Returns:
  pointer to parent configuration, returns a reference, not a cloned copy

AXIS2_EXTERN struct axis2_svc* axis2_svc_grp_get_svc | ( | const axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env,
|  | const axutil_qname_t * | svc_qname |
| ) |  |  | `[read]`

Gets named service from service group.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct
  | svc_qname | pointer to QName of the service

Returns:
  pointer to service corresponding to given QName, returns a reference, not a cloned copy

AXIS2_EXTERN struct axis2_svc_grp_ctx* axis2_svc_grp_get_svc_grp_ctx | ( | const axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env,
|  | struct axis2_conf_ctx * | parent |
| ) |  |  | `[read]`

Gets service group context related to this service group.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct
  | parent | pointer to configuration context which is the parent of the context hierarchy

Returns:
  pointer to service group context related to this service group, returns a reference, not a cloned copy

AXIS2_EXTERN axis2_bool_t axis2_svc_grp_is_param_locked | ( | axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env,
|  | const axis2_char_t * | param_name |
| ) |  |  |

Checks if the named parameter is locked.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct
  | param_name | pointer to param name

Returns:
  AXIS2_TRUE if the named parameter is locked, else AXIS2_FALSE

AXIS2_EXTERN axis2_status_t axis2_svc_grp_remove_svc | ( | axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env,
|  | const axutil_qname_t * | svc_qname |
| ) |  |  |

Removes named service from service group.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct
  | svc_name | pointer to service QName

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t axis2_svc_grp_set_name | ( | axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env,
|  | const axis2_char_t * | svc_grp_name |
| ) |  |  |

Sets service group name.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct
  | svc_grp_name | service group name string

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t axis2_svc_grp_set_parent | ( | axis2_svc_grp_t * | svc_grp,
|  | const axutil_env_t * | env,
|  | struct axis2_conf * | parent |
| ) |  |  |

Sets parent which is of type configuration.

Parameters:

  | svc_grp | pointer to service group struct
  | env | pointer to environment struct
  | parent | parent configuration, service group does not assume the ownership of configuration

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE