updated toString ItemObserved

This commit is contained in:
Francesco Mangiacrapa 2024-04-15 17:01:56 +02:00
parent a8b931d9ed
commit 0417e471ac
4 changed files with 31 additions and 3 deletions

View File

@ -23,6 +23,11 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" path="src/test/resources"/> <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View File

@ -14,6 +14,7 @@ import org.gcube.application.cms.plugins.events.EventManager;
import org.gcube.application.cms.plugins.events.EventManager.Event; import org.gcube.application.cms.plugins.events.EventManager.Event;
import org.gcube.application.cms.plugins.events.ItemObserved; import org.gcube.application.cms.plugins.events.ItemObserved;
import org.gcube.application.cms.plugins.faults.InitializationException; import org.gcube.application.cms.plugins.faults.InitializationException;
import org.gcube.application.cms.plugins.faults.InvalidProfileException;
import org.gcube.application.cms.plugins.faults.MaterializationException; import org.gcube.application.cms.plugins.faults.MaterializationException;
import org.gcube.application.cms.plugins.faults.ShutDownException; import org.gcube.application.cms.plugins.faults.ShutDownException;
import org.gcube.application.cms.plugins.implementations.AbstractPlugin; import org.gcube.application.cms.plugins.implementations.AbstractPlugin;
@ -248,7 +249,9 @@ public class CatalogueBindingPlugin extends AbstractPlugin implements EventListe
log.info("Events subscribed read from config {} ", eventsSubscrInTheUCD); log.info("Events subscribed read from config {} ", eventsSubscrInTheUCD);
} }
} catch (InvalidProfileException e) {
log.warn("Unable to read configuration for {} in the UCD {}", CatalogueBindingPlugin.PLUGIN_ID,
useCaseDescriptor.getId());
} catch (Exception e) { } catch (Exception e) {
log.error("Unable to read configuration ", e); log.error("Unable to read configuration ", e);
} catch (Throwable t) { } catch (Throwable t) {

View File

@ -82,4 +82,24 @@ public class ItemObserved<T extends Project> implements ItemObservable {
} }
return null; return null;
} }
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("ItemObserved [userCaller=");
builder.append(userCaller);
builder.append(", context=");
builder.append(context);
builder.append(", useCaseDescriptor id=");
builder.append(useCaseDescriptor!=null?useCaseDescriptor.getId():null);
builder.append(", project id=");
builder.append(project!=null?project.getId():null);
builder.append(", event=");
builder.append(event);
builder.append(", optional=");
builder.append(optional);
builder.append("]");
return builder.toString();
}
} }

View File

@ -332,7 +332,7 @@ public class NotificationsPlugin extends AbstractPlugin implements EventListener
} }
} catch (InvalidProfileException e) { } catch (InvalidProfileException e) {
log.warn("Unable to read configuration for {} in the UCD {}" + NotificationsPlugin.PLUGIN_ID, log.warn("Unable to read configuration for {} in the UCD {}", NotificationsPlugin.PLUGIN_ID,
useCaseDescriptor.getId()); useCaseDescriptor.getId());
} catch (Exception e) { } catch (Exception e) {
log.error("Unable to read configuration for " + NotificationsPlugin.PLUGIN_ID, e); log.error("Unable to read configuration for " + NotificationsPlugin.PLUGIN_ID, e);