private void loadExternalRoutines(String schema, Collection<AISProtobuf.Routine> pbRoutines) {
for (AISProtobuf.Routine pbRoutine : pbRoutines) {
if (pbRoutine.hasClassName() || pbRoutine.hasMethodName()) {
Routine routine = destAIS.getRoutine(schema, pbRoutine.getRoutineName());
if (routine == null) {
throw new ProtobufReadException(
pbRoutine.getDescriptorForType().getFullName(),
String.format("%s not found", pbRoutine.getRoutineName())
);
}
SQLJJar sqljJar = null;
String className = null;
String methodName = null;
if (pbRoutine.hasJarName()) {
sqljJar = destAIS.getSQLJJar(pbRoutine.getJarName().getSchemaName(),
pbRoutine.getJarName().getTableName());
if (sqljJar == null) {
throw new ProtobufReadException(
pbRoutine.getDescriptorForType().getFullName(),
String.format("%s references JAR %s", pbRoutine.getRoutineName(), pbRoutine.getJarName())
);
}
}