OpenICF Connector Development

This topic has 2 replies, 2 voices, and was last updated 3 years, 1 month ago by mreines.

  • Author
    Posts
  • #22928
     mreines
    Participant

    I have implemented a OpenICF Connector in which everything seems to work as expected when mapping against the managed users, with a single exception.
    I don’t see any ‘Data’ tab in the IdM (v6) Admin Web Interface. Any ideas on why this wouldn’t appear? I’ve implemented the following interfaces:
    Connector, CreateOp, ResolveUsernameOp, DeleteOp, SearchOp<Filter>, UpdateOp, SchemaOp, TestOp

    Any insight into this?

    #22933
     japearson
    Participant

    For the SearchOp methods are you writing results to the ResultHandler? Are you able to share the code of your connector or at least snippets of it?

    #22955
     mreines
    Participant

    Yes I am writing to result handler – I mostly followed the code from the CSV connector… here is the entire method… I appreciate the response and hope you can further clarify. The documentation is OK, but not terribly detailed.

        public void executeQuery(ObjectClass oclass, Filter query, ResultsHandler handler, OperationOptions options) {
            LOG.info("Query oclass - {0}, query - {1}, options - {2}", oclass.getObjectClassValue(), query, options.toString());
    
            PagingOptions pageOptions = getPagingOptions(options);
            int nextRowOffset = (pageOptions.pageSize > 0) ? (pageOptions.offset + pageOptions.pageSize) : 0;
            int resultsHandled = pageOptions.pageSize;
    
            Map<String, String> account = new HashMap<>();
            for (int i = 0; i < ACCOUNTS.get(configuration.getFilename()).get(NAME).size(); i++){
                for (String header : ACCOUNTS.get(configuration.getFilename()).keySet()) {
                    account.put(header, ACCOUNTS.get(configuration.getFilename()).get(header).get(i));
                }
                ConnectorObject object = buildConnectorObject(account);
                if (query == null || query.accept(object)){
                    if (pageOptions.offset-- <= 0){
                        if (!handler.handle(object)){
                            break;
                        }
                        if (pageOptions.pageSize > 0 && --resultsHandled <= 0) {
                            break;
                        }
                    }
                }
            }
    
            if (handler instanceof SearchResultsHandler) {
                SearchResult searchResult = new SearchResult(
                        nextRowOffset > ACCOUNTS.get(configuration.getFilename()).get(NAME).size()
                                ? "0"
                                : Base64.encode(String.valueOf(nextRowOffset).getBytes()),
                        SearchResult.CountPolicy.EXACT,
                        ACCOUNTS.get(configuration.getFilename()).get(NAME).size(),
                        Math.max(0, ACCOUNTS.get(configuration.getFilename()).get(NAME).size() - nextRowOffset));
                ((SearchResultsHandler) handler).handleResult(searchResult);
            }
        }
    
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

©2021 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?