/** * Unset (delete) a bucket's notification configuration; removes the effect of any * previously-applied configuration. * * @param bucketName * a bucket with a notification configuration. * @throws S3ServiceException */ public void unsetNotificationConfig(String bucketName) throws S3ServiceException { setNotificationConfigImpl(bucketName, new NotificationConfig()); }
@Override public void endElement(String name, String elementText) { if (name.equals("Topic")) { this.lastTopic = elementText; } else if (name.equals("Event")) { this.lastEvent = elementText; config.addTopicConfig(config.new TopicConfig( this.lastTopic, this.lastEvent)); } else if (name.equals("NotificationConfiguration")) { } } }
@Override protected void setNotificationConfigImpl(String bucketName, NotificationConfig config) throws S3ServiceException { Map<String, String> requestParameters = new HashMap<String, String>(); requestParameters.put("notification", ""); Map<String, Object> metadata = new HashMap<String, Object>(); String xml; try { xml = config.toXml(); } catch (Exception e) { throw new S3ServiceException("Unable to build NotificationConfig XML document", e); } try { performRestPut(bucketName, null, metadata, requestParameters, new StringEntity(xml, "text/plain", Constants.DEFAULT_ENCODING), true); } catch (ServiceException se) { throw new S3ServiceException(se); } catch (UnsupportedEncodingException e) { throw new S3ServiceException("Unable to encode XML document", e); } }
@Override protected void setNotificationConfigImpl(String bucketName, NotificationConfig config) throws S3ServiceException { Map<String, String> requestParameters = new HashMap<String, String>(); requestParameters.put("notification", ""); Map<String, Object> metadata = new HashMap<String, Object>(); String xml; try { xml = config.toXml(); } catch (Exception e) { throw new S3ServiceException("Unable to build NotificationConfig XML document", e); } try { performRestPut(bucketName, null, metadata, requestParameters, new StringEntity(xml, "text/plain", Constants.DEFAULT_ENCODING), true); } catch (ServiceException se) { throw new S3ServiceException(se); } catch (UnsupportedEncodingException e) { throw new S3ServiceException("Unable to encode XML document", e); } }
@Override public void endElement(String name, String elementText) { if (name.equals("Topic")) { this.lastTopic = elementText; } else if (name.equals("Event")) { this.lastEvent = elementText; config.addTopicConfig(config.new TopicConfig( this.lastTopic, this.lastEvent)); } else if (name.equals("NotificationConfiguration")) { } } }
/** * Unset (delete) a bucket's notification configuration; removes the effect of any * previously-applied configuration. * * @param bucketName * a bucket with a notification configuration. * @throws S3ServiceException */ public void unsetNotificationConfig(String bucketName) throws S3ServiceException { setNotificationConfigImpl(bucketName, new NotificationConfig()); }