Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

Commit

Permalink
#4 fixes for metadata create
Browse files Browse the repository at this point in the history
  • Loading branch information
mconway committed Aug 22, 2014
1 parent 13c8220 commit e01e00e
Showing 1 changed file with 3 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ private void processUnionOperation(Message message, Messages ofMessages) {
String absolutePath = null;
for (DataEntity part : message.getHasPart()) {

log.info("part:{}", part);

/*
* Look for AVU create event
*/
Expand All @@ -135,6 +137,7 @@ private void processUnionOperation(Message message, Messages ofMessages) {

log.info("have metadata object:{}", part.getAdditionalProperties()
.get(METADATA_OBJECT));
@SuppressWarnings("unchecked")
List<Map<String, String>> avuEntries = (List<Map<String, String>>) part
.getAdditionalProperties().get(METADATA_OBJECT);

Expand All @@ -143,16 +146,6 @@ private void processUnionOperation(Message message, Messages ofMessages) {

Map<String, String> entry = avuEntries.get(0);

/*
* if (avuDataEntry.size() != 3) {
* log.warn("expected 3 elements in avu data...discarded");
* continue; }
*
* String attribute = (String) avuDataEntry.get(2); String value =
* (String) avuDataEntry.get(1); String unit = (String)
* avuDataEntry.get(0);
*/

String attribute = entry.get("attribute");
String value = entry.get("value");
String unit = entry.get("unit");
Expand All @@ -163,12 +156,6 @@ private void processUnionOperation(Message message, Messages ofMessages) {
addMetadataEvent.setIrodsAbsolutePath(absolutePath);
try {
AvuData avuData = AvuData.instance(attribute, value, unit);

/*
* AvuData avuData = AvuData.instance(attribute.substring(10),
* value.substring(6), unit.substring(5));
*/

addMetadataEvent.setAvuData(avuData);
this.onMetadataAdd(addMetadataEvent);
} catch (JargonException e) {
Expand Down

0 comments on commit e01e00e

Please sign in to comment.