Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Development
  3. How to get the "object tree" and

How to get the "object tree" and

Scheduled Pinned Locked Moved Development
3 Posts 2 Posters 19.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 1
    1
    165432896
    wrote on last edited by
    #1

    hi:
    I am developping our own console by the client java api(version 1.1.5). my friend have been ask you the get the official java-client(nxmc),but we are incapable the read it(because we are a new hand in java) .

    Back to our topic:
    I want to get the "object tree" just like below:
    Entire Network
      + 10.0.0.0/24
      + 10.0.1.0/24
      - 10.0.2.0/24
        + 10.2.2.3/24
        + 10.2.2.4/24

    How can it come true in the official java-client(nxmc)? It that some of the existing java api for it?
    Best wish!

    If you a free,can you tell me how the "topological graph"(ip neighbors) come true? Is it  come true just like the  "object tree"  above

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      Hi!

      In nxmc we use Eclipse viewers, so code to got parent/child relations is actually decoupled into separate pieces. Simple code to print object tree, which you can use as an example:

      	private void printObject(GenericObject object, int level)
      	{
      		for(int i = 0; i < level; i++)
      			System.out.print(' ');
      		System.out.println(object.getObjectName());
      
      		for(GenericObject o : object.getChildsAsArray())
      			printObject(o, level + 2);
      	}
      
      	public void main() throws Exception
      	{
      		final NXCSession session = connect();  // obtain session somehow
      
      		session.syncObjects();
      
      		GenericObject object = session.findObjectById(1, EntireNetwork.class);
      
      		printObject(object, 0);
      
      		session.disconnect();
      	}
      

      Best regards,
      Victor

      1 Reply Last reply
      0
      • 1
        1
        165432896
        wrote on last edited by
        #3

        Thank you very much

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        Powered by NodeBB Contributors
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups