Interface JavaContext
public interface JavaContext
Contains information about the current request for consumption within the
JavaDelegate.
In order to minimize coupling against user code, no internal application API is exposed.
- Since:
- 5.0
-
Method Summary
Modifier and Type Method Description java.lang.StringgetClientIPAddress()java.util.Map<java.lang.String,java.lang.String>getCookies()java.util.Map<java.lang.String,java.lang.Integer>getFullSize()N.B.: The return value is only available after the image has been accessed; before then, it is an empty map.java.lang.StringgetIdentifier()java.lang.StringgetLocalURI()java.util.Map<java.lang.String,java.lang.Object>getMetadata()Map with the following structure:java.util.List<java.util.Map<java.lang.String,java.lang.Object>>getOperations()N.B.: The return value is only available after the image has been accessed; before then, it is an empty map.java.lang.StringgetOutputFormat()N.B.: The return value is only available after the image has been accessed; before then, it is an empty map.java.lang.IntegergetPageNumber()java.util.Map<java.lang.String,java.lang.String>getRequestHeaders()java.lang.StringgetRequestURI()java.util.Map<java.lang.String,java.lang.Integer>getResultingSize()N.B.: The return value is only available after the image has been accessed; before then, it is an empty map.int[]getScaleConstraint()
-
Method Details
-
getClientIPAddress
java.lang.String getClientIPAddress()- Returns:
- Client IP address.
-
getCookies
java.util.Map<java.lang.String,java.lang.String> getCookies()- Returns:
- Map of cookie name-value pairs, or an empty map if none exist.
-
getFullSize
java.util.Map<java.lang.String,java.lang.Integer> getFullSize()N.B.: The return value is only available after the image has been accessed; before then, it is an empty map.- Returns:
- Map with
widthandheightkeys corresponding to the pixel dimensions of the source image.
-
getIdentifier
java.lang.String getIdentifier()- Returns:
- Image identifier.
-
getLocalURI
java.lang.String getLocalURI()- Returns:
- URI seen by the application, which may be different from
getRequestURI()when operating behind a reverse proxy server.
-
getMetadata
java.util.Map<java.lang.String,java.lang.Object> getMetadata()Map with the following structure:
{ "exif": { "tagSet": "Baseline TIFF", "fields": { "Field1Name": value, "Field2Name": value, "EXIFIFD": { "tagSet": "EXIF", "fields": { "Field1Name": value, "Field2Name": value } } } }, "iptc": [ "Field1Name": value, "Field2Name": value ], "xmp_string": "<rdf:RDF>...</rdf:RDF>", "xmp_model": https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Model.html "native": { # structure varies } }- The
exifkey refers to embedded EXIF data. This also includes IFD0 metadata from source TIFFs, whether or not an EXIF IFD is present. - The
iptckey refers to embedded IPTC IIM data. - The
xmp_stringkey refers to raw embedded XMP data, which may or may not contain EXIF and/or IPTC information. - The
xmp_modelkey contains aorg.apache.jena.rdf.model.Modelobject pre-loaded with the contents ofxmp_string. - The
nativekey refers to format-specific metadata.
Any combination of the above keys may be present or missing depending on what is available in a particular source image.
N.B.: The return value is only available after the image has been accessed; before then, it is an empty map.
- Returns:
- See above.
- The
-
getOperations
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getOperations()N.B.: The return value is only available after the image has been accessed; before then, it is an empty map.- Returns:
- List of operations in order of application. Only operations that
are not no-ops are included. Every map contains a
classkey corresponding to the operation class name, which will be one of theedu.illinois.library.cantaloupe.operation.Operationimplementations.
-
getOutputFormat
java.lang.String getOutputFormat()N.B.: The return value is only available after the image has been accessed; before then, it is an empty map.- Returns:
- Output format media (MIME) type.
-
getPageNumber
java.lang.Integer getPageNumber()- Returns:
- Page number requested by the client.
-
getRequestHeaders
java.util.Map<java.lang.String,java.lang.String> getRequestHeaders()- Returns:
- Map of header name-value pairs.
-
getRequestURI
java.lang.String getRequestURI()- Returns:
- URI requested by the client.
-
getResultingSize
java.util.Map<java.lang.String,java.lang.Integer> getResultingSize()N.B.: The return value is only available after the image has been accessed; before then, it is an empty map.- Returns:
- Map with
widthandheightkeys corresponding to the pixel dimensions of the resulting image after all operations have been applied.
-
getScaleConstraint
int[] getScaleConstraint()- Returns:
- Two-element array with numerator at position 0 and denominator at position 1.
-