GetHSMSystemInfo.java

Exemplo de recuperação de informações de contadores do HSM.

Veja Nota sobre os exemplos.
package doxy.examples;
import com.dinamonetworks.HSMAllInfo;
public class GetHSMSystemInfo {
public static void main(String[] args) throws TacException {
/*
* Recupera informações de sistema do HSM.
*
* */
Dinamo opUserSession = new Dinamo();
String operatorId = "master";
String hsmIP = "10.0.62.10";
opUserSession.openSession(hsmIP, operatorId, "12345678", TacNDJavaLib.DEFAULT_PORT, false, false, true);
HSMAllInfo allInfo = opUserSession.getHSMInfo();
System.out.println("\nCounter info:");
System.out.println("Users count: " + allInfo.getCounterInfo().getUsers());
System.out.println("Objects count: " + allInfo.getCounterInfo().getObjects());
System.out.println("Base file size: " + allInfo.getCounterInfo().getSlbeFileSize());
System.out.println("Tasks count: " + allInfo.getCounterInfo().getTasks());
System.out.println("VM size: " + allInfo.getCounterInfo().getVmSize());
System.out.println("\nStatus info:");
System.out.println("Sessions count: " + allInfo.getStatusInfo().getSessionCount());
System.out.println("CPU: " + allInfo.getStatusInfo().getCpuUsage() + "%");
System.out.println("Memory: " + allInfo.getStatusInfo().getMemUsage() + "%");
System.out.println("\nDisk info:");
System.out.println("Block size: " + allInfo.getDiskInfo().getBlockSize());
System.out.println("Total blocks: " + allInfo.getDiskInfo().getTotalBlocks());
System.out.println("Free blocks: " + allInfo.getDiskInfo().getFreeBlocks());
System.out.println("\nHSM info:");
System.out.println("HSM firmware version: " + opUserSession.getFirmwareVersion());
System.out.println("HSM model: " + opUserSession.getModel());
System.out.println("HSM serial number: " + opUserSession.getSerialNumber());
opUserSession.closeSession();
}
}