20
20
import java .beans .VetoableChangeSupport ;
21
21
import java .io .IOException ;
22
22
import java .io .Serializable ;
23
+ import java .util .ArrayList ;
24
+ import java .util .Collections ;
23
25
import java .util .Date ;
24
26
import java .util .Enumeration ;
27
+ import java .util .List ;
25
28
import java .util .TimeZone ;
26
- import java .util .Vector ;
27
29
28
30
/**
29
31
Provides access to a group of statistics that represent the current status of the system.
@@ -40,8 +42,8 @@ public class SystemStatus implements Serializable
40
42
41
43
// The receiver variables retrieved for each format. Index zero will be set to the last format retrieved.
42
44
byte [][] receiverVariables_ = new byte [4 ][];
43
- // A vector of SystemPool object retrieved from the system.
44
- private Vector poolsVector_ ;
45
+ // A list of SystemPool object retrieved from the system.
46
+ private List < SystemPool > poolsList_ ;
45
47
46
48
// Flag indicating if we have connected to the system yet.
47
49
private transient boolean connected_ = false ;
@@ -790,23 +792,39 @@ public String getSystemName() throws AS400SecurityException, ErrorCompletingRequ
790
792
Converter conv = new Converter (system_ .getJobCcsid (), system_ );
791
793
return conv .byteArrayToString (receiverVariables_ [0 ], 16 , 8 ).trim ();
792
794
}
795
+
796
+ /**
797
+ Returns an enumeration containing a SystemPool object for each system pool.
798
+ @return An enumeration containing a SystemPool object for each system pool.
799
+ @exception AS400SecurityException If a security or authority error occurs.
800
+ @exception ErrorCompletingRequestException If an error occurs before the request is completed.
801
+ @exception InterruptedException If this thread is interrupted.
802
+ @exception IOException If an error occurs while communicating with the system.
803
+ @exception ObjectDoesNotExistException If the object does not exist on the system.
804
+ @deprecated see getSystemPoolsList()
805
+ @see #getSystemPoolsList()
806
+ **/
807
+ public Enumeration <SystemPool > getSystemPools () throws AS400SecurityException , ErrorCompletingRequestException , InterruptedException , IOException , ObjectDoesNotExistException
808
+ {
809
+ return Collections .enumeration (getSystemPoolsList ());
810
+ }
793
811
794
812
/**
795
- Returns an enumeration containing a SystemPool object for each system pool.
796
- @return An enumeration containing a SystemPool object for each system pool.
813
+ Returns a list containing a SystemPool object for each system pool.
814
+ @return A list containing a SystemPool object for each system pool.
797
815
@exception AS400SecurityException If a security or authority error occurs.
798
816
@exception ErrorCompletingRequestException If an error occurs before the request is completed.
799
817
@exception InterruptedException If this thread is interrupted.
800
818
@exception IOException If an error occurs while communicating with the system.
801
819
@exception ObjectDoesNotExistException If the object does not exist on the system.
802
820
**/
803
- public Enumeration getSystemPools () throws AS400SecurityException , ErrorCompletingRequestException , InterruptedException , IOException , ObjectDoesNotExistException
821
+ public List < SystemPool > getSystemPoolsList () throws AS400SecurityException , ErrorCompletingRequestException , InterruptedException , IOException , ObjectDoesNotExistException
804
822
{
805
823
loadInformation (3 );
806
824
807
825
// If we've already retrieved the pools, just return it.
808
- if (poolsVector_ != null ) return poolsVector_ . elements () ;
809
- poolsVector_ = new Vector ();
826
+ if (poolsList_ != null ) return poolsList_ ;
827
+ poolsList_ = new ArrayList < SystemPool > ();
810
828
811
829
// Parse the pool information.
812
830
int number = BinaryConverter .byteArrayToInt (receiverVariables_ [3 ], 32 );
@@ -827,11 +845,13 @@ public Enumeration getSystemPools() throws AS400SecurityException, ErrorCompleti
827
845
String poolName = new CharConverter (system_ .getJobCcsid (), system_ ).byteArrayToString (poolInformation , 44 , 10 );
828
846
systemPool = new SystemPool (system_ , poolName );
829
847
}
830
- poolsVector_ . addElement (systemPool );
848
+ poolsList_ . add (systemPool );
831
849
offset += length ;
832
850
}
833
- return poolsVector_ . elements () ;
851
+ return poolsList_ ;
834
852
}
853
+
854
+
835
855
836
856
837
857
private static final int FORMAT_DTS = AS400Timestamp .FORMAT_DTS ; // *DTS format
@@ -1047,7 +1067,7 @@ public void refreshCache()
1047
1067
// Clear the receiver variables;
1048
1068
receiverVariables_ = new byte [4 ][];
1049
1069
// Clear the vector of pools.
1050
- poolsVector_ = null ;
1070
+ poolsList_ = null ;
1051
1071
}
1052
1072
1053
1073
/**
0 commit comments