throw new ValueNotAllowedException(new ErrorMessage("errors.keyedreference.NoTModelKey"));
}
public void validateKeyedReference(KeyedReference kr, Configuration config) throws DispositionReportFaultMessage {
if (kr.getTModelKey() == null || kr.getTModelKey().length() == 0)
throw new ValueNotAllowedException(new ErrorMessage("errors.keyedreference.NoTModelKey"));
if (kr.getKeyValue() == null || kr.getKeyValue().length() == 0)
throw new ValueNotAllowedException(new ErrorMessage("errors.keyedreference.NoKeyValue"));
String rootPublisherStr = config.getString(Property.JUDDI_ROOT_PUBLISHER);
// Per section 6.2.2.1 of the specification, no publishers (except the root) are allowed to use the node categorization tmodelKey
if (Constants.NODE_CATEGORY_TMODEL.equalsIgnoreCase(kr.getTModelKey())) {
if (!rootPublisherStr.equals(publisher.getAuthorizedName()))
throw new ValueNotAllowedException(new ErrorMessage("errors.keyedreference.NodeCategoryTModel", Constants.NODE_CATEGORY_TMODEL));
}
}