Layer7 Access Management

Expand all | Collapse all

SSO Java SDK "Get All" Methods

Jump to Best Answer
  • 1.  SSO Java SDK "Get All" Methods

    Posted 08-26-2016 11:38 PM

    Hi all,

     

    Recently been working with the Java SDK for a client for some Policy Store management operations. I was using the SSO Perl API successfully for a while, ran into a bug with one of the methods so attempted to switch to the Java API. Does the Java API have the methods in the different classes for retrieving all objects of a certain type like the Perl API had. Example in the com.netegrity.sdk.policyapi package I only see the ability to return a single agent that is specified. The same goes for ACO and other objects.


    getAgent(java.lang.String agentName,SmAgent agent)

    Maybe I am just missing it, any help would be appreciated.

    Thanks,
    Adam


  • 2.  Re: SSO Java SDK "Get All" Methods
    Best Answer

    Posted 08-28-2016 09:47 PM

    Hi All, 

     

    In case anyone was following this I found my answer. I see you need to use the getGlobalObjectNames method and use a vector with the static field value of the class you want to retrieve. Hope this helps someone in the future too: Here is how you can iterate through the agents and print them out.

     

    SmApiResult result = new SmApiResult();

    SmPolicyApi policyapi = new SmPolicyApiImpl(mySession);

    Vector vector = new Vector(15);

    result = policyapi.getGlobalObjectNames("Agents", vector);

    System.out.println("Result is success? " + result);

    System.out.println("Vector is" + vector.size();

     

    Iterator i = vector.iterator();

        while (i.hasNext()) {

          System.out.println(i.next());

        }

     

     

     

    Thanks,

     

    Adam



  • 3.  Re: SSO Java SDK "Get All" Methods

    Posted 08-29-2016 02:50 AM

    Hi Adam,

    Thank you for sharing this.

     

    Cheers,

    Ujwol