public class GreenToRed extends Object implements ExternalReferenceTranslatorSPI<GreenReference,RedReference>
Constructor and Description |
---|
GreenToRed() |
Modifier and Type | Method and Description |
---|---|
RedReference |
createReference(GreenReference ref,
ReferenceContext context)
Given an existing ExternalReferenceSPI, build the appropriate target
ExternalReferenceSPI implementation and return it.
|
Class<GreenReference> |
getSourceReferenceType()
Return the type of external reference that this translator consumes.
|
Class<RedReference> |
getTargetReferenceType()
Return the type of external reference this translator constructs.
|
float |
getTranslationCost()
Return an approximate complexity cost of the translation.
|
boolean |
isEnabled(ReferenceContext arg0)
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.
|
public RedReference createReference(GreenReference ref, ReferenceContext context)
ExternalReferenceTranslatorSPI
createReference
in interface ExternalReferenceTranslatorSPI<GreenReference,RedReference>
ref
- 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 systempublic Class<GreenReference> getSourceReferenceType()
ExternalReferenceTranslatorSPI
getSourceReferenceType
in interface ExternalReferenceTranslatorSPI<GreenReference,RedReference>
public Class<RedReference> getTargetReferenceType()
ExternalReferenceTranslatorSPI
getTargetReferenceType
in interface ExternalReferenceTranslatorSPI<GreenReference,RedReference>
public float getTranslationCost()
ExternalReferenceTranslatorSPI
getTranslationCost
in interface ExternalReferenceTranslatorSPI<GreenReference,RedReference>
public boolean isEnabled(ReferenceContext arg0)
ExternalReferenceTranslatorSPI
isEnabled
in interface ExternalReferenceTranslatorSPI<GreenReference,RedReference>
arg0
- the reference context that will be used to construct new
references during the translation processCopyright © 2015–2016 The Apache Software Foundation. All rights reserved.