webspherejava-17open-liberty

The equivalent (or near alternative) of com.ibm.websphere.tivoli.* for openliberty with java 17


As the title says, do you have:

  1. Suggestions
  2. Alternatives
  3. An or have encountered this case that you have migrated to openliberty from websphere server? Thank you!

Solution

  • I have resorted to ldap of openliberty.

    UPDATE

    Thank you for bringing this up @Doug Breaux, as I was into updating my code, I forgot to update this post.

    Moving on, what I did is a of combination of unboundid and vanilla Java LDAP to succeed in converting my methods. But, I plan to migrate it all in unboundid as I see it, it is being supported fairly good continuously.

    Porting my code. Here is the list of PDUser https://www.ibm.com/docs/en/sva/10.0.7?topic=groups-administering-user-information methods that I have primarily used.

    But since I will no longer use Websphere, I am now using Java LDAP Vanilla code like:

        String ldapUrl = "";
        String searchBase = "";
        String searchFilter = "cn="+userName;
        String username = "";
        String password = "";
    
        Hashtable<String, String> env = new Hashtable<>();
        env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
        env.put(Context.PROVIDER_URL, ldapUrl);
        env.put(Context.SECURITY_AUTHENTICATION, "simple");
        env.put(Context.SECURITY_PRINCIPAL, username);
        env.put(Context.SECURITY_CREDENTIALS, password);
        DirContext ctx = null;
        try {
            ctx = new InitialDirContext(env);
            SearchControls searchControls = new SearchControls();
            searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
    
            NamingEnumeration<SearchResult> results = ctx.search(searchBase, searchFilter, searchControls);
    
            if (results.hasMore()) {
                SearchResult result = results.next();
                return true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            ctx.close();
        }
    

    For unboundid java code, I have read through this https://docs.ldap.com/ldap-sdk/docs/getting-started/controls.html