package com.xqsr.ARSystemInfo; import com.bmc.arsys.api.ARException; import com.bmc.arsys.api.ARServerUser; import com.bmc.arsys.api.Constants; import com.bmc.arsys.api.ServerInfo; import com.bmc.arsys.api.ServerInfoMap; public class ARSystemServerInfo { public static void main(String[] args) { // Initialize a new ARServerUser object, this is the main object we are // using for all actions ARServerUser context = new ARServerUser("Demo", "", "","192.168.184.128"); ARSystemServerInfo arSystemInfo = new ARSystemServerInfo(); arSystemInfo.getServerInfo(context); } public void getServerInfo(ARServerUser context) { try { int[] requestList = new int[7]; requestList[0] = ServerInfo.DB_TYPE; requestList[1] = ServerInfo.SERVER_IDENT; requestList[2] = ServerInfo.OS; requestList[3] = ServerInfo.HOSTNAME; requestList[4] = ServerInfo.DB_USER; requestList[5] = ServerInfo.FULL_HOSTNAME; requestList[6] = ServerInfo.DB_VERSION; ServerInfoMap serverInfoMap = context.getServerInfo(requestList); System.out.println("Server ID: " + serverInfoMap.get(41)); System.out.println("AR Server Version : "+ context.getServerVersion()); System.out.println("Database Type: " + serverInfoMap.get(1)); System.out.println("Database Version: " + serverInfoMap.get(Constants.AR_SERVER_INFO_DB_VERSION)); System.out.println("Full Hostname: "+ serverInfoMap.get(Constants.AR_SERVER_INFO_FULL_HOSTNAME)); System.out.println("AR Server Operating System: " + serverInfoMap.get(Constants.AR_SERVER_INFO_OS)); } catch (ARException a) { a.printStackTrace(); } } }