public interface ExternalReferenceTranslatorSPI<SourceType extends ExternalReferenceSPI,TargetType extends ExternalReferenceSPI>
ReferenceSetAugmentor
.
This SPI should not be used for cases where an ExternalReferenceSPI is
constructed from a stream of bytes, this is intended for direct reference to
reference translation with the assumption that this is more efficient for
whatever reason. For cases where the reference is constructed from a byte
stream you should implement ExternalReferenceBuilder
instead.
For SPI purposes implementations should be java beans with default constructors, any required state such as the location of remote repositories to which data can be staged will be passed in in the ReferenceContext.
Modifier and Type | Method and Description |
---|---|
TargetType |
createReference(SourceType sourceReference,
ReferenceContext context)
Given an existing ExternalReferenceSPI, build the appropriate target
ExternalReferenceSPI implementation and return it.
|
Class<SourceType> |
getSourceReferenceType()
Return the type of external reference that this translator consumes.
|
Class<TargetType> |
getTargetReferenceType()
Return the type of external reference this translator constructs.
|
float |
getTranslationCost()
Return an approximate complexity cost of the translation.
|
boolean |
isEnabled(ReferenceContext context)
Because the reference translator may rely on facilities provided to it
through the context this method is available to check whether these
facilities are sufficient.
|
TargetType createReference(SourceType sourceReference, ReferenceContext context)
sourceReference
- the reference to be used as source for the translation.context
- a reference resolution context, needed potentially to access
the existing external references or to construct the new one,
especially in cases where the context contains security agents
giving access to a remote data staging systemExternalReferenceConstructionException
- if an error occurs instantiating the new reference.Class<SourceType> getSourceReferenceType()
Class<TargetType> getTargetReferenceType()
boolean isEnabled(ReferenceContext context)
context
- the reference context that will be used to construct new
references during the translation processfloat getTranslationCost()
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.