Package org.ivoa.dm.executionbroker
Class SimpleExecutionSession
java.lang.Object
org.ivoa.dm.executionbroker.AbstractExecutionSession
org.ivoa.dm.executionbroker.SimpleExecutionSession
- All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations,org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
- Direct Known Subclasses:
ScheduledExecutionSession
@Entity
@VoDml(id="execbroker:SimpleExecutionSession",
role=objectType)
public class SimpleExecutionSession
extends AbstractExecutionSession
implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
A simple execution session.
objectType: SimpleExecutionSession
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder class for SimpleExecutionSession, mainly for use in the functional builder pattern.Nested classes/interfaces inherited from class org.ivoa.dm.executionbroker.AbstractExecutionSession
AbstractExecutionSession.AbstractExecutionSessionBuilder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SimpleExecutionComponents.protected List<SimpleSessionConnector>A list of connectors to interact with the session.protected DateThe date and time when this offer expires.protected SimpleExecutionSessionPhase.Fields inherited from class org.ivoa.dm.executionbroker.AbstractExecutionSession
_id -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new SimpleExecutionSessionSimpleExecutionSession(AbstractExecutionSession superinstance, SimpleExecutionSessionPhase phase, Date expires, SimpleExecutionComponents components, List<SimpleSessionConnector> connectors) Constructor from supertype instance.Copy Constructor.SimpleExecutionSession(SimpleExecutionSessionPhase phase, Date expires, SimpleExecutionComponents components, List<SimpleSessionConnector> connectors) full parameter constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a org.ivoa.dm.executionbroker.SimpleSessionConnector to the composition.copyMe()make a clone of the object taking into account current polymorhic type.static SimpleExecutionSessioncreate a SimpleExecutionSession in functional builder style.voiddelete(jakarta.persistence.EntityManager em) voidReturns components Attribute.Returns connectors composition as an immutable list.Returns expires Attribute.getPhase()Returns phase Attribute.voidRemove a org.ivoa.dm.executionbroker.SimpleSessionConnector from the composition.voidupdate a org.ivoa.dm.executionbroker.SimpleSessionConnector in the composition.voidsetComponents(SimpleExecutionComponents pComponents) Set components Attribute.voidsetConnectors(List<SimpleSessionConnector> pConnectors) Defines whole connectors composition.voidsetExpires(Date pExpires) Set expires Attribute.voidsetPhase(SimpleExecutionSessionPhase pPhase) Set phase Attribute.voidUpdate this object with the content of the given object.withComponents(SimpleExecutionComponents pComponents) fluent setter for components Attribute.withExpires(Date pExpires) fluent setter for expires Attribute.withPhase(SimpleExecutionSessionPhase pPhase) fluent setter for phase Attribute.Methods inherited from class org.ivoa.dm.executionbroker.AbstractExecutionSession
createAbstractExecutionSession, getId, updateUsingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ivoa.vodml.jpa.JPAManipulationsForObjectType
getId
-
Field Details
-
phase
@VoDml(id="execbroker:SimpleExecutionSession.phase", role=attribute, type="execbroker:SimpleExecutionSessionPhase", typeRole=enumeration) protected SimpleExecutionSessionPhase phase. : Attribute phase : multiplicity 1 -
expires
@VoDml(id="execbroker:SimpleExecutionSession.expires", role=attribute, type="ivoa:datetime", typeRole=primitiveType) protected Date expiresThe date and time when this offer expires. Only valid while the state is OFFERED. : Attribute expires : multiplicity 1 -
components
@VoDml(id="execbroker:SimpleExecutionSession.components", role=composition, type="execbroker:SimpleExecutionComponents", typeRole=objectType) protected SimpleExecutionComponents components. composition components : ( Multiplicity : 1 ) -
connectors
@VoDml(id="execbroker:SimpleExecutionSession.connectors", role=composition, type="execbroker:SimpleSessionConnector", typeRole=objectType) protected List<SimpleSessionConnector> connectorsA list of connectors to interact with the session. composition connectors : ( Multiplicity : 1..* )
-
-
Constructor Details
-
SimpleExecutionSession
public SimpleExecutionSession()Creates a new SimpleExecutionSession -
SimpleExecutionSession
public SimpleExecutionSession(SimpleExecutionSessionPhase phase, Date expires, SimpleExecutionComponents components, List<SimpleSessionConnector> connectors) full parameter constructor.- Parameters:
phase- .expires- The date and time when this offer expires. Only valid while the state is OFFERED.components- .connectors- A list of connectors to interact with the session.
-
SimpleExecutionSession
Copy Constructor. Note that references will remain as is rather than be copied.- Parameters:
other- the object to be copied.
-
SimpleExecutionSession
public SimpleExecutionSession(AbstractExecutionSession superinstance, SimpleExecutionSessionPhase phase, Date expires, SimpleExecutionComponents components, List<SimpleSessionConnector> connectors) Constructor from supertype instance.- Parameters:
superinstance- The supertype.phase- .expires- The date and time when this offer expires. Only valid while the state is OFFERED.components- .connectors- A list of connectors to interact with the session.
-
-
Method Details
-
copyMe
make a clone of the object taking into account current polymorhic type.- Overrides:
copyMein classAbstractExecutionSession- Returns:
- the cloned object.
-
updateUsing
Update this object with the content of the given object. Note that references will remain as is rather than be copied.- Parameters:
other- the object to be copied.
-
getPhase
Returns phase Attribute.- Returns:
- phase Attribute
-
setPhase
Set phase Attribute.- Parameters:
pPhase- value to set
-
withPhase
fluent setter for phase Attribute.- Parameters:
pPhase- value to set- Returns:
- SimpleExecutionSession
-
getExpires
Returns expires Attribute.- Returns:
- expires Attribute
-
setExpires
Set expires Attribute.- Parameters:
pExpires- value to set
-
withExpires
fluent setter for expires Attribute.- Parameters:
pExpires- value to set- Returns:
- SimpleExecutionSession
-
getComponents
Returns components Attribute.- Returns:
- components Attribute
-
setComponents
Set components Attribute.- Parameters:
pComponents- value to set
-
withComponents
fluent setter for components Attribute.- Parameters:
pComponents- value to set- Returns:
- SimpleExecutionSession
-
getConnectors
Returns connectors composition as an immutable list.- Returns:
- connectors composition.
-
setConnectors
Defines whole connectors composition.- Parameters:
pConnectors- composition to set.
-
addToConnectors
Add a org.ivoa.dm.executionbroker.SimpleSessionConnector to the composition.- Parameters:
p- org.ivoa.dm.executionbroker.SimpleSessionConnector to add
-
removeFromConnectors
Remove a org.ivoa.dm.executionbroker.SimpleSessionConnector from the composition.- Parameters:
p- org.ivoa.dm.executionbroker.SimpleSessionConnector to remove
-
replaceInConnectors
update a org.ivoa.dm.executionbroker.SimpleSessionConnector in the composition.- Parameters:
_p- org.ivoa.dm.executionbroker.SimpleSessionConnector to update the match is done via the database key
-
createSimpleExecutionSession
public static SimpleExecutionSession createSimpleExecutionSession(Consumer<SimpleExecutionSession.SimpleExecutionSessionBuilder> f) create a SimpleExecutionSession in functional builder style.- Parameters:
f- the functional builder.- Returns:
- an object initialized from the builder.
-
forceLoad
public void forceLoad()- Specified by:
forceLoadin interfaceorg.ivoa.vodml.jpa.JPAManipulations- Overrides:
forceLoadin classAbstractExecutionSession
-
delete
public void delete(jakarta.persistence.EntityManager em) - Specified by:
deletein interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>- Overrides:
deletein classAbstractExecutionSession
-