}
if (count <= 0) {
throw new IllegalArgumentException("Count is invalid: " + count);
}
for (String path : statusVariables) {
StatusVariablePath statusVariablePath = new StatusVariablePath(path);
ServiceReference monitorableReference = common.findMonitorableReferenceById(statusVariablePath.getMonitorableId());
String pid = (String) monitorableReference.getProperty(Constants.SERVICE_PID);
if (!common.notifiesOnChange(monitorableReference, statusVariablePath.getStatusVariableId())) {
throw new IllegalArgumentException("StatusVariable: " + path + " does not support notifications");
}
checkPermissions(new StatusVariablePath(pid, statusVariablePath.getStatusVariableId()), monitorableReference,
MonitorPermission.PUBLISH, MonitorPermission.STARTJOB);
}
SubscriptionMonitoringJob job = new SubscriptionMonitoringJob(common, logVisitor, initiator, statusVariables, count);
common.addJob(job);