el.setAttributeValue(APPConstants.ASSOC_TYPE, associationType);
el.setText(associationPaths);
RequestOptions requestOptions = getAuthorization();
requestOptions.setHeader("Destination", associationPaths);
requestOptions.setHeader("AssociationType", associationType);
ClientResponse resp = abderaClient.delete(baseURI + APPConstants.ATOM +
encodeURL(sourcePath +
RegistryConstants.URL_SEPARATOR +
APPConstants.ASSOCIATIONS),
requestOptions);
if (resp.getType() == Response.ResponseType.SUCCESS) {
if (log.isDebugEnabled()) {
log.debug("remove association " + sourcePath + " to " + associationPaths +
" type " + associationType + " succeeded" +
", Response Status: " + resp.getStatus() +
", Response Type: " + resp.getType());
}
abderaClient.teardown();
} else {
String msg = "remove association " + sourcePath + " to " + associationPaths +
" type " + associationType + "failed" +
", Response Status: " + resp.getStatus() +
", Response Type: " + resp.getType();
log.error(msg);
abderaClient.teardown();
throw new RegistryException(msg);
}
}