1 package com.trendmicro.grid.acl.l0;
2
3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
5
6 import javax.xml.bind.annotation.*;
7 import javax.xml.ws.WebFault;
8
9
10
11
12
13
14
15
16
17
18 @XmlAccessorType(XmlAccessType.FIELD)
19 @XmlType(namespace = Level0Constants.NAMESPACE)
20 @WebFault(targetNamespace = Level0Constants.NAMESPACE)
21 public class BatchSizeExceededException extends RuntimeException {
22
23 private static final long serialVersionUID = -5854824433574110209L;
24
25 private static final Logger log = LoggerFactory.getLogger(BatchSizeExceededException.class);
26 private static final String DEFAULT_MESSAGE = "This request exceeded the allowed batch size. " +
27 "Please retry in batches that fit into the allowed batch size.";
28
29 @XmlAttribute
30 private int allowedBatchSize;
31
32 @XmlElement
33 private String message = DEFAULT_MESSAGE;
34
35 public BatchSizeExceededException(int allowedBatchSize) {
36 super(DEFAULT_MESSAGE);
37 this.allowedBatchSize = allowedBatchSize;
38
39 if (log.isTraceEnabled()) {
40 log.trace("About to throw BatchSizeExceededException, AllowedBatchSize: {}, Message: {}", allowedBatchSize, message);
41 }
42 }
43
44 public int getAllowedBatchSize() {
45 return allowedBatchSize;
46 }
47 }