197
ISXO Custom Server Properties Integration Mads Nielsen Kongens Lyngby 2010 IMM-B.Eng-2010-14

ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

  • Upload
    lamanh

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

ISXO Custom Server PropertiesIntegration

Mads Nielsen

Kongens Lyngby 2010IMM-B.Eng-2010-14

Page 2: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

Technical University of DenmarkInformatics and Mathematical ModellingBuilding 321, DK-2800 Kongens Lyngby, DenmarkPhone +45 45253351, Fax +45 [email protected]

Page 3: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

Preface

This thesis has been performed in conjunction with IMM at DTU, and APCDenmark.

This thesis will discuss methods of gathering various kinds of commonly foundproperties on physical servers, gathered by different management systems.

The thesis will also discuss how to integrate some of those properties into atarget application named InfraStruXure Operations and will cover many of theaspects when integrating with other systems, how to present the integrated data,how to collect and store the data.

The thesis takes an exploratory approach and will briefly describe some of thesystems which have been tried out, how they might be useful in the environmentim using and which systems might be less useful from a value perspective.

Having available server-level information available inside ISX Operations willbring a tremendous advantage because ISX Operations already has a strongphysical model of the datacenter. Adding system information on a server basismakes it possible to model almost the entire datacenter, making it easier for thedata center operator to monitor and survey the state of the datacenter.

Page 4: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

ii

Page 5: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

Contents

Preface i

1 Introduction 1

2 Domain 32.1 InfraStruXure Operations . . . . . . . . . . . . . . . . . . . . . . 32.2 InfraStruXure Operations Web service description . . . . . . . . 52.3 InfraStruXure Operations datacenter model . . . . . . . . . . . . 62.4 InfraStruXure Operations plugin architechture . . . . . . . . . . 62.5 Datacenter terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.6 Custom server properties . . . . . . . . . . . . . . . . . . . . . . 82.7 Existing management systems . . . . . . . . . . . . . . . . . . . . 9

3 Design 173.1 Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.2 Speed considerations . . . . . . . . . . . . . . . . . . . . . . . . . 183.3 Usability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

4 Implementation and Results 234.1 VMware results and implementation . . . . . . . . . . . . . . . . 234.2 Nagios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304.3 Microsoft Systems Center Operations Manager 2007 . . . . . . . 364.4 UI implementation . . . . . . . . . . . . . . . . . . . . . . . . . . 384.5 Implementation packages . . . . . . . . . . . . . . . . . . . . . . 48

5 Test 515.1 VMware integration test . . . . . . . . . . . . . . . . . . . . . . . 515.2 Nagios integration test . . . . . . . . . . . . . . . . . . . . . . . . 555.3 MS SCOM 2007 integration test . . . . . . . . . . . . . . . . . . 565.4 Test conclusions and observations . . . . . . . . . . . . . . . . . . 57

6 Discussion 59

Page 6: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

iv CONTENTS

7 Conclusion 63

A Appendix A - Nagios source 65

B Appendix B - VMware UI source 91

C Appendix C - VMware source 137

D Appendix D - Property rules source 185

Page 7: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

Chapter 1

Introduction

This thesis covers the integration of custom server properties and ISX Opera-tions. The first chapter in the report will briefly describe the domain in whichi am operating, how ISXO works and which components it consists of. Fromthere on it will go on with descriptions of the different management systems itried out and how i tried to integrate the data from that system into ISXO andfinally how i ended up integrating the different management systems.

The thesis will cover three different management systems

• VMware V-center 4.0

• Nagios

• MS SCOM 2007

As you will note when reading the thesis i placed more emphasis on VMwarein the end because during my work i realized i could do much more with theoutput of that application and put it to real value use in ISX Operations. Itopened up for the possibility to actually display the properties and to completethe cycle of the integration.

One thing i also noted throughout my project was that the systems you integrateare very very different to each other, and that each of them has their ownstrengths and weaknesses i could fully envison a scenario where the end userwould be better off using more than one of these systems to get maximumvalue.

Page 8: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

2 Introduction

The gathered properties are important for the datacenter operator, especially ifhe can visually identify which equipment is faulty from a the application givena set of properties tied to a service.

Page 9: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

Chapter 2

Domain

The domain chapter will describe the enviroment in which im building my imple-mentation, how it will try to integrate with the enviroment and briefly explainthe ISX Operations platform.

2.1 InfraStruXure Operations

During this paper I will make numerous references to the InfraStruXure Oper-ations (ISX Operations) which is the application I am targeting my referenceimplementation/proof of concept implementation at, to work and function inconjunction with the application is a key requirement in my considerations.ISXO has a very powerful physical data center model, where location and thephysical properties of a datacenter are modeled. The modeled properties alsoinclude cabling, power and cooling information.

One area where ISXO is weak is in terms of the individual servers and theinformation about them, a server doesn’t know where it is, but ISXO does.ISXO also knows what the equipment is, but beyond that it’s knowledge islimited about the individual server or equipment.

Aside from ISX Operations, there is another product, ISX Designer, which isused to design a datacenter and afterwards it is possible to import this designinto ISX Operations. There is also a piece of software named ISX Central whichmonitors the state and collects alarms raised by various types of sensors and

Page 10: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

4 Domain

devices in the datacenter, and finally we have ISX Operations which tries tolink the measured data gathered by sensors in the datacenter and their actualphysical location.

Below is a short diagram illustrating the relationship between the different ISXproducts. ISX Central is being developed in West Kingston (USA) and ISXOperations in Kolding. ISX Operations and ISX Central are currently at version6.0 both of which were released in January. As a datacenter operator one of

Figure 2.1: ISX Architecture

the biggest hurdles to managing a datacenter is finding the location of faultyequipment. That is why there has been a huge focus on the design of the ISXOperations on getting that functionality into ISX Operations.

ISX Operations have several different modules which comes as optional modules,you can at any time choose to upgrade your installation, provided that you havepurchased a license for that particular piece of software, with the addition ofa module to your ISX Operations installation. So to summarize here are thepurposes each component serves:

• ISX Change

– Work orders, tracking the movement of equipment. E-mail notifica-tion to supervisors when changes to the datacenter have been imple-

Page 11: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

2.2 InfraStruXure Operations Web service description 5

mented.

• ISX Mobile

– Mobile ISXO client. Simple mobile client, great for monitoring alarmsand updating work orders.

• ISX Capacity

– Advanced cooling calculations, capacity groups and energy cost andusage reports for your datacenter.

• ISX Energy Efficiency

– Measure, calculate and show your PUE(Power Usage Efficiency). Ameasurement of how much of the power you put into your datacenteractually goes to your servers, and isn’t ”wasted” on cooling and powerloss. It’s calculated by dividing the power going into your datacenterwith the power used to run your it equipment. A PUE of 1.0 indicatesthat ALL the power you let into your datacenter is used to power youractual IT equipment.

2.2 InfraStruXure Operations Web service de-scription

ISXO also now features a Web service API to add information to the ISXOModel framework, the Web service API is still in development.

There are two relevant Web services which we would need to use in order toimport the data we have gathered from the different management systems men-tioned in this report.

• NameNetwokDevicePropertyWebService

• CustomPropertyWebService

The first Web service is for some of the data you will find on almost any physicalor virtual equipment in a datacenter, this includes free disk space, CPU loadetc.

The second Web service can be used for more specific properties, it could bea status message of a service running on the host or a custom output from an

Page 12: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

6 Domain

application running on that host. All Web service .java code is generated usingan old Xfire Eclipse plugin. The Web services are all described using standardWSDL annotation.

The Web services share some commonalities, they all require that you specifya key-value pair for lookup and then an array of properties which you want toadd. One key difference between the two are the validation requirements, thecustom property web service has no validation and all properties are stringswith no validation required. The network device properties on the other hand,are still strings, but the string has been analyzed before insertion.

2.3 InfraStruXure Operations datacenter model

The ISXO data model models the entire physical datacenter model, all the waydown to cabling and power connections, and the model is persisted throughhibernate in an PostgreSQL database. All model object requires a persistancehandler so that any modifications done to an object in the application is directlymirrored in the model database. For this paper I will not be developing apersistence handler as the required handlers for adding this functionality isbeing developed as we speak, and I intend to use that framework.

2.4 InfraStruXure Operations plugin architech-ture

From the top, plugins for ISXO can be categorized into two buckets: Serverplugins and client plugins. Server resides on the host running the ISX Centralapplication, while the client plugins are being used by the clients installing ISXOto connect to the ISX Central database.

When you first connect to an ISX Central server plugins are automaticallydownloaded from the server onto the client version on first startup. After thatyou are ready to go.

Going down you will see that there are plugins for the different componentswhich you can add to the basic ISX Operations, components such as ISX Ca-pacity and ISX Change.

So a key design choice when developing a plugin in for ISX Operations is plugin

Page 13: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

2.5 Datacenter terms 7

location and placement, for my project most of the additions will be on theclient side as the database and model is already able to handle the properties Iintend to add.

Plugins are further divided into features, a feature might consist of several plu-gins, and a feature might be a composite of many smaller features.

2.5 Datacenter terms

The domain is the Small-Medium and Large and X-Large datacenters. Data-centers require sophisticated infrastructure and cooling equipment to functionproperly, partly because thermal density is rising, and because blade centers arebecoming much more popular in the industry. When you have 25 servers in arack, each outputting a few hundreds of watts, then the need for planning andadequate cooling becomes increasingly important.

A datacenter is comprised of several components, you’ve got cooling equip-ment, power distribution equipment, security equipment and cabling. Serversare mounted in racks, an industry standard rack has 42 free U positions, andservers have their height listed in units. The largest ones using up 5-8 U posi-tions, and the smaller ones only 1U. Servers need power, and for distributing thepower coming from the Power Distribution Unit, you use a Power DistributionUnit mounted in a rack to give power to the equipment in the rack. PDU’sreceive power from an Uninterruptable Power Supply (UPS).

One thing that is of great importance is redundancy, which usually comes inthese flavors:

• N

• N+1

• 2N

• 2N+1

Redundancy is ensured by connecting servers to multiple power sources, so ifone fails, another one takes over. N redundancy is no redundancy and the 2N+1configuration offers the highest amount of redundancy in the datacenter.

Page 14: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

8 Domain

2.6 Custom server properties

• Semi-static properties (Hardware, confgiuration settings)

– IP

– Mac address

– OS and OS version

– Processor information/Hardware information

– Server manufacturer

• Dynamic properties (Performance indicators, service state)

– Memory usage

– CPU load

– Swap file usage

– Free disk space

– Service status

– Network load

– Cooling information

– Power usage information

ISX Operations and ISX Central cover dynamic properties very nicely, becausecooling and power status of your datacenter equipment is very important in abusiness perspective, downtime is very expensive in large companies and havingserver level information about these properties can help avoid, and alleviateproblems which might occur. A few dynamic properties are not covered by ISXOperations, those are things like CPU load or memory consumption, either anaverage over any given window, or the current and immediate state.

The static properties on the other hand, is not something that is covered orincluded much in ISX Operations or ISX Central and that is the kind of proper-ties which we want other management systems to enrich ISX Operations with.As you will notice I will further specialize these properties into two differentkinds, one which ensures the format of the information collected, and anotherone which is very freeform and can be used on any object in the database modeldefined by ISX Operations.

Page 15: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

2.7 Existing management systems 9

2.7 Existing management systems

This section of the report will briefly describe which management systems whichhave been under considerations, and I will also briefly explain why some of themwill receive less attention in this paper. I will be listing positives and negativesabout each of these management systems, and describe how they would be ableto enrich an already existing platform with additional information which mightbe important for buisness purposes.

2.7.1 Nagios

Nagios is an open source management monitoring system, free for download andusage. It’s script based and you can write custom scripts to check various partsof the system. Scripts can be .sh scripts python scripts etc. The only thingthat Nagios demands is that the script returns a code indicating the status ofthat particular service. An example for a use would be to monitor a particularservice or application running with a specific pid, and then you could write ascript checking the status of that particular application, for example its memoryfootprint etc.

Nagios comes bundled with the Apache web server and you can use the webinterface on this web server to access the nagios status information page. If youwant to use the information gathered by Nagios in another application you’llneed to install some addons for Nagios to fill out that requirement.

Services can be grouped, and placed into service groups, you can define hostsand define groups of hosts which you in turn can assign to a service whichyou then also can assign to a service group. In Nagios you also define contactinformation, so if a service goes critical, you can have Nagios forward an alertmail indicating that a server has gone critical.

Everything is done manually through the .cfg files which you configure prior tostarting Nagios. Nagios is highly configurable and there is no auto discovery orautomatic addition of hosts to your configuration files. Three additional addonsare of interest when working with Nagios, by default Nagios displays a visualrepresentation of the state of the hosts that it is set up to monitor and canforward contact alerts if one of the services goes critical. As for Nagios, it’s aweb-app which you deploy on a Tomcat server. The three addons for Nagiosare:

• NDOUtils

Page 16: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

10 Domain

• NRPE

• NSCA

For the purpose of this project I decided to go with the two first addons, thefirst one allows you to store service output data in database like MySQL. Thesecond addon is an addon for remote script execution on monitoring targets.The database is very useful, because it allows you to control gather historicalservice data and it also allows for other systems pull information when requiredor requested. The daemon will periodically do database cleanup and you canconfigure how much data you want to log to the database. The NDO2DB

Figure 2.2: Nagios NDO mod

daemon is configured to listen either to a standard TCP socket or the UNIX-Domain socket. For the NDOMOD module it is probably best practice to use aTCP socket in case you want to run your NDO2DB daemon on a remote hostand not locally with your Nagios daemon.

I will not go into detail about the Nagios database model created by the NDO-MOD, further information can be found in the link found in the bibliography.

Page 17: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

2.7 Existing management systems 11

Figure 2.3: Nagios ndomod overview

Since I will be trying to integrate with a system which normally has more than100 servers in the model it deemed best fit to look for a solution where theuser could configure when to update, and what server information he want toupdate.

Since the focus of this paper will be on semi static properties it would makeno sense to send information every time the ndo2db submitted information thedatabase.

The NRPE addon (Nagios Remote Plugin Execution) allows you to triggerscripts on remote machines, for example Nagios server A could ask host B toexecute script C.

2.7.2 Microsoft Systems Center Operations Manager 2007

Microsoft Systems Center Operations Manager 2007 (MS SCOM 2007) is arapidly growing application to monitor and survey different parts of a moderndatacenter or server rooms. You can monitor services, databases, web servers,web pages etc.

Page 18: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

12 Domain

MS SCOM operates about and uses management packs to discover, monitor andprobe information and displays this information in a view which you can createin the management pack.

To collect information about the managed and monitored objects you will haveto use the SDK that comes with MS SCOM. It’s not possible to gather otherinformation than alarms and state changes using the ConnectorFramework SDKwhich is bundled with MS SCOM 2007. To gather state information and directproperties of the monitored object you would have to use the regular SDK thathave more powerful methods for directly accessing the monitored objects.

Figure 2.4: MS SCOM 2007

What does this mean, it means that in order to actually get the data you arelooking to collect you would have to write a management pack that discoversthis data, and display this information in MS SCOM 2007. After the data havebeen gathered you would have to write a program to export this informationvia the SDK and import it into ISX Operations.

Since we cannot make assumptions on which management packs the user mighthave installed it makes sense to target a management pack which comes bundledwith the standard install of MS SCOM 2007. Developing a management pack togather the information I am looking for in this paper would be very cumbersome,because much of the information I am looking for would necessitate the installof an agent on the hosts being monitored.

Page 19: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

2.7 Existing management systems 13

Customers would be very hesitant to install agents on all of their hosts, andmany of those agents are only compatible with a Windows operating system soit would not make much sense in larger data centers. For small and mediumdata centers MS SCOM 2007 makes much more sense, customers might writecustom management packs just to monitor mail servers, firewalls etc.

Management packs are written in XML and MS SCOM2007 comes bundledwith an XML schema and a small program to validate your management pack.Developing a management pack requires you to write a target class, which mustextend and reference one of the base classes included in the installation of MSSCOM 2007. Once you have defined a target class, you will need to write a dis-covery for this class. A target class could be something like a WindowsComputerobject or WindowsApplication object.

A discovery is timed, and you can have your discovery make a call to a webservice, look in the registry for a specific key or look in the task manager for arunning task. Microsoft suggests that it is probably best to use JavaScript as thescript language in your discovery, but you could also choose to use Visual Basicscripts or Power Shell scripts. Although both Visual Basic and Power Shellrequires the install of additional software on the objects you want to discoverand monitor.

Combined the target class, the discovery and the monitor describes a workflowwhich can be displayed in MS SCOM 2007. However, if you really wanted totake truly advantage of the properties in MS SCOM you would have to packmanagement packs with the installation and distribution of ISX Operations.That is necessary because we need to know which management packs to targetwhen extracting the properties of the monitored objects.

2.7.3 VMware

VMware is a virtualization platform used by many smaller companies to hosta multitude of easily interchangeable virtual machines sitting on a number ofphysical host systems. Such a system is relevant for the task at hand since it iswidely used by the customers of APC. Furthermore I found that Microsoft VMM(Virtual Machine Manager), which I will not cover with this report, integrateswith

Page 20: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

14 Domain

2.7.3.1 VMware model hierarchy

The small illustration below shows the basic hierarchy which would be preferableto try and mimic in the implementation, basically you would want a datacenterto hold clusters, a cluster to hold host systems, and host systems should hold alist of virtual machines running on them.

Figure 2.5: VMware hierarchy

That means that a cluster object should maintain a list of host systems. Andthen again each of those host systems should maintain and populate a list ofvirtual machines.

For server properties the host systems are the most interesting things to monitorbecause some of those properties we are looking for are already clearly defined inthe SDK that comes with VMware. Furthermore the VMware model hierarchyallows you to add folders to store your virtual machines and organize the undera datacenter.

2.7.3.2 VMware web service SDK

VMware features a very extensive SDK. Almost all information is availableand it is very freeform since everything is fetched using strings describing the

Page 21: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

2.7 Existing management systems 15

property path in the model. The SDK can also be used for maintenance work,like shutting down a virtual machine, moving it, adding storage etc. but for theintents and purpose of my project that is not what I will focus on.

The link VMware web service API can be found here: [2]

Without going in too deep, getting properties from VMware is matter of knowingthe correct property path for the objects which you are looking for. So inmy implementation I used the reference example provided with the SDK as aguideline for finding out which properties might be relevant.

For example, if you want to find out which virtual machines are running onany particular host system you can get a ”Managed Object Reference” point-ing to the virtual machines running on this particular host by getting theproperty ”hostsystem.vm”. When you then collect the data, you can castthis data to an ArrayOfManagedObjects and the using a call to extract theList<ManagedObjectReference>. The same goes if you want to collect sum-mary information about memory usage, you might do something like this: ”host-system.summary.memory”.

The API documentation contains information about the types of the data youcan collect from virtual machines and host systems.

Page 22: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

16 Domain

Page 23: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

Chapter 3

Design

This chapter will cover the design aspects of the projects, which technologies Iintend to use and also show some of the concept art used in creating the firstprototype for the UI implementation.

3.1 Technologies

In my project I decided to use several different technologies to realize the wishfor custom server properties in ISX Operations. Among the technologies usedare:

• Eclipse RCP framework

• SWT/JFace, Swing

• Nagios, the associated Add-ons like NDOMOD and NRPE

• VMware web service SDK

• Microsoft SCOM SDK

• GEF, the graphical editing framework used to display the various domainmodel objects, things like servers, switches and racks in a datacenter

Page 24: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

18 Design

Since there are a lot of new technologies involved I expected quite a few startupissues getting everything up and running, to test the different managementsystems in the company environment.

3.2 Speed considerations

Since my work is a proof of concept speed of execution will not be a mainfactor in my design, optimization can be done at a later stage and I will focusmore on getting the data in the first place. To test to see what information thatcan be gathered. In regards to the UI speed considerations are pretty importantthough, since I will be using GEF to draw and illustrate some of the properties Ihave been gathering, so finding a good way to illustrate and draw the propertiesseemed like a good idea to begin with.

3.3 Usability

Usability has been a key concern in my design considerations, since this is aproof of concept, we want it to be presentable and easy to understand should itbe decided that the components I am developing will go into production. Forexample, creating a visual interface to actually show some of the data which Ihave gathered. One of the first tasks when designing an implementation thatis as generic as possible would be to develop a data model which also for someflexibility in the way the data is formatted, since each management systemsformats the information gathered in very different ways I decided to make ageneric interface with a type specifier for the target return type.

Another issue I ran into is where the entry point is, somehow I have to storethis gathered data in a meaningful way with a point of entry, or in other wordswhat is the identifier for each property and where should the data be placed.One thing that resides on most every physical piece of hardware in datacenteris an IP address or a hostname so using those properties as entry points fordata insertion makes sense. The entry point would have to uniquely identifya piece of equipment in the datacenter, so for example you could also use theequipments barcode as an insertion key.

A third design issue is the question as to where I should place my implemen-tation in the already existing product. All of my plugins will belong to thefeature Capacity Feature since NetworkDeviceProperty belongs to that feature.

Page 25: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

3.3 Usability 19

It also makes sense from a functional point of view since the CapacityFeaturealso includes logic for displaying measured power data for equipment in yourdatacenter. As said earlier power is a dynamic property, and both propertieslike CPU load, or memory consumption is in some way a performance indicatorabout your hardware. I decided to split logic and UI into two separate projectsfor each of my implementations. This makes it easier for people who want tocarry on with the development of my proof of concept implementations.

For the first version of the UI i created some pictures to get an idea on how wecould present the properties i had gathered, and how the properties could bedisplayed on the various canvases/views in the application. The first mockup isshown in Figure 3.1 which is a simple dialog to set up the various display rules.

Figure 3.1: Mockup UI - Creation dialog

Figure 3.2 is how i envisoned the data to be show in the rack-front editor. Theoperator should be quick to see the status of his datacenter and get a quickoverview just by loooking at it.

Page 26: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

20 Design

Figure 3.2: Mockup rack front layout

3.3.1 Re-usability

As a point of re-usability is is not only important which feature you add yourprojects to, it’s also important how you structure the individual projects.

Page 27: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

3.3 Usability 21

The point is to make it easy for the next people to take over, one way to do thatis to make clearly defining package names so that the developers will have aneasier time figuring out where to put their classes. For that reason i intend tostructure my classes in such a way that the ones taking over after me will knowwhere to look.

Another thing about reusability is related to extensability. That means keepingyour methods as small as possible, delegating larger tasks into smaller moremanageble size etc. I will also try to use design patterns where they are ap-plicable and provide a tangible benefit. One of the nice things about writingan application using eclipse RCP is that it actually encourages that kind ofthinking that is to seperate UI from design logic.

Page 28: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

22 Design

Page 29: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

Chapter 4

Implementation and Results

This chapter will deal with implementation and the results of the effort.

In my implementation im using two different web services for adding proper-ties to ISX Operations. The first one NameNetworkDevicePropertyService usesa <String,NetworkDeviceProperty> method signature while the CustomProp-ertyWebService uses a <CustomProperty,CustomProperty> method signature.Both the NetworkDevice and the CustomProperty contains a key and a value.

4.1 VMware results and implementation

The VMware implementation ended up being the most integrated of the testimplementations I created for custom server properties in ISX Operations.

4.1.1 Connecting to VMware V-Center

The connection to the V-center server works much the same way as you connectto a database, you have to setup username and password, and also setup SSLcertificates because by default the web service uses SSL for data retrieval andinsertion. Currently I’m creating a fake trust certificate for connecting and theusername and password are stored in a property file. Ideally you would want touse the properties you have defined in the UI.

Page 30: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

24 Implementation and Results

4.1.2 Gathering properties

Every class that wishes to be a network device property and/or a custom prop-erty must implement one or both of the following interfaces:

• ICustomProperty<T>

• INetworkDeviceProperty<T>

The two interfaces offer similar functionality except that the INetworkDevice-Property has one additional method for validation because we need type safetyand we expect to know the format of the property we are trying to use. Noticethat both of the interfaces have been parameterized, so that you actually haveto specify the return type of that particular property. For now, all properties re-turn strings, but maybe later if you wished to expand on the use of the interfaceyou could change that.

A type of object can also choose to implement both of these interfaces if theproperty is also to be displayed as a tooltip on the floor and/or rack layout andas part of rule to visualize the property which the user wishes to realize anddisplay.

Figure 4.1 illustrates the two different interfaces which I have implemented, asyou can see the custom property interface includes no method to set a key,that’s because the custom property uses a key value pair for insertion, basedon another custom property. This key, is not determined by the interfaces butis attached to the VDataObject. Custom properties are tooltips with <StringpropertyName, String value>and the display string is selected using the staticmethods in the class PropertyMappingUtilities.

The property mapping utility class holds, and maintains a map that creates therelationship between the various information classes I have implemented.

Page 31: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

4.1 VMware results and implementation 25

Figure 4.1: Interfaces for custom properties

Figure 4.2: PropertyMappingUtilities.java

For custom devices the label is selected this way

Proper tyMapp ingUt i l i t i e s . getCusomPropertyLookupKey ( Clas sToInse r t )

So when you pass in an info class, and you want to add the information containedin the info the label is chosen in this class. An example of an info class is shown

Page 32: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

26 Implementation and Results

in Figure 4.1. This s somewhat di�erent if you want to insert your data as anetwork device property. Network properties do not have a label, they just havean assigned key, and a value attached to that key. Values are checked beforethey are inserted.

Every value object in my implementation for VMware must implement the in-terface VDataObject in order to obtain the lookup key for custom propertyinsertion.

Every value object in the implementation also holds a list of ICustomPropertyand INetworkDeviceProperty, the relationship is depcicted in Figure 4.3

Figure 4.3: Diagram showing the relationship between the value object and theassociated info classes

You will also notice two classes named PropertySpeci�er and PropertyFilterUtilites,these two classes implements an abstraction layer for property collecting usingthe VMware webservice SDK. The property speci�er enum, is a reference to anarray of strings which indicates which properties should be fetched using theSDK. If no speci�er is passed in, the program will select everything. In my casethe VDataObject class acts as a parent container and insertion point for customproperties. So when you fetch data by instantiating a datacenter like the smallexample below, all relevant information is collected.

