eimAddIdentifier()--Add EIM Identifier


  Syntax
 #include <eim.h>

 int eimAddIdentifier(EimHandle        * eim,
                      char             * name,
                      enum EimIdAction   nameInUseAction,
                      unsigned int     * sizeOfUniqueName,
                      char             * uniqueName,
                      char             * description,
        EimRC            * eimrc)

 
  Service Program Name: QSYS/QSYEIM

  Default Public Authority: *USE

  Threadsafe: Yes

The eimAddIdentifier() function creates an identifier in EIM related to a specific person or entity within an enterprise. This identifier is used to manage information and identify relationships for a specific user or identity.


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.

name  (Input)
A name to be used for this identifier.

nameInUseAction  (Input)
The name for the new identifier must be unique. This value indicates the action to be taken if the provided name is already being used. Possible values are:

EIM_FAIL (0) Do not generate a unique name, return an error.
EIM_GEN_UNIQUE (1) Generate a unique name.

sizeOfUniqueName  (Input/Output)
The size of the field in which to return the unique name. This parameter is ignored if nameInUseAction is EIM_FAIL.

At input it is the size provided by the caller. On output it contains the actual size returned. This value should be the size of the name parameter plus an additional 20 bytes.

uniqueName  (Output)
The space to return the unique identifier for this new EIM identifier. This parameter is ignored if nameInUseAction is EIM_FAIL.

description  (Input)
Description for the new EIM identifier. This parameter may be NULL.

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
Identifier already exists.

EIMERR_IDENTIFIER_EXISTS (19) EIM Identifier already exists by this name.

EINVAL
Input parameter was 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_HANDLE_INVAL (17) EimHandle is not valid.
EIMERR_IDACTION_INVAL (18) Name in use action is not valid.
EIMERR_PARM_REQ (34) Missing required parameter. Please check API documentation.
EIMERR_PTR_INVAL (35) Pointer parameter is not valid.
EIMERR_UNIQUE_SIZE (43) Length of unique name is not valid.

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.

Restrictions

There is a restriction on the characters allowed for identifier 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 will add an EIM identifier.

#include <eim.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
    int           rc;
    char          eimerr[100];
    EimRC       * err;
    EimHandle   * handle;

    char          unique[30];
    unsigned int  sizeOfUnique = 30;

    /* 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 identifier of Mary Smith        */
    if (0 != (rc = eimAddIdentifier(handle,
                                    "Mary Smith",
                                    EIM_GEN_UNIQUE,
                                    &sizeOfUnique,
                                    unique,
                                    "The coolest person",
                                    err)))
        printf("Add identifier error = %d", rc);

    return 0;
}


API introduced: V5R2
Top | Security APIs | APIs by category