Class ArchitecturalTemplateAPI


  • public final class ArchitecturalTemplateAPI
    extends Object
    An API class providing methods to interact with Architectural Templates
    • Method Detail

      • getArchitecturalTemplate

        public static AT getArchitecturalTemplate​(org.modelversioning.emfprofile.Stereotype stereotype)
      • getRole

        public static Role getRole​(org.modelversioning.emfprofile.Stereotype stereotype)
        Gets the Role associated with the given Stereotype.
        Parameters:
        stereotype - the Stereotype
        Returns:
        the Role
        Throws:
        RuntimeException - if the given stereotype does not conform the role-convention.
      • getArchitecturalTemplate

        public static AT getArchitecturalTemplate​(org.modelversioning.emfprofile.Profile profile)
        Gets the AT associated with the given Profile.
        Parameters:
        profile - the Profile
        Returns:
        the AT
        Throws:
        RuntimeException - if the given architectural template does not conform the Architectural-Template-convention.
      • isRole

        public static boolean isRole​(org.modelversioning.emfprofile.Stereotype stereotype)
        Tests whether a Stereotype conforms the role-convention (a tagged-value for the #ROLE_URI exists). {@see #isRole}
      • isSystemRole

        public static boolean isSystemRole​(org.modelversioning.emfprofile.Stereotype stereotype)
        Tests whether a Stereotype is a system-role. {@see #isSystemRole}
      • isArchitecturalTemplateStereotypeApplication

        public static boolean isArchitecturalTemplateStereotypeApplication​(org.modelversioning.emfprofileapplication.StereotypeApplication stereotypeApplication)
        Tests whether a StereotypeApplication belongs to an architectural template.
      • isArchitecturalTemplateStereotype

        public static boolean isArchitecturalTemplateStereotype​(org.modelversioning.emfprofile.Stereotype stereotype)
        Tests whether a Stereotype belongs to an architectural template.
      • isArchitecturalTemplate

        public static boolean isArchitecturalTemplate​(org.modelversioning.emfprofile.Profile profile)
        Tests whether a Profile is an Architectural-Template. {@see #isArchitecturalTemplate}
      • getSystemRoleStereotype

        public static org.modelversioning.emfprofile.Stereotype getSystemRoleStereotype​(org.modelversioning.emfprofile.Profile profile)
        Gets the Stereotype that represents the system-role for the given Profile.
        Parameters:
        profile - the ArchitecturalTemplate-Profile
        Returns:
        the SystemRole-Stereotype
        Throws:
        RuntimeException - if the given profile is no Architectural Template
      • applyArchitecturalTemplate

        public static void applyArchitecturalTemplate​(org.palladiosimulator.pcm.system.System system,
                                                      AT architecturalTemplate)
        Applies the given AT to the System.
        Parameters:
        system - the System
        architecturalTemplate - the AT
        Throws:
        RuntimeException - if the Architectural Template does not define any roles.
        See Also:
        applyArchitecturalTemplate(System, Profile)
      • applyArchitecturalTemplate

        public static void applyArchitecturalTemplate​(org.palladiosimulator.pcm.system.System system,
                                                      org.modelversioning.emfprofile.Profile profile)
        Applies the given Architectural-Template-Profile to the System.
        Parameters:
        system - the System
        profile - the Profile
        Throws:
        RuntimeException - if the profile does not define an Architectural Template.
      • applyArchitecturalTemplate

        public static void applyArchitecturalTemplate​(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment resourceenvironment,
                                                      AT architecturalTemplate)
        Applies the given AT to the ResourceEnvironment.
        Parameters:
        system - the ResourceEnvironment
        architecturalTemplate - the AT
        Throws:
        RuntimeException - if the Architectural Template does not define any roles.
        See Also:
        applyArchitecturalTemplate(System, Profile)
      • applyArchitecturalTemplate

        public static void applyArchitecturalTemplate​(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment resourceenvironment,
                                                      org.modelversioning.emfprofile.Profile profile)
        Applies the given Architectural-Template-Profile to the ResourceEnvironment.
        Parameters:
        system - the ResourceEnvironment
        profile - the Profile
        Throws:
        RuntimeException - if the profile does not define an Architectural Template.
      • unapplyArchitecturalTemplate

        public static void unapplyArchitecturalTemplate​(org.palladiosimulator.pcm.system.System system,
                                                        AT architecturalTemplate)
        Unapplies the given AT from the System.
        Parameters:
        system - the System
        architecturalTemplate - the AT
        Throws:
        RuntimeException - if the Architectural Template does not define any roles.
        See Also:
        unapplyArchitecturalTemplate(System, Profile)
      • unapplyArchitecturalTemplate

        public static void unapplyArchitecturalTemplate​(org.palladiosimulator.pcm.system.System system,
                                                        org.modelversioning.emfprofile.Profile profile)
        Unapplies the given Architectural-Template-Profile from the System.
        Parameters:
        system - the System
        profile - the Profile
        Throws:
        RuntimeException - if the profile does not define an Architectural Template.
      • unapplyArchitecturalTemplate

        public static void unapplyArchitecturalTemplate​(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment resourceenvironment,
                                                        AT architecturalTemplate)
        Unapplies the given AT from the ResourceEnvironment.
        Parameters:
        system - the ResourceEnvironment
        architecturalTemplate - the AT
        Throws:
        RuntimeException - if the Architectural Template does not define any roles.
        See Also:
        unapplyArchitecturalTemplate(System, Profile)
      • unapplyArchitecturalTemplate

        public static void unapplyArchitecturalTemplate​(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment resourceenvironment,
                                                        org.modelversioning.emfprofile.Profile profile)
        Unapplies the given Architectural-Template-Profile from the ResourceEnvironment.
        Parameters:
        system - the ResourceEnvironment
        profile - the Profile
        Throws:
        RuntimeException - if the profile does not define an Architectural Template.
      • applyRole

        public static void applyRole​(EObject eObject,
                                     org.modelversioning.emfprofile.Stereotype stereotype)
        Applies the given Role-Stereotype to the EObject.
        Parameters:
        eObject - the EObject
        stereotype - the Stereotype
        Throws:
        RuntimeException - if the given stereotype does not conform the role-convention.
      • unapplyRole

        public static void unapplyRole​(EObject eObject,
                                       Role role)
        Unapplies the given Role from the EObject.
        Parameters:
        eObject - the EObject
        role - the Role
      • unapplyRole

        public static void unapplyRole​(EObject eObject,
                                       org.modelversioning.emfprofile.Stereotype stereotype)
        Unapplies the given Role-Stereotype from the EObject.
        Parameters:
        eObject - the EObject
        stereotype - the Stereotype
        Throws:
        RuntimeException - if the given stereotype does not conform the role-convention.
      • getAppliedArchitecturalTemplates

        public static Collection<AT> getAppliedArchitecturalTemplates​(Resource resource)
        Returns all ATs applied to the System.
        Parameters:
        resource - the System
        Returns:
        applied ATs
      • getArchitecturalTemplateApplications

        public static Collection<org.modelversioning.emfprofileapplication.StereotypeApplication> getArchitecturalTemplateApplications​(org.palladiosimulator.pcm.system.System system)
        Returns all StereotypeApplications applied to the System that are role-applications (their Stereotype is a Role).
        Parameters:
        eObject - the EObject
        Returns:
        role-StereotypeApplications
      • getATsFromSystem

        public static Collection<AT> getATsFromSystem​(org.palladiosimulator.pcm.system.System system)
        Receives the architectural templates attached to a system. Such an attachment is realized via an annotation to an profile with an AT annotation. The annotation references the AT the role; the role is identified by matching the stereotype name to the roles of the AT. If no such role can be found, an empty List is returned.
        Returns:
        the architectural template applied to this system; an empty List if no such template can be found.
      • getRoleApplications

        public static Collection<org.modelversioning.emfprofileapplication.StereotypeApplication> getRoleApplications​(EObject eObject)
        Returns all StereotypeApplications applied to the EObject that are role-applications (their Stereotype is a Role).
        Parameters:
        eObject - the EObject
        Returns:
        role-StereotypeApplications
      • getATStereotypeApplicationsWithoutRoles

        public static Collection<org.modelversioning.emfprofileapplication.StereotypeApplication> getATStereotypeApplicationsWithoutRoles​(EObject eObject)
      • getATProfileImports

        public static final Collection<org.modelversioning.emfprofileapplication.ProfileImport> getATProfileImports​(EObject eObject)
        TODO documentation
      • getRegisteredArchitecturalTemplates

        public static Collection<AT> getRegisteredArchitecturalTemplates()
        Returns all ATs that are currently registered.
        Returns:
        the ATs
      • hasRoles

        public static boolean hasRoles​(EObject eObject)
        Tests whether the given EObject has roles attached.
        Parameters:
        eObject - the EObject to test
        Returns:
        the test result
      • getInitiatorATs

        public static Set<AT> getInitiatorATs()
      • getRegisteredATCatlogs

        public static Set<Catalog> getRegisteredATCatlogs()