Big Picture: I created two Java-Classes, one to get Output from a NetApp Simulator and another to create a JTable with Volume names and specifications.
The Code for the JTable is "exactly" this one: Java: Console output in JTable
Sample Code to get the Volume names:
public static Object VolName() {
ApiRunner runner = new ApiRunner(ApiTarget.builder()
.withHost(host).withUserName(user).withPassword(pass)
.withTargetType(TargetType.FILER).useHttp().build());
VolumeListInfoIterStartRequest volListReq = new VolumeListInfoIterStartRequest();
Iterator<VolumeInfo> volumeIter = runner.iterate(volListReq, 20);
VolumeInfo volume = null;
while(volumeIter.hasNext()) {
volume = volumeIter.next();
System.out.println("Sample 1: " + volume.getName());
}
System.out.println("Sample 2: " + volume.getName());
return volume.getName();
}
The Java-Commands which are from a NetApp Java Library.
Now to explain the Problem the Console output:
Sample 1: volume1
Sample 1: volume2
Sample 1: volume3
Sample 1: volume4
Sample 1: volume5
Sample 2: volume5
My return value is always volume5. How do I create an array out of this method or another method to loop this values?
Sorry for my poor English.