/** * Sets the hour metrics properties. * * @param metrics * A {@link MetricsProperties} object which represents the hour metrics properties. */ public void setHourMetrics(final MetricsProperties metrics) { this.serviceProperties.setHourMetrics(metrics); }
/** * Sets the hour metrics properties. * * @param metrics * A {@link MetricsProperties} object which represents the hour metrics properties. */ public void setHourMetrics(final MetricsProperties metrics) { this.serviceProperties.setHourMetrics(metrics); }
@Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { this.elementStack.push(localName); if (Constants.AnalyticsConstants.CORS_RULE_ELEMENT.equals(localName)) { this.rule = new CorsRule(); } else if (Constants.AnalyticsConstants.LOGGING_ELEMENT.equals(localName)) { this.props.setLogging(new LoggingProperties()); } else if (Constants.AnalyticsConstants.HOUR_METRICS_ELEMENT.equals(localName)) { this.props.setHourMetrics(new MetricsProperties()); } else if (Constants.AnalyticsConstants.MINUTE_METRICS_ELEMENT.equals(localName)) { this.props.setMinuteMetrics(new MetricsProperties()); } else if (Constants.AnalyticsConstants.CORS_ELEMENT.equals(localName)) { this.props.setCors(new CorsProperties()); } }
@Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { this.elementStack.push(localName); if (Constants.AnalyticsConstants.CORS_RULE_ELEMENT.equals(localName)) { this.rule = new CorsRule(); } else if (Constants.AnalyticsConstants.LOGGING_ELEMENT.equals(localName)) { this.props.setLogging(new LoggingProperties()); } else if (Constants.AnalyticsConstants.HOUR_METRICS_ELEMENT.equals(localName)) { this.props.setHourMetrics(new MetricsProperties()); } else if (Constants.AnalyticsConstants.MINUTE_METRICS_ELEMENT.equals(localName)) { this.props.setMinuteMetrics(new MetricsProperties()); } else if (Constants.AnalyticsConstants.CORS_ELEMENT.equals(localName)) { this.props.setCors(new CorsProperties()); } else if (Constants.AnalyticsConstants.DELETE_RETENTION_POLICY_ELEMENT.equals(localName)) { this.props.setDeleteRetentionPolicy(new DeleteRetentionPolicy()); } else if (Constants.AnalyticsConstants.STATIC_WEBSITE_ELEMENT.equals(localName)) { this.props.setStaticWebsiteProperties(new StaticWebsiteProperties()); } }
/** * Parses the {@link ServiceProperties} from the given XML stream. * * @param stream * @throws IOException * @throws SAXException * @throws ParserConfigurationException */ public static ServiceProperties readServicePropertiesFromStream(final InputStream stream) throws SAXException, IOException, ParserConfigurationException { SAXParser saxParser = Utility.getSAXParser(); ServicePropertiesHandler handler = new ServicePropertiesHandler(); handler.props.setLogging(null); handler.props.setHourMetrics(null); handler.props.setMinuteMetrics(null); handler.props.setCors(null); saxParser.parse(stream, handler); return handler.props; }
/** * Parses the {@link ServiceProperties} from the given XML stream. * * @param stream * @throws IOException * @throws SAXException * @throws ParserConfigurationException */ public static ServiceProperties readServicePropertiesFromStream(final InputStream stream) throws SAXException, IOException, ParserConfigurationException { SAXParser saxParser = Utility.getSAXParser(); ServicePropertiesHandler handler = new ServicePropertiesHandler(); handler.props.setLogging(null); handler.props.setHourMetrics(null); handler.props.setMinuteMetrics(null); handler.props.setCors(null); handler.props.setDeleteRetentionPolicy(null); handler.props.setStaticWebsiteProperties(null); saxParser.parse(stream, handler); return handler.props; }
/** * Initializes a new instances of the ServiceProperties class. */ public ServiceProperties() { this.setLogging(new LoggingProperties()); this.setHourMetrics(new MetricsProperties()); this.setMinuteMetrics(new MetricsProperties()); this.setCors(new CorsProperties()); }
/** * Initializes a new instances of the ServiceProperties class. */ public ServiceProperties() { this.setLogging(new LoggingProperties()); this.setHourMetrics(new MetricsProperties()); this.setMinuteMetrics(new MetricsProperties()); this.setCors(new CorsProperties()); // DeleteRetentionPolicy and StaticWebsiteProperties are not included by default because they are not accepted by services other than blob. }
newProps.setHourMetrics(null); newProps.setMinuteMetrics(null); newProps.setHourMetrics(props.getHourMetrics()); newProps.setMinuteMetrics(props.getMinuteMetrics()); newProps.setCors(null);