|
|
|||
|
||||
This document is useful for developers who must develop in more than one language. It lists the language bindings for the core ONTAPI routines, side by side. In the interests of brevity and conciseness, the bindings are not completely documented here (no type or parameter information is given). For complete documentation, please consult
ONTAPI core routines in C
ONTAPI core routines in Perl
ONTAPI core routines in Java
| Core Routine Names and Functions |
In this table, an item with " -- " in it indicates that there is no analog for this call in that language. Typically, that's because of differences in memory and/or process management. The #defines in C are to accommodate legacy 1st-generation code; you should not use them.
The first group of core APIs deals with startup and memory management
C++ |
Perl |
Java |
|
|
na_startup(); |
new NaServer | new NaServer(); | One-time startup to prepare for API and network things. |
| na_shutdown(); |
-- | NaServer::close(); | Cleanup of system resources. |
| na_elem_new(); | new NaElement | new NaElement(); | Allocate resources for a new I/O element. |
| na_elem_free(); |
-- | -- | Free up all resources used by the I/O element. |
| na_free(); |
-- | -- | Free memory for a given chunk of memory allocated by the system. |
|
|
|||
C++ |
Perl |
Java |
|
| na_elem_child(); |
NaElement::child_get($) | NaElement::childGet(); | Returns the nested element named eltname. |
| na_elem_set_content(); | NaElement::set_content($) | NaElement::setContent(); | Directly set the contents of an element. This low-level routine is mostly used internally. |
| na_elem_has_children(); |
NaElement::has_children() | NaElement::hasChildren(); | True if the element has any nested elements within it |
| na_child_add(); | NaElement::child_add($) | NaElement::childAdd(); | Add a nested element to an element (nested elements are technically unordered and accessed by name, but this routine adds it to the end of the nested element list). |
| na_child_add_string(); | NaElement::child_add_string($$) | NaElement::childAddString(); | Create a new element (a name/value pair), and add it to the nested element list . |
| na_child_get_string(); |
NaElement::child_get_string($) | NaElement::childGetString(); | Get the value from a name/value pair (a child element) as a string. |
| na_child_add_int(); | NaElement::child_add_int($) | NaElement::childAddInt(); | Set the value of a name/value pair (a child element) as an integer, and add it to the nested element list. |
| na_child_get_int(); | NaElement::child_get_int($) | NaElement::childGetInt(); | Get the value from a name/value pair (a child element) as an integer. |
| na_child_iterator(); |
NaElement::children_get(); | NaElement::childrenGet() | Set up an iterator for iterating over the children of element elt. You'll call na_iterator_next() on this iterator to walk through the nested element list. Perl and Java, which do automatic memory management, simply return the entire list. |
| na_iterator_next(); | Given a tag returned by na_child_iterator(), call this function repeatedly to iterate through all children of the element na_child_iterator() was invoked on. | ||
| na_child_get_string_encrypted(); | NaElement:: |
NaElement:: |
Get a nested element, decrypt it, and return the decrypted data. |
| na_child_add_string_encrypted(); | NaElement:: child_add_string_encrypted($$$) |
NaElement:: childAddStringEncrypted(); |
Create a new element, encrypt the data contained in it in with a provided key, and add the new element to the nested element list. |
| na_child_add_bool(); | -- | -- | Add a child element with a boolean value (zero or one). Note: boolean values are encoded on the wire--in XML--as "true" or "false". |
| na_child_get_bool(); | -- | -- | Get a child element and decode its value as a boolean value (zero or one). |
The third group of core APIs manages server connections, authentication, and sending and receiving of API messages |
|||
C++ |
Perl |
Java |
|
| na_server_t* na_server_open(); |
new NaServer($$$) | NaServer constructor | Open a connection to the specified server with a specified ONTAPI version number. |
| na_server_close(); |
-- | NaServer destructor | Close server connection to free up resources on the filer. |
|
na_server_set_admin_user(); #define na_server_adminuser \ |
NaServer::set_admin_user($$) | NaServer::setAdminUser(); | Set the administrative server user for this connection. |
|
na_server_set_style(); #define na_server_style \ |
NaServer::set_style($) |
NaServer::setStyle(); | Set the server transport style, which must be login/password style, DCE/RPC or hosts-equiv style. |
| na_server_get_style(); |
NaServer::get_style() | NaServer::getStyle(); | Get the server style. |
|
na_server_set_server_type(); |
NaServer::set_server_type($) |
NaServer::setServerType(); | Set the type of the server. |
|
na_server_get_server_type(); |
NaServer::get_server_type() |
NaServer::getServerType(); | Get the server type. |
|
na_server_set_transport_type(); |
NaServer:: |
NaServer::setTransportType(); | The average user does not need to set this. |
|
na_server_get_transport(); |
NaServer:: |
NaServer::getTransportType(); | Use HTTP, HTTPS, etc. (New in 1.3) |
|
na_server_set_port(); |
NaServer::set_port($) |
NaServer::setPort(); | Set the port used for an http connection. |
|
na_server_get_port(); |
NaServer::get_port() |
NaServer::getPort(); | |
| na_server_invoke(); | NaServer::invoke($...) |
-- |
Syntactic sugar for |
| na_server_invoke_elem(); | NaServer::invoke_elem($) | NaServer::invokeElem(); | Send an element to the server and wait for a response. |
Three routines suffice to determine the status of a request upon its return from the server: |
|||
C++ |
Perl |
Java |
|
| na_results_status(); |
NaElement::results_status() | NaElement::resultsStatus(); | Return success or failure, depending on the success
of the last requested operation |
| na_results_reason(); |
NaElement::results_reason() | NaElement::resultsReason(); | A string containing [hopefully] useful information about
the failure |
| na_results_errno(); |
NaElement::results_errno() | NaElement::resultsErrno(); | The error number of the failure |
Finally, it's sometimes useful to print out an element string in all it's XMLized glory. This formatting routine helps with that. |
|||
C++ |
Perl |
Java |
|
| na_elem_sprintf(); | NaElement::sprintf() | NaElement:::toString(); | Pretty-print the element. |
There are some differences in the implementations, some unavoidable and some a result of design decisions or technical difficulties. The unavoidable differences include
Differences in the design decision class include