}
return filter;
}
private Resource getResource(Subscriber subscriber, Registry registry) throws Exception {
EventingSubscriber eventingSub = null;
Resource resource = null;
OMFactory factory = OMAbstractFactory.getOMFactory();
OMElement payload = factory.createOMElement(SUBSCRIPTION, null);
if (subscriber instanceof EventingSubscriber) {
eventingSub = (EventingSubscriber) subscriber;
addId(payload, eventingSub.getId());
addSubscriptionEndingTime(payload, eventingSub.getSubscriptionEndingTime());
if (eventingSub.getDelivery() != null) {
addDelivery(payload, eventingSub.getDelivery());
}
if (eventingSub.getEndToEPr() != null) {
addEndToEpr(payload, eventingSub.getEndToEPr());
}
if (eventingSub.getFilter() != null) {
addFilter(payload, eventingSub.getFilter());
}
resource = registry.newResource();
resource.setContent(payload.toString());
}