Interface TransformationContext
-
- All Known Subinterfaces:
ResourceTransformationContext
public interface TransformationContext- Author:
- Tomaz Cerar
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <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> TgetAttachment(OperationContext.AttachmentKey<T> key)Retrieves an object that has been attached to this context.TransformersLoggergetLogger()Returns Transformers logger that must be used for reporting any problems with transformationProcessTypegetProcessType()Get the type of process in which this operation is executing.ImmutableManagementResourceRegistrationgetResourceRegistration(PathAddress address)Get the management resource registration.ImmutableManagementResourceRegistrationgetResourceRegistrationFromRoot(PathAddress address)Get the management resource registration.RunningModegetRunningMode()Gets the running mode of the process.TransformationTargetgetTarget()Get the transformation target.ResourcereadResource(PathAddress address)Read a model resource.ResourcereadResourceFromRoot(PathAddress address)Read a model resource from the root.
-
-
-
Method Detail
-
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
ImmutableManagementResourceRegistration getResourceRegistration(PathAddress address)
Get the management resource registration.- Parameters:
address- the path address- Returns:
- the registration
-
getResourceRegistrationFromRoot
ImmutableManagementResourceRegistration getResourceRegistrationFromRoot(PathAddress address)
Get the management resource registration.- Parameters:
address- the path address- Returns:
- the registration
-
readResource
Resource readResource(PathAddress address)
Read a model resource.- Parameters:
address- the path address- Returns:
- a read-only resource
-
readResourceFromRoot
Resource readResourceFromRoot(PathAddress address)
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
<T> T getAttachment(OperationContext.AttachmentKey<T> key)
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
<T> T attach(OperationContext.AttachmentKey<T> key, T value)
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
<T> T attachIfAbsent(OperationContext.AttachmentKey<T> key, T value)
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
<T> T detach(OperationContext.AttachmentKey<T> key)
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.
-
-