Documentation for a newer release is available. View Latest

Use Client Library

DPS provides client library which can be used by applications which integrates DPS. Client port contains all interfaces which can be used to work with DPS.

More about implementations and dependencies can be seen here Client Library

Available client ports are:

  • DpsSchemasClientPort - contains methods to get setting schemes

  • DpsCrudClientPort - contains methods to create, update, delete and get setting by id

  • DpsSearchClientPort - contains methods to search settings by searchable parameters

  • DpsApprovalsClientPort - contains methods to handle approvals (approve, reject get approvals)

  • DpsHistoryClientPort - contains methods to search setting history

An example of how client port can be used:

import com.iconsolutions.ipf.dynamicsettings.v2.client.port.DpsCrudClientPort;
import com.iconsolutions.ipf.dynamicsettings.v2.dto.CreateSetting;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
...

@Slf4j
@RequiredArgsConstructor
public class ClientCustomLogic {
    private final DpsCrudClientPort dpsCrudClientPort;

    public CompletionStage<Void> customLogic() {
        CreateSetting<ClientSetting> createSetting = CreateSetting.<ClientSetting>builder()
                .requiresApproval(false)
                .source("manual")
                .processingEntity("001")
                .createdBy("operator")
                .payload(ClientSetting.builder().build())
                .build();
        return dpsCrudClientPort.createSetting(ClientSetting.SETTING_TYPE, createSetting)
                .thenAccept(createdSetting -> log.info("Setting created #{}", createdSetting.getValue().getLogicalUniqueKey()));
    }
}