HrAssertUrlRequest assertUrlRequest = new HrAssertUrlRequest(context, record.getHostUrl());
assertUrlRequest.executeAssert();
}
// create native resource
Native nativeResource = null;
// check if either host URL or title has changed
if (hostUrlChanged || titleChanged || (findableChanged && record.getFindable())) {
record.setUpdateDate(new Date());
// if hot URL or title has changed than proceed with generation of the
// native resource
String title = "";
// First, try to create native resource from the response
nativeResource = createNativeResource(record);
if (nativeResource == null) {
// if no native resource available, create an artificial one based on
//the information (host URL & title) from the repository.
nativeResource = record.generateNativeResource();
// get title
title = record.getName();
ProtocolInvoker.setLockTitle(record.getProtocol(), false);
} else {
// if the native resource is available, make sure it's a valid metadata resource
// prepare record for publication; it will validate schema
PublicationRequest pubReq = new PublicationRequest(context, user, nativeResource.getContent());
Schema schema = pubReq.prepareForPublication();
boolean lockTitle = false;
if (record.getName().length() == 0) {
title = schema.getMeaning().getTitle();
} else {