Skip to content

Commit

Permalink
Merge pull request #171 from rwth-acis/release/1.3.1
Browse files Browse the repository at this point in the history
Release/1.3.1
  • Loading branch information
lakhoune authored Sep 20, 2023
2 parents 727a82f + a368177 commit a6979c7
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ archiva_credentials.xml
.gradle
.classpath
.project
.settings
.settings
.vscode/settings.json
4 changes: 3 additions & 1 deletion core/src/main/java/i5/las2peer/api/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,11 @@ public Serializable invokeInternally(ServiceNameVersion service, String method,
* @param activityName The activity name of the XES event.
* @param resourceId The resource id of the XES event.
* @param resourceType The resource type of the XES event.
* @param lifecyclePhase The lifecycle of the XES event.
*/

public void monitorXESEvent(MonitoringEvent event, String message, String caseId, String activityName,
String resourceId, String resourceType);
String resourceId, String resourceType, String lifecyclePhase, Long timeOfEvent);

// Class loading

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ public void monitorEvent(Object from, MonitoringEvent event, String message, boo

@Override
public void monitorXESEvent(MonitoringEvent event, String message, String caseId, String activityName,
String resourceId, String resourceType) {
String resourceId, String resourceType, String lifecyclePhase, Long timeOfEvent) {
String sourceAgentId = serviceAgent != null ? serviceAgent.getIdentifier() : null;
node.observerNotice(event, node.getNodeId(), sourceAgentId, null, null, message, caseId, activityName,
resourceId, resourceType);
resourceId, resourceType, lifecyclePhase, timeOfEvent);
}