VDatacenter dc = new VDatacenter ( ' Mydatacenter ' ) ;

However if you instead do like the example below, speci�c properties will be col-lected. Speci�ed by the enumerators passed in as arguments to the constructor.So if you pass in a PropertySpec�er enum after name of the datecenter you canspecify more precisely what you are looking for.

Page 33: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

4.4 UI implementation 39

4.4.1 Creating drawing rules

For the graphical representation of the gathered data I decided to create a verysimple rule system. One of things I wish to accomplish would be to develop asystem, on which given a set of rules like this:

• If CPU load greater than 20% and Operating system == Windows 7 thenpaint the rack mounted equipment with a red background

Three classes came out of this, one class to hold the property color, and a set ofthe conditions required to fulfill the requirement for that rule. Second class wasa simple enumerator where I put the relational operators as enumerated types,and finally the third class, which ties a given collected network device propertywith a relational operator and a given target value.

Figure 4.11: Property rule class diagram

4.4.2 Creating the shapes

The UI in ISXO Operations, more specifically the graphical components usedto draw the various objects in the datacenter model uses the GEF framework.Each model object has a figure attached to it which is the drawn on the canvasusing a set of painters. So to implement this I had to create a figure for myrack layout and a figure for the individual server in the rack. The two classesare these:

Page 34: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

40 Implementation and Results

4.4.3 Creating the required overlays

A factory class was created for my overlay, so that when you switch your overlay,figures are created and painted according to the context in which they are shown,for that to happen I had to register my overlays via. The RCP framework byextending the existing extension point org.eclipse.overlay. I also had to registera factory responsible for creating these edit parts for the overlay, again this isdone via plugin.xml files in my plugin and the result can be seen in Listing 4.5the listing here create a new overlay tab with the label ”Properties”.

Listing 4.5: Overlay XML

<ex tens i on po int=”com . apc . c on f i g . u i . gdf . ove r l ay ”><over l ay

default=” f a l s e ”id=”com . apc . managementintegration . vmware . u i .

p rope r tyove r l ay ”name=”Prope r t i e s ”>

<e d i t p a r t f a c t o r yc l a s s=”com . apc . managementintegration . vmware . u i .

ove r l ay . f l o o r e d i t o r . RackPropertyEditPartFactory ”>

</ ed i t p a r t f a c t o r y></ over l ay><over l ay

default=” f a l s e ”id=”com . apc . managementintegration . vmware . u i .

r ackprope r tyove r l ay ”name=”Prope r t i e s ”>

<e d i t p a r t f a c t o r yc l a s s=”com . apc . managementintegration . vmware . u i .

ove r l ay . r a ck ed i t o r .RackFrontPropertyEditPartFactory ”>

</ ed i t p a r t f a c t o r y></ over l ay>

</ extens i on>

An overlay in ISX Operation is selected using the small tabs highlighted inFigure 4.10, each overlay has a specific view attached to it and will highlightdifferent aspects of your datacenter. One overlay might highlight how muchyour equipment weighs and display if the floor is able to adequately supportthe weight of the equipment, you might wonder why this is an issue, but thatis because many datacenters feature raised floors (to improve aiflow), and thesefloors are not always able to support as much weight as any regular floor.

Also take note that i have added two new overlays, thats because you havetwo diffrent sets of visible overlays, one is visible when you’re viewing the rackfront, the other set of overlays is visible when you view the floor layout of yourdatacenter.

Page 35: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

4.4 UI implementation 41

4.4.4 Creating the context menu

Creating a right click context menu involves a new kind of element, called acommand. A command is like many of the other elements defined in Eclipse RCPan xml files which extends a base eclipse component. So in order to create a rightclick context menu. I had to extend the extension point org.eclipse.ui.menus andorg.eclipse handlers to create the menu contribution for the right click contextmenu.

Listing 4.6: Menus XML

<ex tens i onpo int=”org . e c l i p s e . u i . commands”>

<commandid=”com . apc . managementintegration . vmware . u i . showSetup”name=”Setup”>

</command></ extens i on><ex tens i on

po int=”org . e c l i p s e . u i . hand le r s ”><handler

c l a s s=”com . apc . managementintegration . vmware . u i .p r e f e r encepage . SetupPopupHandler”

commandId=”com . apc . managementintegration . vmware . u i .showSetup”>

<enabledWhen><and>

<not><r e f e r e n c e

d e f i n i t i o n I d=”com . apc . dcoverview . editmode”></ r e f e r e n c e>

</not><t e s t

f o r c eP lug inAc t i va t i on=” true ”property=”com . apc . managementintegration . vmware

. u i . p r e f e r encepage . i s InProper tyOver lay ”></ t e s t>

</and></enabledWhen>

</ handler></ extens i on><ex tens i on

po int=”org . e c l i p s e . u i . menus”><menuContribution

locat ionURI=”popup:com . apc . c on f i g . r a ck ed i t o r . i s x c e n t r a l. rackEditorView”>

<commandcommandId=”com . apc . managementintegration . vmware . u i .

showSetup”l a b e l=”Conf igure Property Display ”s t y l e=”push”>

<vis ibleWhencheckEnabled=” f a l s e ”>

Page 36: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

42 Implementation and Results

<t e s tf o r c eP lug inAc t i va t i on=” true ”property=”com . apc . managementintegration . vmware

. u i . p r e f e r encepage . i s InProper tyOver lay ”></ t e s t>

</ vis ibleWhen></command>

</menuContribution><menuContribution

locat ionURI=”popup:com . apc . c on f i g . f l o o r e d i t o r .i s x c e n t r a l . f l oo rEd i to rView ”>

<commandcommandId=”com . apc . managementintegration . vmware . u i .

showSetup”l a b e l=”Conf igure Property Display ”s t y l e=”push”>

<vis ibleWhencheckEnabled=” f a l s e ”>

<t e s tf o r c eP lug inAc t i va t i on=” true ”property=”com . apc . managementintegration . vmware

. u i . p r e f e r encepage . i s InProper tyOver lay ”></ t e s t>

</ vis ibleWhen></command>

</menuContribution></ extens i on>

It is worth noting that i put in a property test to see if the option should actuallybe displayed, this right click context menu will on be shown when the propertyoverlay i created is active.

4.4.5 Creating the preference page

The configuration menu for VMware is also developed using this framework,again all I have to do is to extend a base extension point and add my ownmenus. This is done like shown in Listing 4.7. This one generates a preferencepage under the ”General” preference tab named Property setup this can be seenin Figure 4.14.

Listing 4.7: Preference page XML

<ex tens i onpo int=”org . e c l i p s e . u i . p r e f e r encePages ”>

<pagecategory=”com . apc . c on f i g . d i a l o g s . core . i n t e r n a l .

p r e f e r e n c e s . Genera lPre ferencePage ”c l a s s=”com . apc . managementintegration . vmware . u i .

p r e f e r encepage . PropertySetupPage”

Page 37: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

4.4 UI implementation 43

id=”com . apc . managementintegration . vmware . u i .propertysetup ”

name=”Property Setup”></page>

</ extens i on>

When the client then needs to use this information for connecting to the variousdifferent management systems it can instantiate this preference store and get thepreference settings by passing in the unique string that identifies that particularproperty.

Settings are persisted so when you exit the application the next time you startit up it will remember the settings you previously entered.

This is a rather nice abstraction since you would never ever have to worry aboutgetting your settings saved since it is being handled by the framework, it alsonicely separate model and settings from the UI.

The property preferences setup page has an associated table viewer containingall the created rules, the table viewer reflects and underlying model which ba-sically is an array of property rules. You can edit the color and the name ofthe rule in the table viewer. When you do this, the model is updated and theviewer is refreshed. Each rule in this table can be edited, when selecting one ofthe rules, and pressing edit, a new screen pops up.

In this new window you can add and remove conditions which make up thisproperty rule, two combo boxes, one for the network device property key, andone for the logic operator for comparing the value associated with the condition.Also, boxes are pre-filled with values taken from the property rule, such as thename and the conditions already associated with that rule.

The PropertyRuleModelProvider implements the model for use in the propertyrule viewer, it is singleton since we do not need more than 1 model for theviewer. The viewer is shown in Figure 4.12.

Page 38: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

44 Implementation and Results

Figure 4.12: Model provider for the property rule preferences dialog

There is also a viewer associated with each property rule, when you edit a prop-erty rule, a new table is show which lists all the compound conditons containedwithin the rule you selected for edit. Like the property rule viewer I also had tocreate a viewer for displaying CompoundConditons contained in the propertyrule.

Below you can see what is needed to create a viewer for displaying the model,you need a content provider which sets the initial input and updates accordingly.Also you need to add a label provider for filling out the individual cell data andadding an appropriate label for that data, for the property rule viewer thereare two columns, a column for the name of the rule, and a column for the colorassociated to that rule. The label provider then fills out the rows with valuesaccording to the column index with fetched values from each element in themodel associated to that viewer.

Page 39: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

4.4 UI implementation 45

Figure 4.13: Rule viewer hierarchy diagram

The above exemplifies how the viewer is tied to a content provider, so whenthe model has changed you need to refresh the viewer, which forces it to reloadthe model associated to the viewer. Since the dataset is really small I decidednot to add listeners to each individual cell in the viewer, might as well updateeverything when we change the model.

In Figure 4.14 you can see how the dialog i have created using the .xml files andjava code.

4.4.6 Updating the display

Another crucial point to make is to figure out how to update the display, morespecifically how to redraw the overlay when properties change. As it happens,redraw of canvas happens whenever your scroll the display, go into a menu etc.So if some of the properties change, for the display to update you would needto scroll the window a bit or access a right click context menu.

Page 40: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

46 Implementation and Results

Figure 4.14: Property rule setup viewer

The proper way to do it would be to devise an updating strategy for updatingproperties, and generate an event if major changes have happened and redrawthe display accordingly. This is issue is pretty minor, but it would take somedevelopment effort to get it correctly setup.

In order to update, or draw a color to a shape in the properties overlay i createdfor ISX Operations you have to fetch the properties associated with your currentmodel object. This is done in the bit of code show in Figure 4.8

Listing 4.8: Method to select background color

private void setPropertyBackgroundColor ( Graphics graphics ,GraphicComponent<DataCenterEquipment> graphicComponent ,

IRackMountableEquipment dc i ) {Map<NetworkDevicePropertyKey , Str ing> networkDevicePropert i e s ;NetworkDevicePropertyService networkDevicePropertyServ ice =

Reg i s t ry . get ( this , SmaCoreSystem . class ) .getNetworkDevicePropertyServ ice ( ) ;

i f ( dc i != null ) {networkDevicePropert i e s = networkDevicePropertyServ ice .

getNetworkDevicePropert ies ( dc i . getModel ( ) ) ;ArrayList<PropertyRule> r u l e s = PropertyRuleModelProvider .

g e t In s tance ( ) . getRules ( ) ;for ( PropertyRule propertyRule : r u l e s ) {

boolean checkAl lCond i t ions = propertyRule .checkAl lCond i t ions ( networkDevicePropert i e s ) ;

i f ( checkAl lCondi t ions ) {currentBgColor = propertyRule . getRuleColor ( ) ;

Page 41: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

4.4 UI implementation 47

}}

}drawBackground ( graphics , graphicComponent . getShape ( ) ) ;

The network device property service offers a neat little method to extract allassociated NetworkDeviceProperties from the piece of datacenter equipmentwhich you are about to draw, and based on that, i pass that into all the rulesexisting and check to see if the the equipment matches a rule where all conditionsare met. Colors are override in my implementation and for multiple colors toappear on a piece of equipment would require a change of code.

Another thing to watch out for is to remember to dispose your colors whendrawing widgets with GEF, if you forget to dispose your color after instantiatingit (that is doing new Color()) it will clog up resources. So if you’ve created anew Color() object, a native resource, you need to make sure you dispose of itafter usage.

Putting it all together you can see the final result of my ui-changes in Figure4.15.

Page 42: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

48 Implementation and Results

Figure 4.15: UI Design

Notice also the readings in the top of the racks, that is a summarized display ofsome of the properties on all the equipement in the racks, i created methods tocalculate the std. deviation on CPU loads, average cpu load and memory usagepercentages.

4.5 Implementation packages

My implementation is seperated into 4 packages

• com.apc.managementintegration.vmware

• com.apc.managementintegration.vmware.ui

• com.apc.managementintegration.nagios

• com.apc.managementintegration.core

Page 43: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

4.5 Implementation packages 49

I have included the entire source so you will have to go through all the subfoldersto get to the actual .java files. Also included is my MS SCOM implementation,but i will just include them as-is and not add them as appendices because ihaven’t really discussed the implementation to any length in my thesis.

Page 44: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

50 Implementation and Results

Page 45: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

Chapter 5

Test

Since I am doing a proof of concept implementation not much weight has beenput on a test chapter, bugs can be ironed out should it bed decided that the con-cept should be put into production. Testing will therefore be mostly empiricalbased on observations and general usage of the implementation.

The Nagios implementation is pretty simple to test, since the implementationdoes not contain any network device properties the way to test that the appli-cation works would simply be to read some of the data Nagios have gatheredand stored in it’s associated SQL database.

For testing output we can both do a lookup in the model database, and visuallyidentify that the properties gathered by Nagios have been correctly added toISX Operations.

For the MS SCOM I will be conducting the same kind of verification by runningthe program, and the observing the correct insertion of properties.

5.1 VMware integration test

For test of the VMware implementation, to see whether the correct propertiesare picked up I created a small test class for accessing, creating and insertingcustom properties. The test accesses a datacenter with 2 host systems and 5virtual machines running on these two host systems. The machines have the

Page 46: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

52 Test

following ip addresses

• 10.216.73.126

• 10.216.73.127

Below is a screenshot of the V-Center console, and there you can see what typeof information is stored for the individual host system. Notice that there is noload on the host with the ip 10.216.73.126.

Figure 5.1: V-Center console

Now turn on some of the virtual machines running on that host, and take a lookwhat happens to the properties being displayed in ISX Operations, the propertywith the condition CPU load more than 15

Page 47: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

5.1 VMware integration test 53

Figure 5.2: Rack equipment being colored

The test was done using the following Test class depicted in Listing 5.1 theinteresting bit is the main method, that is what i have been using to insert thegathered properties.

Listing 5.1: Testclass for VMwarepackage com . apc . management in tegrat ion . vmware ;

import java . u t i l . A r rayL is t ;

import com . apc . management in tegrat ion . vmware . ob jec tmode l . VCluster ;import com . apc . management in tegrat ion . vmware . ob jec tmode l . VDatacenter

;import com . apc . management in tegrat ion . vmware . ob jec tmode l . VHostSystem

;import com . apc . management in tegrat ion . vmware . ob jec tmode l . VMachine ;/ ��

� Test c l a s s f o r my i n t e g r a t i o n . Should produce no e r r o r s .� @author man ie lse�� /

p u b l i c c l a s s Test f/ � �

Page 48: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

_ser

vice

.logi

n(_s

ic.g

etS

essi

onM

anag

er()

, use

rNam

e, p

assw

ord,

nu

ll);

} Sys

tem

.out

.prin

tln(_

sic.

getA

bout

().g

etA

piT

ype(

));

Sys

tem

.out

.prin

tln(_

sic.

getA

bout

().g

etA

piV

ersi

on()

);} pu

blic

VM

War

eCon

nect

ion(

Str

ing

user

, Str

ing

serv

er, S

trin

g pa

ss,

bool

ean

use

SS

L) {

try

{co

nnec

tAnd

Logi

n(se

rver

, use

r, p

ass,

use

SS

L);

} ca

tch

(E

xcep

tion

e) {

e.pr

intS

tack

Tra

ce()

;}

} publ

ic V

MW

areC

onne

ctio

n()

