}
}
private static Subscription BuildClientSubscriptionSearchResults(Map map, AtomicReference<String> outmsg) {
try {
Subscription sub = new Subscription();
String alertCritera = ((String[]) map.get("alertCriteraMultipleItem"))[0];
sub.setSubscriptionFilter(new SubscriptionFilter());
Name name = new Name();
name.setValue(((String[]) map.get("searchcontent"))[0]);
name.setLang(((String[]) map.get("searchlang"))[0]);
FindQualifiers fq = new FindQualifiers();
String[] fqs = (String[]) map.get("findqualifier");
if (fqs != null) {
for (int i = 0; i < fqs.length; i++) {
fq.getFindQualifier().add(fqs[i]);
}
}
if (fq.getFindQualifier().isEmpty()) {
fq = null;
}
if (alertCritera != null) {
if (alertCritera.equalsIgnoreCase("binding")) {
//sub.getSubscriptionFilter().setFindBinding(new FindBinding());
//sub.getSubscriptionFilter().getFindBinding().
} else if (alertCritera.equalsIgnoreCase("service")) {
sub.getSubscriptionFilter().setFindService(new FindService());
sub.getSubscriptionFilter().getFindService().getName().add(name);
sub.getSubscriptionFilter().getFindService().setFindQualifiers(fq);
} else if (alertCritera.equalsIgnoreCase("business")) {
sub.getSubscriptionFilter().setFindBusiness(new FindBusiness());
sub.getSubscriptionFilter().getFindBusiness().setFindQualifiers(fq);
sub.getSubscriptionFilter().getFindBusiness().getName().add(name);
// sub.getSubscriptionFilter().getGetBusinessDetail().getBusinessKey().addAll(keys);
} else if (alertCritera.equalsIgnoreCase("publisherAssertion")) {
//unknow if this will work
sub.getSubscriptionFilter().setGetAssertionStatusReport(new GetAssertionStatusReport());
sub.getSubscriptionFilter().getGetAssertionStatusReport().setCompletionStatus(CompletionStatus.valueOf(((String[]) map.get("assertionStatus"))[0]));
} else if (alertCritera.equalsIgnoreCase("relatedBusiness")) {
sub.getSubscriptionFilter().setFindRelatedBusinesses(new FindRelatedBusinesses());
sub.getSubscriptionFilter().getFindRelatedBusinesses().setFindQualifiers(fq);
sub.getSubscriptionFilter().getFindRelatedBusinesses().setBusinessKey(((String[]) map.get("searchcontent"))[0]);
} else if (alertCritera.equalsIgnoreCase("tmodel")) {
sub.getSubscriptionFilter().setFindTModel(new FindTModel());
sub.getSubscriptionFilter().getFindTModel().setFindQualifiers(fq);
sub.getSubscriptionFilter().getFindTModel().setName(name);
} else {
outmsg.set("alert critera invalid");
return null;
}
} else {