@Override
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/java/i5/las2peer/logging/L2pLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ public void log(Long timestamp, MonitoringEvent event, String sourceNode, String
@Override
public void logXESEvent(Long timestamp, MonitoringEvent event, String sourceNode, String sourceAgentId,
String destinationNode, String destinationAgentId, String remarks, String caseId, String activityName,
String resourceId, String resourceType) {
String resourceId, String resourceType, String lifecyclePhase, Long timeOfEvent) {
StringBuilder logLine = new StringBuilder();
logLine.append(event + " (" + event.getCode() + ")\t");
logLine.append(appendPart(sourceNode));
Expand All @@ -540,6 +540,8 @@ public void logXESEvent(Long timestamp, MonitoringEvent event, String sourceNode
logLine.append(appendPart(activityName));
logLine.append(appendPart(resourceId));
logLine.append(appendPart(resourceType));
logLine.append(appendPart(lifecyclePhase));
logLine.append(appendPart(timeOfEvent));
// with default levels this hides the output from console and only writes it to
// logfile
log(observerLevel, logLine.toString());
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/i5/las2peer/logging/NodeObserver.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ public void log(Long timestamp, MonitoringEvent event, String sourceNode, String
*/
public void logXESEvent(Long timestamp, MonitoringEvent event, String sourceNode, String sourceAgentId,
String destinationNode, String destinationAgentId, String remarks, String caseId, String activityName,
String resourceId, String resourceType);
String resourceId, String resourceType, String lifecyclePhase, Long timeOfEvent);

}
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public void log(Long timestamp, MonitoringEvent event, String sourceNode, String
@Override
public void logXESEvent(Long timestamp, MonitoringEvent event, String sourceNode, String sourceAgentId,
String destinationNode, String destinationAgentId, String remarks, String caseId, String activityName,
String resourceId, String resourceType) {
String resourceId, String resourceType, String lifecyclePhase,Long timeOfEvent) {
if (sourceNode == null) {
return; // We do not log events without a source node into a database with different
// sources;-)
Expand All @@ -268,7 +268,8 @@ public void logXESEvent(Long timestamp, MonitoringEvent event, String sourceNode
}

monitoringMessages[messagesCount++] = new XESEventMessage(timestamp, event, sourceNode, sourceAgentId,
destinationNode, destinationAgentId, remarks, caseId, activityName, resourceId, resourceType);
destinationNode, destinationAgentId, remarks, caseId, activityName, resourceId, resourceType,
lifecyclePhase, timeOfEvent);

if (readyToSend()) {
checkInit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public class XESEventMessage extends MonitoringMessage {
private String activityName;
private String resourceId;
private String resourceType;
private String lifecyclePhase;

private Long timeOfEvent;

/**
*
Expand All @@ -39,16 +42,19 @@ public class XESEventMessage extends MonitoringMessage {
* @param resourceId resourceId of the event
* @param resourceType resourceType of the event (e.g. user, service, bot,
* etc.)
* @param lifecyclePhase lifecyclePhase of the event (e.g. start, complete,
* etc.)
*/
public XESEventMessage(Long timestamp, MonitoringEvent event, String sourceNode, String sourceAgentId,
String destinationNode, String destinationAgentId, String remarks, String caseId, String activityName,
String resourceId, String resourceType) {
String resourceId, String resourceType, String lifecyclePhase, Long timeOfEvent) {
super(timestamp, event, sourceNode, sourceAgentId, destinationNode, destinationAgentId, remarks);

this.caseId = caseId;
this.activityName = activityName;
this.resourceId = resourceId;
this.resourceType = resourceType;
this.lifecyclePhase = lifecyclePhase;
this.timeOfEvent = timeOfEvent;
}

public String getCaseId() {
Expand All @@ -67,4 +73,12 @@ public String getResourceType() {
return resourceType;
}

public String getLifecyclePhase() {
return lifecyclePhase;
}

public Long getTimeOfEvent() {
return timeOfEvent;
}

}
25 changes: 24 additions & 1 deletion core/src/main/java/i5/las2peer/p2p/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,28 @@ public void observerNotice(MonitoringEvent event, Object sourceNode, String sour
public void observerNotice(MonitoringEvent event, Object sourceNode, String sourceAgentId, Object destinationNode,
String destinationAgentId, String remarks, String caseId, String activityName, String resourceId,
String resourceType) {
observerNotice(event, sourceNode, sourceAgentId, destinationNode, destinationAgentId, remarks, caseId,
activityName, resourceId, resourceType, null, null);
}

/**
* Logs an event to all observers.
*
* @param event The event for this notification.
* @param sourceNode A source node for this event
* @param sourceAgentId A source agent id for this event
* @param destinationNode A destination node for this event
* @param destinationAgentId A destination agent id for this event
* @param remarks Some free text note or description about this
* event.
* @param caseId caseId of the event
* @param activityName activityName of the event
* @param resourceId resourceId of the event
* @param resourceType resourceType of the event
*/
public void observerNotice(MonitoringEvent event, Object sourceNode, String sourceAgentId, Object destinationNode,
String destinationAgentId, String remarks, String caseId, String activityName, String resourceId,
String resourceType, String lifecyclePhase, Long timeOfEvent) {
long timestamp = new Date().getTime();
String sourceNodeRepresentation = getNodeRepresentation(sourceNode);
String destinationNodeRepresentation = getNodeRepresentation(destinationNode);
Expand All @@ -451,7 +473,8 @@ public void observerNotice(MonitoringEvent event, Object sourceNode, String sour
continue;
}
ob.logXESEvent(timestamp, event, sourceNodeRepresentation, sourceAgentId, destinationNodeRepresentation,
destinationAgentId, remarks, caseId, activityName, resourceId, resourceType);
destinationAgentId, remarks, caseId, activityName, resourceId, resourceType, lifecyclePhase,
timeOfEvent);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ public void log(Long timestamp, MonitoringEvent event, String sourceNode, String
public void logXESEvent(Long timestamp, MonitoringEvent event, String sourceNode, String sourceAgentId,
String destinationNode, String destinationAgentId, String remarks, String caseId,
String activityName,
String resourceId, String resourceType) {
String resourceId, String resourceType, String lifecyclePhase, Long timeOfEvent) {
// TODO Auto-generated method stub
}
});
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
las2peer.revision=1.3
las2peer.build.number=0
las2peer.build.number=1
java.version=17
junit.version=4.13.1
jersey.version=2.35
Expand Down

0 comments on commit a6979c7

Please sign in to comment.