io.ciera.tool.sql.ooaofooa.message.impl.MSG_MImpl Maven / Gradle / Ivy
package io.ciera.tool.sql.ooaofooa.message.impl;
import io.ciera.runtime.instanceloading.AttributeChangedDelta;
import io.ciera.runtime.instanceloading.InstanceCreatedDelta;
import io.ciera.runtime.summit.application.IRunContext;
import io.ciera.runtime.summit.classes.IInstanceIdentifier;
import io.ciera.runtime.summit.classes.InstanceIdentifier;
import io.ciera.runtime.summit.classes.ModelInstance;
import io.ciera.runtime.summit.exceptions.EmptyInstanceException;
import io.ciera.runtime.summit.exceptions.InstancePopulationException;
import io.ciera.runtime.summit.exceptions.XtumlException;
import io.ciera.runtime.summit.types.IWhere;
import io.ciera.runtime.summit.types.IXtumlType;
import io.ciera.runtime.summit.types.UniqueId;
import io.ciera.tool.Sql;
import io.ciera.tool.sql.ooaofooa.interaction.InteractionParticipant;
import io.ciera.tool.sql.ooaofooa.interaction.impl.InteractionParticipantImpl;
import io.ciera.tool.sql.ooaofooa.message.AsynchronousMessage;
import io.ciera.tool.sql.ooaofooa.message.MSG_M;
import io.ciera.tool.sql.ooaofooa.message.MessageArgument;
import io.ciera.tool.sql.ooaofooa.message.MessageArgumentSet;
import io.ciera.tool.sql.ooaofooa.message.ReturnMessage;
import io.ciera.tool.sql.ooaofooa.message.SynchronousMessage;
import io.ciera.tool.sql.ooaofooa.message.impl.AsynchronousMessageImpl;
import io.ciera.tool.sql.ooaofooa.message.impl.MessageArgumentSetImpl;
import io.ciera.tool.sql.ooaofooa.message.impl.ReturnMessageImpl;
import io.ciera.tool.sql.ooaofooa.message.impl.SynchronousMessageImpl;
import io.ciera.tool.sql.ooaofooa.packageableelement.PackageableElement;
import io.ciera.tool.sql.ooaofooa.packageableelement.impl.PackageableElementImpl;
public class MSG_MImpl extends ModelInstance implements MSG_M {
public static final String KEY_LETTERS = "MSG_M";
public static final MSG_M EMPTY_MSG_M = new EmptyMSG_M();
private Sql context;
// constructors
private MSG_MImpl( Sql context ) {
this.context = context;
ref_Msg_ID = UniqueId.random();
ref_Receiver_Part_ID = UniqueId.random();
ref_Sender_Part_ID = UniqueId.random();
m_participatesInCommunication = false;
R1000_has_an_informal_MessageArgument_set = new MessageArgumentSetImpl();
R1001_has_a_formal_MessageArgument_set = new MessageArgumentSetImpl();
R1007_has_destination_InteractionParticipant_inst = InteractionParticipantImpl.EMPTY_INTERACTIONPARTICIPANT;
R1008_has_source_InteractionParticipant_inst = InteractionParticipantImpl.EMPTY_INTERACTIONPARTICIPANT;
R1018_is_a_AsynchronousMessage_inst = AsynchronousMessageImpl.EMPTY_ASYNCHRONOUSMESSAGE;
R1018_is_a_ReturnMessage_inst = ReturnMessageImpl.EMPTY_RETURNMESSAGE;
R1018_is_a_SynchronousMessage_inst = SynchronousMessageImpl.EMPTY_SYNCHRONOUSMESSAGE;
R8001_is_a_PackageableElement_inst = PackageableElementImpl.EMPTY_PACKAGEABLEELEMENT;
}
private MSG_MImpl( Sql context, UniqueId instanceId, UniqueId ref_Msg_ID, UniqueId ref_Receiver_Part_ID, UniqueId ref_Sender_Part_ID, boolean m_participatesInCommunication ) {
super(instanceId);
this.context = context;
this.ref_Msg_ID = ref_Msg_ID;
this.ref_Receiver_Part_ID = ref_Receiver_Part_ID;
this.ref_Sender_Part_ID = ref_Sender_Part_ID;
this.m_participatesInCommunication = m_participatesInCommunication;
R1000_has_an_informal_MessageArgument_set = new MessageArgumentSetImpl();
R1001_has_a_formal_MessageArgument_set = new MessageArgumentSetImpl();
R1007_has_destination_InteractionParticipant_inst = InteractionParticipantImpl.EMPTY_INTERACTIONPARTICIPANT;
R1008_has_source_InteractionParticipant_inst = InteractionParticipantImpl.EMPTY_INTERACTIONPARTICIPANT;
R1018_is_a_AsynchronousMessage_inst = AsynchronousMessageImpl.EMPTY_ASYNCHRONOUSMESSAGE;
R1018_is_a_ReturnMessage_inst = ReturnMessageImpl.EMPTY_RETURNMESSAGE;
R1018_is_a_SynchronousMessage_inst = SynchronousMessageImpl.EMPTY_SYNCHRONOUSMESSAGE;
R8001_is_a_PackageableElement_inst = PackageableElementImpl.EMPTY_PACKAGEABLEELEMENT;
}
public static MSG_M create( Sql context ) throws XtumlException {
MSG_M newMSG_M = new MSG_MImpl( context );
if ( context.addInstance( newMSG_M ) ) {
newMSG_M.getRunContext().addChange(new InstanceCreatedDelta(newMSG_M, KEY_LETTERS));
return newMSG_M;
}
else throw new InstancePopulationException( "Instance already exists within this population." );
}
public static MSG_M create( Sql context, UniqueId ref_Msg_ID, UniqueId ref_Receiver_Part_ID, UniqueId ref_Sender_Part_ID, boolean m_participatesInCommunication ) throws XtumlException {
return create(context, UniqueId.random(), ref_Msg_ID, ref_Receiver_Part_ID, ref_Sender_Part_ID, m_participatesInCommunication);
}
public static MSG_M create( Sql context, UniqueId instanceId, UniqueId ref_Msg_ID, UniqueId ref_Receiver_Part_ID, UniqueId ref_Sender_Part_ID, boolean m_participatesInCommunication ) throws XtumlException {
MSG_M newMSG_M = new MSG_MImpl( context, instanceId, ref_Msg_ID, ref_Receiver_Part_ID, ref_Sender_Part_ID, m_participatesInCommunication );
if ( context.addInstance( newMSG_M ) ) {
return newMSG_M;
}
else throw new InstancePopulationException( "Instance already exists within this population." );
}
// attributes
private UniqueId ref_Msg_ID;
@Override
public UniqueId getMsg_ID() throws XtumlException {
checkLiving();
return ref_Msg_ID;
}
@Override
public void setMsg_ID(UniqueId ref_Msg_ID) throws XtumlException {
checkLiving();
if (ref_Msg_ID.inequality( this.ref_Msg_ID)) {
final UniqueId oldValue = this.ref_Msg_ID;
this.ref_Msg_ID = ref_Msg_ID;
getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_Msg_ID", oldValue, this.ref_Msg_ID));
if ( !R1001_has_a_formal_MessageArgument().isEmpty() ) R1001_has_a_formal_MessageArgument().setFormal_Msg_ID( ref_Msg_ID );
if ( !R1018_is_a_ReturnMessage().isEmpty() ) R1018_is_a_ReturnMessage().setMsg_ID( ref_Msg_ID );
if ( !R1018_is_a_AsynchronousMessage().isEmpty() ) R1018_is_a_AsynchronousMessage().setMsg_ID( ref_Msg_ID );
if ( !R1000_has_an_informal_MessageArgument().isEmpty() ) R1000_has_an_informal_MessageArgument().setInformal_Msg_ID( ref_Msg_ID );
if ( !R1018_is_a_SynchronousMessage().isEmpty() ) R1018_is_a_SynchronousMessage().setMsg_ID( ref_Msg_ID );
}
}
private UniqueId ref_Receiver_Part_ID;
@Override
public UniqueId getReceiver_Part_ID() throws XtumlException {
checkLiving();
return ref_Receiver_Part_ID;
}
@Override
public void setReceiver_Part_ID(UniqueId ref_Receiver_Part_ID) throws XtumlException {
checkLiving();
if (ref_Receiver_Part_ID.inequality( this.ref_Receiver_Part_ID)) {
final UniqueId oldValue = this.ref_Receiver_Part_ID;
this.ref_Receiver_Part_ID = ref_Receiver_Part_ID;
getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_Receiver_Part_ID", oldValue, this.ref_Receiver_Part_ID));
}
}
private UniqueId ref_Sender_Part_ID;
@Override
public void setSender_Part_ID(UniqueId ref_Sender_Part_ID) throws XtumlException {
checkLiving();
if (ref_Sender_Part_ID.inequality( this.ref_Sender_Part_ID)) {
final UniqueId oldValue = this.ref_Sender_Part_ID;
this.ref_Sender_Part_ID = ref_Sender_Part_ID;
getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_Sender_Part_ID", oldValue, this.ref_Sender_Part_ID));
}
}
@Override
public UniqueId getSender_Part_ID() throws XtumlException {
checkLiving();
return ref_Sender_Part_ID;
}
private boolean m_participatesInCommunication;
@Override
public boolean getParticipatesInCommunication() throws XtumlException {
checkLiving();
return m_participatesInCommunication;
}
@Override
public void setParticipatesInCommunication(boolean m_participatesInCommunication) throws XtumlException {
checkLiving();
if (m_participatesInCommunication != this.m_participatesInCommunication) {
final boolean oldValue = this.m_participatesInCommunication;
this.m_participatesInCommunication = m_participatesInCommunication;
getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "m_participatesInCommunication", oldValue, this.m_participatesInCommunication));
}
}
// instance identifiers
@Override
public IInstanceIdentifier getId1() {
try {
return new InstanceIdentifier(getMsg_ID());
}
catch ( XtumlException e ) {
getRunContext().getLog().error(e);
System.exit(1);
return null;
}
}
// operations
// static operations
// events
// selections
private MessageArgumentSet R1000_has_an_informal_MessageArgument_set;
@Override
public void addR1000_has_an_informal_MessageArgument( MessageArgument inst ) {
R1000_has_an_informal_MessageArgument_set.add(inst);
}
@Override
public void removeR1000_has_an_informal_MessageArgument( MessageArgument inst ) {
R1000_has_an_informal_MessageArgument_set.remove(inst);
}
@Override
public MessageArgumentSet R1000_has_an_informal_MessageArgument() throws XtumlException {
return R1000_has_an_informal_MessageArgument_set;
}
private MessageArgumentSet R1001_has_a_formal_MessageArgument_set;
@Override
public void addR1001_has_a_formal_MessageArgument( MessageArgument inst ) {
R1001_has_a_formal_MessageArgument_set.add(inst);
}
@Override
public void removeR1001_has_a_formal_MessageArgument( MessageArgument inst ) {
R1001_has_a_formal_MessageArgument_set.remove(inst);
}
@Override
public MessageArgumentSet R1001_has_a_formal_MessageArgument() throws XtumlException {
return R1001_has_a_formal_MessageArgument_set;
}
private InteractionParticipant R1007_has_destination_InteractionParticipant_inst;
@Override
public void setR1007_has_destination_InteractionParticipant( InteractionParticipant inst ) {
R1007_has_destination_InteractionParticipant_inst = inst;
}
@Override
public InteractionParticipant R1007_has_destination_InteractionParticipant() throws XtumlException {
return R1007_has_destination_InteractionParticipant_inst;
}
private InteractionParticipant R1008_has_source_InteractionParticipant_inst;
@Override
public void setR1008_has_source_InteractionParticipant( InteractionParticipant inst ) {
R1008_has_source_InteractionParticipant_inst = inst;
}
@Override
public InteractionParticipant R1008_has_source_InteractionParticipant() throws XtumlException {
return R1008_has_source_InteractionParticipant_inst;
}
private AsynchronousMessage R1018_is_a_AsynchronousMessage_inst;
@Override
public void setR1018_is_a_AsynchronousMessage( AsynchronousMessage inst ) {
R1018_is_a_AsynchronousMessage_inst = inst;
}
@Override
public AsynchronousMessage R1018_is_a_AsynchronousMessage() throws XtumlException {
return R1018_is_a_AsynchronousMessage_inst;
}
private ReturnMessage R1018_is_a_ReturnMessage_inst;
@Override
public void setR1018_is_a_ReturnMessage( ReturnMessage inst ) {
R1018_is_a_ReturnMessage_inst = inst;
}
@Override
public ReturnMessage R1018_is_a_ReturnMessage() throws XtumlException {
return R1018_is_a_ReturnMessage_inst;
}
private SynchronousMessage R1018_is_a_SynchronousMessage_inst;
@Override
public void setR1018_is_a_SynchronousMessage( SynchronousMessage inst ) {
R1018_is_a_SynchronousMessage_inst = inst;
}
@Override
public SynchronousMessage R1018_is_a_SynchronousMessage() throws XtumlException {
return R1018_is_a_SynchronousMessage_inst;
}
private PackageableElement R8001_is_a_PackageableElement_inst;
@Override
public void setR8001_is_a_PackageableElement( PackageableElement inst ) {
R8001_is_a_PackageableElement_inst = inst;
}
@Override
public PackageableElement R8001_is_a_PackageableElement() throws XtumlException {
return R8001_is_a_PackageableElement_inst;
}
@Override
public IRunContext getRunContext() {
return context().getRunContext();
}
@Override
public Sql context() {
return context;
}
@Override
public String getKeyLetters() {
return KEY_LETTERS;
}
@Override
public MSG_M self() {
return this;
}
@Override
public MSG_M oneWhere(IWhere condition) throws XtumlException {
if (null == condition) throw new XtumlException("Null condition passed to selection.");
if (condition.evaluate(this)) return this;
else return EMPTY_MSG_M;
}
}
class EmptyMSG_M extends ModelInstance implements MSG_M {
// attributes
public UniqueId getMsg_ID() throws XtumlException {
throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
}
public void setMsg_ID( UniqueId ref_Msg_ID ) throws XtumlException {
throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
}
public UniqueId getReceiver_Part_ID() throws XtumlException {
throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
}
public void setReceiver_Part_ID( UniqueId ref_Receiver_Part_ID ) throws XtumlException {
throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
}
public void setSender_Part_ID( UniqueId ref_Sender_Part_ID ) throws XtumlException {
throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
}
public UniqueId getSender_Part_ID() throws XtumlException {
throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
}
public boolean getParticipatesInCommunication() throws XtumlException {
throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
}
public void setParticipatesInCommunication( boolean m_participatesInCommunication ) throws XtumlException {
throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
}
// operations
// selections
@Override
public MessageArgumentSet R1000_has_an_informal_MessageArgument() {
return (new MessageArgumentSetImpl());
}
@Override
public MessageArgumentSet R1001_has_a_formal_MessageArgument() {
return (new MessageArgumentSetImpl());
}
@Override
public InteractionParticipant R1007_has_destination_InteractionParticipant() {
return InteractionParticipantImpl.EMPTY_INTERACTIONPARTICIPANT;
}
@Override
public InteractionParticipant R1008_has_source_InteractionParticipant() {
return InteractionParticipantImpl.EMPTY_INTERACTIONPARTICIPANT;
}
@Override
public AsynchronousMessage R1018_is_a_AsynchronousMessage() {
return AsynchronousMessageImpl.EMPTY_ASYNCHRONOUSMESSAGE;
}
@Override
public ReturnMessage R1018_is_a_ReturnMessage() {
return ReturnMessageImpl.EMPTY_RETURNMESSAGE;
}
@Override
public SynchronousMessage R1018_is_a_SynchronousMessage() {
return SynchronousMessageImpl.EMPTY_SYNCHRONOUSMESSAGE;
}
@Override
public PackageableElement R8001_is_a_PackageableElement() {
return PackageableElementImpl.EMPTY_PACKAGEABLEELEMENT;
}
@Override
public String getKeyLetters() {
return MSG_MImpl.KEY_LETTERS;
}
@Override
public MSG_M self() {
return this;
}
@Override
public boolean isEmpty() {
return true;
}
@Override
public MSG_M oneWhere(IWhere condition) throws XtumlException {
if (null == condition) throw new XtumlException("Null condition passed to selection.");
return MSG_MImpl.EMPTY_MSG_M;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy