Interface TransformationContext
- All Known Subinterfaces:
ResourceTransformationContext
public interface TransformationContext
- Author:
- Tomaz Cerar
-
Method Summary
Modifier and TypeMethodDescription<T> Tattach(OperationContext.AttachmentKey<T> key, T value) Attaches an arbitrary object to this context.<T> TattachIfAbsent(OperationContext.AttachmentKey<T> key, T value) Attaches an arbitrary object to this context only if the object was not already attached.<T> Tdetach(OperationContext.AttachmentKey<T> key) Detaches or removes the value from this context.<T> TRetrieves an object that has been attached to this context.Returns Transformers logger that must be used for reporting any problems with transformationGet the type of process in which this operation is executing.getResourceRegistration(PathAddress address) Get the management resource registration.Get the management resource registration.Gets the running mode of the process.Get the transformation target.readResource(PathAddress address) Read a model resource.readResourceFromRoot(PathAddress address) Read a model resource from the root.
-
Method Details
-
getTarget
TransformationTarget getTarget()Get the transformation target.- Returns:
- the transformation target
-
getProcessType
ProcessType getProcessType()Get the type of process in which this operation is executing.- Returns:
- the process type. Will not be
null
-
getRunningMode
RunningMode getRunningMode()Gets the running mode of the process.- Returns:
- the running mode. Will not be
null
-
getResourceRegistration
Get the management resource registration.- Parameters:
address- the path address- Returns:
- the registration
-
getResourceRegistrationFromRoot
Get the management resource registration.- Parameters:
address- the path address- Returns:
- the registration
-
readResource
Read a model resource.- Parameters:
address- the path address- Returns:
- a read-only resource
-
readResourceFromRoot
Read a model resource from the root.- Parameters:
address- the path address- Returns:
- the read-only resource
-
getLogger
TransformersLogger getLogger()Returns Transformers logger that must be used for reporting any problems with transformation- Returns:
- TransformersLogger associated with target host
-
getAttachment
Retrieves an object that has been attached to this context.- Type Parameters:
T- the value type of the attachment.- Parameters:
key- the key to the attachment.- Returns:
- the attachment if found otherwise
null.
-
attach
Attaches an arbitrary object to this context.- Type Parameters:
T- the value type of the attachment.- Parameters:
key- they attachment key used to ensure uniqueness and used for retrieval of the value.value- the value to store.- Returns:
- the previous value associated with the key or
nullif there was no previous value.
-
attachIfAbsent
Attaches an arbitrary object to this context only if the object was not already attached. If a value has already been attached with the key provided, the current value associated with the key is returned.- Type Parameters:
T- the value type of the attachment.- Parameters:
key- they attachment key used to ensure uniqueness and used for retrieval of the value.value- the value to store.- Returns:
- the previous value associated with the key or
nullif there was no previous value.
-
detach
Detaches or removes the value from this context.- Type Parameters:
T- the value type of the attachment.- Parameters:
key- the key to the attachment.- Returns:
- the attachment if found otherwise
null.
-