Sun Identity Manager 8.1 Web Services

ExtendedRequest Examples

The following table describes the different ExtendedRequest classes that you can use to send messages to and receive messages from the client.

Table 1–4 ExtendedRequest Classes for Sending and Receiving Messages

ExtendedRequest Class

Description 

changeUserPassword

Constructs a message to request a user password change. 

deleteUser

Constructs a message to request a user deletion. 

disableUser

Constructs a message to request the disabling of a user. 

enableUser

Constructs a message to request the enabling of a user. 

launchProcess

Constructs a message to request the launch of a process. 

listResourceobjects

Constructs a message to request the name of a resource object in the Identity Manager repository, and the type of object supported by that resource. The request returns a list of names. 

resetUserPassword

Constructs a message to request the reset of a user password. 

runForm

Allows you to create custom SPML requests that return information obtained by calling the Identity Manager Session API. 

The server code converts each ExtendedRequest into a view operation.

The following examples illustrate the typical formats for an ExtendedRequest and its classes:

ExtendedRequest Example

The following example shows the typical format for an ExtendedRequest.


Example 1–5 ExtendedRequest Format


ExtendedRequest req = new ExtendedRequest();
req.setOperationIdentifier("changeUserPassword");
req.setAttribute("accountId", "exampleuser");
req.setAttribute("password", "xyzzy");
req.setAttribute("accounts","Lighthouse,LDAP,RACF");
ExtendedResponse res = (ExtendedResponse) client.send(req);

Most SPML ExtendedRequest requests accept the following arguments:

deleteUser Example

The following example shows the typical format for a deleteUser request (View -> Deprovision view).


Note –

If you customize this request, there might be side effects.



Example 1–6 deleteUser Request


ExtendedRequest req = new ExtendedRequest();
req.setOperationIdentifier("deleteUser");
req.setAttribute("accountId","exampleuser");
req.setAttribute("accounts","Lighthouse,LDAP,RACF");
ExtendedResponse res = (ExtendedResponse) client.send(req);

disableUser Example

The following example shows the typical format for a disableUser request (View -> Disable view).


Example 1–7 disableUser Request


ExtendedRequest req = new ExtendedRequest();
req.setOperationIdentifier("disableUser");
req.setAttribute("accountId","exampleuser");
req.setAttribute("accounts","Lighthouse,LDAP,RACF");
ExtendedResponse res = (ExtendedResponse) client.send(req);

enableUser Example

The following example shows the typical format for an enableUser request (View -> Enable view).


Example 1–8 enableUser Request


ExtendedRequest req = new ExtendedRequest();
req.setOperationIdentifier("enableUser");
req.setAttribute("accountId","exampleuser");
req.setAttribute("accounts","Lighthouse,LDAP,RACF");
ExtendedResponse res = (ExtendedResponse) client.send(req);

launchProcess Example

The following example shows the typical format for a launchProcess request (View -> Process view).


Example 1–9 launchProcess Request


ExtendedRequest req = new ExtendedRequest();
req.setOperationIdentifier("launchProcess");
req.setAttribute("process", "my custom process");
req.setAttribute("taskName", "my task instance");
ExtendedResponse res = (ExtendedResponse) client.send(req);

where:

The remaining attributes are arbitrary and they are passed into the task.

listResourceObjects Example

The following example shows the typical format for a listResourceObjects request.


Example 1–10 listResourceObjects Request


ExtendedRequest req = new ExtendedRequest();
req.setOperationIdentifier("listResourceObjects");
req.setAttribute("resource", "LDAP");
req.setAttribute("type", "group");
ExtendedResponse res = (ExtendedResponse) client.send(req);

where:

resetUserPassword Example

The following example shows the typical format for a resetUserPassword request (View -> Reset User Password view).


Example 1–11 resetUserPassword Request


ExtendedRequest req = new ExtendedRequest();
req.setOperationIdentifier("resetUserPassword");
req.setAttribute("accountId","exampleuser");
req.setAttribute("accounts","Lighthouse,LDAP,RACF");
ExtendedResponse res = (ExtendedResponse) client.send(req);

runForm Example

The following example shows the typical format for a runForm request.


Example 1–12 runForm Request


ExtendedRequest req = new ExtendedRequest();
req.setOperationIdentifier("runForm");
req.setAttribute("form", "SPML Get Object Names");
ExtendedResponse res = (ExtendedResponse) client.send(req);

where form is the name of a configuration object containing a form.