@@ -674,6 +674,33 @@ public void exportBatchSubscription(Long subscriptionId,
674674 usagePointIdList , UsagePoint .class ), stream , exportFilter ,
675675 hrefFragment );
676676 }
677+
678+ @ Override
679+ public void exportBatchSubscriptionUsagePoint (Long subscriptionId ,
680+ OutputStream stream , ExportFilter exportFilter ) throws IOException {
681+ String hrefFragment = "/Batch/Subscription/" + subscriptionId + "/UsagePoint" ;
682+ // first find all the usagePointIds this subscription is related to
683+ List <Long > usagePointIdList = subscriptionService
684+ .findUsagePointIds (subscriptionId );
685+ exportEntriesFull (subscriptionId , resourceService .findEntryTypeIterator (
686+ usagePointIdList , UsagePoint .class ), stream , exportFilter ,
687+ hrefFragment );
688+ }
689+
690+ @ Override
691+ public void exportBatchSubscriptionUsagePoint (Long subscriptionId , Long usagePointId ,
692+ OutputStream stream , ExportFilter exportFilter ) throws IOException {
693+ String hrefFragment = "/Batch/Subscription/" + subscriptionId + "/UsagePoint/" + usagePointId ;
694+ List <Long > usagePointIdList = new ArrayList <Long > ();
695+ List <Long > temp = subscriptionService
696+ .findUsagePointIds (subscriptionId );
697+ if (temp .contains (usagePointId )) {
698+ usagePointIdList .add (usagePointId );
699+ }
700+ exportEntriesFull (subscriptionId , resourceService .findEntryTypeIterator (
701+ usagePointIdList , UsagePoint .class ), stream , exportFilter ,
702+ hrefFragment );
703+ }
677704
678705 @ Override
679706 public void exportBatchBulk (Long bulkId , String thirdParty , OutputStream outputStream ,
@@ -757,8 +784,7 @@ private void exportEntries(EntryTypeIterator entries, OutputStream stream,
757784 }
758785
759786 @ SuppressWarnings ({ "rawtypes" , "unchecked" })
760- // TODO: this needs to be templated and RetailCustomer inherited from
761- // IdentifiedObject to remove the above supress warnings
787+
762788 private void exportEntries (Long subscriptionId , EntryTypeIterator entries , OutputStream stream ,
763789 ExportFilter exportFilter , Class resourceClass , String hrefFragment )
764790 throws IOException {
@@ -884,18 +910,17 @@ private void exportEntries_Root(Long subscriptionId, EntryTypeIterator entries,
884910
885911
886912 private String adjustFragment (String fragment , EntryType entry ) {
887- // TODO there may be other setup things - Likely BatchList
888- // if that still exists.
913+
889914 String result = fragment ;
890915 if (fragment .contains ("DownloadMyData" )) {
891916 result .replace ("DownloadMyData" , "UsagePoint" );
892917 }
893918 if (fragment .contains ("Batch" )) {
894919 if (fragment .contains ("Bulk" )) {
895- // ToDo need the proper URI fragment for a Bulk
920+
896921 UsagePoint up = entry .getContent ().getUsagePoint ();
897922 RetailCustomer rc = up .getRetailCustomer ();
898- // TODO here need the proper URI fragment for a subscription
923+
899924 result = "/RetailCustomer/" + rc .getId () + "/UsagePoint" ;
900925 }
901926 // if (fragment.contains("Subscription")) {
0 commit comments