Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem formulation: Consider a process of Information Security Audit that almos

ID: 3856481 • Letter: P

Question

Problem formulation:

Consider a process of Information Security Audit that almost every organization has to pass from time to time. Part of the process is the assessment of assets from the perspective of security risk analysis. There are 3 security services: confidentiality, integrity, and availability and each of these services can be considered in the context of some application (software). For example, availability: every institution maintains academic records of all students. Such records are stored in a database, and this database is managed and accessed by means of DBMS (database management system) software, that in turn runs on some hardware server (asset). That server has many components, i.e. power supplies, NICs, HDD/SSDs, etc which may fail and their failure may cause failure of the server and therefore inability (failure of availability service) of users to access the application.

Your task is to write a Java program that would represent an asset. Later on, you will be asked to extend this program and implement different types of assets as well as different types of applications and their relationship. As of now your program contain two classes:

•Asset
•Driver

The former class, i.e. Asset, has to have the following attributes and methods:

•String Type. Can be one of the following: Server, Switch, Router, PSU (power supply unit), HDD, SSD, NIC (network interface card)
•int ID A unique number that identify any given asset.
•String Name General description of the asset including (if needed) vendor, hardware, model, etc.
•String serial Serial number of the asset which is a combination of characters usually found on a sticker affixed on some surface of the asset
•int PID Parent ID -- ID of the asset that appears to be "parent" to this one. For example Server asset is the "parent" of NIC asset because NIC is plugged into the server. In case when asset has no parent, this value has to be set to -1.
•"Getters" and "setters" for all attributes
•Default constructor (one that takes no parameters and uses default values of attributes)
•Method String toString() that returns textual presentation of an asset object. Values of all attributes must be used in compilation of that string.

The latter class, i.e. Driver is used to host main() method that would instantiate a few objects of class Asset (use some illustrative cases like 1 server, 1 switch, 2 PSUs, 3 NICs, etc) and store references to those objects in an array. Then it would iterate through the array and for every asset it would print result returned by toString() method.

Explanation / Answer

PROGRAM CODE:

Asset.java

package array;

public class Asset {

  

   private String Type;

   private int ID;

   private String Name;

   private String serial;

   private int PID;

  

   Asset()

   {

       Type = "";

       ID = 0;

       Name = "";

       serial = "";

       PID = 0;

   }

   public String getType() {

       return Type;

   }

   public void setType(String type) {

       Type = type;

   }

   public int getID() {

       return ID;

   }

   public void setID(int iD) {

       ID = iD;

   }

   public String getName() {

       return Name;

   }

   public void setName(String name) {

       Name = name;

   }

   public String getSerial() {

       return serial;

   }

   public void setSerial(String serial) {

       this.serial = serial;

   }

   public int getPID() {

       return PID;

   }

   public void setPID(int pID) {

       PID = pID;

   }

  

   @Override

   public String toString() {

       return "Type=" + Type + " ID=" + ID + " Name=" + Name + " Serial=" + serial + " PID=" + PID;

   }

}

Driver.java

package array;

public class Driver {

   public static void main(String[] args) {

       Asset assetCollection[] = new Asset[5];

       Asset asset1 = new Asset();

       asset1.setType("Server");

       asset1.setID(92746);

       asset1.setName("Schneider 2008");

       asset1.setSerial("PY3427");

       asset1.setPID(342678);

       assetCollection[0] = asset1;

      

       Asset asset2 = new Asset();

       asset2.setType("NIC");

       asset2.setID(342678);

       asset2.setName("NIC sample card");

       asset2.setSerial("EQ3248");

       asset2.setPID(-1);

       assetCollection[1] = asset2;

      

       Asset asset3 = new Asset();

       asset3.setType("NIC");

       asset3.setID(342678);

       asset3.setName("NIC sample card");

       asset3.setSerial("EQ3248");

       asset3.setPID(-1);

       assetCollection[2] = asset3;

      

       Asset asset4 = new Asset();

       asset4.setType("Switch");

       asset4.setID(20578);

       asset4.setName("Switch sample");

       asset4.setSerial("PY8234");

       asset4.setPID(-1);

       assetCollection[3] = asset4;

      

       Asset asset5 = new Asset();

       asset5.setType("NIC");

       asset5.setID(57382);

       asset5.setName("NIC sample card 3");

       asset5.setSerial("EQ562");

       asset5.setPID(-1);

       assetCollection[4] = asset5;

      

       for(int i=0; i<5; i++)

           System.out.println(assetCollection[i]);

   }

}

OUTPUT:

Type=Server ID=92746 Name=Schneider 2008 Serial=PY3427 PID=342678

Type=NIC ID=342678 Name=NIC sample card Serial=EQ3248 PID=-1

Type=NIC ID=342678 Name=NIC sample card Serial=EQ3248 PID=-1

Type=Switch ID=20578 Name=Switch sample Serial=PY8234 PID=-1

Type=NIC ID=57382 Name=NIC sample card 3 Serial=EQ562 PID=-1

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote