From d4a0a3e341898dfe7ffcc07e3f1006c5883dc3db Mon Sep 17 00:00:00 2001 From: mguessan Date: Tue, 24 Aug 2010 20:27:41 +0000 Subject: [PATCH] Caldav: improve event logging, include subject git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1378 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ExchangeSession.java | 14 ++++++++------ .../davmail/exchange/dav/DavExchangeSession.java | 4 +++- .../davmail/exchange/ews/EwsExchangeSession.java | 2 ++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index c52cf754..b030fd02 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -1745,12 +1745,6 @@ public abstract class ExchangeSession { return etag; } - protected HttpException buildHttpException(Exception e) { - String message = "Unable to get event " + getName() + " at " + permanentUrl + ": " + e.getMessage(); - LOGGER.warn(message); - return new HttpException(message); - } - /** * Set item href. * @@ -1950,6 +1944,7 @@ public abstract class ExchangeSession { */ public abstract class Event extends Item { protected String contentClass; + protected String subject; protected VCalendar vCalendar; /** @@ -1980,6 +1975,12 @@ public abstract class ExchangeSession { return vCalendar.toString(); } + protected HttpException buildHttpException(Exception e) { + String message = "Unable to get event " + getName() + " subject: "+subject+" at " + permanentUrl + ": " + e.getMessage(); + LOGGER.warn(message); + return new HttpException(message); + } + /** * Retrieve item body from Exchange * @@ -2208,6 +2209,7 @@ public abstract class ExchangeSession { // calendar CdoInstanceType ITEM_PROPERTIES.add("instancetype"); ITEM_PROPERTIES.add("urlcompname"); + ITEM_PROPERTIES.add("subject"); } /** diff --git a/src/java/davmail/exchange/dav/DavExchangeSession.java b/src/java/davmail/exchange/dav/DavExchangeSession.java index 21df1efb..398ad06b 100644 --- a/src/java/davmail/exchange/dav/DavExchangeSession.java +++ b/src/java/davmail/exchange/dav/DavExchangeSession.java @@ -1155,6 +1155,7 @@ public class DavExchangeSession extends ExchangeSession { permanentUrl = getPropertyIfExists(properties, "permanenturl"); etag = getPropertyIfExists(properties, "etag"); displayName = getPropertyIfExists(properties, "displayname"); + subject = getPropertyIfExists(properties, "subject"); } protected String getPermanentUrl() { @@ -1262,7 +1263,7 @@ public class DavExchangeSession extends ExchangeSession { @Override public byte[] getEventContent() throws IOException { byte[] result; - LOGGER.debug("Get event: " + permanentUrl); + LOGGER.debug("Get event subject: "+subject+ " permanentUrl: " + permanentUrl); // try to get PR_INTERNET_CONTENT try { result = getICSFromInternetContentProperty(); @@ -1722,6 +1723,7 @@ public class DavExchangeSession extends ExchangeSession { EVENT_REQUEST_PROPERTIES.add("etag"); EVENT_REQUEST_PROPERTIES.add("contentclass"); EVENT_REQUEST_PROPERTIES.add("displayname"); + EVENT_REQUEST_PROPERTIES.add("subject"); } protected static final DavPropertyNameSet EVENT_REQUEST_PROPERTIES_NAME_SET = new DavPropertyNameSet(); diff --git a/src/java/davmail/exchange/ews/EwsExchangeSession.java b/src/java/davmail/exchange/ews/EwsExchangeSession.java index b048c9bb..a50322a5 100644 --- a/src/java/davmail/exchange/ews/EwsExchangeSession.java +++ b/src/java/davmail/exchange/ews/EwsExchangeSession.java @@ -884,6 +884,7 @@ public class EwsExchangeSession extends ExchangeSession { permanentUrl = response.get(Field.get("permanenturl").getResponseName()); etag = response.get(Field.get("etag").getResponseName()); displayName = response.get(Field.get("displayname").getResponseName()); + subject = response.get(Field.get("subject").getResponseName()); itemName = response.get(Field.get("urlcompname").getResponseName()); // workaround for missing urlcompname in Exchange 2010 if (itemName == null) { @@ -1021,6 +1022,7 @@ public class EwsExchangeSession extends ExchangeSession { EVENT_REQUEST_PROPERTIES.add("permanenturl"); EVENT_REQUEST_PROPERTIES.add("etag"); EVENT_REQUEST_PROPERTIES.add("displayname"); + EVENT_REQUEST_PROPERTIES.add("subject"); EVENT_REQUEST_PROPERTIES.add("urlcompname"); }