Home | History | Annotate | Download | only in srm
      1 /*
      2  * CDDL HEADER START
      3  *
      4  * The contents of this file are subject to the terms of the
      5  * Common Development and Distribution License (the "License").
      6  * You may not use this file except in compliance with the License.
      7  *
      8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9  * or http://www.opensolaris.org/os/licensing.
     10  * See the License for the specific language governing permissions
     11  * and limitations under the License.
     12  *
     13  * When distributing Covered Code, include this CDDL HEADER in each
     14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15  * If applicable, add the following below this CDDL HEADER, with the
     16  * fields enclosed by brackets "[]" replaced with your own identifying
     17  * information: Portions Copyright [yyyy] [name of copyright owner]
     18  *
     19  * CDDL HEADER END
     20  */
     21 /*
     22  * Copyright (c) 2001 by Sun Microsystems, Inc.
     23  * All rights reserved.
     24  *
     25  * ProcessAggregateDataModel.java
     26  */
     27 
     28 package com.sun.wbem.solarisprovider.srm;
     29 
     30 import javax.wbem.cim.*;
     31 
     32 
     33 /**
     34  * Data model of aggregated process utilization
     35  * It encapsulates a CIM instance of
     36  * a Solaris_ProjectProcessAggregateStatisticalInformation
     37  * or Solaris_UserProcessAggregateStatisticalInformation class.
     38  * @author Sun Microsystems
     39  */
     40 public class ProcessAggregateDataModel extends ProcessDataModel {
     41 
     42 
     43     /**
     44      * Construct an aggregated process utilization model and set the user id
     45      * or the project name propertyto uidStr.
     46      * @param   idStr the user id or project name
     47      */
     48     public ProcessAggregateDataModel(String idStr) {
     49 	name = idStr;
     50     }
     51 
     52     protected void setOpPropertiesVector() {
     53 
     54 	opProperties.add(new CIMProperty(SYSTEMNAME,
     55 	      new CIMValue(csName)));
     56 
     57 	opProperties.add(new CIMProperty(SYSTEMCREATIONCLASSNAME,
     58 	      new CIMValue(SOLARIS_COMPUTERSYSTEM)));
     59 
     60 	opProperties.add(new CIMProperty(NAME,
     61 	      new CIMValue(name)));
     62     }
     63 
     64     protected void setCIMInstance(boolean newInstance) {
     65 	super.setCIMInstance(newInstance);
     66 	setStrProp(newInstance, CREATIONCLASSNAME,
     67 	    SOLARIS_PROCESSAGGREGATESTATISTICALINFORMATION);
     68     }
     69 
     70     /**
     71      * Returns the string value of this object
     72      */
     73     public String toString() {
     74 	return super.toString() + "Name    " + name + "\n" + super.toString();
     75     }
     76 
     77     protected void initKeyValTable() {
     78 	super.initKeyValTable();
     79 	keyValTab.put("id_nproc", new SetUI64Prop("NumProcs"));
     80     }
     81 
     82 } // end class ProcessAggregateDataModel
     83