(file) Return to ProviderClient.java CVS log (file) (dir) Up to [Pegasus] / pegasus-JavaCIMClient / cimclient / tests / ProviderClientTest

File: [Pegasus] / pegasus-JavaCIMClient / cimclient / tests / ProviderClientTest / ProviderClient.java (download)
Revision: 1.1, Thu Jul 17 17:32:55 2003 UTC (20 years, 11 months ago) by kumpf
Branch: MAIN
CVS Tags: test, pegasus25BeforeLicenseUpdate, local, TEST, SLPPERFINST-root, SLPPERFINST-branch, RELEASE_2_4_FC_CANDIDATE_1, RELEASE_2_4_1-BETA3, RELEASE_2_4_1-BETA2, RELEASE_2_4_1-BETA1, RELEASE_2_4_1, RELEASE_2_4_0-RC3, RELEASE_2_4_0-RC2, RELEASE_2_4_0, RELEASE_2_4-root, RELEASE_2_4-branch, RELEASE_2_3_2-testfreeze, RELEASE_2_3_2-root, RELEASE_2_3_2-releasesnapshot, RELEASE_2_3_2-branch-freeze, RELEASE_2_3_2-branch, RELEASE_2_3_1-root, RELEASE_2_3_1-branch, RELEASE_2_3_0-root, RELEASE_2_3_0-msg-freeze, RELEASE_2_3_0-branch, PRE_LICENSE_UPDATE_2003, POST_LICENSE_UPDATE_2003, PEP217_PRE_BRANCH, PEP217_POST_BRANCH, PEP217_BRANCH, PEP214ROOT, PEP214BRANCH, PEP214-root, PEP214-branch, PEP213_SIZE_OPTIMIZATIONS, PEP-214B-root, PEG25_IBM_5_16_05, MONITOR_CONSOLIDATION_2_5_BRANCH, IBM_241_April1405, HPUX_TEST, HEAD, CQL_2_5_BRANCH, CHUNKTESTDONE_PEP140, BUG2493_BINREP-root, BUG2493_BINREP-branch
Branch point for: pep_88
HP-BAPU: PEP-64 CIM Client and CIM Listener Java Interface


package tests.ProviderClientTest;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;
import org.snia.wbem.client.CIMClient;
import org.snia.wbem.cim.*;

//import connect.*;
public class ProviderClient
{

//===========================================================
//   M A I N
//===========================================================
  public static void main(String args[])
  {
        String managedSystem="localhost";
	String className=null;
	String propertyName=null;
	String nameSpace = "root/cimv2";
        int portNo=CIMNameSpace.DEFAULT_PORT;
        String protocol = null;

        System.setProperty("org.snia.wbem.cimom.properties", "./cim.properties");
        if (args.length == 6) 
        {
  	  managedSystem = args[0];
    	  nameSpace=args[1];
  	  portNo=Integer.parseInt(args[2]);
          protocol=args[3];
	  className = args[4];
	  propertyName = args[5];
        } 
        else 
        {
             String USAGE="USAGE: java ProviderClient hostname namespace portNo ssl/nossl className propertyName";
             String EXAMPLE1="java ProviderClient localhost root/cimv2 5989 ssl PG_ComputerSystem Name";
             String EXAMPLE2="java ProviderClient sequoia root/cimv2 5989 ssl PG_OperatingSystem Version ";
             String EXAMPLE3="java ProviderClient sequoia root 5988 nossl PG_OperatingSystem Version ";

             System.err.println("\n" + USAGE);
             System.err.println("Example:");
             System.err.println("\t" +EXAMPLE1);
             System.err.println("\t" +EXAMPLE2);
             System.err.println("\t" +EXAMPLE3);
             System.exit(1);
        }

	XMLConnect connect = new XMLConnect();
	WBEMValue  val = new WBEMValue();


	connect.setManagedSystem(managedSystem);
	connect.setPort(portNo);
	connect.setNamespace(nameSpace);
	connect.setProtocol(protocol);
	connect.connectSystem();

        CIMClient cc=null;
	cc = connect.getConnectHandle();
	System.out.println("Connection Handle: "+cc);

	String value;
        value = val.getPropertyValue(cc, nameSpace, className, propertyName);

	System.out.println("Value: "+value);
	//system.exit(0);
   }
}

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2