Class LocalFederationManagement

    • Field Detail

      • log

        protected final org.slf4j.Logger log
      • federation

        protected final ComponentProvider federation
        The simulation components of this federation.
      • federateDescriptors

        protected final Map<String,​FederateDescriptor> federateDescriptors
        Mapping between federation id and federation descriptors.
      • federateAmbassadors

        protected final Map<String,​FederateAmbassador> federateAmbassadors
        Mapping between federation id and federation ambassador instances.
    • Constructor Detail

      • LocalFederationManagement

        public LocalFederationManagement​(ComponentProvider federation)
        Constructor with string identifying a federation as parameter.
        Parameters:
        federation - federation
    • Method Detail

      • createFederation

        public void createFederation()
        Description copied from interface: FederationManagement
        Creates an empty federation. After calling this method it is possible for federates to join the federation.
        Specified by:
        createFederation in interface FederationManagement
      • addFederate

        public void addFederate​(FederateDescriptor descriptor)
                         throws Exception
        Description copied from interface: FederationManagement
        Adds a federate to the federation. This method can be called either before or during runtime of the simulation of the federation.
        Specified by:
        addFederate in interface FederationManagement
        Parameters:
        descriptor - object containing all data that are necessary to manage the lifecycle of a federate
        Throws:
        Exception
      • isFederateJoined

        public boolean isFederateJoined​(String federateId)
        Description copied from interface: FederationManagement
        Checks whether a federate is joined or not.
        Specified by:
        isFederateJoined in interface FederationManagement
        Parameters:
        federateId - unique string identifying the federate
        Returns:
        a boolean, whether a federate is joined or not
      • getAmbassador

        public FederateAmbassador getAmbassador​(String federateId)
        Description copied from interface: FederationManagement
        Returns a reference to the ambassador associated with the given federate id.
        Specified by:
        getAmbassador in interface FederationManagement
        Parameters:
        federateId - unique string identifying the federate
        Returns:
        ambassador associated with the given federate id
      • deployFederate

        protected void deployFederate​(FederateDescriptor descriptor)
                               throws Exception
        Deploys a federate represented by its descriptor on the local machine.
        Parameters:
        descriptor - federate descriptor consisting all necessary data to deploy a federate
        Throws:
        Exception - if the federate could not be deployed
      • startFederate

        protected void startFederate​(FederateDescriptor handle)
                              throws Exception
        Starts a federate represented by its handle on the local machine.
        Parameters:
        handle - federate handle consisting all necessary data to start a federate
        Throws:
        Exception - if the federate could not be started
      • stopFederate

        protected void stopFederate​(FederateDescriptor handle,
                                    boolean forceStop)
                             throws Exception
        Stops a federate represented by its handle on the local machine.
        Parameters:
        handle - federate handle consisting all necessary data to stop a federate
        Throws:
        Exception - if the federate could not be stopped
      • undeployFederate

        protected void undeployFederate​(FederateDescriptor handle)
                                 throws Exception
        Undeploys a federate represented by its handle on the local machine.
        Parameters:
        handle - federate handle consisting all necessary data to undeploy a federate
        Throws:
        Exception - if the federate could not be undeployed