{

/**

* G

et p

refe

renc

es fo

r co

nnec

tivity

info

rmat

ion,

pas

swor

d an

d en

able

men

t. A

t thi

s po

int *

inpu

t sho

uld

be v

alid

. *

/S

trin

g us

er_n

ame;

Str

ing

pass

;S

trin

g ur

l;bo

olea

n u

sesS

SL;

//IP

refe

renc

eSto

re s

tore

= P

latfo

rmU

I.get

Pre

fere

nceS

tore

();

IPre

fere

nceS

tore

sto

re =

nu

ll;

if(s

tore

!=

null

) {

user

_nam

e =

sto

re.g

etS

trin

g(""

);pa

ss =

sto

re.g

etS

trin

g(""

);us

esS

SL

= s

tore

.get

Boo

lean

("")

;} bo

olea

n is

Ena

bled

=

true

;//b

oole

an is

Ena

bled

= s

tore

.get

Boo

lean

(VM

War

eSet

upC

onst

ants

.EN

AB

LE_V

MW

AR

E);

if(is

Ena

bled

) {

try

{us

er_n

ame

= "

adm

inis

trat

or";

//Str

ing

user

_nam

e =

sto

re.g

etS

trin

g(V

MW

areS

etup

Con

stan

ts.V

MW

AR

E_U

SE

RN

AM

E);

pass

= "

apcA

PC

1234"

;//S

trin

g pa

ss =

sto

re.g

etS

trin

g(V

MW

areS

etup

Con

stan

ts.V

MW

AR

E_P

AS

SW

OR

D);

url =

"10

.216

.73.

124";

//Str

ing

url =

sto

re.g

etS

trin

g(V

MW

areS

etup

Con

sta

nts.

VM

WA

RE

_UR

L);

uses

SS

L =

tr

ue;

//boo

lean

use

sSS

L =

sto

re.g

etB

oole

an(V

MW

areS

etup

Con

stan

ts.V

MW

AR

E_U

SE

SS

L);

conn

ectA

ndLo

gin(

url,

user

_nam

e,pa

ss,u

sesS

SL)

;}

catc

h (

File

Not

Fou

ndE

xcep

tion

e) {

e.pr

intS

tack

Tra

ce()

;}

catc

h (

Exc

eptio

n e)

{e.

prin

tSta

ckT

race

();

}}

} publ

ic V

imP

ortT

ype

getS

ervi

ce()

{

Apr

29,

10

14:5

3P

age

3/4

VM

War

eCon

nect

ion.

java

retu

rn _

serv

ice;

} publ

ic S

ervi

ceC

onte

nt g

etS

ervi

ceC

onte

nt()

{re

turn

_si

c;}

}

Apr

29,

10

14:5

3P

age

4/4

VM

War

eCon

nect

ion.

java

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

010

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/V

MW

areC

onne

ctio

n.ja

va

Page 49: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e;

impo

rt ja

va.io

.File

;im

port

java

.io.F

ileN

otF

ound

Exc

eptio

n;im

port

java

.io.F

ileR

eade

r;im

port

java

.io.IO

Exc

eptio

n;im

port

java

.util

.Arr

ayLi

st;

impo

rt ja

va.u

til.H

ashM

ap;

impo

rt ja

va.u

til.L

ist;

impo

rt ja

va.u

til.P

rope

rtie

s;im

port

java

.util

.Ran

dom

;im

port

java

.util

.Set

;

impo

rt o

rg.c

odeh

aus.

xfire

.clie

nt.C

lient

;im

port

org

.cod

ehau

s.xf

ire.tr

ansp

ort.C

hann

el;

impo

rt c

om.a

pc.c

onfig

.net

wor

kdev

icep

rope

rty.

Net

wor

kDev

iceP

rope

rtyK

ey;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.ICus

tom

Pro

pert

y;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.IN

etw

orkD

evic

ePro

pert

y;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.ob

ject

mod

el.V

Clu

ster

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.ob

ject

mod

el.V

Dat

aObj

ect;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

obje

ctm

odel

.VD

atac

ente

r;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.ob

ject

mod

el.V

Hos

tSys

tem

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.ob

ject

mod

el.V

Mac

hine

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.pr

oper

ties.

Pro

pert

yMap

ping

Util

ities

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.w

ebse

rvic

e.C

usto

mP

rope

rtyW

ebS

ervi

ceC

lient

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.w

ebse

rvic

e.C

usto

mP

rope

rtyW

ebS

ervi

ceE

xcep

tion;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

web

serv

ice.

Cus

tom

Pro

pert

yWeb

Ser

vice

Por

tTyp

e;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.w

ebse

rvic

e.N

ameN

etw

orkD

evic

ePro

pert

yW

ebS

ervi

ceC

lient

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.w

ebse

rvic

e.N

ameN

etw

orkD

evic

ePro

pert

yW

ebS

ervi

ceP

ortT

ype;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

web

serv

ice.

Nam

eVirt

ualiz

atio

nWeb

Ser

vic

eClie

nt;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

web

serv

ice.

Nam

eVirt

ualiz

atio

nWeb

Ser

vic

ePor

tTyp

e;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.w

ebse

rvic

e.N

etw

orkD

evic

eWeb

Ser

vice

Ex

cept

ion;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

web

serv

ice.

Virt

ualiz

atio

nWeb

Ser

vice

Exc

eptio

n;im

port

com

.apc

.virt

ualiz

atio

n.m

odel

.Arr

ayO

fClu

ster

;im

port

com

.apc

.virt

ualiz

atio

n.m

odel

.Arr

ayO

fHos

tSys

tem

;im

port

com

.apc

.virt

ualiz

atio

n.m

odel

.Arr

ayO

fVirt

ualM

achi

ne;

impo

rt c

om.a

pc.v

irtua

lizat

ion.

mod

el.H

ostS

yste

m;

impo

rt c

om.a

pc.v

irtua

lizat

ion.

mod

el.V

irtua

lMac

hine

;im

port

com

.apc

.web

serv

ice.

com

mon

.mod

el.A

rray

OfC

usto

mP

rope

rty;

impo

rt c

om.a

pc.w

ebse

rvic

e.co

mm

on.m

odel

.Arr

ayO

fNet

wor

kDev

iceP

rope

rty;

impo

rt c

om.a

pc.w

ebse

rvic

e.co

mm

on.m

odel

.Cus

tom

Pro

pert

y;im

port

com

.apc

.web

serv

ice.

com

mon

.mod

el.N

etw

orkD

evic

ePro

pert

y;/*

* *

@au

thor

man

iels

e * *

/pu

blic

cl

ass

V

MW

areV

irtua

lizat

ionW

ebse

rvic

e

impl

emen

ts IV

irtua

lMod

elO

bjec

tWeb

ser

vice

Fac

ade

{pr

ivat

e

stat

ic

final

Str

ing

AP

C =

"ap

c";

//$N

ON

-NLS

-1$

priv

ate

st

atic

fin

al S

trin

g H

TT

P_P

RE

FIX

= "

http

://";

//$

NO

N-N

LS-1

$pr

ivat

e

stat

ic

final

Str

ing

HT

TP

S_P

RE

FIX

= "

http

s://"

; //$

NO

N-N

LS-1

$

Apr

29,

10

14:5

3P

age

1/7

VM

War

eVirt

ualiz

atio

nWeb

serv

ice.

java

priv

ate

st

atic

fin

al S

trin

g V

IRT

UA

LIZ

AT

ION

_WE

BS

ER

VIC

E=

"/n

bc/w

s/co

re/N

ameV

irtu

aliz

atio

nWeb

Ser

vice "

; //$

NO

N-N

LS-1

$pr

ivat

e

stat

ic

final

Str

ing

CU

ST

OM

_PR

OP

ER

TY

_WE

BS

ER

VIC

E=

"/nbc

/ws/

core

/Cus

tom

Pr

oper

tyW

ebS

ervi

ce ";

//$N

ON

-NLS

-1$

priv

ate

st

atic

fin

al S

trin

g N

AM

E_N

ET

WO

RK

_DE

VIC

E_P

RO

PE

RT

Y_W

EB

SE

RV

ICE

="/nbc

/ws/

core

/Nam

eNet

wor

kDev

iceP

rope

rtyW

ebS

ervi

ce";

//$

NO

N-N

LS-1

$

priv

ate

Nam

eVirt

ualiz

atio

nWeb

Ser

vice

Por

tTyp

e na

meV

irtua

lizat

ionW

ebS

ervi

ceP

ortT

ype;

priv

ate

Cus

tom

Pro

pert

yWeb

Ser

vice

Por

tTyp

e cu

stom

Pro

pert

yWeb

Ser

vice

Por

tTyp

e;pr

ivat

e N

ameN

etw

orkD

evic

ePro

pert

yWeb

Ser

vice

Por

tTyp

e na

meN

etw

orkD

evic

ePro

pert

yWeb

Ser

vice

Por

tTyp

e;

priv

ate

Clie

nt m

odel

Virt

ualiz

atio

nClie

nt;

priv

ate

Clie

nt c

usto

mP

rope

rtyC

lient

;pr

ivat

e C

lient

nam

eNet

wor

kDev

iceP

rope

rtyC

lient

;

/**

*

*/

publ

ic V

MW

areV

irtua

lizat

ionW

ebse

rvic

e ()

{P

rope

rtie

s pr

ops

=

new

Pro

pert

ies(

);S

trin

g op

erat

ions

Hos

t =

null

;bo

olea

n u

seS

SL

=

fals

e;

try

{pr

ops.

load

(ne

w F

ileR

eade

r(ne

w F

ile("

vmw

are.

prop

ertie

s")))

;op

erat

ions

Hos

t = p

rops

.get

Pro

pert

y("

oper

atio

ns_u

rl");

useS

SL

= B

oole

an.p

arse

Boo

lean

(pro

ps.g

etP

rope

rty(

"us

e_ss

l"));

} ca

tch

(F

ileN

otF

ound

Exc

eptio

n e)

{e.

prin

tSta

ckT

race

();

} ca

tch

(IO

Exc

eptio

n e)

{e.

prin

tSta

ckT

race

();

} nam

eVirt

ualiz

atio

nWeb

Ser

vice

Por

tTyp

e =

ne

w N

ameV

irtua

lizat

ionW

ebS

ervi

ceC

lient

().g

etN

ameV

irtua

lizat

ionW

ebS

ervi

ceH

ttpP

ort(

null

);cu

stom

Pro

pert

yWeb

Ser

vice

Por

tTyp

e =

ne

w C

usto

mP

rope

rtyW

ebS

ervi

ceC

lient

().g

etC

usto

mP

rope

rtyW

ebS

ervi

ceH

ttpP

ort(

null

);na

meN

etw

orkD

evic

ePro

pert

yWeb

Ser

vice

Por

tTyp

e =

ne

w N

ameN

etw

orkD

evic

ePro

pert

yWeb

Ser

vice

Clie

nt()

.get

Nam

eNet

wor

kDev

iceP

rope

rtyW

ebS

ervi

ceH

ttpP

ort(

nul

l);

//Virt

ualiz

atio

n m

odel

web

serv

ice

mod

elV

irtua

lizat

ionC

lient

= C

lient

.get

Inst

ance

(nam

eVirt

ualiz

atio

nWeb

Ser

vice

Por

tTyp

e);

mod

elV

irtua

lizat

ionC

lient

.set

Pro

pert

y(C

hann

el.U

SE

RN

AM

E, A

PC

);m

odel

Virt

ualiz

atio

nClie

nt.s

etP

rope

rty(

Cha

nnel

.PA

SS

WO

RD

, AP

C);

if(!

useS

SL)

{m

odel

Virt

ualiz

atio

nClie

nt.s

etU

rl(H

TT

P_P

RE

FIX

+op

erat

ions

Hos

t+V

IRT

UA

LIZ

AT

ION

_WE

BS

ER

VIC

E);

} el

se {

mod

elV

irtua

lizat

ionC

lient

.set

Url(

HT

TP

S_P

RE

FIX

+op

erat

ions

Hos

t+V

IRT

UA

LIZ

AT

ION

_WE

BS

ER

VIC

E);

} //Cus

tom

pro

pert

y w

ebse

rvic

ecu

stom

Pro

pert

yClie

nt =

Clie

nt.g

etIn

stan

ce(c

usto

mP

rope

rtyW

ebS

ervi

Apr

29,

10

14:5

3P

age

2/7

VM

War

eVirt

ualiz

atio

nWeb

serv

ice.

java

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

011

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/V

MW

areV

irtua

lizat

ionW

ebse

rvic

e.ja

va

Page 50: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

ceP

ortT

ype)

;cu

stom

Pro

pert

yClie

nt.s

etP

rope

rty(

Cha

nnel

.US

ER

NA

ME

, AP

C);

cust

omP

rope

rtyC

lient

.set

Pro

pert

y(C

hann

el.P

AS

SW

OR

D, A

PC

);if

(!us

eSS

L) {

cust

omP

rope

rtyC

lient

.set

Url(

HT

TP

_PR

EF

IX+

oper

atio

nsH

ost+

CU

ST

OM

_PR

OP

ER

TY

_WE

BS

ER

VIC

E);

} el

se {

cust

omP

rope

rtyC

lient

.set

Url(

HT

TP

S_P

RE

FIX

+op

erat

ions

Hos

t+C

US

TO

M_P

RO

PE

RT

Y_W

EB

SE

RV

ICE

);} //P

re-d

efin

ed p

rope

rtie

s(N

etw

orkD

evic

e pr

oper

ties)

nam

eNet

wor

kDev

iceP

rope

rtyC

lient

= C

lient

.get

Inst

ance

(nam

eNet

wor

kD

evic

ePro

pert

yWeb

Ser

vice

Por

tTyp

e);

nam

eNet

wor

kDev

iceP

rope

rtyC

lient

.set

Pro

pert

y(C

hann

el.U

SE

RN

AM

E, A

PC

);na

meN

etw

orkD

evic

ePro

pert

yClie

nt.s

etP

rope

rty(

Cha

nnel

.PA

SS

WO

RD

, AP

C);

if(!

useS

SL)

{na

meN

etw

orkD

evic

ePro

pert

yClie

nt.s

etU

rl(H

TT

P_P

RE

FIX

+op

era

tions

Hos

t+N

AM

E_N

ET

WO

RK

_DE

VIC

E_P

RO

PE

RT

Y_W

EB

SE

RV

ICE

);}

else

{na

meN

etw

orkD

evic

ePro

pert

yClie

nt.s

etU

rl(H

TT

PS

_PR

EF

IX+

oper

atio

nsH

ost+

NA

ME

_NE

TW

OR

K_D

EV

ICE

_PR

OP

ER

TY

_WE

BS

ER

VIC

E);

}

} /* (

non-

Java

doc)

* @

see

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.IV

irtua

lMod

elO

bjec

tWeb

serv

ice

Fac

ade#

addC

lust

er(c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

obje

ctm

odel

.VC

lust

er)

*/

@O

verr

ide

publ

ic

void

add

Clu

ster

(VC

lust

er o

bj)

{A

rray

List

<V

Hos

tSys

tem

> h

ostS

yste

ms

= o

bj.fi

ndH

ostS

yste

ms(

);A

rray

OfH

ostS

yste

m a

rray

OfH

ostS

yste

m =

ne

w A

rray

OfH

ostS

yste

m()

;fo

r (

VH

ostS

yste

m v

irtua

lHos

tSys

tem

: ho

stS

yste

ms)

{H

ostS

yste

m h

s;tr

y {

hs =

nam

eVirt

ualiz

atio

nWeb

Ser

vice

Por

tTyp

e.cr

eate

Hos

tSys

tem

(virt

ualH

ostS

yste

m.g

etV

irtua

lHos

tSys

tem

Info

().g

etN

ame(

));

arra

yOfH

ostS

yste

m.g

etH

ostS

yste

m()

.add

(hs)

;}

catc

h (

Virt

ualiz

atio

nWeb

Ser

vice

Exc

eptio

n e)

{e.

prin

tSta

ckT

race

();

}

} if(a

rray

OfH

ostS

yste

m !=

nu

ll)

{na

meV

irtua

lizat

ionW

ebS

ervi

ceP

ortT

ype.

crea

teC

lust

er(a

rray

OfH

ostS

yste

m);

}} /*

(no

n-Ja

vado

c) *

@se

e co

m.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

IVirt

ualM

odel

Obj

ectW

ebse

rvi

ceF

acad

e#ad

dAllV

irtua

lMac

hine

s()

*/

@O

verr

ide

publ

ic

void

add

AllV

irtua

lMac

hine

s()

{tr

y {

Apr

29,

10

14:5

3P

age

3/7

VM

War

eVirt

ualiz

atio

nWeb

serv

ice.

java

VD

atac

ente

r da

tace

nter

=

new

VD

atac

ente

r(nu

ll);

Arr

ayLi

st<

VH

ostS

yste

m>

virt

ualH

ostL

ist =

dat

acen

ter.

getV

irtua

lHos

tLis

t();

for

(V

Hos

tSys

tem

vH

ostS

yste

m :

virt

ualH

ostL

ist)

{vH

ostS

yste

m.fi

ndV

irtua

lMac

hine

s();

Str

ing

nam

e =

vH

ostS

yste

m.g

etV

irtua

lHos

tSys

tem

Info

().g

etN

ame(

);H

ostS

yste

m h

s;

if((

hs =

nam

eVirt

ualiz

atio

nWeb

Ser

vice

Por

tTyp

e.ge

tHos

tSys

tem

(nam

e))

==

nu

ll)

{hs

= n

ameV

irtua

lizat

ionW

ebS

ervi

ceP

ortT

ype.

crea

teH

ostS

yste

m(n

ame)

;} A

rray

List

<V

Mac

hine

> h

ostV

ms

= v

Hos

tSys

tem

.get

Hos

tVm

s();

for

(V

Mac

hine

vM

achi

ne :

host

Vm

s) {

Virt

ualM

achi

ne c

reat

eVirt

ualM

achi

ne =

na

meV

irtua

lizat

ionW

ebS

ervi

ceP

ortT

ype.

crea

teV

irtua

lMac

hine

();

nam

eVirt

ualiz

atio

nWeb

Ser

vice

Por

tTyp

e.ad

dV

irtua

lMac

hine

(hs,

cre

ateV

irtua

lMac

hine

);

} Arr

ayO

fVirt

ualM

achi

ne v

ms

= n

ameV

irtua

lizat

ionW

ebS

ervi

ceP

ortT

ype.

getV

irtua

lMac

hine

s(hs

);}

} ca

tch

(E

xcep

tion

e) {

e.pr

intS

tack

Tra

ce()

;}

} publ

ic

void

test

AllG

ette

rs()

{A

rray

OfC

lust

er a

llClu

ster

s =

nam

eVirt

ualiz

atio

nWeb

Ser

vice

Por

tTyp

e.ge

tAllC

lust

ers(

);S

yste

m.o

ut.p

rintln

("N

umbe

r of

clu

ster

s: "+al

lClu

ster

s.ge

tClu

ster

().s

ize(

));

//$N

ON

-NLS

-1$ Arr

ayO

fHos

tSys

tem

allH

ostS

yste

ms

= n

ameV

irtua

lizat

ionW

ebS

ervi

ceP

ortT

ype.

getA

llHos

tSys

tem

s();

Sys

tem

.out

.prin

tln("

Num

ber

of h

osts

: "+al

lHos

tSys

tem

s.ge

tHos

tSys

tem

().s

ize(

));

//$N

ON

-NLS

-1$

Arr

ayO

fVirt

ualM

achi

ne a

llVirt

ualM

achi

nes

= n

ameV

irtua

lizat

ionW

ebS

ervi

ceP

ortT

ype.

getA

llVirt

ualM

achi

nes(

);S

yste

m.o

ut.p

rintln

("N

umbe

r of

vm

s: "+

allV

irtua

lMac

hine

s.ge

tVirt

ualM

achi

ne()

.siz

e())

; //$

NO

N-N

LS-1

$} /*

(no

n-Ja

vado

c) *

@se

e co

m.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

IVirt

ualM

odel

Obj

ectW

ebse

rvi

ceF

acad

e#ge

tVirt

ualM

achi

nes(

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.ob

ject

mod

el.V

Ho

stS

yste

m)

*/

@O

verr

ide

publ

ic

void

get

Virt

ualM

achi

nes(

VH

ostS

yste

m v

Hos

t) {

Hos

tSys

tem

hs;

try

{hs

= n

ameV

irtua

lizat

ionW

ebS

ervi

ceP

ortT

ype.

getH

ostS

yste

m(

vHos

t.get

Virt

ualH

ostS

yste

mIn

fo()

.get

Nam

e())

;if

(hs

!=

null

) {

Arr

ayO

fVirt

ualM

achi

ne v

irtua

lMac

hine

s =

nam

eVirt

ualiz

atio

nWeb

Ser

vice

Por

tTyp

e.ge

tVirt

ualM

achi

nes(

hs);

}

Apr

29,

10

14:5

3P

age

4/7

VM

War

eVirt

ualiz

atio

nWeb

serv

ice.

java

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

012

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/V

MW

areV

irtua

lizat

ionW

ebse

rvic

e.ja

va

Page 51: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

} ca

tch

(V

irtua

lizat

ionW

ebS

ervi

ceE

xcep

tion

e) {

e.pr

intS

tack

Tra

ce()

;}

} /* (

non-

Java

doc)

* @

see

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.IV

irtua

lMod

elO

bjec

tWeb

serv

ice

Fac

ade#

addH

ostS

yste

m(c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

obje

ctm

odel

.VH

ostS

yste

m)

*/

@O

verr

ide

publ

ic

void

add

Hos

tSys

tem

(VH

ostS

yste

m h

ost)

{tr

y {

Str

ing

nam

e =

hos

t.get

Virt

ualH

ostS

yste

mIn

fo()

.get

Nam

e();

Hos

tSys

tem

hos

tSys

tem

= n

ameV

irtua

lizat

ionW

ebS

ervi

ceP

ort

Typ

e.ge

tHos

tSys

tem

(nam

e);

if(h

ostS

yste

m =

=

null

)na

meV

irtua

lizat

ionW

ebS

ervi

ceP

ortT

ype.

crea

teH

ostS

yste

m(n

ame)

;}

catc

h (

Virt

ualiz

atio

nWeb

Ser

vice

Exc

eptio

n e)

{e.

prin

tSta

ckT

race

();

}} pu

blic

vo

id te

stN

ameN

etw

orkD

evic

ePro

pert

ies(

) {

try

{N

etw

orkD

evic

ePro

pert

yKey

ndp

k =

Net

wor

kDev

iceP

rope

rtyK

ey.H

OS

T;

Net

wor

kDev

iceP

rope

rty

ndp

=

new

Net

wor

kDev

iceP

rope

rty(

);nd

p.se

tKey

(ndp

k);

ndp.

setV

alue

("")

;A

rray

OfN

etw

orkD

evic

ePro

pert

y ar

rayO

fNet

wok

Dev

iceP

rope

rty

=

new

Arr

ayO

fNet

wor

kDev

iceP

rope

rty(

);ar

rayO

fNet

wok

Dev

iceP

rope

rty.

getN

etw

orkD

evic

ePro

pert

y().

add

(ndp

);

nam

eNet

wor

kDev

iceP

rope

rtyW

ebS

ervi

ceP

ortT

ype.

crea

teO

rUpd

ate

(nu

ll,

null

);}

catc

h (

Net

wor

kDev

iceW

ebS

ervi

ceE

xcep

tion

e) {

e.pr

intS

tack

Tra

ce()

;}

} /**

*

* @

para

m o

bjec

t *

*

The

VD

ataO

bjec

t can

be

eith

er a

hos

t sys

tem

or

a vi

rtua

l mac

hine

. *

/pu

blic

vo

id a

ddC

usto

mP

rope

rtie

s(V

Dat

aObj

ect o

bjec

t) {

Arr

ayLi

st<

ICus

tom

Pro

pert

y<S

trin

g>>

pro

pert

ies

= o

bjec

t.get

Pro

per

ties(

);A

rray

OfC

usto

mP

rope

rty

look

upK

ey =

ne

w A

rray

OfC

usto

mP

rope

rty(

);

Cus

tom

Pro

pert

y lo

okup

=

new

Cus

tom

Pro

pert

y();

look

up.s

etK

ey(P

rope

rtyM

appi

ngU

tiliti

es.g

etC

usto

mP

rope

rtyL

ooku

pKe

y(ob

ject

.get

Cla

ss()

));

look

up.s

etV

alue

(obj

ect.g

etLo

okup

Key

Val

ue()

);

look

upK

ey.g

etC

usto

mP

rope

rty(

).ad

d(lo

okup

);

Arr

ayO

fCus

tom

Pro

pert

y va

lues

=

new

Arr

ayO

fCus

tom

Pro

pert

y();

for

(IC

usto

mP

rope

rty<

Str

ing>

pro

pert

y : p

rope

rtie

s) {

Apr

29,

10

14:5

3P

age

5/7

VM

War

eVirt

ualiz

atio

nWeb

serv

ice.

java

Cus

tom

Pro

pert

y cP

rope

rty

=

new

Cus

tom

Pro

pert

y();

cPro

pert

y.se

tKey

(Pro

pert

yMap

ping

Util

ities

.get

Cus

tom

Pro

pert

yVal

ueK

ey(p

rope

rty.

getC

lass

()))

; cPro

pert

y.se

tVal

ue(p

rope

rty.

getC

usto

mP

rope

rtyV

alue

());

valu

es.g

etC

usto

mP

rope

rty(

).ad

d(cP

rope

rty)

;} tr

y {

List

<C

usto

mP

rope

rty>

cus

tom

Pro

pert

y =

look

upK

ey.g

etC

usto

mP

rope

rty(

);fo

r (

Cus

tom

Pro

pert

y cu

stom

Pro

pert

y2 :

cust

omP

rope

rty)

{S

yste

m.o

ut.p

rintln

(cus

tom

Pro

pert

y2.g

etV

alue

()+

"

"+cu

stom

Pro

pert

y2.g

etK

ey()

);} cu

stom

Pro

pert

yWeb

Ser

vice

Por

tTyp

e.cr

eate

OrU

pdat

e(lo

okup

Ke

y, v

alue

s);

} ca

tch

(C

usto

mP

rope

rtyW

ebS

ervi

ceE

xcep

tion

e) {

e.pr

intS

tack

Tra

ce()

;}

} publ

ic

void

add

Ran

dom

Pro

pert

ies(

) {

for

(in

t i=

1; i<

16; i

++

) {

Arr

ayO

fNet

wor

kDev

iceP

rope

rty

arra

yOfN

etw

orkD

evic

ePro

pert

y =

ne

w A

rray

OfN

etw

orkD

evic

ePro

pert

y();

Str

ing

addr

= "

10.2

16.7

3."+

i; //$

NO

N-N

LS-1

$N

etw

orkD

evic

ePro

pert

y nd

p =

ne

w N

etw

orkD

evic

ePro

pert

y();

ndp.

setK

ey(N

etw

orkD

evic

ePro

pert

yKey

.CP

U_L

OA

D);

ndp.

setV

alue

(ne

w R

ando

m()

.nex

tDou

ble(

)+""

);

//$N

ON

-NLS

-1$

Net

wor

kDev

iceP

rope

rty

ndpo

s =

ne

w N

etw

orkD

evic

ePro

pert

y();

ndpo

s.se

tKey

(Net

wor

kDev

iceP

rope

rtyK

ey.O

S);

if(i%

2 =

= 1

) {

ndpo

s.se

tVal

ue("

Win

dow

s 7"

);

//$N

ON

-NLS

-1$

} el

se

if(i%

3 =

= 0

) {

ndpo

s.se

tVal

ue("

Ubu

ntu

9.04

");

//$N

ON

-NLS

-1$

} el

se {

ndpo

s.se

tVal

ue("

Iffy

McC

rash

ing

42.0"

);

//$N

ON

-NLS

-1$

} arra

yOfN

etw

orkD

evic

ePro

pert

y.ge

tNet

wor

kDev

iceP

rope

rty(

).ad

d(nd

p);

arra

yOfN

etw

orkD

evic

ePro

pert

y.ge

tNet

wor

kDev

iceP

rope

rty(

).ad

d(nd

pos)

;tr

y {

nam

eNet

wor

kDev

iceP

rope

rtyW

ebS

ervi

ceP

ortT

ype.

crea

teO

rUpd

ate(

addr

, arr

ayO

fNet

wor

kDev

iceP

rope

rty)

;}

catc

h (

Net

wor

kDev

iceW

ebS

ervi

ceE

xcep

tion

e) {

e.pr

intS

tack

Tra

ce()

;}

}} @

Ove

rrid

epu

blic

vo

id a

ddA

llClu

ster

s()

{} @

Ove

rrid

e

Apr

29,

10

14:5

3P

age

6/7

VM

War

eVirt

ualiz

atio

nWeb

serv

ice.

java

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

013

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/V

MW

areV

irtua

lizat

ionW

ebse

rvic

e.ja

va

Page 52: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

publ

ic

void

add

AllH

ostS

yste

ms(

) {

} @O

verr

ide

publ

ic

void

add

Net

wor

kDev

iceP

rope

rtie

s(V

Dat

aObj

ect d

ata)

{if

(dat

a in

stan

ceof

VH

ostS

yste

m ||

dat

a in

stan

ceof

VM

achi

ne)

{/*

* *

Firs

t ste

p: C

olle

ct a

nd g

athe

r th

e ne

twor

k de

vice

pro

pert

ies

cont

aine

d in

the

Hos

t Sys

tem

*/

Has

hMap

<N

etw

orkD

evic

ePro

pert

yKey

,INet

wor

kDev

iceP

rope

rty<

Str

ing>

> n

etw

orkD

evic

ePro

pert

yMap

= d

ata.

getN

etw

orkD

evic

ePro

pert

yMap

();

/**

* S

econ

d st

ep: E

xtra

ct th

e ke

ys a

ttach

ed to

eac

h cu

stom

pro

pert

y. U

se th

is k

ey g

et th

e at

tach

ed v

alue

from

the

ICus

tom

Pro

pert

y ob

ject

in

* th

e ne

twor

k de

vice

pro

pert

y m

ap. C

onst

ruct

a N

etw

ork

Dev

ice

prop

erty

from

this

info

rmat

ion

*/

N

etw

orkD

evic

ePro

pert

y id

entif

ier

=

new

Net

wor

kDev

iceP

rop

erty

();

iden

tifie

r.se

tKey

(Net

wor

kDev

iceP

rope

rtyK

ey.H

OS

T);

iden

tifie

r.se

tVal

ue(d

ata.

getL

ooku

pKey

Val

ue()

);

Set

<N

etw

orkD

evic

ePro

pert

yKey

> k

eyS

et =

net

wor

kDev

iceP

rop

erty

Map

.key

Set

();

Arr

ayO

fNet

wor

kDev

iceP

rope

rty

prop

ertie

s =

ne

w A

rray

OfN

etw

orkD

evic

ePro

pert

y();

prop

ertie

s.ge

tNet

wor

kDev

iceP

rope

rty(

).ad

d(id

entif

ier)

;

for

(N

etw

orkD

evic

ePro

pert

yKey

net

wor

kDev

iceP

rope

rtyK

ey :

key

Set

) {

Net

wor

kDev

iceP

rope

rty

prop

erty

=

new

Net

wor

kDev

ice

Pro

pert

y();

prop

erty

.set

Key

(net

wor

kDev

iceP

rope

rtyK

ey);

prop

erty

.set

Val

ue(n

etw

orkD

evic

ePro

pert

yMap

.get

(net

wor

kDev

iceP

rope

rtyK

ey).

getN

etw

orkD

evic

ePro

pert

y())

;pr

oper

ties.

getN

etw

orkD

evic

ePro

pert

y().

add(

prop

erty

);} tr

y {

List

<N

etw

orkD

evic

ePro

pert

y> n

etw

orkD

evic

ePro

pert

y =

pro

pert

ies.

getN

etw

orkD

evic

ePro

pert

y();

for

(N

etw

orkD

evic

ePro

pert

y ne

twor

kDev

iceP

rope

rty

2 : n

etw

orkD

evic

ePro

pert

y) {

Sys

tem

.out

.prin

tln(n

etw

orkD

evic

ePro

pert

y2.

getK

ey()

+ n

etw

orkD

evic

ePro

pert

y2.g

etV

alue

());

} nam

eNet

wor

kDev

iceP

rope

rtyW

ebS

ervi

ceP

ortT

ype.

crea

teO

rUpd

ate(

data

.get

Look

upK

eyV

alue

(), p

rope

rtie

s);

} ca

tch

(N

etw

orkD

evic

eWeb

Ser

vice

Exc

eptio

n e)

{e.

prin

tSta

ckT

race

();

}}

else

{th

row

ne

w Il

lega

lArg

umen

tExc

eptio

n("

Arg

umen

t not

sup

port

ed: "+

data

.get

Cla

ss()

.get

Nam

e())

; //$

NO

N-N

LS-1

$}

}

}

Apr

29,

10

14:5

3P

age

7/7

VM

War

eVirt

ualiz

atio

nWeb

serv

ice.

java

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

014

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/V

MW

areV

irtua

lizat

ionW

ebse

rvic

e.ja

va

Page 53: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e;

/**

* M

anag

ed o

bjec

t typ

es, a

s us

ed in

VM

War

e.

* @

auth

or M

ads

Nie

lsen

* */

publ

ic e

num

VM

anag

edO

bjec

ts {

Fol

der,

Virt

ualM

achi

ne,

Hos

tSys

tem

,D

atac

ente

r,C

lust

er;

@O

verr

ide

publ

ic S

trin

g to

Str

ing(

) {

switc

h(

this

) {

case

Fol

der: retu

rn "

Fol

der";

//$

NO

N-N

LS-1

$ca

se V

irtua

lMac

hine

:re

turn

"V

irtua

lMac

hine

";

//$N

ON

-NLS

-1$

case

Hos

tSys

tem

:re

turn

"H

ostS

yste

m";

//$N

ON

-NLS

-1$

case

Dat

acen

ter:

retu

rn "

Dat

acen

ter";

//$N

ON

-NLS

-1$

case

Clu

ster

:re

turn

"C

lust

erC

ompu

teR

esou

rce

";

//$N

ON

-NLS

-1$

defa

ult

:th

row

ne

w Il

lega

lArg

umen

tExc

eptio

n("

Illeg

al V

Man

age

d ob

ject

arg

umen

t ");

//$N

ON

-NLS

-1$

}};

}

Apr

29,

10

14:5

3P

age

1/1

VM

anag

edO

bjec

ts.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

015

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/V

Man

aged

Obj

ects

.java

Page 54: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo;

impo

rt c

om.a

pc.c

onfig

.net

wor

kdev

icep

rope

rty.

Net

wor

kDev

iceP

rope

rtyK

ey;

/**

* P

retty

ficat

ion(

tm)

clas

s fo

r m

emor

y us

age.

Thi

s on

e re

turn

s a

float

indi

catin

g th

e us

age

* a

s a

perc

enta

ge o

f tot

al c

apac

ity. I

am

als

o at

tach

ing

a ne

twor

k de

vice

pro

pert

y ke

y to

this

* p

artic

ular

pie

ce o

f inf

orm

atio

n. *

*

/pu

blic

cl

ass

C

PU

Load

Info

im

plem

ents

ICus

tom

Pro

pert

y<S

trin

g>, I

Net

wor

kDev

iceP

rope

rty<

Str

ing>

{ priv

ate

Net

wor

kDev

iceP

rope

rtyK

ey k

ey;

priv

ate

in

t u

sedC

pu;

priv

ate

in

t to

talC

pu;

priv

ate

in

t c

ores

;pr

ivat

e

doub

le u

sage

Per

cent

age;

publ

ic C

PU

Load

Info

() {

setN

etw

orkD

evic

eKey

(Net

wor

kDev

iceP

rope

rtyK

ey.C

PU

_LO

AD

);} /*

* *

*

@pa

ram

use

dCpu

* @

para

m to

talC

pu *

@th

row

s In

valid

Cus

tom

Pro

pert

yVal

ueE

xcep

tion

*/

publ

ic C

PU

Load

Info

(in

t u

sedC

pu,

int

tota

lCpu

) th

row

s In

valid

Cus

tom

Pro

per

tyV

alue

Exc

eptio

n {

this

.key

= N

etw

orkD

evic

ePro

pert

yKey

.CP

U_L

OA

D;

this

.use

dCpu

= u

sedC

pu;

this

.tota

lCpu

= to

talC

pu;

if(t

otal

Cpu

!= 0

)th

is.u

sage

Per

cent

age

= (

(do

uble

)use

dCpu

/tota

lCpu

);if

(val

idat

e(us

ageP

erce

ntag

e) =

=

fals

e)

{th

row

ne

w In

valid

Cus

tom

Pro

pert

yVal

ueE

xcep

tion(

""+

usag

ePe

rcen

tage

);

//$N

ON

-NLS

-1$

}} pu

blic

Dou

ble

getU

sage

Per

cent

age(

) {

retu

rn u

sage

Per

cent

age;

} publ

ic

int

get

Use

dCpu

() {

retu

rn u

sedC

pu;

} publ

ic

void

set

Use

dCpu

(in

t u

sedC

pu)

{th

is.u

sedC

pu =

use

dCpu

;} pu

blic

in

t g

etT

otal

Cpu

() {

retu

rn to

talC

pu;

} publ

ic

void

set

Tot

alC

pu(

int

tota

lCpu

) {

this

.tota

lCpu

= to

talC

pu;

}

Apr

29,

10

14:5

3P

age

1/2

CP

ULo

adIn

fo.ja

vapu

blic

vo

id s

etC

ores

(in

t c

ores

) {

this

.cor

es =

cor

es;

} publ

ic

int

get

Cor

es()

{re

turn

cor

es;

} publ

ic

void

set

Usa

geP

erce

ntag

e(do

uble

usa

geP

erce

ntag

e) {

this

.usa

geP

erce

ntag

e =

usa

geP

erce

ntag

e;} @

Ove

rrid

epu

blic

Str

ing

getC

usto

mP

rope

rtyV

alue

() {

retu

rn g

etU

sage

Per

cent

age(

).to

Str

ing(

);} @

Ove

rrid

epu

blic

Boo

lean

val

idat

e(O

bjec

t val

ue)

{bo

olea

n v

alid

=

fals

e;

Dou

ble

doub

leva

lue

= (

Dou

ble)

valu

e;

if(d

oubl

eval

ue >

= 0

d) {

valid

=

true

;} re

turn

val

id;

} @O

verr

ide

publ

ic S

trin

g to

Str

ing(

) {

retu

rn S

trin

g.fo

rmat

("C

PU

util

izat

ion

%s

Mhz

of %

d M

hz (

%s)",us

edC

pu,to

talC

pu,g

etU

sage

Per

cent

age(

));

} @O

verr

ide

publ

ic N

etw

orkD

evic

ePro

pert

yKey

get

Net

wor

kDev

iceK

ey()

{re

turn

key

;} @

Ove

rrid

epu

blic

Str

ing

getN

etw

orkD

evic

ePro

pert

y()

{re

turn

usa

geP

erce

ntag

e+""

;} @

Ove

rrid

epu

blic

vo

id s

etN

etw

orkD

evic

eKey

(Net

wor

kDev

iceP

rope

rtyK

ey k

ey)

{th

is.k

ey =

key

;

} @O

verr

ide

publ

ic

bool

ean

val

idat

ePro

pert

y()

{re

turn

val

idat

e(us

ageP

erce

ntag

e);

}}

Apr

29,

10

14:5

3P

age

2/2

CP

ULo

adIn

fo.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

016

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/C

PU

Load

Info

.java

Page 55: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo;

impo

rt c

om.a

pc.c

onfig

.net

wor

kdev

icep

rope

rty.

Net

wor

kDev

iceP

rope

rtyK

ey;

/**

* C

lass

to r

epre

sent

a d

escr

iptio

n of

the

serv

er m

anuf

actu

rer

and

mod

el. N

ot c

urr

ently

a n

etw

ork

devi

ce *

pro

pert

y. *

@au

thor

man

iels

e * *

/pu

blic

cl

ass

G

ener

alS

yste

mIn

fo

impl

emen

ts IC

usto

mP

rope

rty<

Str

ing>

, IN

etw

orkD

evic

ePro

pert

y<S

trin

g> {

priv

ate

Str

ing

vend

or;

priv

ate

Str

ing

mod

el;

publ

ic G

ener

alS

yste

mIn

fo()

{}

/**

*

* @

para

m v

endo

r *

@pa

ram

mod

el *

/pu

blic

Gen

eral

Sys

tem

Info

(Str

ing

vend

or, S

trin

g m

odel

) {

this

.ven

dor

= v

endo

r;th

is.m

odel

= m

odel

;} pu

blic

vo

id s

etV

endo

r(S

trin

g ve

ndor

) {

this

.ven

dor

= v

endo

r;} pu

blic

Str

ing

getV

endo

r()

{re

turn

ven

dor;

} publ

ic

void

set

Mod

el(S

trin

g m

odel

) {

this

.mod

el =

mod

el;

} publ

ic S

trin

g ge

tMod

el()

{re

turn

mod

el;

} @O

verr

ide

publ

ic S

trin

g to

Str

ing(

) {

retu

rn S

trin

g.fo

rmat

("%

s %

s", v

endo

r,m

odel

);

//$N

ON

-NLS

-1$

} @O

verr

ide

publ

ic S

trin

g ge

tCus

tom

Pro

pert

yVal

ue()

{re

turn

this

.toS

trin

g();

} @O

verr

ide

publ

ic B

oole

an v

alid

ate(

Obj

ect v

alue

) {

retu

rn

null

;} @

Ove

rrid

epu

blic

Str

ing

getN

etw

orkD

evic

ePro

pert

y()

{re

turn

nu

ll;

} @O

verr

ide

publ

ic N

etw

orkD

evic

ePro

pert

yKey

get

Net

wor

kDev

iceK

ey()

{re

turn

nu

ll;

} @O

verr

ide

publ

ic

void

set

Net

wor

kDev

iceK

ey(N

etw

orkD

evic

ePro

pert

yKey

key

) {

Apr

29,

10

14:5

3P

age

1/2

Gen

eral

Sys

tem

Info

.java

} @O

verr

ide

publ

ic

bool

ean

val

idat

ePro

pert

y()

{re

turn

tr

ue;

}}

Apr

29,

10

14:5

3P

age

2/2

Gen

eral

Sys

tem

Info

.java

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

017

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/G

ener

alS

yste

mIn

fo.ja

va

Page 56: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo;

/**

*

* @

auth

or m

anie

lse

* * @

para

m <

T>

*

* C

lass

es w

ho w

ish

to u

se c

usto

m p

rope

rtie

s m

ust i

mpl

emen

t thi

s in

terf

ace,

i pa

ram

eter

ized

it in

cas

e yo

u m

ight

wan

t to

retu

rn *

a d

iffer

ent v

alue

in th

e fu

ture

. Cur

rent

ly a

ll th

e im

plem

enta

tions

are

str

ing

s. */

publ

ic

inte

rfac

e

ICus

tom

Pro

pert

y<T

> {

/**

* @

retu

rn th

e va

lue

of th

is c

usto

m p

rope

rty.

*/

publ

ic T

get

Cus

tom

Pro

pert

yVal

ue()

;/*

* *

@pa

ram

val

ue *

@re

turn

true

if th

e cu

stom

pro

pert

y is

val

id, o

ther

wis

e fa

lse.

*/

publ

ic B

oole

an v

alid

ate(

Obj

ect v

alue

);}

Apr

29,

10

14:5

3P

age

1/1

ICus

tom

Pro

pert

y.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

018

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/IC

usto

mP

rope

rty.

java

Page 57: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo;

impo

rt c

om.a

pc.c

onfig

.net

wor

kdev

icep

rope

rty.

Net

wor

kDev

iceP

rope

rtyK

ey;

publ

ic

inte

rfac

e

INet

wor

kDev

iceP

rope

rty<

T>

{/*

* *

@pa

ram

key

*/

publ

ic

void

set

Net

wor

kDev

iceK

ey(N

etw

orkD

evic

ePro

pert

yKey

key

);/*

* *

@re

turn

*/

publ

ic N

etw

orkD

evic

ePro

pert

yKey

get

Net

wor

kDev

iceK

ey()

;/*

* *

@re

turn

*/

publ

ic T

get

Net

wor

kDev

iceP

rope

rty(

);/*

* *

@re

turn

*/

publ

ic

bool

ean

val

idat

ePro

pert

y();

}

Apr

29,

10

14:5

3P

age

1/1

INet

wor

kDev

iceP

rope

rty.

java

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

019

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/IN

etw

orkD

evic

ePro

pert

y.ja

va

Page 58: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo;

publ

ic

clas

s

Inva

lidC

usto

mP

rope

rtyV

alue

Exc

eptio

n

exte

nds

Exc

eptio

n {

/**

*

*/

priv

ate

st

atic

fin

al

long

ser

ialV

ersi

onU

ID =

-39

5883

8154

0751

7184

2L;

/**

* @

para

m m

essa

ge *

/pu

blic

Inva

lidC

usto

mP

rope

rtyV

alue

Exc

eptio

n(S

trin

g m

essa

ge)

{su

per

(mes

sage

);}

}

Apr

29,

10

14:5

3P

age

1/1

Inva

lidC

usto

mP

rope

rtyV

alue

Exc

eptio

n.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

020

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/In

valid

Cus

tom

Pro

pert

yVal

ueE

xcep

tion.

java

Page 59: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo;

impo

rt c

om.a

pc.c

onfig

.net

wor

kdev

icep

rope

rty.

Net

wor

kDev

iceP

rope

rtyK

ey;

/**

* M

emor

y cl

ass.

Con

tain

s in

form

atio

n ab

out f

ree

mem

ory

on e

ither

a v

irtua

l mac

hin

e or

a h

ost s

yste

m.

*/

publ

ic

clas

s

Mem

oryU

sage

Info

im

plem

ents

ICus

tom

Pro

pert

y<S

trin

g>, I

Net

wor

kDev

iceP

rope

rty<

Str

ing>

{pr

ivat

e N

etw

orkD

evic

ePro

pert

yKey

key

;pr

ivat

e

int

use

dMem

ory;

priv

ate

lo

ng to

talM

emor

y;pr

ivat

e

doub

le m

emor

yUsa

geP

erce

ntag

e;

publ

ic M

emor

yUsa

geIn

fo()

{se

tNet

wor

kDev

iceK

ey(N

etw

orkD

evic

ePro

pert

yKey

.ME

MO

RY

_US

AG

E);

} /**

* V

alid

atio

n is

don

e on

inst

antia

tion.

* @

para

m tM

em *

@pa

ram

use

dMem

ory

* @

thro

ws

Inva

lidC

usto

mP

rope

rtyV

alue

Exc

eptio

n *

/pu

blic

Mem

oryU

sage

Info

(lo

ng tM

em,

int

use

dMem

ory)

th

row

s In

valid

Cus

tom

Pr

oper

tyV

alue

Exc

eptio

n { se

tNet

wor

kDev

iceK

ey(N

etw

orkD

evic

ePro

pert

yKey

.ME

MO

RY

_US

AG

E);

this

.use

dMem

ory

= u

sedM

emor

y;th

is.to

talM

emor

y =

tMem

;if

(tot

alM

emor

y !=

0)

this

.mem

oryU

sage

Per

cent

age

= (

(do

uble

)use

dMem

ory/

tota

lMe

mor

y);

if(v

alid

ate(

mem

oryU

sage

Per

cent

age)

==

fa

lse

) {

thro

w

new

Inva

lidC

usto

mP

rope

rtyV

alue

Exc

eptio

n("

Inva

lid "+

thi

s.ge

tCla

ss()

.get

Nam

e()

+"

"+

mem

oryU

sage

Per

cent

age)

; //$

NO

N-N

LS-1

$ //$

NO

N-N

LS-2

$}

} priv

ate

lo

ng c

onve

rtT

oMeg

abyt

e(lo

ng b

ytes

) {

retu

rn b

ytes

/(10

24*1

024)

;} pu

blic

in

t g

etU

sedM

emor

y()

{re

turn

use

dMem

ory;

} publ

ic

void

set

Use

dMem

ory(

int

use

dMem

ory)

{th

is.u

sedM

emor

y =

use

dMem

ory;

} publ

ic

long

get

Tot

alM

emor

y()

{re

turn

tota

lMem

ory;

} publ

ic

void

set

Tot

alM

emor

y(lo

ng to

talM

emor

y) {

this

.tota

lMem

ory

= to

talM

emor

y;} pu

blic

do

uble

get

Mem

oryU

sage

Per

cent

age(

) {

retu

rn m

emor

yUsa

geP

erce

ntag

e;}

Apr

29,

10

14:5

3P

age

1/2

Mem

oryU

sage

Info

.java

publ

ic

void

set

Mem

oryU

sage

Per

cent

age(

doub

le m

emor

yUsa

geP

erce

ntag

e) {

this

.mem

oryU

sage

Per

cent

age

= m

emor

yUsa

geP

erce

ntag

e;} @

Ove

rrid

epu

blic

Str

ing

getC

usto

mP

rope

rtyV

alue

() {

retu

rn th

is.to

Str

ing(

);} @

Ove

rrid

epu

blic

Str

ing

toS

trin

g()

{re

turn

Str

ing.

form

at("

%s

mb

of %

d m

b (

%s)",

use

dMem

ory,

conv

ertT

oMeg

abyt

e(to

talM

emor

y),m

emor

yUsa

geP

erce

ntag

e);

//$N

ON

-NLS

-1$

} @O

verr

ide

publ

ic B

oole

an v

alid

ate(

Obj

ect v

alue

) {

bool

ean

val

id =

fa

lse

;if

(mem

oryU

sage

Per

cent

age

>=

0d

&&

mem

oryU

sage

Per

cent

age

<=

1d

) {

valid

=

true

;}

else

if

(mem

oryU

sage

Per

cent

age

> 1

d) {

setM

emor

yUsa

geP

erce

ntag

e(1d

);va

lid =

tr

ue;

} retu

rn v

alid

;} @

Ove

rrid

epu

blic

Str

ing

getN

etw

orkD

evic

ePro

pert

y()

{re

turn

mem

oryU

sage

Per

cent

age+

"";

//$N

ON

-NLS

-1$

} @O

verr

ide

publ

ic N

etw

orkD

evic

ePro

pert

yKey

get

Net

wor

kDev

iceK

ey()

{re

turn

key

;} /* @

Ove

rrid

epu

blic

Str

ing

getR

ealN

etw

orkD

evic

ePro

pert

y()

{re

turn

mem

oryU

sage

Per

cent

age+

""; /

/$N

ON

-NLS

-1} */ @

Ove

rrid

epu

blic

vo

id s

etN

etw

orkD

evic

eKey

(Net

wor

kDev

iceP

rope

rtyK

ey k

ey)

{th

is.k

ey =

key

;

} @O

verr

ide

publ

ic

bool

ean

val

idat

ePro

pert

y()

{re

turn

tr

ue;

}}

Apr

29,

10

14:5

3P

age

2/2

Mem

oryU

sage

Info

.java

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

021

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/M

emor

yUsa

geIn

fo.ja

va

Page 60: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo;

impo

rt c

om.a

pc.c

onfig

.net

wor

kdev

icep

rope

rty.

Net

wor

kDev

iceP

rope

rtyK

ey;

publ

ic

clas

s

Ope

ratin

gSys

tem

Info

im

plem

ents

ICus

tom

Pro

pert

y<S

trin

g>,IN

etw

orkD

evi

ceP

rope

rty<

Str

ing>

{pu

blic

st

atic

fin

al S

trin

g D

EF

AU

LT_S

TR

ING

_OS

= "

OS

not

def

ined"

; //$

NO

N-N

LS-1

$pu

blic

st

atic

fin

al S

trin

g D

EF

AU

LT_S

TR

ING

_VE

RS

ION

= "

Ver

sion

not

def

ined"

; //

$NO

N-N

LS-1

$pr

ivat

e N

etw

orkD

evic

ePro

pert

yKey

key

;pr

ivat

e S

trin

g os

Ver

sion

;pr

ivat

e S

trin

g os

Nam

e;

publ

ic O

pera

tingS

yste

mIn

fo()

{se

tNet

wor

kDev

iceK

ey(N

etw

orkD

evic

ePro

pert

yKey

.OS

);} /*

* *

@pa

ram

osN

ame

* @

para

m o

sVer

sion

*

* P

ass

in th

e na

me

of th

e op

erat

ing

syst

em a

nd th

e ve

rsio

n. If

non

e ar

e s

uppl

ied,

nul

l is

assu

med

* a

nd d

efau

lt va

lues

are

ass

igne

d.

*/

publ

ic O

pera

tingS

yste

mIn

fo(S

trin

g os

Nam

e, S

trin

g os

Ver

sion

) {

setN

etw

orkD

evic

eKey

(Net

wor

kDev

iceP

rope

rtyK

ey.O

S);

this

.osN

ame

= o

sNam

e;th

is.o

sVer

sion

= o

sVer

sion

;} pu

blic

vo

id s

etO

sVer

sion

(Str

ing

osV

ersi

on)

{th

is.o

sVer

sion

= o

sVer

sion

;} pu

blic

Str

ing

getO

sVer

sion

() {

retu

rn o

sVer

sion

;} pu

blic

vo

id s

etO

sNam

e(S

trin

g os

Nam

e) {

this

.osN

ame

= o

sNam

e;} pu

blic

Str

ing

getO

sNam

e()

{re

turn

osN

ame;

} @O

verr

ide

publ

ic S

trin

g to

Str

ing(

) {

if(o

sNam

e !=

nu

ll &

& o

sVer

sion

!=

null

) {

retu

rn S

trin

g.fo

rmat

("%

s %

s", o

sNam

e,os

Ver

sion

);

//$N

ON

-N

LS-1

$}

else

if

(os

Ver

sion

==

nu

ll &

& o

sNam

e !=

nu

ll)

{re

turn

Str

ing.

form

at("

%s

%s",

osN

ame,

DE

FA

ULT

_ST

RIN

G_V

ER

SIO

N);

//$

NO

N-N

LS-1

$}

else

if

(os

Ver

sion

!=

null

&&

osN

ame

==

nu

ll)

{re

turn

Str

ing.

form

at("

%s

%s",

DE

FA

ULT

_ST

RIN

G_O

S, o

sVer

sio

n);

//$N

ON

-NLS

-1$

} el

se {

retu

rn S

trin

g.fo

rmat

("%

s %

s", D

EF

AU

LT_S

TR

ING

_OS

,DE

FA

ULT

_S

TR

ING

_VE

RS

ION

);

//$N

ON

-NLS

-1$

}} @

Ove

rrid

e

Apr

29,

10

14:5

3P

age

1/2

Ope

ratin

gSys

tem

Info

.java

publ

ic S

trin

g ge

tCus

tom

Pro

pert

yVal

ue()

{re

turn

this

.toS

trin

g();

} @O

verr

ide

publ

ic B

oole

an v

alid

ate(

Obj

ect v

alue

) {

if(o

sNam

e =

=

null

&&

osV

ersi

on =

=

null

) {

retu

rn

fals

e;

} retu

rn

true

;} @

Ove

rrid

epu

blic

Net

wor

kDev

iceP

rope

rtyK

ey g

etN

etw

orkD

evic

eKey

() {

retu

rn k

ey;

} @O

verr

ide

publ

ic S

trin

g ge

tNet

wor

kDev

iceP

rope

rty(

) {

retu

rn th

is.to

Str

ing(

);} @

Ove

rrid

epu

blic

vo

id s

etN

etw

orkD

evic

eKey

(Net

wor

kDev

iceP

rope

rtyK

ey k

ey)

{th

is.k

ey =

key

;

} @O

verr

ide

publ

ic

bool

ean

val

idat

ePro

pert

y()

{if

(osN

ame

==

nu

ll &

& o

sVer

sion

==

nu

ll)

{re

turn

fa

lse

;} re

turn

tr

ue;

}}

Apr

29,

10

14:5

3P

age

2/2

Ope

ratin

gSys

tem

Info

.java

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

022

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/O

pera

tingS

yste

mIn

fo.ja

va

Page 61: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo;

/**

*

* @

auth

or m

anie

lse

*

* C

lass

to r

epre

sent

a p

roce

ssor

. * *

/pu

blic

cl

ass

P

roce

ssor

Info

im

plem

ents

ICus

tom

Pro

pert

y<S

trin

g> {

publ

ic S

trin

g pr

oces

sorM

anuf

actu

rer;

publ

ic S

trin

g pr

oces

sorM

odel

;pu

blic

in

t p

roce

ssor

Fre

quen

cy;

publ

ic

bool

ean

sup

port

Hyp

erth

read

ing;

publ

ic

shor

t n

umbe

rOfC

ores

;pu

blic

sh

ort

num

berO

fCpu

Pac

kage

s;

//As

in, h

ow m

any

dies

are

in th

e sy

stem

, a s

yste

m m

ight

hav

e 2

x O

ctoc

ored

pro

cess

ors

publ

ic P

roce

ssor

Info

() {

}/*

* *

*

@pa

ram

pro

cess

orM

odel

* @

para

m s

uppo

rtH

yper

thre

adin

g *

@pa

ram

num

berO

fCor

es *

@pa

ram

pro

cess

orF

requ

ency

*/

publ

ic P

roce

ssor

Info

(Str

ing

proc

esso

rMod

el,

bool

ean

sup

port

Hyp

erth

read

ing,

sh

ort

num

berO

fCor

es,

int

pro

cess

orF

requ

ency

) {

supe

r()

;th

is.p

roce

ssor

Mod

el =

pro

cess

orM

odel

;th

is.s

uppo

rtH

yper

thre

adin

g =

sup

port

Hyp

erth

read

ing;

this

.num

berO

fCor

es =

num

berO

fCor

es;

this

.pro

cess

orF

requ

ency

= p

roce

ssor

Fre

quen

cy;

} publ

ic S

trin

g ge

tPro

cess

orM

odel

() {

retu

rn p

roce

ssor

Mod

el;

} publ

ic

void

set

Pro

cess

orM

odel

(Str

ing

proc

esso

rMod

el)

{th

is.p

roce

ssor

Mod

el =

pro

cess

orM

odel

;} pu

blic

in

t g

etP

roce

ssor

Fre

quen

cy()

{re

turn

pro

cess

orF

requ

ency

;} pu

blic

vo

id s

etP

roce

ssor

Fre

quen

cy(

int

pro

cess

orF

requ

ency

) {

this

.pro

cess

orF

requ

ency

= p

roce

ssor

Fre

quen

cy;

} publ

ic

bool

ean

isS

uppo

rtH

yper

thre

adin

g()

{re

turn

sup

port

Hyp

erth

read

ing;

} publ

ic

void

set

Sup

port

Hyp

erth

read

ing(

bool

ean

sup

port

Hyp

erth

read

ing)

{th

is.s

uppo

rtH

yper

thre

adin

g =

sup

port

Hyp

erth

read

ing;

} publ

ic

shor

t g

etN

umbe

rOfC

ores

() {

retu

rn n

umbe

rOfC

ores

;

Apr

29,

10

14:5

3P

age

1/2

Pro

cess

orIn

fo.ja

va} pu

blic

vo

id s

etN

umbe

rOfC

ores

(sh

ort

num

berO

fCor

es)

{th

is.n

umbe

rOfC

ores

= n

umbe

rOfC

ores

;} @

Ove

rrid

epu

blic

Str

ing

getC

usto

mP

rope

rtyV

alue

() {

retu

rn th

is.to

Str

ing(

);} @

Ove

rrid

epu

blic

Str

ing

toS

trin

g()

{re

turn

Str

ing.

form

at("

Mod

el: %

s N

umbe

r of

cor

es: %

s",

pro

cess

orM

odel

,nu

mbe

rOfC

ores

);

//$N

ON

-NLS

-1$

} @O

verr

ide

publ

ic B

oole

an v

alid

ate(

Obj

ect v

alue

) {

retu

rn

true

;}

}

Apr

29,

10

14:5

3P

age

2/2

Pro

cess

orIn

fo.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

023

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/P

roce

ssor

Info

.java

Page 62: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo;

/**

* @

auth

or m

anie

lse

* * S

mal

l cla

ss to

hol

d st

atus

info

rmat

ion,

at t

he m

omen

t the

re is

no

addi

tiona

l lo

gic

atta

ched

to th

is c

lass

* th

is m

ight

cha

nge

late

r. *

/pu

blic

cl

ass

S

tatu

sInf

o

impl

emen

ts IC

usto

mP

rope

rty<

Str

ing>

{pr

ivat

e S

trin

g st

atus

;

publ

ic S

tatu

sInf

o(S

trin

g st

atus

) {

this

.sta

tus

= s

tatu

s;} pu

blic

vo

id s

etS

tatu

s(S

trin

g st

atus

) {

this

.sta

tus

= s

tatu

s;} pu

blic

Str

ing

getS

tatu

s()

{re

turn

sta

tus;

} @O

verr

ide

publ

ic S

trin

g to

Str

ing(

) {

retu

rn s

tatu

s;} @

Ove

rrid

epu

blic

Str

ing

getC

usto

mP

rope

rtyV

alue

() {

retu

rn th

is.to

Str

ing(

);} @

Ove

rrid

epu

blic

Boo

lean

val

idat

e(O

bjec

t val

ue)

{re

turn

sta

tus

!=

null

&&

!sta

tus.

isE

mpt

y()

? tr

ue :

fals

e;

} /* @O

verr

ide

publ

ic S

trin

g ge

tNet

wor

kDev

iceP

rope

rty(

) {

retu

rn n

ull;

} */}

Apr

29,

10

14:5

3P

age

1/1

Sta

tusI

nfo.

java

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

024

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/S

tatu

sInf

o.ja

va

Page 63: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo;

impo

rt ja

va.u

til.H

ashM

ap;

impo

rt c

om.a

pc.c

onfig

.net

wor

kdev

icep

rope

rty.

Net

wor

kDev

iceP

rope

rtyK

ey;

/**

* S

tora

ge r

epre

sent

atio

n, in

vm

war

e st

orag

e is

dis

trib

uted

pos

sibl

y am

ong

one

or

man

y st

orag

e un

its.

* I

put i

n so

me

met

hods

to c

onve

rt if

nee

ded.

Man

y of

the

poss

ible

attr

ibut

es o

f fre

e sp

ace

is e

xpre

ssed

* in

byt

es, s

o to

mak

e it

read

able

I in

clud

ed m

etho

ds to

con

vert

to m

egab

yte

and

giga

byte

. *

@au

thor

man

iels

e * *

/pu

blic

cl

ass

S

tora

geIn

fo

impl

emen

ts IC

usto

mP

rope

rty<

Str

ing>

,INet

wor

kDev

iceP

rope

rty

<S

trin

g> { pr

ivat

e N

etw

orkD

evic

ePro

pert

yKey

key

;pr

ivat

e L

ong

free

Spa

ce;

priv

ate

Lon

g to

talS

pace

; pr

ivat

e L

ong

used

Spa

ce;

priv

ate

Has

hMap

<S

trin

g,S

trin

g> d

ataS

tore

s =

ne

w H

ashM

ap<

Str

ing,

Str

ing>

();

publ

ic S

tora

geIn

fo()

{se

tKey

(Net

wor

kDev

iceP

rope

rtyK

ey.F

RE

E_D

ISK

_SP

AC

E);

} publ

ic S

tora

geIn

fo(L

ong

fSpa

ce, L

ong

tSpa

ce)

thro

ws

Inva

lidC

usto

mP

rope

rtyV

alue

Exc

eptio

n {

this

.set

Key

(Net

wor

kDev

iceP

rope

rtyK

ey.F

RE

E_D

ISK

_SP

AC

E);

this

.set

Fre

eSpa

ce(c

onve

rtT

oMeg

aByt

es(f

Spa

ce))

;th

is.s

etT

otal

Spa

ce(c

onve

rtT

oMeg

aByt

es(t

Spa

ce))

;th

is.s

etU

sedS

pace

(get

Tot

alS

pace

() -

get

Fre

eSpa

ce()

);if

(!va

lidat

ePro

pert

y())

{th

row

ne

w In

valid

Cus

tom

Pro

pert

yVal

ueE

xcep

tion(

"In

valid

"+t

his.

getC

lass

().g

etN

ame(

) +

"va

lue"

);}

} priv

ate

lo

ng c

onve

rtT

oMeg

aByt

es(L

ong

byte

s) {

retu

rn b

ytes

/(10

24*1

024)

;} pr

ivat

e

long

con

vert

ToG

igaB

ytes

(Lon

g by

tes)

{re

turn

byt

es/(

1024

*102

4*10

24);

} publ

ic

void

set

Tot

alS

pace

(Lon

g to

talS

pace

) {

this

.tota

lSpa

ce =

tota

lSpa

ce;

} publ

ic L

ong

getT

otal

Spa

ce()

{re

turn

tota

lSpa

ce;

} publ

ic

void

set

Fre

eSpa

ce(L

ong

free

Spa

ce)

{th

is.fr

eeS

pace

= fr

eeS

pace

;} pu

blic

Lon

g ge

tFre

eSpa

ce()

{

Apr

29,

10

14:5

3P

age

1/3

Sto

rage

Info

.java

retu

rn fr

eeS

pace

;} pu

blic

vo

id s

etU

sedS

pace

(Lon

g us

edS

pace

) {

this

.use

dSpa

ce =

use

dSpa

ce;

} publ

ic L

ong

getU

sedS

pace

() {

retu

rn u

sedS

pace

;} pu

blic

vo

id s

etD

ataS

tore

s(H

ashM

ap<

Str

ing,

Str

ing>

dat

aSto

res)

{th

is.d

ataS

tore

s =

dat

aSto

res;

} publ

ic H

ashM

ap<

Str

ing,

Str

ing>

get

Dat

aSto

res(

) {

retu

rn d

ataS

tore

s;} @

Ove

rrid

epu

blic

Str

ing

toS

trin

g()

{re

turn

Str

ing.

form

at("

%s

mb

used

of %

s m

b (%

s m

b fr

ee)

", u

sedS

pace

,get

To

talS

pace

(),g

etF

reeS

pace

());

} /**

* C

usto

mP

rope

rty

web

serv

ice

retu

rn ty

pe r

equi

rem

ent.

Con

vert

ing

it to

a s

trin

g, u

sing

toS

trin

g()

as d

efau

lt. In

the

futu

re *

one

mig

ht d

ecid

e to

let s

tora

ge in

form

atio

n re

turn

a d

iffer

ent v

alue

, m

ight

be

a pr

imiti

ve ty

pe o

r a

com

plex

obj

ect.

*/

@O

verr

ide

publ

ic S

trin

g ge

tCus

tom

Pro

pert

yVal

ue()

{re

turn

this

.toS

trin

g();

} @O

verr

ide

publ

ic B

oole

an v

alid

ate(

Obj

ect v

alue

) {

retu

rn (

Long

)val

ue !=

nu

ll &

& (

(Lon

g)va

lue)

.long

Val

ue()

> 0

?

true

: fa

lse

;} @

Ove

rrid

epu

blic

Str

ing

getN

etw

orkD

evic

ePro

pert

y()

{re

turn

free

Spa

ce+

"";

} publ

ic

void

set

Key

(Net

wor

kDev

iceP

rope

rtyK

ey k

ey)

{th

is.k

ey =

key

;} pu

blic

Net

wor

kDev

iceP

rope

rtyK

ey g

etK

ey()

{re

turn

key

;} @

Ove

rrid

epu

blic

Net

wor

kDev

iceP

rope

rtyK

ey g

etN

etw

orkD

evic

eKey

() {

retu

rn k

ey;

} /* @O

verr

ide

Apr

29,

10

14:5

3P

age

2/3

Sto

rage

Info

.java

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

025

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/S

tora

geIn

fo.ja

va

Page 64: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

publ

ic S

trin

g ge

tRea

lNet

wor

kDev

iceP

rope

rty(

) {

retu

rn n

ull;

} */ @O

verr

ide

publ

ic

void

set

Net

wor

kDev

iceK

ey(N

etw

orkD

evic

ePro

pert

yKey

key

) {

this

.key

= k

ey;

} @O

verr

ide

publ

ic

bool

ean

val

idat

ePro

pert

y()

{re

turn

val

idat

e(fr

eeS

pace

);}

}

Apr

29,

10

14:5

3P

age

3/3

Sto

rage

Info

.java

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

026

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/S

tora

geIn

fo.ja

va

Page 65: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo;

impo

rt c

om.v

mw

are.

vim

25.A

rray

OfM

anag

edO

bjec

tRef

eren

ce;

impo

rt c

om.v

mw

are.

vim

25.C

ompu

teR

esou

rceS

umm

ary;

/**

*

* @

auth

or m

anie

lse

* C

lass

to r

epre

sent

info

rmat

ion

abou

t a c

lust

er.

* T

he C

ompu

teR

esou

rceS

umm

ary

cont

ains

sum

mar

ized

info

rmat

ion

abou

t the

hos

t sys

tem

s at

tach

ed to

this

Clu

ster

*/

publ

ic

clas

s

Virt

ualC

lust

erIn

fo {

priv

ate

Com

pute

Res

ourc

eSum

mar

y su

mm

ary;

priv

ate

Arr

ayO

fMan

aged

Obj

ectR

efer

ence

hos

t;pu

blic

Com

pute

Res

ourc

eSum

mar

y ge

tSum

mar

y()

{re

turn

sum

mar

y;} pu

blic

vo

id s

etS

umm

ary(

Com

pute

Res

ourc

eSum

mar

y su

mm

ary)

{th

is.s

umm

ary

= s

umm

ary;

} publ

ic A

rray

OfM

anag

edO

bjec

tRef

eren

ce g

etH

ost(

) {

retu

rn h

ost;

} publ

ic

void

set

Hos

t(A

rray

OfM

anag

edO

bjec

tRef

eren

ce h

ost)

{th

is.h

ost =

hos

t;} @

Ove

rrid

epu

blic

Str

ing

toS

trin

g()

{re

turn

"V

irtua

lClu

ster

Info

- a

ll in

fo in

sum

mar

y ob

ject";

//$

NO

N-N

LS-1

$}

}

Apr

29,

10

14:5

3P

age

1/1

Virt

ualC

lust

erIn

fo.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

027

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/V

irtua

lClu

ster

Info

.java

Page 66: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo;

impo

rt c

om.v

mw

are.

vim

25.M

anag

edE

ntity

Sta

tus;

/**

*

* @

auth

or m

anie

lse

* */

publ

ic

clas

s

Virt

ualD

atac

ente

rInf

o {

priv

ate

Str

ing

nam

e;pr

ivat

e M

anag

edE

ntity

Sta

tus

stat

us;

publ

ic S

trin

g ge

tNam

e()

{re

turn

nam

e;} pu

blic

vo

id s

etN

ame(

Str

ing

nam

e) {

this

.nam

e =

nam

e;} pu

blic

Man

aged

Ent

ityS

tatu

s ge

tSta

tus(

) {

retu

rn s

tatu

s;} /*

* *

@pa

ram

sta

tus

*/

publ

ic

void

set

Sta

tus(

Man

aged

Ent

ityS

tatu

s st

atus

) {

this

.sta

tus

= s

tatu

s;}

}

Apr

29,

10

14:5

3P

age

1/1

Virt

ualD

atac

ente

rInf

o.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

028

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/V

irtua

lDat

acen

terI

nfo.

java

Page 67: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo;

impo

rt ja

va.u

til.A

rray

List

;im

port

java

.util

.Has

hMap

;

impo

rt c

om.a

pc.c

onfig

.net

wor

kdev

icep

rope

rty.

Net

wor

kDev

iceP

rope

rtyK

ey;

impo

rt c

om.v

mw

are.

vim

25.H

ostS

yste

mIn

fo;

impo

rt c

om.v

mw

are.

vim

25.M

anag

edE

ntity

Sta

tus;

/**

*

* @

auth

or m

anie

lse

* A

cla

ss to

enc

apsu

late

info

rmat

ion

abou

t a V

irtua

l Hos

t Sys

tem

. *

Con

tain

s a

list o

f pro

pert

ies

whi

ch is

the

set s

ched

uled

to b

e ad

ded

as a

cus

tom

pro

pert

y in

ISX

O. A

lso

* h

olds

and

mai

ntai

ns a

list

of n

etw

ork

devi

ce p

rope

rtie

s. *

/pu

blic

cl

ass

V

irtua

lHos

tSys

tem

Info

{

priv

ate

Arr

ayLi

st<

ICus

tom

Pro

pert

y<S

trin

g>>

pro

pert

ies

=

new

Arr

ayLi

st<

ICus

tom

Pro

pert

y<S

trin

g>>

();

priv

ate

Has

hMap

<N

etw

orkD

evic

ePro

pert

yKey

, IN

etw

orkD

evic

ePro

pert

y<S

trin

g>>

net

wor

kDev

iceP

rope

rtyM

ap =

ne

w H

ashM

ap<

Net

wor

kDev

iceP

rope

rtyK

ey,IN

etw

orkD

evic

eP

rope

rty<

Str

ing>

>()

;pr

ivat

e S

trin

g na

me;

priv

ate

Man

aged

Ent

ityS

tatu

s st

atus

;pr

ivat

e H

ostS

yste

mIn

fo in

fo;

priv

ate

in

t o

vera

llCpu

Usa

ge;

priv

ate

in

t o

vera

llMem

oryU

sage

;pr

ivat

e

long

mem

oryC

apac

ity;

priv

ate

lo

ng to

talD

ataS

tore

Cap

acity

;pr

ivat

e

long

free

Dat

aSto

reC

apac

ity;

priv

ate

Str

ing

cpuM

odel

;pr

ivat

e

int

cpu

Mhz

;pr

ivat

e

shor

t n

umbe

rOfC

puC

ores

;pr

ivat

e

shor

t n

umbe

rOfP

hysi

calC

puP

acka

ges;

priv

ate

in

t n

umbe

rOfV

ms;

publ

ic V

irtua

lHos

tSys

tem

Info

() {

} publ

ic S

trin

g ge

tNam

e()

{re

turn

nam

e;} pu

blic

vo

id s

etN

ame(

Str

ing

nam

e) {

this

.nam

e =

nam

e;} pu

blic

Man

aged

Ent

ityS

tatu

s ge

tSta

tus(

) {

retu

rn s

tatu

s;} pu

blic

vo

id s

etS

tatu

s(M

anag

edE

ntity

Sta

tus

stat

us)

{th

is.s

tatu

s =

sta

tus;

} publ

ic

int

get

Ove

rallC

puU

sage

() {

retu

rn o

vera

llCpu

Usa

ge;

} publ

ic

void

set

Ove

rallC

puU

sage

(in

t o

vera

llCpu

Usa

ge)

{

Apr

29,

10

14:5

3P

age

1/3

Virt

ualH

ostS

yste

mIn

fo.ja

vath

is.o

vera

llCpu

Usa

ge =

ove

rallC

puU

sage

;} pu

blic

in

t g

etO

vera

llMem

oryU

sage

() {

retu

rn o

vera

llMem

oryU

sage

;} pu

blic

vo

id s

etO

vera

llMem

oryU

sage

(in

t o

vera

llMem

oryU

sage

) {

this

.ove

rallM

emor

yUsa

ge =

ove

rallM

emor

yUsa

ge;

} publ

ic S

trin

g ge

tCpu

Mod

el()

{re

turn

cpu

Mod

el;

} publ

ic

void

set

Cpu

Mod

el(S

trin

g cp

uMod

el)

{th

is.c

puM

odel

= c

puM

odel

;} pu

blic

in

t g

etC

puM

hz()

{re

turn

cpu

Mhz

;} pu

blic

vo

id s

etC

puM

hz(

int

cpu

Mhz

) {

this

.cpu

Mhz

= c

puM

hz;

} publ

ic

shor

t g

etN

umbe

rOfC

puC

ores

() {

retu

rn n

umbe

rOfC

puC

ores

;} pu

blic

vo

id s

etN

umbe

rOfC

puC

ores

(sh

ort

num

berO

fCpu

Cor

es)

{th

is.n

umbe

rOfC

puC

ores

= n

umbe

rOfC

puC

ores

;} pu

blic

sh

ort

get

Num

berO

fPhy

sica

lCpu

Pac

kage

s()

{re

turn

num

berO

fPhy

sica

lCpu

Pac

kage

s;} pu

blic

vo

id s

etN

umbe

rOfP

hysi

calC

puP

acka

ges(

shor

t n

umbe

rOfP

hysi

calC

puP

ack

ages

) {

this

.num

berO

fPhy

sica

lCpu

Pac

kage

s =

num

berO

fPhy

sica

lCpu

Pac

kage

s;} pu

blic

vo

id s

etM

emor

yCap

acity

(lo

ng m

emor

yCap

acity

) {

this

.mem

oryC

apac

ity =

mem

oryC

apac

ity;

} publ

ic

long

get

Mem

oryC

apac

ity()

{re

turn

mem

oryC

apac

ity;

} publ

ic

void

set

Num

berO

fVm

s(in

t n

umbe

rOfV

ms)

{th

is.n

umbe

rOfV

ms

= n

umbe

rOfV

ms;

} publ

ic

int

get

Num

berO

fVm

s()

{re

turn

num

berO

fVm

s;} pu

blic

vo

id s

etIn

fo(H

ostS

yste

mIn

fo in

fo)

{th

is.in

fo =

info

;} pu

blic

Hos

tSys

tem

Info

get

Info

() {

retu

rn in

fo;

} publ

ic

void

set

Pro

pert

ies(

Arr

ayLi

st<

ICus

tom

Pro

pert

y<S

trin

g>>

pro

pert

ies)

{th

is.p

rope

rtie

s =

pro

pert

ies;

} publ

ic A

rray

List

<IC

usto

mP

rope

rty<

Str

ing>

> g

etP

rope

rtie

s()

{re

turn

pro

pert

ies;

} publ

ic

void

set

Tot

alD

ataS

tore

Cap

acity

(lo

ng to

talD

ataS

tore

Cap

acity

) {

this

.tota

lDat

aSto

reC

apac

ity =

tota

lDat

aSto

reC

apac

ity;

} publ

ic

long

get

Tot

alD

ataS

tore

Cap

acity

() {

Apr

29,

10

14:5

3P

age

2/3

Virt

ualH

ostS

yste

mIn

fo.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

029

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/V

irtua

lHos

tSys

tem

Info

.java

Page 68: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

retu

rn to

talD

ataS

tore

Cap

acity

;} pu

blic

vo

id s

etF

reeD

ataS

tore

Cap

acity

(lo

ng fr

eeD

ataS

tore

Cap

acity

) {

this

.free

Dat

aSto

reC

apac

ity =

free

Dat

aSto

reC

apac

ity;

} publ

ic

long

get

Fre

eDat

aSto

reC

apac

ity()

{re

turn

free

Dat

aSto

reC

apac

ity;

} publ

ic

void

set

Net

wor

kDev

iceP

rope

rtyM

ap(H

ashM

ap<

Net

wor

kDev

iceP

rope

rtyK

ey, I

Net

wor

kDev

iceP

rope

rty<

Str

ing>

> n

etw

orkD

evic

ePro

pert

yMap

) {

this

.net

wor

kDev

iceP

rope

rtyM

ap =

net

wor

kDev

iceP

rope

rtyM

ap;

} publ

ic H

ashM

ap<

Net

wor

kDev

iceP

rope

rtyK

ey, I

Net

wor

kDev

iceP

rope

rty<

Str

ing>

> g

etN

etw

orkD

evic

ePro

pert

yMap

() {

retu

rn n

etw

orkD

evic

ePro

pert

yMap

;}

}

Apr

29,

10

14:5

3P

age

3/3

Virt

ualH

ostS

yste

mIn

fo.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

030

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/V

irtua

lHos

tSys

tem

Info

.java

Page 69: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo;

impo

rt ja

va.u

til.A

rray

List

;im

port

java

.util

.Has

hMap

;

impo

rt c

om.a

pc.c

onfig

.net

wor

kdev

icep

rope

rty.

Net

wor

kDev

iceP

rope

rtyK

ey;

impo

rt c

om.v

mw

are.

vim

25.M

anag

edE

ntity

Sta

tus;

/**

* @

auth

or m

anie

lse

* */

publ

ic

clas

s

Virt

ualM

achi

neIn

fo {

priv

ate

Arr

ayLi

st<

ICus

tom

Pro

pert

y<S

trin

g>>

pro

pert

ies

=

new

Arr

ayLi

st<

ICus

tom

Pro

pert

y<S

trin

g>>

();

priv

ate

Has

hMap

<N

etw

orkD

evic

ePro

pert

yKey

, IN

etw

orkD

evic

ePro

pert

y<S

trin

g>>

net

wor

kDev

iceP

rope

rtyM

ap =

ne

w H

ashM

ap<

Net

wor

kDev

iceP

rope

rtyK

ey,IN

etw

orkD

evic

eP

rope

rty<

Str

ing>

>()

;pr

ivat

e S

trin

g na

me;

priv

ate

Man

aged

Ent

ityS

tatu

s st

atus

;pr

ivat

e S

trin

g gu

estS

tate

;pr

ivat

e S

trin

g gu

estO

pera

tingS

yste

m;

priv

ate

Str

ing

gues

tIp;

priv

ate

Str

ing

host

Nam

e;//C

urre

nt v

m-m

emor

y us

age

priv

ate

in

t g

uest

Mem

oryU

sage

;//C

urre

nt v

m-m

emor

y us

age,

of t

he h

ost m

emor

ypr

ivat

e

int

hos

tMem

oryU

sage

;//A

lloca

ted

mem

ory

to th

is v

irtua

l mac

hine

priv

ate

in

t g

uest

Allo

cate

dMem

ory;

//VM

cpu

usa

ge.

priv

ate

in

t g

uest

Cpu

Usa

ge;

//Num

ber

of c

pu's

allo

cate

d to

this

vm

.pr

ivat

e

int

num

berO

fAllo

cate

dCpu

s;//A

lloca

ted

cpu

as c

onfig

ured

priv

ate

in

t a

lloca

tedC

pu;

publ

ic S

trin

g ge

tNam

e()

{re

turn

nam

e;} pu

blic

vo

id s

etN

ame(

Str

ing

nam

e) {

this

.nam

e =

nam

e;} pu

blic

Man

aged

Ent

ityS

tatu

s ge

tSta

tus(

) {

retu

rn s

tatu

s;} pu

blic

vo

id s

etS

tatu

s(M

anag

edE

ntity

Sta

tus

stat

us)

{th

is.s

tatu

s =

sta

tus;

} publ

ic S

trin

g ge

tGue

stS

tate

() {

retu

rn g

uest

Sta

te;

} publ

ic

void

set

Gue

stS

tate

(Str

ing

gues

tSta

te)

{th

is.g

uest

Sta

te =

gue

stS

tate

;} pu

blic

Str

ing

getG

uest

Ope

ratin

gSys

tem

() {

retu

rn g

uest

Ope

ratin

gSys

tem

;} pu

blic

vo

id s

etG

uest

Ope

ratin

gSys

tem

(Str

ing

gues

tOpe

ratin

gSys

tem

) {

this

.gue

stO

pera

tingS

yste

m =

gue

stO

pera

tingS

yste

m;

} publ

ic S

trin

g ge

tGue

stIp

() {

Apr

29,

10

14:5

3P

age

1/3

Virt

ualM

achi

neIn

fo.ja

vare

turn

gue

stIp

;} pu

blic

vo

id s

etG

uest

Ip(S

trin

g gu

estIp

) {

this

.gue

stIp

= g

uest

Ip;

} publ

ic S

trin

g ge

tHos

tNam

e()

{re

turn

hos

tNam

e;} pu

blic

vo

id s

etH

ostN

ame(

Str

ing

host

Nam

e) {

this

.hos

tNam

e =

hos

tNam

e;} pu

blic

lo

ng g

etG

uest

Mem

oryU

sage

() {

retu

rn g

uest

Mem

oryU

sage

;} pu

blic

vo

id s

etG

uest

Mem

oryU

sage

(in

t g

uest

Mem

oryU

sage

) {

this

.gue

stM

emor

yUsa

ge =

gue

stM

emor

yUsa

ge;

} publ

ic

int

get

Gue

stA

lloca

tedM

emor

y()

{re

turn

gue

stA

lloca

tedM

emor

y;} pu

blic

vo

id s

etG

uest

Allo

cate

dMem

ory(

int

gue

stA

lloca

tedM

emor

y) {

this

.gue

stA

lloca

tedM

emor

y =

gue

stA

lloca

tedM

emor

y;} pu

blic

vo

id s

etG

uest

Cpu

Usa

ge(

int

gue

stC

puU

sage

) {

this

.gue

stC

puU

sage

= g

uest

Cpu

Usa

ge;

} publ

ic

int

get

Gue

stC

puU

sage

() {

retu

rn g

uest

Cpu

Usa

ge;

} publ

ic

void

set

Allo

cate

dCpu

s(in

t a

lloca

tedC

pus)

{th

is.n

umbe

rOfA

lloca

tedC

pus

= a

lloca

tedC

pus;

} publ

ic

int

get

Allo

cate

dCpu

s()

{re

turn

num

berO

fAllo

cate

dCpu

s;} pu

blic

vo

id s

etH

ostM

emor

yUsa

ge(

int

hos

tMem

oryU

sage

) {

this

.hos

tMem

oryU

sage

= h

ostM

emor

yUsa

ge;

} publ

ic

int

get

Hos

tMem

oryU

sage

() {

retu

rn h

ostM

emor

yUsa

ge;

} publ

ic

void

set

Allo

cate

dCpu

(in

t a

lloca

tedC

pu)

{th

is.a

lloca

tedC

pu =

allo

cate

dCpu

;} pu

blic

in

t g

etA

lloca

tedC

pu()

{re

turn

allo

cate

dCpu

;} pu

blic

vo

id s

etP

rope

rtie

s(A

rray

List

<IC

usto

mP

rope

rty<

Str

ing>

> p

rope

rtie

s) {

this

.pro

pert

ies

= p

rope

rtie

s;} pu

blic

Arr

ayLi

st<

ICus

tom

Pro

pert

y<S

trin

g>>

get

Pro

pert

ies(

) {

retu

rn p

rope

rtie

s;} pu

blic

vo

id s

etN

etw

orkD

evic

ePro

pert

yMap

(Has

hMap

<N

etw

orkD

evic

ePro

pert

yKey

, IN

etw

orkD

evic

ePro

pert

y<S

trin

g>>

net

wor

kDev

iceP

rope

rtyM

ap)

{th

is.n

etw

orkD

evic

ePro

pert

yMap

= n

etw

orkD

evic

ePro

pert

yMap

;}

Apr

29,

10

14:5

3P

age

2/3

Virt

ualM

achi

neIn

fo.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

031

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/V

irtua

lMac

hine

Info

.java

Page 70: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

publ

ic H

ashM

ap<

Net

wor

kDev

iceP

rope

rtyK

ey, I

Net

wor

kDev

iceP

rope

rty<

Str

ing>

> g

etN

etw

orkD

evic

ePro

pert

yMap

() {

retu

rn n

etw

orkD

evic

ePro

pert

yMap

;} @

Ove

rrid

epu

blic

Str

ing

toS

trin

g()

{S

trin

g re

turn

Str

ing

=

null

;fo

r (

ICus

tom

Pro

pert

y<?>

pro

pert

y : p

rope

rtie

s) {

retu

rnS

trin

g+=

prop

erty

.toS

trin

g()+

"\n

";

//$N

ON

-NLS

-1$

} for

(IN

etw

orkD

evic

ePro

pert

y<?>

pro

pert

y : n

etw

orkD

evic

ePro

pert

yMap

.val

ues(

)) {

retu

rnS

trin

g+=

prop

erty

.toS

trin

g()+

"\n

";

//$N

ON

-NLS

-1$

} retu

rn r

etur

nStr

ing;

}}

Apr

29,

10

14:5

3P

age

3/3

Virt

ualM

achi

neIn

fo.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

032

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

fo/V

irtua

lMac

hine

Info

.java

Page 71: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

tern

al;

impo

rt o

rg.e

clip

se.o

sgi.u

til.N

LS;

publ

ic

clas

s

Mes

sage

s

exte

nds

NLS

{

pr

ivat

e

stat

ic

final

Str

ing

BU

ND

LE_N

AM

E =

"co

m.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

inte

rna

l.mes

sage

s ";

//$N

ON

-NLS

-1$

stat

ic {

//

initi

aliz

e re

sour

ce b

undl

e

N

LS.in

itial

izeM

essa

ges(

BU

ND

LE_N

AM

E, M

essa

ges.

clas

s);

}

publ

ic

stat

ic S

trin

g V

MW

AR

E_P

RE

FE

RE

NC

E_P

AG

E_U

SE

RN

AM

E;

publ

ic

stat

ic S

trin

g V

MW

AR

E_P

RE

FE

RE

NC

E_P

AG

E_P

AS

SW

OR

D;

publ

ic

stat

ic S

trin

g V

MW

AR

E_P

RE

FE

RE

NC

E_P

AG

E_S

ER

VE

R_P

AT

H;

publ

ic

stat

ic S

trin

g V

MW

AR

E_P

RE

FE

RE

NC

E_C

ON

FIR

M_B

UT

TO

N;

publ

ic

stat

ic S

trin

g V

MW

AR

E_P

RE

FE

RE

NC

E_U

SE

SS

L;pu

blic

st

atic

Str

ing

VM

WA

RE

_PR

EF

ER

EN

CE

_TIT

LE;

publ

ic

stat

ic S

trin

g E

NA

BLE

_VM

WA

RE

;

publ

ic

stat

ic S

trin

g M

EM

OR

Y_P

RO

PE

RT

Y_T

EX

T;

}

Apr

29,

10

14:5

3P

age

1/1

Mes

sage

s.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

033

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/in

tern

al/M

essa

ges.

java

Page 72: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.ob

ject

mod

el;

impo

rt ja

va.u

til.A

rray

List

;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

VM

War

eCon

nect

ion;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

VM

anag

edO

bjec

ts;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.Virt

ualC

lust

erIn

fo;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

prop

ertie

s.P

rope

rtyF

ilter

Util

ities

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.pr

oper

ties.

Pro

pert

ySpe

cifie

r;im

port

com

.vm

war

e.vi

m25

.Arr

ayO

fMan

aged

Obj

ectR

efer

ence

;im

port

com

.vm

war

e.vi

m25

.Com

pute

Res

ourc

eSum

mar

y;im

port

com

.vm

war

e.vi

m25

.Dyn

amic

Pro

pert

y;im

port

com

.vm

war

e.vi

m25

.Man

aged

Obj

ectR

efer

ence

;im

port

com

.vm

war

e.vi

m25

.Obj

ectC

onte

nt;

/**

* A

Cla

ss to

rep

rese

nt d

ata

gath

ered

abo

ut V

MW

are

clus

ters

. *

@au

thor

man

iels

e * *

/pu

blic

cl

ass

V

Clu

ster

{pr

ivat

e A

rray

List

<V

Hos

tSys

tem

> h

ostL

ist =

ne

w A

rray

List

<V

Hos

tSys

tem

>()

;pr

ivat

e V

irtua

lClu

ster

Info

clu

ster

Info

=

new

Virt

ualC

lust

erIn

fo()

;pr

ivat

e S

trin

g vi

rtua

lClu

ster

Nam

e;/*

* *

*

@pa

ram

nam

e -

Spe

cifie

s w

hich

clu

ster

to g

athe

r in

form

atio

n ab

out.

* @

para

m s

peci

fier

- S

peci

fies

whi

ch p

rope

rtie

s to

fetc

h fr

om th

e V

-Cen

ter.

*/

publ

ic V

Clu

ster

(Str

ing

nam

e, P

rope

rtyS

peci

fier.

.. sp

ecifi

er)

{tr

y {

setV

irtua

lClu

ster

Nam

e(na

me)

;M

anag

edO

bjec

tRef

eren

ce c

lust

erR

efer

ence

= V

MW

areC

onne

cti

on.g

etU

til()

.get

Dec

ende

ntM

oRef

(nu

ll, V

Man

aged

Obj

ects

.Clu

ster

.toS

trin

g(),

nam

e);

Obj

ectC

onte

nt[]

cont

ent =

VM

War

eCon

nect

ion.

getU

til()

.get

Obj

ectP

rope

rtie

s(nu

ll, c

lust

erR

efer

ence

, Pro

pert

yFilt

erU

tiliti

es.g

etF

ilter

(Pro

pert

ySpe

cifie

r.C

LUS

TE

R))

;if

(con

tent

!=

null

)co

nstr

uct(

cont

ent)

;}

catc

h (

Exc

eptio

n e)

{e.

prin

tSta

ckT

race

();

} host

List

.add

All(

findH

ostS

yste

ms(

));

} priv

ate

vo

id c

onst

ruct

(Obj

ectC

onte

nt[]

cont

ent)

{fo

r (

Obj

ectC

onte

nt c

onte

nts

: con

tent

) {

Dyn

amic

Pro

pert

y[] p

ropS

et =

con

tent

s.ge

tPro

pSet

();

for

(D

ynam

icP

rope

rty

prop

erty

: pr

opS

et)

{O

bjec

t val

ue =

pro

pert

y.ge

tVal

();

Str

ing

nam

e =

pro

pert

y.ge

tNam

e();

if(v

alue

!=

null

) {

if(n

ame.

equa

lsIg

nore

Cas

e("

sum

mar

y"))

{ge

tClu

ster

Info

().s

etS

umm

ary(

(Com

pute

Res

ourc

eSum

mar

y)va

lue)

;}

else

if

(nam

e.eq

uals

Igno

reC

ase(

"ho

st"))

{

getC

lust

erIn

fo()

.set

Hos

t((A

rray

OfM

anag

edO

bjec

tRef

eren

ce)v

alue

);}

}

Apr

29,

10

14:5

3P

age

1/2

VC

lust

er.ja

va}

}} /*

* *

Sin

ce w

e al

read

y ob

tain

ed r

efer

ence

s to

hos

t-sy

stem

s, u

se th

ese

refe

ren

ces

to c

onst

ruct

vhs

's.

*/

publ

ic A

rray

List

<V

Hos

tSys

tem

> fi

ndH

ostS

yste

ms(

) {

Arr

ayLi

st<

VH

ostS

yste

m>

hos

ts =

ne

w A

rray

List

<V

Hos

tSys

tem

>()

;M

anag

edO

bjec

tRef

eren

ce[]

man

aged

Obj

ectR

efer

ence

= g

etC

lust

erIn

fo()

.get

Hos

t().

getM

anag

edO

bjec

tRef

eren

ce()

;fo

r (

Man

aged

Obj

ectR

efer

ence

ref

: m

anag

edO

bjec

tRef

eren

ce)

{tr

y {

//Use

the

nam

e to

con

stru

ct a

new

vhs

obj

ect.

Str

ing

nam

e =

(S

trin

g)V

MW

areC

onne

ctio

n.ge

tUtil

().g

etD

ynam

icP

rope

rty(

ref,

"na

me")

; //$

NO

N-N

LS-1

$V

Hos

tSys

tem

vhs

=

new

VH

ostS

yste

m(n

ame)

;ho

sts.

add(

vhs)

;}

catc

h (

Exc

eptio

n e)

{e.

prin

tSta

ckT

race

();

}} re

turn

hos

ts;

} publ

ic

void

set

Clu

ster

Info

(Virt

ualC

lust

erIn

fo c

lust

erIn

fo)

{th

is.c

lust

erIn

fo =

clu

ster

Info

;} pu

blic

Virt

ualC

lust

erIn

fo g

etC

lust

erIn

fo()

{re

turn

clu

ster

Info

;} pu

blic

vo

id s

etV

irtua

lClu

ster

Nam

e(S

trin

g vi

rtua

lClu

ster

Nam

e) {

this

.virt

ualC

lust

erN

ame

= v

irtua

lClu

ster

Nam

e;} pu

blic

Str

ing

getV

irtua

lClu

ster

Nam

e()

{re

turn

virt

ualC

lust

erN

ame;

} publ

ic

void

set

Hos

tLis

t(A

rray

List

<V

Hos

tSys

tem

> h

ostL

ist)

{th

is.h

ostL

ist =

hos

tLis

t;} pu

blic

Arr

ayLi

st<

VH

ostS

yste

m>

get

Hos

tLis

t()

{re

turn

hos

tLis

t;}

}

Apr

29,

10

14:5

3P

age

2/2

VC

lust

er.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

034

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/ob

ject

mod

el/V

Clu

ster

.java

Page 73: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.ob

ject

mod

el;

impo

rt ja

va.u

til.A

rray

List

;im

port

java

.util

.Has

hMap

;

impo

rt c

om.a

pc.c

onfig

.net

wor

kdev

icep

rope

rty.

Net

wor

kDev

iceP

rope

rtyK

ey;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.ICus

tom

Pro

pert

y;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.IN

etw

orkD

evic

ePro

pert

y;

publ

ic

inte

rfac

e

VD

ataO

bjec

t {

/**

*

* @

retu

rn a

list

of c

usto

m p

rope

rtie

s. T

he lo

okup

key

is a

lso

defin

ed i

n th

is in

terf

ace.

*/

publ

ic A

rray

List

<IC

usto

mP

rope

rty<

Str

ing>

> g

etP

rope

rtie

s();

/**

* @

retu

rn a

map

con

tain

ing

the

map

ping

for

netw

ork

devi

ce p

rope

rtie

s *

/pu

blic

Has

hMap

<N

etw

orkD

evic

ePro

pert

yKey

, IN

etw

orkD

evic

ePro

pert

y<S

trin

g>>

get

Net

wor

kDev

iceP

rope

rtyM

ap()

;/*

* *

@re

turn

the

look

upke

y va

lue,

mor

e of

ten

than

not

this

is th

e na

me/

hos

tnam

e/ip

adre

ss o

f the

obj

ect.

*/

publ

ic S

trin

g ge

tLoo

kupK

eyV

alue

();

/**

*

*/

publ

ic

void

set

Look

upK

eyV

alue

(Str

ing

valu

e);

}

Apr

29,

10

14:5

3P

age

1/1

VD

ataO

bjec

t.jav

a

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

035

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/ob

ject

mod

el/V

Dat

aObj

ect.j

ava

Page 74: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.ob

ject

mod

el;

impo

rt ja

va.u

til.A

rray

List

;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

VM

War

eCon

nect

ion;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

VM

anag

edO

bjec

ts;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.Virt

ualD

atac

ente

rInf

o;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.pr

oper

ties.

Pro

pert

yFilt

erU

tiliti

es;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

prop

ertie

s.P

rope

rtyS

peci

fier;

impo

rt c

om.v

mw

are.

vim

25.D

ynam

icP

rope

rty;

impo

rt c

om.v

mw

are.

vim

25.M

anag

edE

ntity

Sta

tus;

impo

rt c

om.v

mw

are.

vim

25.M

anag

edO

bjec

tRef

eren

ce;

impo

rt c

om.v

mw

are.

vim

25.O

bjec

tCon

tent

;/*

* *

*

@au

thor

man

iels

e * *

/pu

blic

cl

ass

V

Dat

acen

ter

{pr

ivat

e M

anag

edO

bjec

tRef

eren

ce m

oref

;pr

ivat

e A

rray

List

<V

Hos

tSys

tem

> v

irtua

lHos

tLis

t =

new

Arr

ayLi

st<

VH

ostS

yst

em>

();

priv

ate

Virt

ualD

atac

ente

rInf

o in

fo;

priv

ate

fin

al S

trin

g da

tace

nter

Nam

e;/*

* *

*

@pa

ram

dat

acen

terN

ame

* @

para

m s

peci

fier

* @

thro

ws

Exc

eptio

n *

/pu

blic

VD

atac

ente

r (S

trin

g da

tace

nter

Nam

e, P

rope

rtyS

peci

fier.

.. sp

ecifi

er)

th

row

s E

xcep

tion

{th

is.d

atac

ente

rNam

e =

dat

acen

terN

ame;

this

.info

=

new

Virt

ualD

atac

ente

rInf

o();

this

.mor

ef =

VM

War

eCon

nect

ion.

getU

til()

.get

Dec

ende

ntM

oRef

(nu

ll,

VM

anag

edO

bjec

ts.D

atac

ente

r.to

Str

ing(

), d

atac

ente

rNam

e);

Obj

ectC

onte

nt[]

obje

ctP

rope

rtie

s =

VM

War

eCon

nect

ion.

getU

til()

.ge

tObj

ectP

rope

rtie

s(nu

ll, m

oref

, Pro

pert

yFilt

erU

tiliti

es.g

etF

ilter

(Pro

pert

ySpe

cifi

er.G

EN

ER

AL,

Pro

pert

ySpe

cifie

r.D

AT

AC

EN

TE

R))

;if

(obj

ectP

rope

rtie

s !=

nu

ll)

{co

nstr

uct(

obje

ctP

rope

rtie

s);

} findV

irtua

lHos

tSys

tem

s(sp

ecifi

er);

} publ

ic

void

con

stru

ct(O

bjec

tCon

tent

[] co

nten

ts)

{fo

r (

Obj

ectC

onte

nt o

bjec

tCon

tent

: co

nten

ts)

{D

ynam

icP

rope

rty[

] pro

pSet

= o

bjec

tCon

tent

.get

Pro

pSet

();

for

(D

ynam

icP

rope

rty

dyna

mic

Pro

pert

y : p

ropS

et)

{O

bjec

t val

= d

ynam

icP

rope

rty.

getV

al()

;if

(dyn

amic

Pro

pert

y.ge

tNam

e().

equa

ls("

conf

igS

tatu

s"))

{ //$

NO

N-N

LS-1

$in

fo.s

etS

tatu

s((M

anag

edE

ntity

Sta

tus)

val)

;}

else

if

(dy

nam

icP

rope

rty.

getN

ame(

).eq

uals

("na

me "

)) {

//$

NO

N-N

LS-1

$in

fo.s

etN

ame(

val.t

oStr

ing(

));

}}

}}

Apr

29,

10

14:5

3P

age

1/2

VD

atac

ente

r.ja

va@

Sup

pres

sWar

ning

s("

unch

ecke

d")pr

ivat

e

void

find

Virt

ualH

ostS

yste

ms(

Pro

pert

ySpe

cifie

r...

spec

ifier

) {

try

{A

rray

List

<M

anag

edO

bjec

tRef

eren

ce>

dec

ende

ntM

oRef

s =

VM

Wa

reC

onne

ctio

n.ge

tUtil

().g

etD

ecen

dent

MoR

efs(

mor

ef, V

Man

aged

Obj

ects

.Hos

tSys

tem

.toS

trin

g())

;fo

r (

Man

aged

Obj

ectR

efer

ence

ref

: de

cend

entM

oRef

s) {

Str

ing

nam

e =

(S

trin

g)V

MW

areC

onne

ctio

n.ge

tUtil

().g

etD

ynam

icP

rope

rty(

ref,

"na

me")

; //$

NO

N-N

LS-1

$V

Hos

tSys

tem

vh

=

new

VH

ostS

yste

m(n

ame,

spec

ifier

);

virt

ualH

ostL

ist.a

dd(v

h);

}}

catc

h (

Exc

eptio

n e)

{e.

prin

tSta

ckT

race

();

}} pu

blic

vo

id s

etV

irtua

lHos

tLis

t(A

rray

List

<V

Hos

tSys

tem

> v

irtua

lHos

tLis

t) {

this

.virt

ualH

ostL

ist =

virt

ualH

ostL

ist;

} publ

ic A

rray

List

<V

Hos

tSys

tem

> g

etV

irtua

lHos

tLis

t()

{re

turn

virt

ualH

ostL

ist;

} publ

ic S

trin

g ge

tDat

acen

terN

ame(

) {

retu

rn d

atac

ente

rNam

e;} @

Ove

rrid

epu

blic

Str

ing

toS

trin

g()

{re

turn

Str

ing.

form

at("

Dat

acen

ter

nam

e: %

s st

atus

: %s

",in

fo.g

etN

ame(

),in

fo.

getS

tatu

s())

; //$

NO

N-N

LS-1

$}

}

Apr

29,

10

14:5

3P

age

2/2

VD

atac

ente

r.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

036

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/ob

ject

mod

el/V

Dat

acen

ter.

java

Page 75: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.ob

ject

mod

el;

publ

ic

clas

s

VF

olde

r {

publ

ic V

Fol

der(

) {}

}

Apr

29,

10

14:5

3P

age

1/1

VF

olde

r.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

037

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/ob

ject

mod

el/V

Fol

der.

java

Page 76: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.ob

ject

mod

el;

impo

rt ja

va.u

til.A

rray

List

;im

port

java

.util

.Col

lect

ion;

impo

rt ja

va.u

til.H

ashM

ap;

impo

rt c

om.a

pc.c

onfig

.net

wor

kdev

icep

rope

rty.

Net

wor

kDev

iceP

rope

rtyK

ey;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

VM

War

eCon

nect

ion;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

VM

anag

edO

bjec

ts;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.CP

ULo

adIn

fo;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.Gen

eral

Sys

tem

Info

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.IC

usto

mP

rope

rty;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.INet

wor

kDev

iceP

rope

rty;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.Inva

lidC

usto

mP

rope

rtyV

alue

Exc

eptio

n;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.M

emor

yUsa

geIn

fo;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.Ope

ratin

gSys

tem

Info

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.P

roce

ssor

Info

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.S

tatu

sInf

o;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.S

tora

geIn

fo;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.Virt

ualH

ostS

yste

mIn

fo;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

prop

ertie

s.P

rope

rtyF

ilter

Util

ities

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.pr

oper

ties.

Pro

pert

ySpe

cifie

r;im

port

com

.vm

war

e.vi

m25

.Arr

ayO

fMan

aged

Obj

ectR

efer

ence

;im

port

com

.vm

war

e.vi

m25

.Dat

asto

reS

umm

ary;

impo

rt c

om.v

mw

are.

vim

25.D

ynam

icP

rope

rty;

impo

rt c

om.v

mw

are.

vim

25.H

ostS

yste

mIn

fo;

impo

rt c

om.v

mw

are.

vim

25.M

anag

edE

ntity

Sta

tus;

impo

rt c

om.v

mw

are.

vim

25.M

anag

edO

bjec

tRef

eren

ce;

impo

rt c

om.v

mw

are.

vim

25.O

bjec

tCon

tent

;

publ

ic

clas

s

VH

ostS

yste

m

impl

emen

ts V

Dat

aObj

ect{

priv

ate

Arr

ayLi

st<

VM

achi

ne>

hos

tVm

s;pr

ivat

e V

irtua

lHos

tSys

tem

Info

virt

ualH

ostS

yste

mIn

fo;

priv

ate

Man

aged

Obj

ectR

efer

ence

mor

ef;

priv

ate

Str

ing

host

Nam

e;/*

* *

*

@pa

ram

hos

tNam

e *

@pa

ram

spe

cifie

r -

List

whi

ch p

rope

rtie

s w

e ar

e in

tere

sted

in, u

se th

e E

num

Pro

pery

Spe

cifie

r to

spe

cify

* p

rope

rtie

s *

/pu

blic

VH

ostS

yste

m(S

trin

g ho

stN

ame,

Pro

pert

ySpe

cifie

r...

spec

ifier

) {

this

.hos

tNam

e =

hos

tNam

e;se

tVirt

ualH

ostS

yste

mIn

fo(

new

Virt

ualH

ostS

yste

mIn

fo()

);

host

Vm

s =

ne

w A

rray

List

<V

Mac

hine

>()

;tr

y {

mor

ef =

VM

War

eCon

nect

ion.

getU

til()

.get

Dec

ende

ntM

oRef

(nu

ll

, VM

anag

edO

bjec

ts.H

ostS

yste

m.to

Str

ing(

), h

ostN

ame)

;O

bjec

tCon

tent

[] co

nten

ts =

nu

ll;

if(s

peci

fier

==

nu

ll ||

spe

cifie

r.le

ngth

==

0)

{co

nten

ts =

VM

War

eCon

nect

ion.

getU

til()

.get

Obj

ectP

rope

rtie

s(nu

ll, m

oref

,P

rope

rtyF

ilter

Util

ities

.get

Filt

er(

Pro

pert

ySpe

cifie

r.H

OS

T_S

YS

TE

M,

Pro

pert

ySpe

cifie

r.H

OS

T_S

YS

TE

M_D

ISK

,P

rope

rtyS

peci

fie

Apr

29,

10

14:5

3P

age

1/5

VH

ostS

yste

m.ja

var.

HO

ST

_SY

ST

EM

_CP

U,

Pro

pert

ySpe

cifie

r.H

OS

T_S

YS

TE

M_M

EM

OR

Y,

Pro

pert

ySpe

cifie

r.H

OS

T_S

YS

TE

M_S

TA

TU

S,

Pro

pert

ySpe

cifie

r.G

EN

ER

AL)

);}

else

{co

nten

ts =

VM

War

eCon

nect

ion.

getU

til()

.get

Obj

ectP

rope

rtie

s(nu

ll, m

oref

,Pro

pert

yFilt

erU

tiliti

es.g

etF

ilter

(spe

cifie

r));

} cons

truc

t(co

nten

ts);

} ca

tch

(E

xcep

tion

e) {

e.pr

intS

tack

Tra

ce()

;} fin

dVirt

ualM

achi

nes(

spec

ifier

);} /*

* *

*

@pa

ram

con

tent

s *

/pr

ivat

e

void

con

stru

ct(O

bjec

tCon

tent

[] co

nten

ts)

{if

(con

tent

s !=

nu

ll)

{C

PU

Load

Info

cpu

Load

;G

ener

alS

yste

mIn

fo g

ener

alIn

fo;

Mem

oryU

sage

Info

mem

oryU

sage

Info

;O

pera

tingS

yste

mIn

fo o

pera

tingS

yste

mIn

fo;

Pro

cess

orIn

fo p

roce

ssor

Info

;S

tora

geIn

fo s

tora

geIn

fo;

Sta

tusI

nfo

stat

usIn

fo;

for

(O

bjec

tCon

tent

con

tent

: co

nten

ts)

{D

ynam

icP

rope

rty[

] pro

pert

es =

con

tent

.get

Pro

pSet

();

for

(D

ynam

icP

rope

rty

prop

erty

: pr

oper

tes)

{O

bjec

t val

ue =

pro

pert

y.ge

tVal

();

Str

ing

nam

e =

pro

pert

y.ge

tNam

e();

if(v

alue

!=

null

) {

if(n

ame.

equa

lsIg

nore

Cas

e("

sum

mar

y.ov

eral

lSta

tus ")

) {

virt

ualH

ostS

yste

mIn

fo.s

etS

tatu

s((M

anag

edE

ntity

Sta

tus)

valu

e);

} el

se

if(n

ame.

equa

lsIg

nore

Cas

e("

sum

mar

y.qu

ickS

tats

.ove

rallC

puU

sage"))

{vi

rtua

lHos

tSys

tem

Info

.se

tOve

rallC

puU

sage

((In

tege

r)va

lue)

;}

else

if

(nam

e.eq

uals

Igno

reC

ase(

"su

mm

ary.

quic

kSta

ts.o

vera

llMem

oryU

sage"))

{vi

rtua

lHos

tSys

tem

Info

.se

tOve

rallM

emor

yUsa

ge((

Inte

ger)

valu

e);

} el

se

if(n

ame.

equa

lsIg

nore

Cas

e("

sum

mar

y.ha

rdw

are.

mem

oryS

ize

"))

{vi

rtua

lHos

tSys

tem

Info

.se

tMem

oryC

apac

ity((

Long

)val

ue);

} el

se

if(n

ame.

equa

lsIg

nore

Cas

e("

sum

mar

y.ha

rdw

are.

cpuM

odel"))

{vi

rtua

lHos

tSys

tem

Info

.se

tCpu

Mod

el(v

alue

.toS

trin

g())

;}

else

if

(nam

e.eq

uals

Igno

reC

ase(

"su

mm

ary.

hard

war

e.cp

uMhz")

) {

virt

ualH

ostS

yste

mIn

fo.s

etC

puM

hz((

Inte

ger)

valu

e);

Apr

29,

10

14:5

3P

age

2/5

VH

ostS

yste

m.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

038

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/ob

ject

mod

el/V

Hos

tSys

tem

.java

Page 77: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

} el

se

if(n

ame.

equa

lsIg

nore

Cas

e("

sum

mar

y.ha

rdw

are.

num

Cpu

Cor

es"))

{vi

rtua

lHos

tSys

tem

Info

.se

tNum

berO

fCpu

Cor

es((

Sho

rt)v

alue

);}

else

if

(nam

e.eq

uals

Igno

reC

ase(

"su

mm

ary.

hard

war

e.nu

mC

puP

kgs

"))

{vi

rtua

lHos

tSys

tem

Info

.se

tNum

berO

fPhy

sica

lCpu

Pac

kage

s((S

hort

)val

ue);

} el

se

if(n

ame.

equa

lsIg

nore

Cas

e("

nam

e"))

{vi

rtua

lHos

tSys

tem

Info

.se

tNam

e(va

lue.

toS

trin

g())

;}

else

if

(nam

e.eq

uals

Igno

reC

ase(

"ha

rdw

are.

syst

emIn

fo"))

{vi

rtua

lHos

tSys

tem

Info

.se

tInfo

((H

ostS

yste

mIn

fo)v

alue

);}

else

if

(nam

e.eq

uals

Igno

reC

ase(

"da

tast

ore")

) {

Arr

ayO

fMan

aged

Obj

ectR

efe

renc

e m

oref

s =

(A

rray

OfM

anag

edO

bjec

tRef

eren

ce)v

alue

;lo

ng s

umF

reeS

pace

= 0

;lo

ng s

umT

otal

Spa

ce =

0;

for

(M

anag

edO

bjec

tRef

ere

nce

refe

renc

e : m

oref

s.ge

tMan

aged

Obj

ectR

efer

ence

())

{tr

y {

Dat

asto

reS

umm

ary

stor

age

= (

Dat

asto

reS

umm

ary)

VM

War

eCon

nect

ion.

getU

til()

.get

Dyn

amic

Pro

per

ty(r

efer

ence

, "su

mm

ary")

;su

mF

reeS

pace

+=

stor

age.

getF

reeS

pace

();

sum

Tot

alS

pace

+=

stor

age.

getC

apac

ity()

;}

catc

h (

Exc

epti

on e

) {

e.pr

intS

tack

Tra

ce()

;}

} virt

ualH

ostS

yste

mIn

fo.s

etT

otal

Dat

aSto

reC

apac

ity(s

umT

otal

Spa

ce);

virt

ualH

ostS

yste

mIn

fo.s

etF

reeD

ataS

tore

Cap

acity

(sum

Fre

eSpa

ce);

}}

}} tr

y {

mem

oryU

sage

Info

=

new

Mem

oryU

sage

Info

(virt

ualH

ostS

yste

mIn

fo.g

etM

emor

yCap

acity

(), v

irtua

lHos

tSys

tem

Info

.get

Ove

rallM

emor

yUsa

ge()

);cp

uLoa

d =

ne

w C

PU

Load

Info

(virt

ualH

ostS

yste

mIn

fo.

getO

vera

llCpu

Usa

ge()

, virt

ualH

ostS

yste

mIn

fo.g

etN

umbe

rOfC

puC

ores

()*v

irtua

lHos

tSys

tem

Info

.get

Cpu

Mhz

());

gene

ralIn

fo =

ne

w G

ener

alS

yste

mIn

fo(v

irtua

lHos

tSys

tem

Info

.get

Info

().g

etV

endo

r(),

virt

ualH

ostS

yste

mIn

fo.g

etIn

fo()

.get

Mod

el()

);op

erat

ingS

yste

mIn

fo =

ne

w O

pera

tingS

yste

mIn

fo("

Virt

ual H

ost S

yste

m", "

4.0"

);

//$N

ON

-NLS

-1$

//$N

ON

-NLS

-2$

proc

esso

rInf

o =

ne

w P

roce

ssor

Info

(virt

ualH

ostS

yste

mIn

fo.g

etC

puM

odel

(),

true

,virt

ualH

ostS

yste

mIn

fo.g

etN

umbe

rOfC

puC

ores

(),v

irtua

lHo

stS

yste

mIn

fo.g

etC

puM

hz()

);st

orag

eInf

o =

ne

w S

tora

geIn

fo(v

irtua

lHos

tSys

tem

Inf

o.ge

tFre

eDat

aSto

reC

apac

ity()

, virt

ualH

ostS

yste

mIn

fo.g

etT

otal

Dat

aSto

reC

apac

ity(

Apr

29,

10

14:5

3P

age

3/5

VH

ostS

yste

m.ja

va))

;st

atus

Info

=

new

Sta

tusI

nfo(

virt

ualH

ostS

yste

mIn

fo.

getS

tatu

s().

getV

alue

());

virt

ualH

ostS

yste

mIn

fo.g

etP

rope

rtie

s().

add(

cpuL

oad)

;vi

rtua

lHos

tSys

tem

Info

.get

Pro

pert

ies(

).ad

d(st

orag

eInf

o);

virt

ualH

ostS

yste

mIn

fo.g

etP

rope

rtie

s().

add(

mem

ory

Usa

geIn

fo);

virt

ualH

ostS

yste

mIn

fo.g

etP

rope

rtie

s().

add(

gene

ralIn

fo);

virt

ualH

ostS

yste

mIn

fo.g

etP

rope

rtie

s().

add(

oper

atin

gSys

tem

Info

);vi

rtua

lHos

tSys

tem

Info

.get

Pro

pert

ies(

).ad

d(st

atus

Info

);vi

rtua

lHos

tSys

tem

Info

.get

Pro

pert

ies(

).ad

d(pr

oces

sorI

nfo)

;

virt

ualH

ostS

yste

mIn

fo.g

etN

etw

orkD

evic

ePro

pert

yMa

p().

put(

cpuL

oad.

getN

etw

orkD

evic

eKey

(), c

puLo

ad);

virt

ualH

ostS

yste

mIn

fo.g

etN

etw

orkD

evic

ePro

pert

yMa

p().

put(

stor

ageI

nfo.

getN

etw

orkD

evic

eKey

(), s

tora

geIn

fo);

virt

ualH

ostS

yste

mIn

fo.g

etN

etw

orkD

evic

ePro

pert

yMa

p().

put(

mem

oryU

sage

Info

.get

Net

wor

kDev

iceK

ey()

, mem

oryU

sage

Info

);vi

rtua

lHos

tSys

tem

Info

.get

Net

wor

kDev

iceP

rope

rtyM

ap(

).pu

t(op

erat

ingS

yste

mIn

fo.g

etN

etw

orkD

evic

eKey

(), o

pera

tingS

yste

mIn

fo);

} ca

tch

(In

valid

Cus

tom

Pro

pert

yVal

ueE

xcep

tion

e) {

e.pr

intS

tack

Tra

ce()

;}

}} pu

blic

vo

id a

ddV

irtua

lMac

hine

(VM

achi

ne v

m)

{ho

stV

ms.

add(

vm);

} publ

ic

void

rem

oveV

irtua

lMac

hine

(VM

achi

ne v

m)

{ho

stV

ms.

rem

ove(

vm);

} publ

ic

void

set

Virt

ualH

ostS

yste

mIn

fo(V

irtua

lHos

tSys

tem

Info

virt

ualH

ostS

yst

emIn

fo)

{th

is.v

irtua

lHos

tSys

tem

Info

= v

irtua

lHos

tSys

tem

Info

;} pu

blic

Virt

ualH

ostS

yste

mIn

fo g

etV

irtua

lHos

tSys

tem

Info

() {

retu

rn v

irtua

lHos

tSys

tem

Info

;} /*

* *

Fin

d vi

rtua

l mac

hine

s. G

et d

esce

ndan

ts o

f the

roo

t, (w

hich

is a

hos

t-sy

stem

). *

/pu

blic

vo

id fi

ndV

irtua

lMac

hine

s(P

rope

rtyS

peci

fier.

..pro

pert

ySpe

cifie

rs)

{tr

y {

Arr

ayLi

st<

Man

aged

Obj

ectR

efer

ence

> d

ecen

dent

MoR

efs

= V

MW

are

Con

nect

ion.

getU

til()

.get

Dec

ende

ntM

oRef

s(m

oref

, VM

anag

edO

bjec

ts.V

irtua

lMac

hine

.to

Str

ing(

));

if(d

ecen

dent

MoR

efs

!=

null

) {

Apr

29,

10

14:5

3P

age

4/5

VH

ostS

yste

m.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

039

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/ob

ject

mod

el/V

Hos

tSys

tem

.java

Page 78: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

for

(M

anag

edO

bjec

tRef

eren

ce r

ef :

dece

nden

tMoR

efs)

{S

trin

g na

me

= V

MW

areC

onne

ctio

n.ge

tUtil

().g

etD

ynam

icP

rope

rty(

ref,

"na

me")

.toS

trin

g();

//$

NO

N-N

LS-1

$V

Mac

hine

vm

=

new

VM

achi

ne(n

ame,

prop

erty

Spe

cifie

rs);

addV

irtua

lMac

hine

(vm

);}

}}

catc

h (

Exc

eptio

n e)

{e.

prin

tSta

ckT

race

();

}} pu

blic

Arr

ayLi

st<

VM

achi

ne>

get

Hos

tVm

s()

{re

turn

hos

tVm

s;} pu

blic

vo

id s

etH

ostV

ms(

Arr

ayLi

st<

VM

achi

ne>

hos

tVm

s) {

this

.hos

tVm

s =

hos

tVm

s;} @

Ove

rrid

epu

blic

Str

ing

toS

trin

g()

{S

trin

g in

fo =

Str

ing.

form

at("

%s\

n", h

ostN

ame)

; //$

NO

N-N

LS-1

$fo

r (

ICus

tom

Pro

pert

y<S

trin

g> p

rope

rty

: virt

ualH

ostS

yste

mIn

fo.g

etP

rope

rtie

s())

{in

fo+

=S

trin

g.fo

rmat

("%

s\n"

, pro

pert

y);

//$N

ON

-NLS

-1$

} Col

lect

ion<

INet

wor

kDev

iceP

rope

rty<

Str

ing>

> v

alue

s =

virt

ualH

ostS

yste

mIn

fo.g

etN

etw

orkD

evic

ePro

pert

yMap

().v

alue

s();

for

(IN

etw

orkD

evic

ePro

pert

y<S

trin

g> iC

usto

mP

rope

rty

: val

ues)

{in

fo+

=S

trin

g.fo

rmat

("%

s\n"

, iC

usto

mP

rope

rty)

; //$

NO

N-N

LS-1

$} re

turn

info

;} @

Ove

rrid

epu

blic

Str

ing

getL

ooku

pKey

Val

ue()

{re

turn

hos

tNam

e;} @

Ove

rrid

epu

blic

Has

hMap

<N

etw

orkD

evic

ePro

pert

yKey

, IN

etw

orkD

evic

ePro

pert

y<S

trin

g>>

get

Net

wor

kDev

iceP

rope

rtyM

ap()

{re

turn

virt

ualH

ostS

yste

mIn

fo.g

etN

etw

orkD

evic

ePro

pert

yMap

();

} @O

verr

ide

publ

ic A

rray

List

<IC

usto

mP

rope

rty<

Str

ing>

> g

etP

rope

rtie

s()

{re

turn

virt

ualH

ostS

yste

mIn

fo.g

etP

rope

rtie

s();

} @O

verr

ide

publ

ic

void

set

Look

upK

eyV

alue

(Str

ing

val)

{th

row

ne

w Il

lega

lAcc

essE

rror

("N

ot a

llow

ed to

set

this")

; //$

NO

N-N

LS-1

$}

}

Apr

29,

10

14:5

3P

age

5/5

VH

ostS

yste

m.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

040

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/ob

ject

mod

el/V

Hos

tSys

tem

.java

Page 79: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.ob

ject

mod

el;

impo

rt ja

va.u

til.A

rray

List

;im

port

java

.util

.Has

hMap

;

impo

rt c

om.a

pc.c

onfig

.net

wor

kdev

icep

rope

rty.

Net

wor

kDev

iceP

rope

rtyK

ey;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

VM

War

eCon

nect

ion;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

VM

anag

edO

bjec

ts;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.CP

ULo

adIn

fo;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.Gen

eral

Sys

tem

Info

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.IC

usto

mP

rope

rty;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.INet

wor

kDev

iceP

rope

rty;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.Inva

lidC

usto

mP

rope

rtyV

alue

Exc

eptio

n;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.M

emor

yUsa

geIn

fo;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.Ope

ratin

gSys

tem

Info

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.P

roce

ssor

Info

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.S

tatu

sInf

o;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.S

tora

geIn

fo;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.Virt

ualM

achi

neIn

fo;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

prop

ertie

s.P

rope

rtyF

ilter

Util

ities

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.pr

oper

ties.

Pro

pert

ySpe

cifie

r;im

port

com

.vm

war

e.vi

m25

.Dyn

amic

Pro

pert

y;im

port

com

.vm

war

e.vi

m25

.Man

aged

Ent

ityS

tatu

s;im

port

com

.vm

war

e.vi

m25

.Man

aged

Obj

ectR

efer

ence

;im

port

com

.vm

war

e.vi

m25

.Obj

ectC

onte

nt;

/**

*

* @

auth

or m

anie

lse

*

*/

publ

ic

clas

s

VM

achi

ne

impl

emen

ts V

Dat

aObj

ect{

priv

ate

Virt

ualM

achi

neIn

fo in

fo =

nu

ll;

priv

ate

Man

aged

Obj

ectR

efer

ence

vm

=

null

;/*

* *

*

/pu

blic

VM

achi

ne()

{se

tInfo

(ne

w V

irtua

lMac

hine

Info

());

} /**

*

* @

para

m n

ame

* @

para

m s

peci

fier

*/

publ

ic V

Mac

hine

(Str

ing

nam

e, P

rope

rtyS

peci

fier.

.. sp

ecifi

er)

{se

tInfo

(ne

w V

irtua

lMac

hine

Info

());

try

{/*

* *

Get

all

mod

el o

bjec

t ref

eren

ces,

und

er th

is v

irtua

l mod

el, i

nclu

ding

the

vm.

* If

no

prop

erty

is s

peci

fied,

get

eve

ry in

form

atio

n re

late

d to

a v

irtua

l mac

hine

. *

/vm

= V

MW

areC

onne

ctio

n.ge

tUtil

().g

etD

ecen

dent

MoR

ef(

null

, V

Man

aged

Obj

ects

.Virt

ualM

achi

ne.to

Str

ing(

), n

ame)

;O

bjec

tCon

tent

[] co

nten

ts =

nu

ll;

if (

spec

ifier

.leng

th =

= 0

) {

cont

ents

= V

MW

areC

onne

ctio

n.ge

tUtil

().g

etO

bjec

tPro

pert

ies(

null

, vm

, Pro

pert

yFilt

erU

tiliti

es.g

etF

ilter

(P

rope

rtyS

peci

fier.

GE

NE

RA

L,

Apr

29,

10

14:5

3P

age

1/5

VM

achi

ne.ja

vaP

rope

rtyS

peci

fier.

VM

,P

rope

rtyS

peci

fier.

VM

_CP

U,

Pro

pert

ySpe

cifie

r.V

M_M

EM

OR

Y,

Pro

pert

ySpe

cifie

r.V

M_S

TA

TU

S,

Pro

pert

ySpe

cifie

r.V

M_O

S))

;}

else

{co

nten

ts =

VM

War

eCon

nect

ion.

getU

til()

.get

Obj

ectP

rope

rtie

s(nu

ll, v

m, P

rope

rtyF

ilter

Util

ities

.get

Filt

er(s

peci

fier)

);} co

nstr

uct(

cont

ents

);}

catc

h (

Exc

eptio

n e)

{e.

prin

tSta

ckT

race

();

}} /*

* *

Con

stru

cts

the

abst

ract

ion

obje

ct fo

r a

virt

ual m

achi

ne. F

etch

ing

rel

avan

t pro

pert

ies

via

the

* V

MW

are

web

serv

ice

sdk.

*

*

@pa

ram

con

tent

s P

ass

in th

e ob

ject

con

tent

you

hav

e ga

ther

ed, b

ased

on

the

prop

erty

nam

es g

athe

red

* c

onst

ruct

the

obje

ct b

ased

on

that

. *

/pr

ivat

e

void

con

stru

ct(O

bjec

tCon

tent

[] co

nten

ts)

{fo

r (

Obj

ectC

onte

nt c

onte

nt :

cont

ents

) {

Dyn

amic

Pro

pert

y[] p

rope

rtie

s =

con

tent

.get

Pro

pSet

();

for

(D

ynam

icP

rope

rty

prop

erty

: pr

oper

ties)

{S

trin

g na

me

= p

rope

rty.

getN

ame(

);O

bjec

t val

ue =

pro

pert

y.ge

tVal

();

if(v

alue

!=

null

) {

if(n

ame.

equa

lsIg

nore

Cas

e("

sum

mar

y.gu

est.g

ues

tId")

) {

//$N

ON

-NLS

-1$

} el

se

if(n

ame.

equa

lsIg

nore

Cas

e("

sum

mar

y.gu

est.h

ostN

ame "))

{ //$

NO

N-N

LS-1

$ge

tInfo

().s

etH

ostN

ame(

valu

e.to

St

ring(

));

} el

se

if(n

ame.

equa

lsIg

nore

Cas

e("

gues

t.ipA

ddre

ss "))

{

//$N

ON

-NLS

-1$

getIn

fo()

.set

Gue

stIp

(val

ue.to

Str

ing(

));

} el

se

if(n

ame.

equa

lsIg

nore

Cas

e("

conf

ig.g

ues

tFul

lNam

e "))

{ //$

NO

N-N

LS-1

$ge

tInfo

().s

etG

uest

Ope

ratin

gSys

tem

(val

ue.to

Str

ing(

));

} el

se

if(n

ame.

equa

lsIg

nore

Cas

e("

sum

mar

y.qu

ickS

tats

.gue

stM

emor

yUsa

ge"))

{ //$

NO

N-N

LS-1

$ge

tInfo

().s

etG

uest

Mem

oryU

sage

((I

nteg

er)v

alue

);}

else

if

(nam

e.eq

uals

Igno

reC

ase(

"su

mm

ary.

conf

ig.m

emor

ySiz

eMB ")

) {

//$N

ON

-NLS

-1$

getIn

fo()

.set

Gue

stA

lloca

tedM

emor

y(In

tege

r.pa

rseI

nt(v

alue

.toS

trin

g())

);}

else

if

(nam

e.eq

uals

Igno

reC

ase(

"co

nfig

.har

dwar

e.nu

mC

PU")

) {

//$N

ON

-NLS

-1$

getIn

fo()

.set

Allo

cate

dCpu

s((I

nte

ger)

valu

e);

} el

se

if(n

ame.

equa

lsIg

nore

Cas

e("

gues

t.gue

stS

tate"

)) {

//$

NO

N-N

LS-1

$ge

tInfo

().s

etG

uest

Sta

te(v

alue

.toS

trin

g())

;}

else

if

(nam

e.eq

uals

Igno

reC

ase(

"gu

estH

ear

tbea

tSta

tus "))

{ //$

NO

N-N

LS-1

$

Apr

29,

10

14:5

3P

age

2/5

VM

achi

ne.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

041

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/ob

ject

mod

el/V

Mac

hine

.java

Page 80: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

getIn

fo()

.set

Sta

tus(

(Man

aged

Ent

ity

Sta

tus)

valu

e);

} el

se

if(n

ame.

equa

lsIg

nore

Cas

e("

nam

e"))

{

//use

d //$

NO

N-N

LS-1

$ge

tInfo

().s

etN

ame(

valu

e.to

Str

ing

());

} el

se

if(n

ame.

equa

lsIg

nore

Cas

e("

sum

mar

y.qu

ickS

tats

.hos

tMem

oryU

sage"))

{ //u

sed

//$N

ON

-NLS

-1$

getIn

fo()

.set

Hos

tMem

oryU

sage

((In

tege

r)va

lue)

;}

else

if

(nam

e.eq

uals

Igno

reC

ase(

"su

mm

ary.

quic

kSta

ts.o

vera

llCpu

Usa

ge"))

{ //u

sed

//$N

ON

-NLS

-1$

getIn

fo()

.set

Gue

stC

puU

sage

((In

tege

r)va

lue)

;}

else

if

(nam

e.eq

uals

Igno

reC

ase(

"su

mm

ary.

runt

ime.

max

Cpu

Usa

ge"))

{ //u

sed

//$N

ON

-NLS

-1$

getIn

fo()

.set

Allo

cate

dCpu

((In

teg

er)v

alue

);}

}}

} crea

teP

rope

rtie

s();

} priv

ate

vo

id c

reat

ePro

pert

ies(

) {

CP

ULo

adIn

fo c

puIn

fo =

nu

ll;

Mem

oryU

sage

Info

mem

Info

=

null

;O

pera

tingS

yste

mIn

fo o

pera

tingS

yste

mIn

fo =

nu

ll;

Sta

tusI

nfo

stat

usin

fo =

nu

ll;

Gen

eral

Sys

tem

Info

gen

eral

Info

=

null

;P

roce

ssor

Info

pro

cess

orIn

fo =

nu

ll;

Sto

rage

Info

sto

rage

Info

=

null

;tr

y {

cpuI

nfo

=

new

CP

ULo

adIn

fo(in

fo.g

etG

uest

Cpu

Usa

ge()

, inf

o.ge

tAllo

cate

dCpu

());

mem

Info

=

new

Mem

oryU

sage

Info

(info

.get

Gue

stA

lloca

tedM

emo

ry()

, inf

o.ge

tHos

tMem

oryU

sage

()); op

erat

ingS

yste

mIn

fo =

ne

w O

pera

tingS

yste

mIn

fo(in

fo.g

etG

ues

tOpe

ratin

gSys

tem

(),

null

);st

atus

info

=

new

Sta

tusI

nfo(

info

.get

Gue

stS

tate

());

info

.get

Net

wor

kDev

iceP

rope

rtyM

ap()

.put

(cpu

Info

.get

Net

wor

kDev

iceK

ey()

, cpu

Info

);in

fo.g

etN

etw

orkD

evic

ePro

pert

yMap

().p

ut(m

emIn

fo.g

etN

etw

orkD

evic

eKey

(), m

emIn

fo);

info

.get

Net

wor

kDev

iceP

rope

rtyM

ap()

.put

(ope

ratin

gSys

tem

Info

.get

Net

wor

kDev

iceK

ey()

, ope

ratin

gSys

tem

Info

);

} ca

tch

(In

valid

Cus

tom

Pro

pert

yVal

ueE

xcep

tion

e1)

{e1

.prin

tSta

ckT

race

();

} try

{if

(info

.get

Gue

stC

puU

sage

() !=

0 &

& in

fo.g

etA

lloca

tedC

pu(

) !=

0)

{cp

uInf

o =

ne

w C

PU

Load

Info

(info

.get

Gue

stC

puU

sage

(),

info

.get

Allo

cate

dCpu

());

getIn

fo()

.get

Pro

pert

ies(

).ad

d(cp

uInf

o);

}

Apr

29,

10

14:5

3P

age

3/5

VM

achi

ne.ja

vaif

(info

.get

Gue

stA

lloca

tedM

emor

y()

!= 0

&&

info

.get

Hos

tMe

mor

yUsa

ge()

!= 0

) {

mem

Info

=

new

Mem

oryU

sage

Info

(info

.get

Gue

stA

lloc

ated

Mem

ory(

),in

fo.g

etH

ostM

emor

yUsa

ge()

); getIn

fo()

.get

Pro

pert

ies(

).ad

d(m

emIn

fo);

} if(in

fo.g

etG

uest

Ope

ratin

gSys

tem

() !=

nu

ll )

{op

erat

ingS

yste

mIn

fo =

ne

w O

pera

tingS

yste

mIn

fo(g

etIn

fo()

.get

Gue

stO

pera

tingS

yste

m()

, nu

ll);

getIn

fo()

.get

Pro

pert

ies(

).ad

d(op

erat

ingS

yste

mIn

fo)

;} if

(info

.get

Gue

stS

tate

() !=

nu

ll)

{st

atus

info

=

new

Sta

tusI

nfo(

info

.get

Gue

stS

tate

());

getIn

fo()

.get

Pro

pert

ies(

).ad

d(st

atus

info

);} bo

olea

n e

nabl

ed =

fa

lse

;if

(ena

bled

) {

gene

ralIn

fo =

ne

w G

ener

alS

yste

mIn

fo()

;ge

tInfo

().g

etP

rope

rtie

s().

add(

gene

ralIn

fo);

proc

esso

rInf

o =

ne

w P

roce

ssor

Info

();

getIn

fo()

.get

Pro

pert

ies(

).ad

d(pr

oces

sorI

nfo)

;st

orag

eInf

o =

ne

w S

tora

geIn

fo()

;ge

tInfo

().g

etP

rope

rtie

s().

add(

stor

ageI

nfo)

;}

} ca

tch

(In

valid

Cus

tom

Pro

pert

yVal

ueE

xcep

tion

e) {

e.pr

intS

tack

Tra

ce()

;}

} @O

verr

ide

publ

ic S

trin

g to

Str

ing(

) {

retu

rn g

etIn

fo()

.toS

trin

g();

} publ

ic

void

set

Info

(Virt

ualM

achi

neIn

fo in

fo)

{th

is.in

fo =

info

;} pu

blic

Virt

ualM

achi

neIn

fo g

etIn

fo()

{re

turn

info

;} pu

blic

Str

ing

getL

ooku

pKey

Val

ue()

{re

turn

info

.get

Nam

e();

} publ

ic A

rray

List

<IC

usto

mP

rope

rty<

Str

ing>

> g

etP

rope

rtie

s()

{re

turn

info

.get

Pro

pert

ies(

);} @

Ove

rrid

epu

blic

Has

hMap

<N

etw

orkD

evic

ePro

pert

yKey

, IN

etw

orkD

evic

ePro

pert

y<S

trin

g>>

get

Net

wor

kDev

iceP

rope

rtyM

ap()

{re

turn

info

.get

Net

wor

kDev

iceP

rope

rtyM

ap()

;} @

Ove

rrid

epu

blic

vo

id s

etLo

okup

Key

Val

ue(S

trin

g va

l) {

thro

w

new

Ille

galA

cces

sErr

or("

Not

allo

wed

to s

et th

is");

//$N

ON

-NLS

-1$

}

Apr

29,

10

14:5

3P

age

4/5

VM

achi

ne.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

042

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/ob

ject

mod

el/V

Mac

hine

.java

Page 81: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

}

Apr

29,

10

14:5

3P

age

5/5

VM

achi

ne.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

043

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/ob

ject

mod

el/V

Mac

hine

.java

Page 82: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.pr

oper

ties;

impo

rt ja

va.u

til.A

rray

List

;im

port

java

.util

.Arr

ays;

impo

rt ja

va.u

til.H

ashM

ap;

impo

rt ja

va.u

til.L

ist;

/**

*

* @

auth

or m

anie

lse

*

* U

tility

cla

ss, u

sefu

l if y

ou d

on't

know

whi

ch p

rope

rtie

s w

hich

mig

ht b

e re

lev

ant.

Thi

s cl

ass

* is

use

d to

add

an

abst

ract

ion

laye

r fo

r pr

oper

ty fi

lters

, tha

t is

it al

low

s f

or e

asy

to u

se s

peci

ficat

ion

* o

n w

hich

pro

pert

ies

you

are

inte

rest

ed in

. *

*

AD

DE

ND

UM

: Now

with

net

wor

k de

vice

pro

pert

ies

in p

lace

, Net

wor

kDev

iceP

rope

rtyK

ey s

houl

d be

use

d. *

/pu

blic

cl

ass

P

rope

rtyF

ilter

Util

ities

{

priv

ate

st

atic

Has

hMap

<P

rope

rtyS

peci

fier,

Str

ing[

]> p

rope

rtyM

ap =

ne

w H

ash

Map

<P

rope

rtyS

peci

fier,

Str

ing[

]>()

;

stat

ic {

addO

rUpd

ateP

rope

rty(

Pro

pert

ySpe

cifie

r.G

EN

ER

AL,

"na

me")

; //$

NO

N-N

LS-1

$ad

dOrU

pdat

ePro

pert

y(P

rope

rtyS

peci

fier.

DA

TA

CE

NT

ER

, "co

nfig

Sta

tus")

; //$

NO

N-N

LS-1

$ad

dOrU

pdat

ePro

pert

y(P

rope

rtyS

peci

fier.

HO

ST

_SY

ST

EM

_DIS

K,

"da

tast

ore")

; //$

NO

N-N

LS-1

$ad

dOrU

pdat

ePro

pert

y(P

rope

rtyS

peci

fier.

HO

ST

_SY

ST

EM

, "

hard

war

e.sy

stem

Info")

; //$

NO

N-N

LS-1

$ad

dOrU

pdat

ePro

pert

y(P

rope

rtyS

peci

fier.

HO

ST

_SY

ST

EM

_ST

AT

US

,"

vm",

//$

NO

N-N

LS-1

$"

sum

mar

y.ov

eral

lSta

tus");

//$N

ON

-NLS

-1$

addO

rUpd

ateP

rope

rty(

Pro

pert

ySpe

cifie

r.H

OS

T_S

YS

TE

M_M

EM

OR

Y,

"su

mm

ary.

quic

kSta

ts.o

vera

llMem

oryU

sage",

//$N

ON

-NLS

-1$

"su

mm

ary.

hard

war

e.m

emor

ySiz

e")

; //$

NO

N-N

LS-1

$ad

dOrU

pdat

ePro

pert

y(P

rope

rtyS

peci

fier.

HO

ST

_SY

ST

EM

_CP

U,

"su

mm

ary.

hard

war

e.cp

uMod

el",

//$N

ON

-NLS

-1$

"su

mm

ary.

quic

kSta

ts.o

vera

llCpu

Usa

ge",

//$N

ON

-NLS

-1$

"su

mm

ary.

hard

war

e.nu

mC

puC

ores",

//$N

ON

-NLS

-1$

"su

mm

ary.

hard

war

e.nu

mC

puP

kgs

",

//$N

ON

-NLS

-1$

"su

mm

ary.

hard

war

e.cp

uMhz")

; //$

NO

N-N

LS-1

$ad

dOrU

pdat

ePro

pert

y(P

rope

rtyS

peci

fier.

VM

,"

sum

mar

y.gu

est.g

uest

Id",

// //$

NO

N-N

LS-1

$"

sum

mar

y.gu

est.h

ostN

ame

",

// //$

NO

N-N

LS-1

$"

sum

mar

y.gu

est.i

pAdd

ress",

// //$

NO

N-N

LS-1

$"

conf

ig.g

uest

Ful

lNam

e");

// //$

NO

N-N

LS-1

$ad

dOrU

pdat

ePro

pert

y(P

rope

rtyS

peci

fier.

VM

_OS

,"

sum

mar

y.co

nfig

.gue

stF

ullN

ame

");

// //$

NO

N-N

LS-1

$ad

dOrU

pdat

ePro

pert

y(P

rope

rtyS

peci

fier.

VM

_ME

MO

RY

,"

sum

mar

y.qu

ickS

tats

.gue

stM

emor

yUsa

ge",

//

//$N

ON

-NLS

-1$

"su

mm

ary.

conf

ig.m

emor

ySiz

eMB");

// //$

NO

N-N

LS-1

$ad

dOrU

pdat

ePro

pert

y(P

rope

rtyS

peci

fier.

VM

_CP

U,

"su

mm

ary.

quic

kSta

ts.h

ostM

emor

yUsa

ge",

// //$

NO

N-N

LS-1

$"

sum

mar

y.qu

ickS

tats

.ove

rallC

puU

sage",

//$N

ON

-NLS

-1$

"su

mm

ary.

runt

ime.

max

Cpu

Usa

ge",//

//$N

ON

-NLS

-1$

"co

nfig

.har

dwar

e.nu

mC

PU");

// //$

NO

N-N

LS-1

$ad

dOrU

pdat

ePro

pert

y(P

rope

rtyS

peci

fier.

VM

_ST

AT

US

,

Apr

29,

10

14:5

3P

age

1/2

Pro

pert

yFilt

erU

tiliti

es.ja

va"

gues

t.gue

stS

tate",

// //$

NO

N-N

LS-1

$"

gues

tHea

rtbe

atS

tatu

s")

; //

//$N

ON

-NLS

-1$

addO

rUpd

ateP

rope

rty(

Pro

pert

ySpe

cifie

r.C

LUS

TE

R,

"su

mm

ary",

//$

NO

N-N

LS-1

$"

host"

);

//$N

ON

-NLS

-1$

} /**

* @

para

m s

peci

fier

* @

retu

rn r

etur

ns a

n ar

ray

of s

trin

gs w

ith th

e pr

oper

ties

we

wan

t to

fetc

h. A

cts

as a

filte

r. *

/pu

blic

st

atic

Str

ing[

] get

Filt

er(P

rope

rtyS

peci

fier.

.. sp

ecifi

er)

{Li

st<

Str

ing>

com

plet

eLis

t =

new

Arr

ayLi

st<

Str

ing>

();

for

(P

rope

rtyS

peci

fier

prop

erty

Spe

cifie

r : s

peci

fier)

{co

mpl

eteL

ist.a

ddA

ll(A

rray

s.as

List

(pro

pert

yMap

.get

(pro

per

tyS

peci

fier)

));

} retu

rn c

ompl

eteL

ist.t

oArr

ay(

new

Str

ing[

com

plet

eLis

t.siz

e()]

);} /*

* *

@pa

ram

spe

cifie

r *

@pa

ram

pro

pert

y *

@re

turn

*

/pu

blic

st

atic

bo

olea

n a

ddO

rUpd

ateP

rope

rty(

Pro

pert

ySpe

cifie

r sp

ecifi

er, S

trin

g...

prop

erty

) {

bool

ean

add

ed =

tr

ue;

if(!

prop

erty

Map

.con

tain

sKey

(spe

cifie

r))

{pr

oper

tyM

ap.p

ut(s

peci

fier,

pro

pert

y);

retu

rn a

dded

;}

else

{

Str

ing[

] def

ined

Pro

pert

ies

= p

rope

rtyM

ap.g

et(s

peci

fier)

;A

rray

List

<S

trin

g> d

efin

edP

rope

rtie

sArr

ay =

ne

w A

rray

List

<S

trin

g>(A

rray

s.as

List

(def

ined

Pro

pert

ies)

);fo

r (

Str

ing

new

Pro

pert

y : p

rope

rty)

{if

(def

ined

Pro

pert

iesA

rray

.con

tain

s(ne

wP

rope

rty)

) {

defin

edP

rope

rtie

sArr

ay.a

dd(n

ewP

rope

rty)

;ad

ded

=

fals

e;

}} pr

oper

tyM

ap.p

ut(s

peci

fier,

def

ined

Pro

pert

iesA

rray

.toA

rra

y(ne

w S

trin

g[de

fined

Pro

pert

iesA

rray

.siz

e()]

));

} retu

rn a

dded

;}

}

Apr

29,

10

14:5

3P

age

2/2

Pro

pert

yFilt

erU

tiliti

es.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

044

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/pr

oper

ties/

Pro

pert

yFilt

erU

tiliti

es.ja

va

Page 83: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.pr

oper

ties;

impo

rt ja

va.u

til.H

ashM

ap;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.CP

ULo

adIn

fo;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.Gen

eral

Sys

tem

Info

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.M

emor

yUsa

geIn

fo;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

info

.Ope

ratin

gSys

tem

Info

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.P

roce

ssor

Info

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.S

tatu

sInf

o;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.in

fo.S

tora

geIn

fo;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

obje

ctm

odel

.VC

lust

er;

impo

rt c

om.a

pc.m

anag

emen

tinte

grat

ion.

vmw

are.

obje

ctm

odel

.VD

atac

ente

r;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.ob

ject

mod

el.V

Hos

tSys

tem

;im

port

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.ob

ject

mod

el.V

Mac

hine

;/*

* *

*

@au

thor

man

iels

e * *

/pu

blic

cl

ass

P

rope

rtyM

appi

ngU

tiliti

es {

publ

ic

stat

ic H

ashM

ap<

Cla

ss<

?>, S

trin

g> p

rope

rtyM

ap =

ne

w H

ashM

ap<

Cla

ss<

?>, S

trin

g>()

;pu

blic

st

atic

Has

hMap

<C

lass

<?>

, Str

ing>

key

Map

=

new

Has

hMap

<C

lass

<?>

,St

ring>

();

/**

* S

impl

e m

ap d

efin

ition

s fo

r so

me

com

mon

cus

tom

pro

pert

ies.

Som

e of

the

se a

re m

ore

spec

ific

for

a ne

twor

k *

dev

ice.

*/

stat

ic {

prop

erty

Map

.put

(CP

ULo

adIn

fo.c

lass

, "C

PU

Loa

d");

//$N

ON

-NLS

-1$

prop

erty

Map

.put

(Mem

oryU

sage

Info

.cla

ss,"

Mem

ory"

);

//$N

ON

-NLS

-1$

prop

erty

Map

.put

(Ope

ratin

gSys

tem

Info

.cla

ss, "

OS"

);

//$N

ON

-NLS

-1$

prop

erty

Map

.put

(Pro

cess

orIn

fo.c

lass

, "P

roce

ssor"

);

//$N

ON

-NLS

-1$

prop

erty

Map

.put

(Sto

rage

Info

.cla

ss, "

Sto

rage

");

//$N

ON

-NLS

-1$

prop

erty

Map

.put

(Sta

tusI

nfo.

clas

s, "

Sta

tus")

; //$

NO

N-N

LS-1

$pr

oper

tyM

ap.p

ut(G

ener

alS

yste

mIn

fo.c

lass

, "S

yste

m in

fo");

//$

NO

N-N

LS

-1$

keyM

ap.p

ut(V

Hos

tSys

tem

.cla

ss, "

Nam

e");

//$

NO

N-N

LS-1

$ke

yMap

.put

(VM

achi

ne.c

lass

, "N

ame"

);

//$N

ON

-NLS

-1$

keyM

ap.p

ut(V

Clu

ster

.cla

ss,"

Nam

e");

//$

NO

N-N

LS-1

$ke

yMap

.put

(VD

atac

ente

r.cl

ass,

"N

ame"

);

//$N

ON

-NLS

-1$

} publ

ic

stat

ic S

trin

g ge

tCus

tom

Pro

pert

yLoo

kupK

ey(C

lass

<?>

obj

) {

retu

rn k

eyM

ap.g

et(o

bj);

} publ

ic

stat

ic S

trin

g se

tCus

tom

Pro

pert

yLoo

kupK

ey(C

lass

<?>

obj

, Str

ing

val

) {

retu

rn k

eyM

ap.p

ut(o

bj, v

al);

} publ

ic

stat

ic S

trin

g ge

tCus

tom

Pro

pert

yVal

ueK

ey(C

lass

<?>

obj

) {

retu

rn p

rope

rtyM

ap.g

et(o

bj);

} publ

ic

stat

ic

void

add

Cus

tom

Pro

pert

yVal

ueK

ey(C

lass

<?>

cla

zz, S

trin

g pr

oper

tyN

ame)

{pr

oper

tyM

ap.p

ut(c

lazz

, pro

pert

yNam

e);

}

Apr

29,

10

14:5

3P

age

1/2

Pro

pert

yMap

ping

Util

ities

.java

publ

ic

stat

ic

void

rem

oveC

usto

mP

rope

rtyV

alue

Key

(Cla

ss<

?> c

lazz

) {

prop

erty

Map

.rem

ove(

claz

z);

} publ

ic

stat

ic

void

cle

arV

alue

Key

s()

{pr

oper

tyM

ap.c

lear

();

}}

Apr

29,

10

14:5

3P

age

2/2

Pro

pert

yMap

ping

Util

ities

.java

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

045

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/pr

oper

ties/

Pro

pert

yMap

ping

Util

ities

.java

Page 84: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.vm

war

e.pr

oper

ties;

/**

* @

auth

or m

anie

lse

* S

impl

e cl

ass

used

to id

entif

y th

e co

mm

on p

rope

rtie

s w

hich

you

mig

ht w

ant t

o f

etch

usi

ng *

VM

War

e S

DK

. Als

o, if

you

acc

iden

tly s

peci

fy th

e sa

me

prop

erty

in tw

o fil

ters

on

ly o

ne p

rope

rty

will

be

adde

d to

the

* to

tal a

rray

. *

/pu

blic

enu

m P

rope

rtyS

peci

fier

{G

EN

ER

AL,

DA

TA

CE

NT

ER

,H

OS

T_S

YS

TE

M,

HO

ST

_SY

ST

EM

_DIS

K,

HO

ST

_SY

ST

EM

_ST

AT

US

,H

OS

T_S

YS

TE

M_C

PU

,H

OS

T_S

YS

TE

M_M

EM

OR

Y,

VM

,V

M_O

S,

VM

_CP

U,

VM

_ME

MO

RY

, V

M_S

TA

TU

S,

CLU

ST

ER

}

Apr

29,

10

14:5

3P

age

1/1

Pro

pert

ySpe

cifie

r.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

046

/46

./src

/com

/apc

/man

agem

entin

tegr

atio

n/vm

war

e/pr

oper

ties/

Pro

pert

ySpe

cifie

r.ja

va

Page 85: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

184 Appendix C - VMware source

Page 86: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

Appendix D

Appendix D - Propertyrules source

Page 87: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking
Page 88: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.co

re.c

ondi

tions

;

impo

rt c

om.a

pc.c

onfig

.net

wor

kdev

icep

rope

rty.

Net

wor

kDev

iceP

rope

rtyK

ey;

/**

*

* @

auth

or m

anie

lse

*

* C

lass

to c

reat

e a

cond

iton

for

a pr

oper

ty, a

key

is a

ssoc

iate

d w

ith a

con

diti

on, a

nd a

rul

e co

ntai

ns 0

..m

* c

ondi

tons

. *

/pu

blic

cl

ass

C

ompo

undC

ondi

tion

{pr

ivat

e C

ondi

tion

cond

ition

;pr

ivat

e C

lass

<?>

con

ditio

nTyp

e;pr

ivat

e N

etw

orkD

evic

ePro

pert

yKey

con

ditio

nKey

;pr

ivat

e O

bjec

t val

ue;

publ

ic C

ompo

undC

ondi

tion(

) {}

publ

ic C

ompo

undC

ondi

tion(

Con

ditio

n co

nditi

on, C

lass

<?>

con

ditio

nTyp

e, N

etw

orkD

evic

ePro

pert

yKey

con

ditio

nKey

, Obj

ect v

alue

) {

this

.con

ditio

n =

con

ditio

n;th

is.c

ondi

tionT

ype

= c

ondi

tionT

ype;

this

.con

ditio

nKey

= c

ondi

tionK

ey;

this

.set

Val

ue(v

alue

);}

/**

* M

etho

d to

che

ck if

the

cond

iton

has

been

met

. Don

e by

iter

atin

g th

roug

h th

e n

etw

ork

prop

ertie

s as

soci

ated

with

*

the

data

cent

er e

quip

men

t. *

*

@pa

ram

val

ueT

oChe

ck *

@re

turn

*/

publ

ic

bool

ean

che

ck(O

bjec

t val

ueT

oChe

ck)

{bo

olea

n v

alid

=

fals

e;

if(v

alue

ToC

heck

!=

null

) {

if(c

ondi

tionT

ype

==

Str

ing.

clas

s) {

Str

ing

strin

gVal

ue =

(S

trin

g)ge

tVal

ue()

;S

trin

g st

ringV

alue

ToC

heck

= (

Str

ing)

valu

eToC

heck

;re

turn

str

ingV

alue

ToC

heck

.equ

als(

strin

gVal

ue);

} el

se

if(c

ondi

tionT

ype

==

Dou

ble.

clas

s) {

Dou

ble

doub

leva

lue

= (

Dou

ble)

getV

alue

();

Dou

ble

doub

leC

heck

valu

e =

Dou

ble.

pars

eDou

ble(

(St

ring)

valu

eToC

heck

);if

(con

ditio

n.eq

uals

(Con

ditio

n.E

QU

AL)

) {

if(d

oubl

eval

ue.e

qual

s(va

lueT

oChe

ck))

{va

lid =

tr

ue;

}}

else

if

(con

ditio

n.eq

uals

(Con

ditio

n.LE

SS

)) {

valid

= d

oubl

eChe

ckva

lue.

doub

leV

alue

() <

dou

blev

alue

.dou

bleV

alue

() ?

tr

ue :

fals

e;

} el

se

if(c

ondi

tion.

equa

ls(C

ondi

tion.

MO

RE

)) {

valid

= d

oubl

eChe

ckva

lue.

doub

leV

alue

() >

dou

blev

alue

.dou

bleV

alue

() ?

tr

ue :

fals

e;

}}

} retu

rn v

alid

;}

Apr

29,

10

14:5

3P

age

1/2

Com

poun

dCon

ditio

n.ja

va

publ

ic C

ondi

tion

getC

ondi

tion(

) {

retu

rn c

ondi

tion;

} publ

ic

void

set

Con

ditio

n(C

ondi

tion

cond

ition

) {

this

.con

ditio

n =

con

ditio

n;} pu

blic

Cla

ss<

?> g

etC

ondi

tionT

ype(

) {

retu

rn c

ondi

tionT

ype;

} publ

ic

void

set

Con

ditio

nTyp

e(C

lass

<?>

con

ditio

nTyp

e) {

this

.con

ditio

nTyp

e =

con

ditio

nTyp

e;} pu

blic

vo

id s

etC

ondi

tionK

ey(N

etw

orkD

evic

ePro

pert

yKey

con

ditio

nKey

) {

this

.con

ditio

nKey

= c

ondi

tionK

ey;

} publ

ic N

etw

orkD

evic

ePro

pert

yKey

get

Con

ditio

nKey

() {

retu

rn c

ondi

tionK

ey;

} publ

ic

void

set

Val

ue(O

bjec

t val

ue)

{th

is.v

alue

= v

alue

;} pu

blic

Obj

ect g

etV

alue

() {

retu

rn v

alue

;} @

Ove

rrid

epu

blic

bo

olea

n e

qual

s(O

bjec

t obj

) {

bool

ean

equ

al =

fa

lse

;if

(obj

!=

null

) {

Com

poun

dCon

ditio

n co

nditi

on =

(C

ompo

undC

ondi

tion)

obj;

retu

rn th

is.g

etC

ondi

tionT

ype(

).eq

uals

(con

ditio

n.ge

tCon

ditio

nTyp

e())

&

& th

is.g

etC

ondi

tionK

ey()

.equ

als(

cond

ition

.get

Co

nditi

onK

ey()

)&

& th

is.g

etV

alue

().e

qual

s(co

nditi

on.g

etV

alue

())

&&

this

.get

Con

ditio

n().

equa

ls(c

ondi

tion.

getC

ondi

tion(

));

} retu

rn e

qual

;}

}

Apr

29,

10

14:5

3P

age

2/2

Com

poun

dCon

ditio

n.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

02/

4./c

ore/

cond

ition

s/C

ompo

undC

ondi

tion.

java

Page 89: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.co

re.c

ondi

tions

;/*

* *

Enu

mer

atio

n cl

ass

for

the

oper

ator

s.

* @

auth

or m

anie

lse

* */

publ

ic e

num

Con

ditio

n {

LES

S,

MO

RE

,N

OT

,E

QU

AL;

@O

verr

ide

publ

ic S

trin

g to

Str

ing(

) {

switc

h(

this

) {

case

LE

SS

: retu

rn "

Less

than

";ca

se M

OR

E:

retu

rn "

Mor

e th

an";

case

EQ

UA

L:re

turn

"E

qual

s";ca

se N

OT

: retu

rn "

Not

";de

faul

t:

thro

w

new

Run

timeE

xcep

tion(

);}

};}

Apr

29,

10

14:5

3P

age

1/1

Con

ditio

n.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

03/

4./c

ore/

cond

ition

s/C

ondi

tion.

java

Page 90: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

pack

age

com

.apc

.man

agem

entin

tegr

atio

n.co

re.c

ondi

tions

;

impo

rt ja

va.u

til.A

rray

List

;im

port

java

.util

.Map

;im

port

java

.util

.UU

ID;

impo

rt o

rg.e

clip

se.s

wt.g

raph

ics.

RG

B;

impo

rt c

om.a

pc.c

onfig

.net

wor

kdev

icep

rope

rty.

Net

wor

kDev

iceP

rope

rtyK

ey;

/**

*

* @

auth

or m

anie

lse

* P

rope

rty

rule

, thi

s ru

le is

ass

ocia

ted

with

a c

olor

. Cho

sen

spec

ifica

lly b

y t

he u

ser.

*/

publ

ic

clas

s

Pro

pert

yRul

e {

priv

ate

UU

ID p

rope

rtyI

D;

priv

ate

Str

ing

prop

erty

Rul

eNam

e;pr

ivat

e R

GB

rul

eCol

or;

priv

ate

Arr

ayLi

st<

Com

poun

dCon

ditio

n> c

ondi

tions

;

publ

ic P

rope

rtyR

ule(

Str

ing

prop

erty

Rul

eNam

e) {

this

.set

Pro

pert

yRul

eNam

e(pr

oper

tyR

uleN

ame)

;se

tCon

ditio

ns(

new

Arr

ayLi

st<

Com

poun

dCon

ditio

n>()

);se

tPro

pert

yID

(UU

ID.r

ando

mU

UID

());

setR

uleC

olor

(ne

w R

GB

(255

,43,

22))

;} pu

blic

bo

olea

n a

ddC

ondi

tion(

Com

poun

dCon

ditio

n co

nditi

on)

{re

turn

get

Con

ditio

ns()

.add

(con

ditio

n);

} publ

ic

void

set

Pro

pert

yRul

eCol

or(R

GB

rul

eCol

or)

{th

is.s

etR

uleC

olor

(rul

eCol

or);

} /**

* p

ass

in a

map

of n

etw

ork

devi

ce p

rope

rtie

s fo

r th

e te

ster

. *

@pa

ram

map

OfD

evic

ePro

pert

ies

* @

retu

rn *

/pu

blic

bo

olea

n c

heck

AllC

ondi

tions

(Map

<N

etw

orkD

evic

ePro

pert

yKey

, Str

ing>

m

apO

fDev

iceP

rope

rtie

s) {

Boo

lean

che

ckS

um =

nu

ll;

for

(C

ompo

undC

ondi

tion

cond

ition

: ge

tCon

ditio

ns()

) {

if(m

apO

fDev

iceP

rope

rtie

s.co

ntai

nsK

ey(c

ondi

tion.

getC

ondi

tio

nKey

()))

{if

(che

ckS

um =

=

null

)ch

eckS

um =

ne

w B

oole

an(

true

);ch

eckS

um &

= c

ondi

tion.

chec

k(m

apO

fDev

iceP

rope

rtie

s.ge

t(co

nditi

on.g

etC

ondi

tionK

ey()

));

}} re

turn

che

ckS

um =

=

null

?

fals

e :

chec

kSum

;} @

Ove

rrid

epu

blic

Str

ing

toS

trin

g()

{re

turn

get

Pro

pert

yRul

eNam

e();

}

Apr

29,

10

14:5

3P

age

1/2

Pro

pert

yRul

e.ja

va

publ

ic

void

set

Pro

pert

yRul

eNam

e(S

trin

g pr

oper

tyR

uleN

ame)

{th

is.p

rope

rtyR

uleN

ame

= p

rope

rtyR

uleN

ame;

} publ

ic S

trin

g ge

tPro

pert

yRul

eNam

e()

{re

turn

pro

pert

yRul

eNam

e;} pu

blic

vo

id s

etR

uleC

olor

(RG

B r

uleC

olor

) {

this

.rul

eCol

or =

rul

eCol

or;

} publ

ic R

GB

get

Rul

eCol

or()

{re

turn

rul

eCol

or;

} @O

verr

ide

publ

ic

bool

ean

equ

als(

Obj

ect o

bj)

{//

TO

DO

Aut

o-ge

nera

ted

met

hod

stub

if(o

bj

inst

ance

of P

rope

rtyR

ule)

{re

turn

((P

rope

rtyR

ule)

obj).

getP

rope

rtyI

D()

.equ

als(

prop

erty

ID);

} retu

rn

fals

e;

} publ

ic

void

set

Pro

pert

yID

(UU

ID p

rope

rtyI

D)

{th

is.p

rope

rtyI

D =

pro

pert

yID

;} pu

blic

UU

ID g

etP

rope

rtyI

D()

{re

turn

pro

pert

yID

;} pu

blic

vo

id s

etC

ondi

tions

(Arr

ayLi

st<

Com

poun

dCon

ditio

n> c

ondi

tions

) {

this

.con

ditio

ns =

con

ditio

ns;

} publ

ic A

rray

List

<C

ompo

undC

ondi

tion>

get

Con

ditio

ns()

{re

turn

con

ditio

ns;

}}

Apr

29,

10

14:5

3P

age

2/2

Pro

pert

yRul

e.ja

va

Prin

ted

by m

anie

lse

Sun

day

May

02,

201

04/

4./c

ore/

cond

ition

s/P

rope

rtyR

ule.

java

Page 91: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

190 Appendix D - Property rules source

Page 92: ISXO Custom Server Properties Integration - etd.dtu.dketd.dtu.dk/thesis/260333/dip10_14_net.pdf · ISXO Custom Server Properties Integration Mads Nielsen ... { Work orders, tracking

Bibliography

[1] Sourceforge. Nagios 3.0 documentation.http://nagios.sourceforge.net/docs/ndoutils/NDOUtils DB Model.pdf,2010.

[2] VMware. VMware vSphere API man-ual. http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/index.html, 2010.