Main Page   Modules   Compound List   File List   Related Pages   Examples  

pds.h

00001 #ifndef _PDS_H_
00002 #define _PDS_H_
00003 
00004 /*
00005  *
00006  *  $Id: pds.h,v 1.11 2003/10/20 17:06:47 pmw Exp $
00007  *
00008  */
00013 #ifdef __cplusplus
00014 extern "C" {
00015 #endif
00016 
00017 #include <sys/types.h>
00018 
00019 #include "atl.h"
00020 
00021 #include "cm.h"
00022 #include "echo.h"
00023 
00024 #include "pdsdefs.h"
00025 
00026 
00027 #define PDS_IP_PORT ATL_CHAR_CONS('C','I','P','P')
00028 #define PDS_IP_HOST ATL_CHAR_CONS('C','I','P','H')
00029 #define PDS_IP_ADDR ATL_CHAR_CONS('C','I','P','A')
00030 
00033 extern pds_entity_id_t null_pds_entity_id;
00036 extern pds_context_id_t null_pds_context_id;
00039 extern pds_domain_id_t null_pds_domain_id;
00040   
00041 
00042 /*
00043  * Server API
00044  */
00045 
00051 pds_service pds_service_open (attr_list contact_attrs);
00052 
00057 int pds_service_close (pds_service service_to_close);
00058 
00063 int pds_shutdown_server (pds_service);
00064 
00065 /*
00066  * High level API
00067  */
00068 
00075 int
00076 pds_lookup_string (pds_domain_id_t domain_id,
00077                   const char* fullname,
00078                   char **value);
00079 
00086 int
00087 pds_bind_string (pds_domain_id_t domain_id,
00088                 const char* fullname,
00089                 const char* value);
00090 
00097 int
00098 pds_lookup_int (pds_domain_id_t domain_id,
00099                const char* fullname,
00100                int* value);
00101 
00108 int
00109 pds_bind_int (pds_domain_id_t domain_id,
00110              const char* fullname,
00111              int value);
00112 
00119 int
00120 pds_lookup_blob (pds_domain_id_t domain_id,
00121                 const char* fullname,
00122                 char** value);
00123 
00131 int
00132 pds_bind_blob (pds_domain_id_t domain_id,
00133               const char* fullname,
00134               char *value,
00135               unsigned int length);
00136 
00144 int
00145 pds_bulk_load_from_URL (pds_service s,
00146                        const char* url);
00147 
00148 /*
00149  * Domain API
00150  */
00160 pds_domain_id_t
00161 pds_create_domain (pds_service s,
00162                   const char *domain_name,
00163                   const char *domain_type,
00164                   int domain_version,
00165                   const char *application_name);
00166 
00176 pds_domain_id_t
00177 pds_open_domain (pds_service s,
00178                 const char *domain_name,
00179                 const char *domain_type,
00180                 int domain_version,
00181                 const char *application_name);
00182 
00187 int
00188 pds_remove_domain (pds_domain_id_t id);
00189 
00199 int
00200 pds_find_matching_domains (pds_service s,
00201                           const char *domain_name,
00202                           const char *domain_type,
00203                           int domain_version,
00204                           const char *application_name,
00205                           pds_domain_id_t **matches);
00206 
00207   /* @{ */
00213 int
00214 pds_set_domain_attrs (pds_domain_id_t d_id, attr_list al);
00215 
00216 int
00217 pds_get_domain_attrs (pds_domain_id_t d_id, attr_list al);
00218   /* @} */
00219 
00220 
00221 /*
00222  *  Context API
00223  */
00224 
00233 pds_context_id_t
00234 pds_create_context (pds_domain_id_t d_id, const char *name, pds_context_id_t c_id);
00235 
00243 int
00244 pds_remove_context (pds_domain_id_t d_id, const char *name, pds_context_id_t c_id);
00245 
00252 int
00253 pds_remove_context_by_id (pds_domain_id_t d_id, pds_context_id_t c_id);
00254 
00260 pds_context_id_t
00261 pds_get_root_context (pds_domain_id_t d_id);
00262 
00270 char **
00271 pds_get_binding_list (pds_domain_id_t d_id, const char* name, int opt_mask);
00272 
00280 char**
00281 pds_get_binding_list_id (pds_domain_id_t d_id, pds_context_id_t c_id, int opt_mask);
00282 
00283 
00284 
00285 /*
00286  *  Entity API
00287  */
00288 
00298 pds_entity_id_t
00299 pds_create_entity (pds_domain_id_t d_id,
00300                   const char *fullname,
00301                   pds_context_id_t c_id,
00302                   pds_entity_data_t *edata,
00303                   attr_list attribute_list);
00304 
00312 int
00313 pds_remove_entity (pds_domain_id_t d_id, const char *fullname, pds_context_id_t c_id);
00314 
00321 int
00322 pds_remove_entity_by_id (pds_domain_id_t d_id, pds_entity_id_t e_id);
00323 
00333 int
00334 pds_bind_entity_to_name (pds_domain_id_t d_id,
00335                         const char *source_name,
00336                         pds_context_id_t source_context,
00337                         const char *new_name,
00338                         pds_context_id_t new_name_context);
00339 
00348 int
00349 pds_bind_entity_to_name_by_id (pds_domain_id_t d_id, 
00350                               pds_entity_id_t e_id, 
00351                               const char *new_name,
00352                               pds_context_id_t new_name_context);
00353 
00361 int
00362 pds_unbind_entity_from_name (pds_domain_id_t d_id, const char *name, pds_context_id_t c_id);
00363 
00371 pds_entity_id_t
00372 pds_resolve_entity_name (pds_domain_id_t d_id, const char *name, pds_context_id_t c_id);
00373 
00382 ECSinkHandle  
00383 pds_register_for_domain_changes (CManager cm,
00384                                 pds_domain_id_t d_id,
00385                                 ECTypedHandlerFunction func_ptr,
00386                                 void *client_data);
00387 
00398 ECSinkHandle
00399 pds_register_for_entity_changes (CManager cm,
00400                                 pds_domain_id_t d_id,
00401                                 const char *name,
00402                                 pds_context_id_t c_id,
00403                                 ECTypedHandlerFunction func_ptr,
00404                                 void *client_data);
00405 
00416 ECSinkHandle
00417 pds_register_for_context_changes (CManager cm,
00418                                   pds_domain_id_t d_id,
00419                                   const char *name,
00420                                   pds_context_id_t c_id,
00421                                   ECTypedHandlerFunction func_ptr,
00422                                   void *client_data);
00423 
00429 int
00430 pds_cancel_changes_registration (ECSinkHandle sink_handle);
00431 
00441 int
00442 pds_get_entity_data (pds_domain_id_t d_id,
00443                     const char *name,
00444                     pds_context_id_t c_id,
00445                     pds_entity_data_t *edata,
00446                     int opt_mask);
00447 
00448 
00457 int
00458 pds_get_entity_data_by_id (pds_domain_id_t d_id, pds_entity_id_t e_id, pds_entity_data_t *edata, int opt_mask);
00459 
00460 
00470 int
00471 pds_set_entity_data (pds_domain_id_t d_id,
00472                     const char *name,
00473                     pds_context_id_t c_id,
00474                     pds_entity_data_t *edata,
00475                     int opt_mask);
00476   
00485 int
00486 pds_set_entity_data_by_id (pds_domain_id_t d_id, pds_entity_id_t e_id, pds_entity_data_t *edata, int opt_mask);
00487 
00497 int
00498 pds_get_entity_attributes (pds_domain_id_t d_id, const char *name, pds_context_id_t c_id, attr_list attrs);
00499 
00508 int
00509 pds_get_entity_attributes_by_id (pds_domain_id_t d_id, pds_entity_id_t e_id, attr_list attributes);
00510 
00520 int
00521 pds_set_entity_attributes (pds_domain_id_t d_id, const char *name, pds_context_id_t c_id, attr_list attrs, int opt);
00522 
00531 int
00532 pds_set_entity_attributes_by_id (pds_domain_id_t d_id, pds_entity_id_t e_id, attr_list attributes, int opt);
00533 
00542 pds_entity_id_t*
00543 pds_find_matching_entities (pds_domain_id_t d_id, const char* name, pds_context_id_t c_id, attr_list attributes);
00544 
00552 pds_entity_id_t*
00553 pds_find_matching_entities_by_name (pds_domain_id_t d_id, const char *fullname, attr_list attributes);
00554 
00555 
00560 CManager
00561 pds_get_CManager();
00562 
00565 #ifdef __cplusplus
00566 } // matches extern "C"
00567 #endif
00568 
00569 #endif
00570 
00571 
00572 /*
00573  *
00574  *  $Log: pds.h,v $
00575  *  Revision 1.11  2003/10/20 17:06:47  pmw
00576  *  Changed documentation to reflect the impending demise of pds_create_domain
00577  *
00578  *  Revision 1.10  2003/10/05 12:10:23  pmw
00579  *  Changes to make utils a C module instead of C++, allowing people to
00580  *  link against its functions more easily
00581  *
00582  *  Revision 1.9  2003/03/19 03:49:27  pmw
00583  *  more documentation tweaks
00584  *
00585  *  Revision 1.8  2003/03/18 20:47:32  pmw
00586  *  added some more documentation stuff
00587  *
00588  *  Revision 1.7  2002/10/30 03:52:50  pmw
00589  *  added parameter to get_binding_list functions to optionally get only entities
00590  *  or contexts
00591  *
00592  *  Revision 1.6  2002/10/22 02:38:12  pmw
00593  *  Finished Doxygen comments for API.
00594  *
00595  *  Revision 1.5  2002/10/21 22:40:21  pmw
00596  *  Still more comments
00597  *
00598  *  Revision 1.4  2002/10/16 21:27:30  pmw
00599  *  More comments.
00600  *
00601  *  Revision 1.3  2002/10/16 04:58:37  pmw
00602  *  added initial Doxygen comments
00603  *
00604  *  Revision 1.2  2002/08/07 18:51:43  eisen
00605  *  Widespread changes to modify how attribute handling works.  Stop using
00606  *  attr_atom_from_string() to get atom values.  Instead, those are set by the
00607  *  application.  Stop using get_attr() (api has changes).  Stop using
00608  *  xmit_object and start using the ATL-supplied encode/decode routines.
00609  *
00610  *  Revision 1.1  2001/10/09 21:37:53  pmw
00611  *  configuration changes
00612  *
00613  *  Revision 1.5  2001/09/23 22:55:54  pmw
00614  *  Contexts now support attributes of their own.  Practically, this is supported
00615  *  by having ContextBindable host the attribute list instead of Entity/Context.  Also
00616  *  added the usual functions on the client side and handlers for getting/setting
00617  *  this attr list for Contexts.
00618  *
00619  *  Revision 1.4  2001/09/10 03:55:43  pmw
00620  *  client lib is now libpdsagent, and is compiled entirely with gcc.  libpdsutil no
00621  *  longer exists.
00622  *
00623  *  Revision 1.3  2001/09/03 20:09:10  pmw
00624  *  changes to deal with string-marshaled attr lists
00625  *
00626  *  Revision 1.2  2001/07/02 15:07:43  pmw
00627  *  removed ContextBindable class def and impl to their own source files
00628  *
00629  *  Revision 1.1.1.1  2000/12/13 22:14:21  pmw
00630  *  imported sources
00631  *
00632  *  Revision 1.16  2000/12/05 00:24:20  pmw
00633  *  Added server_shutdown message
00634  *
00635  *  Revision 1.15  2000/11/30 01:47:55  pmw
00636  *  rearranged include files to fix inappropriate inclusions
00637  *
00638  *  Revision 1.14  2000/11/29 04:37:37  pmw
00639  *  changed channel-handling again, Entity now performs most of its own
00640  *  change event sends
00641  *
00642  *  Revision 1.13  2000/11/22 21:42:36  pmw
00643  *  proactivity based on entity events now appears to work correctly.  In particular,
00644  *  creation events based on the prior registration of placeholder entities and their
00645  *  later "creation" as real entities works.
00646  *
00647  *  Revision 1.12  2000/11/21 21:35:28  pmw
00648  *  Domain change events now work correctly.  moved event transmission
00649  *  responsibilities to Proactive class.
00650  *
00651  *  Revision 1.11  2000/11/21 00:23:56  pmw
00652  *  Since I didn't have enough to do, a little code reorganization to keep
00653  *  things from getting dramatically out of hand.  Fixed a couple of
00654  *  bugs-in-waiting.
00655  *
00656  *  Revision 1.10  2000/11/20 05:08:53  pmw
00657  *  added pds_open_domain call.  semantics are such that a domain id is always
00658  *  returned, either because one matching the criteria was found or a new one
00659  *  was created because no matches were found.
00660  *
00661  *  Revision 1.9  2000/11/19 23:28:31  pmw
00662  *  pds_server now supports bulk load of data with -f command-line option.  Also added
00663  *  command message so bulk loads can happen on-line.
00664  *
00665  *  Revision 1.8  2000/10/25 21:44:49  pmw
00666  *  Compiles after major revisions to support multiple WP services on
00667  *  client-side.  This should eventually allow a client to use services by
00668  *  linking in the library directly or by communicating using CMRPC.
00669  *
00670  *  Revision 1.7  2000/09/19 21:12:12  pmw
00671  *  revised for new cmrpc handler interface
00672  *
00673  *  Revision 1.6  2000/04/10 20:00:13  pmw
00674  *  completed port to CM from DataExchange
00675  *
00676  *  Revision 1.5  2000/01/06 04:59:06  pmw
00677  *  changed id scheme so java side is simpler
00678  *
00679  *  Revision 1.4  1999/12/21 18:47:56  pmw
00680  *  Too many changes - really shouldn't have done this many
00681  *
00682  *  Revision 1.3  1999/12/09 22:35:15  pmw
00683  *  added client_priv header, RCS comments
00684  *
00685  *
00686  */

Generated on Mon Oct 20 14:46:45 2003 for Proactive Directory Service by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002