Class CalendarFeedFetcher
Addresses are the CalendarAddressGuard's: it is the resolver
of the connection manager, so the address of every connection is judged when
the connection is opened; the guard also checks each URL's shape before it is
requested, and redirects are followed here, one hop at a time, each target
checked again. Bounds: a connect timeout, a read timeout, a deadline
over the whole read — redirects included — enforced by cancelling the request,
a body limit counted on the decoded bytes (a compressed body cannot inflate
past it), and a redirect count. Nothing of the platform's goes out: no
cookie store, no credentials, no proxy, no retry; the only headers sent are
the ones a conditional read needs. Nothing of the URL goes into a log:
it may embed a secret.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWhat a read of a link answered. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DurationLongest wait for a connection.static final longLargest body read, in bytes.static final intMost redirects followed.static final StringThe ports a link may reach unless the deployment says otherwise.static final DurationLongest wait between two reads.static final DurationLongest read of a link, redirects included. -
Constructor Summary
ConstructorsConstructorDescriptionCalendarFeedFetcher(boolean allowInternalAddresses, String allowedPorts) The fetcher of a deployment. -
Method Summary
-
Field Details
-
DEFAULT_MAX_BYTES
public static final long DEFAULT_MAX_BYTESLargest body read, in bytes.- See Also:
-
DEFAULT_CONNECT
Longest wait for a connection. -
DEFAULT_READ
Longest wait between two reads. -
DEFAULT_TOTAL
Longest read of a link, redirects included. -
DEFAULT_MAX_REDIRECTS
public static final int DEFAULT_MAX_REDIRECTSMost redirects followed.- See Also:
-
DEFAULT_PORTS
The ports a link may reach unless the deployment says otherwise.- See Also:
-
-
Constructor Details
-
CalendarFeedFetcher
@Autowired public CalendarFeedFetcher(@Value("${exo.agenda.calendarSubscription.allowInternalAddresses:false}") boolean allowInternalAddresses, @Value("${exo.agenda.calendarSubscription.allowedPorts:80,443,8080,8443}") String allowedPorts) The fetcher of a deployment.- Parameters:
allowInternalAddresses- whether internal addresses may be read, false by default: the deployment's opt-out, as caldav-integration'sexo.agenda.caldav.server.allowPrivateAddressesallowedPorts- comma-separated ports a link may reach
-
-
Method Details
-
getGuard
- Returns:
- the address guard, whose URL rules the service applies before a read
-
fetch
public CalendarFeedFetcher.FeedResponse fetch(URI uri, String etag, String lastModified) throws CalendarFeedException Reads a link, conditionally when validators are given.- Parameters:
uri- the URL, already normalized by the guardetag- the entity tag of the previous read, or nulllastModified- the Last-Modified header of the previous read, or null- Returns:
- what the server answered
- Throws:
CalendarFeedException- with the reason nothing usable was read
-
close
@PreDestroy public void close()Stops the deadline thread and closes the connections.
-