validateUDDIv3Key(key.substring(0, key.lastIndexOf(KeyGenerator.PARTITION_SEPARATOR)));
}
public static void validateUDDIv3KeyGeneratorTModel(org.uddi.api_v3.TModel tModel) throws DispositionReportFaultMessage {
if (tModel == null)
throw new ValueNotAllowedException(new ErrorMessage("errors.tmodel.NullInput"));
validateUDDIv3KeyGeneratorKey(tModel.getTModelKey());
// A key generator key should have exactly one category and it's key value should be 'keyGenerator'
org.uddi.api_v3.CategoryBag categories = tModel.getCategoryBag();
if (categories != null) {
List<org.uddi.api_v3.KeyedReference> elems = categories.getKeyedReference();
if (elems != null && elems.size() == 1) {
org.uddi.api_v3.KeyedReference elem = elems.get(0);
if (elem != null) {
if (elem != null && elem instanceof org.uddi.api_v3.KeyedReference) {
String keyedValue = ((org.uddi.api_v3.KeyedReference)elem).getKeyValue();
if (keyedValue != null) {
if (keyedValue.equalsIgnoreCase(KeyGenerator.KEYGENERATOR_SUFFIX))
return;
}
}
}
}
}
throw new ValueNotAllowedException(new ErrorMessage("errors.tmodel.keygenerator.BadCategory"));
}