1 18 package sync4j.framework.protocol.v11; 19 20 import java.util.List ; 21 import java.util.Iterator ; 22 23 import sync4j.framework.core.*; 24 25 import sync4j.framework.protocol.ProtocolException; 26 import sync4j.framework.protocol.v11.BasicRequirements; 27 import sync4j.framework.protocol.v11.Errors; 28 29 35 public class ManagementActionsRequirements 36 extends BasicRequirements 37 implements Errors { 38 39 41 43 50 static public void checkResults(List results) throws ProtocolException { 51 Results r; 52 List items; 53 54 Iterator i = results.iterator(); 55 56 while (i.hasNext()) { 57 r = (Results)i.next(); 58 59 items = r.getItems(); 60 if (items.size() == 0) { 61 Object [] args = new Object [] { r.getCmdID().getCmdID() }; 62 throw new ProtocolException(ERRMSG_NO_ITEM_IN_RESULTS, args); 63 } 64 65 Iterator j = items.iterator(); 66 while (j.hasNext()) { 67 if (((Item)j.next()).getSource() == null) { 68 throw new ProtocolException(ERRMSG_MISSING_SOURCE_ITEM); 69 } 70 } 71 } 72 } 73 } | Popular Tags |