public abstract class InteractionContext<T extends org.apache.isis.applib.events.InteractionEvent> extends Object
Facet of) the
domain object.
There are two main responsibilities:
AuthenticationSession.
Defining this as a separate interface makes for a more stable APIInteractionEvent (more on
this below).
The InteractionContext hierarchy is parallel to the
InteractionEvent hierarchy. Having parallel hierarchies is a bit of a
code-smell. However, it is required because the context hierarchy is internal to the framework (with references to
ObjectAdapters, AuthenticationSessions and so forth), whereas
the event hierarchy is part of the corelib, that is
public API.
The class is genericized so that the factory
method can return the correct subclass without having to downcast.
| Constructor and Description |
|---|
InteractionContext(InteractionContextType interactionType,
DeploymentCategory deploymentCategory,
AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
org.apache.isis.applib.Identifier identifier,
ObjectAdapter target) |
| Modifier and Type | Method and Description |
|---|---|
abstract T |
createInteractionEvent()
Factory method to create corresponding
InteractionEvent. |
Map<Integer,ObjectAdapter> |
getContributeeAsMap() |
DeploymentCategory |
getDeploymentCategory() |
org.apache.isis.applib.Identifier |
getIdentifier()
The identifier of the object or member that is being identified with.
|
InteractionContextType |
getInteractionType()
The type of interaction.
|
InteractionInvocationMethod |
getInvocationMethod()
How the interaction was initiated.
|
AuthenticationSession |
getSession()
The
user or role that is performing this
interaction. |
ObjectAdapter |
getTarget()
The target object that this interaction is with.
|
boolean |
isProgrammatic()
Convenience method that indicates whether the
interaction was invoked programmatically. |
void |
putContributee(int contributeeParam,
ObjectAdapter contributee) |
public InteractionContext(InteractionContextType interactionType, DeploymentCategory deploymentCategory, AuthenticationSession session, InteractionInvocationMethod invocationMethod, org.apache.isis.applib.Identifier identifier, ObjectAdapter target)
public DeploymentCategory getDeploymentCategory()
public InteractionContextType getInteractionType()
Available for use by Facets that apply only in certain
conditions. For example, some facets for collections will care only when
an object is being added to the collection, but won't care when an object
is being removed from the collection.
Alternatively, Facets can use instanceof.
public org.apache.isis.applib.Identifier getIdentifier()
If the type is
InteractionContextType.OBJECT_VALIDATE, will be the identifier of
the target object's specification. Otherwise will be
the identifier of the member.
public AuthenticationSession getSession()
user or role that is performing this
interaction.public InteractionInvocationMethod getInvocationMethod()
public boolean isProgrammatic()
interaction was invoked programmatically.public ObjectAdapter getTarget()
public void putContributee(int contributeeParam, ObjectAdapter contributee)
public Map<Integer,ObjectAdapter> getContributeeAsMap()
public abstract T createInteractionEvent()
InteractionEvent.Copyright © 2010–2014 The Apache Software Foundation. All rights reserved.