Sun Identity Manager 8.1 Web Services

Batch Capability

Identity Manager supports the Batch capability described in the following table.

Table 2–4 Batch Capability

Capability  

Description 

OperationalAttributes

BatchRequest

Executes a batch of requests. 

None 

The following example performs a batch add operation.


Example 2–11 Example Batch Request

SessionAwareSpml2Client client = new 
    SessionAwareSpml2Client("http://example.com:8080/idm/servlet/openspml2");
ListTargetsResponse loginInfo = client.login("Configurator", "configurator");

BatchRequest batchReq = new BatchRequest();
for (int i = 1; i <= 10; i++) {
    AddRequest addReq = new AddRequest();
    Extensible attrs = new Extensible();
    attrs.addOpenContentElement(new DSMLAttr("objectclass", "spml2Person"));
    attrs.addOpenContentElement(new DSMLAttr("accountId", "test_" + 
       String.format("%03d", i)));
    attrs.addOpenContentElement(new DSMLAttr("credentials", "password"));
    addReq.setData(attrs);
    addReq.setReturnData(ReturnData.EVERYTHING);
    batchReq.addRequest(addReq);
}
BatchResponse batchRes = (BatchResponse) client.send(batchReq);
if (batchRes.getStatus().equals(StatusCode.SUCCESS)) {
    System.out.println("Successfully performed batch add operation.");
}