protected Vector listOnlyPacketsThatWeWantUsingLocalIds( String accountId, Vector listWithLocalIds) { Vector mirroringInfo = new Vector(); for (int i = 0; i < listWithLocalIds.size(); ++i) { UniversalId uid = UniversalId.createFromAccountAndLocalId( accountId, (String) ((Vector) listWithLocalIds.get(i)).get(0)); BulletinMirroringInformation mirroringData = new BulletinMirroringInformation(uid); mirroringInfo.add(mirroringData.getInfoWithLocalId()); } return listOnlyPacketsThatWeWantUsingBulletinMirroringInformation(accountId, mirroringInfo); }
Vector writeSampleAvailableIDPacket(BulletinHeaderPacket bhp) throws Exception { StringWriter writer = new StringWriter(); byte[] sigBytes = bhp.writeXml(writer, authorSecurity); DatabaseKey key = null; if (bhp.getStatus().equals(BulletinConstants.STATUSDRAFT)) key = DatabaseKey.createDraftKey(bhp.getUniversalId()); else key = DatabaseKey.createSealedKey(bhp.getUniversalId()); String sigString = StreamableBase64.encode(sigBytes); MockDatabase db = new MockServerDatabase(); db.writeRecord(key, "Some text"); supplier.addAvailableIdsToMirror(db, key, sigString); BulletinMirroringInformation bulletinInfo = new BulletinMirroringInformation(db, key, sigString); Vector info = bulletinInfo.getInfoWithLocalId(); return info; }