@@ -0,0 +1,2087 @@
+package de.passau.uni.sec.compose.pdp.servioticy.provenance;%0A%0Aimport com.fasterxml.jackson.databind.JsonNode;%0Aimport com.fasterxml.jackson.databind.ObjectMapper;%0Aimport java.io.IOException;%0Aimport java.security.Timestamp;%0Aimport java.util.Date;%0Aimport java.util.List;%0Aimport java.util.LinkedList;%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0A%0Aimport de.passau.uni.sec.compose.pdp.servioticy.exception.PDPServioticyException;%0A%0Apublic class ServioticyProvenance %0A%7B%0A%0A    public static JsonNode getInitialProvenance(JsonNode serviceObjectMetadata) throws PDPServioticyException%0A    %7B%0A%09//JsonNode ret = rootNode.path(%22provenance%22);%0A%09if (serviceObjectMetadata != null)%0A%09%7B%0A%09%09// extract entity%0A%09%09String entity = %22%22;%0A%09%09Pattern entity_PATTERN = Pattern.compile(%22%5C%22id%5C%22%5C%5Cs*:%5C%5Cs*%5C%22(%5B%5E%5C%22%5D+)%5C%22%22);%0A%09%09Matcher entity_m = entity_PATTERN.matcher(serviceObjectMetadata.toString());%0A%09%09entity_m.find();%0A%09%09entity = entity_m.group(1);%0A%0A%09%09// extract onbehalf%0A%09%09String onbehalf = %22%22;%0A%09%09Pattern onbehalf_PATTERN = Pattern.compile(%22%5C%22owner_id%5C%22%5C%5Cs*:%5C%5Cs*%5C%22(%5B%5E%5C%22%5D+)%5C%22%22);%0A%09%09Matcher onbehalf_m = onbehalf_PATTERN.matcher(serviceObjectMetadata.toString());%0A%09%09onbehalf_m.find();%0A%09%09onbehalf = onbehalf_m.group(1);%0A%0A%09%09// get source%0A%09%09String source = %22%22;%0A%0A%09%09// generate timestamp%0A%09%09Date date= new Date();%0A%09%09long time = date.getTime();%0A%09%09String timestamp = Long.toString(time);%0A%0A%09%09// build inital provenance data%0A%09%09String string = %22%7B%5C%22provenance%5C%22:%7B%5C%22agent%5C%22 : %5C%22SO%5C%22, %5C%22type%5C%22: %5C%22sensor_update%5C%22, %5C%22entity%5C%22:%5C%22%22+ entity + %22%5C%22, %5C%22activity%5C%22 : %5C%22creation%5C%22, %5C%22timestamp%5C%22:%22 + timestamp + %22,%5C%22accessed%5C%22:%5C%22%5C%22, %5C%22onbehalf%5C%22:%5C%22%22 + onbehalf + %22%5C%22, %5C%22source%5C%22:%5C%22%22 + source + %22%5C%22%7D%7D%22;%0A%09%09ObjectMapper mapper = new ObjectMapper();%0A%09%09JsonNode so_data;%0A%09%09try%7B%0A%09%09%09so_data = mapper.readTree(string);%0A%09%09%09return so_data;%0A%09%09%7D%0A%09%09catch (IOException e)%0A%09%09%7B%0A%09%09%09throw new PDPServioticyException(400, %22The parameters for SendDataToServiceObject were wrong. %22, %22Wrong parameters%22);%0A%09%09%7D%0A%09%7D%0A%09else%0A%09%7B%0A%09%09throw new PDPServioticyException(400, %22The parameters for SendDataToServiceObject were wrong. %22, %22Wrong parameters%22);%0A%09%7D%0A    %7D%0A%7D%0A

update wrong package name