eimAddApplicationRegistry()--Add an Application Registry to the EIM Domain
Syntax
#include <eim.h>
int eimAddApplicationRegistry(EimHandle * eim,
char * registryName,
char * registryType,
char * description,
char * systemRegistryName,
EimRC * eimrc)
Service Program Name: QSYS/QSYEIM
Default Public Authority: *USE
Threadsafe: Yes
The eimAddApplicationRegistry() function adds an
application registry to the EIM domain. An application registry is a subset of
a system registry. These can be used to manage which applications can be used
by a user in a registry. Once added, this registry is participating in the EIM
domain. Mapping associations can only be made with identities in registries
that are currently participating in the EIM domain.
Authorities and Locks
- EIM Data
- Access to EIM data is controlled by EIM access groups. LDAP administrators
also have access to EIM data. The access groups whose members have authority to
the EIM data for this API follow:
Parameters
- eim (Input)
- The EIM handle returned by a previous call to eimCreateHandle(). A valid
connection is required for this function.
- registryName (Input)
- The name for this application registry. This name needs to be unique within
the EIM domain.
- registryType (Input)
- A string form of an OID that represents the registry type and a user name
normalization method. The normalization method is necessary because some
registries are case-independent and others are case-dependent. EIM uses this
information to make sure the appropriate search occurs. When a registry is
case-independent registry user names are converted to uppercase. See eim.h for
a list of predefined types. A user can define their own registry type. Refer to
Registry Type section below.
A type of EIM_REGTYPE_GROUP_REGISTRY_IG ("1.3.18.0.2.33.17-caseIgnore") or
EIM_REGTYPE_GROUP_REGISTRY_EX ("1.3.18.0.2.33.18-caseExact") cannot be specified.
- description (Input)
- The description for this new application registry entry. This parameter may
be NULL.
- systemRegistryName (Input)
- The name of the system registry of which this application registry is a
subset.
- eimrc (Input/Output)
- The structure in which to return error code information. If the return
value is not 0, eimrc is set with additional information. This parameter may be
NULL. For the format of the structure, see EimRC--EIM
Return Code Parameter.
Return Value
The return value from the API. Following each return value is the list of
possible values for the messageCatalogMessageID field in the
eimrc parameter for that value.
- 0
- Request was successful.
- EACCES
- Access denied. Not enough permissions to access data.
EIMERR_ACCESS (1) |
Insufficient access to EIM data. |
- EBADDATA
- eimrc is not valid.
- EBUSY
- Unable to allocate internal system object.
EIMERR_NOLOCK (26) |
Unable to allocate internal system object. |
- ECONVERT
- Data conversion error.
EIMERR_DATA_CONVERSION (13) |
Error occurred when converting data between code
pages. |
- EEXIST
- EIM registry entry already exists.
EIMERR_REGISTRY_EXISTS (37) |
Registry entry already exists in EIM. |
- EINVAL
- Input parameter was not valid.
EIMERR_HANDLE_INVAL (17) |
EimHandle is not valid. |
EIMERR_CHAR_INVAL (21) |
A restricted character was used in the object
name. Check the API for a list of restricted characters. |
EIMERR_PARM_REQ (34) |
Missing required parameter. Please check API
documentation. |
EIMERR_PTR_INVAL (35) |
Pointer parameter is not valid. |
EIMERR_REGTYPE_INVAL (62) |
Registry type is not valid. |
- ENOENT
- System registry not found.
EIMERR_NO_SYSREG (33) |
System registry not found. |
- ENOMEM
- Unable to allocate required space.
EIMERR_NOMEM (27) |
No memory available. Unable to allocate required
space. |
- ENOTCONN
- LDAP connection has not been made.
EIMERR_NOT_CONN (31) |
Not connected to LDAP. Use eimConnect() API and
try the request again. |
- EROFS
- LDAP connection is for read only. Need to connect to master.
EIMERR_READ_ONLY (36) |
LDAP connection is for read only. Use
eimConnectToMaster() to get a write connection. |
- EUNKNOWN
- Unexpected exception.
EIMERR_LDAP_ERR (23) |
Unexpected LDAP error. %s |
EIMERR_UNKNOWN (44) |
Unknown error or unknown system state. |
User Defined Registry Type
The registry type is comprised of two pieces: a string form of an OID that
represents the registry type and a user name normalization method. The
normalization method is necessary because some registries are case-independent
and others are case-dependent. Platforms can define their own registry type.
They would first define a unique OID for their registry and then concatenate it
with the predefined normalization methods. Refer to eim.h for the supported
normalization methods.
Example:
#define MYREGOID "7.6.5.4.3.2.1"
MyRegType = MYREGOID + EIM_NORM_CASE_IGNORE;
Restrictions
There is a restriction on the characters allowed for registry name.
The following characters are special characters that are not allowed in
object names. They also should not be used in object attributes that would be
used for a search operation.
, = + < > # ; \ * "
Related Information
Example
See Code disclaimer information
for information pertaining to code examples.
The following example creates a new EIM application registry.
#include <eim.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
int rc;
char eimerr[100];
EimRC * err;
EimHandle * handle;
/* Get eim handle from input arg. */
/* This handle is already connected to EIM. */
handle = (EimHandle *)argv[1];
/* Set up error structure. */
memset(eimerr,0x00,100);
err = (EimRC *)eimerr;
err->memoryProvidedByCaller = 100;
/* Add new application registry */
if (0 != (rc = eimAddApplicationRegistry(handle,
"MyXXXRegistry",
EIM_REGTYPE_OS400,
"For XXX applications",
"MyRegistry",
err)))
printf("Add application registry error = %d", rc);
return 0;
}
API introduced: V5R2