Class ArchitecturalTemplateAPI
java.lang.Object
org.palladiosimulator.architecturaltemplates.api.ArchitecturalTemplateAPI
An API class providing methods to interact with Architectural Templates
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyArchitecturalTemplate(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment resourceenvironment, org.modelversioning.emfprofile.Profile profile) Applies the given Architectural-Template-Profileto theResourceEnvironment.static voidapplyArchitecturalTemplate(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment resourceenvironment, AT architecturalTemplate) Applies the givenATto theResourceEnvironment.static voidapplyArchitecturalTemplate(org.palladiosimulator.pcm.system.System system, org.modelversioning.emfprofile.Profile profile) Applies the given Architectural-Template-Profileto theSystem.static voidapplyArchitecturalTemplate(org.palladiosimulator.pcm.system.System system, AT architecturalTemplate) Applies the givenATto theSystem.static voidApplies the given Role-Stereotypeto theEObject.static voidstatic Collection<Role>getApplicableRoles(EObject eObject) static Collection<AT>getAppliedArchitecturalTemplates(Resource resource) Returns allATs applied to theSystem.static Collection<Role>getAppliedRoles(EObject eObject) static ATgetArchitecturalTemplate(org.modelversioning.emfprofile.Profile profile) Gets theATassociated with the givenProfile.static ATgetArchitecturalTemplate(org.modelversioning.emfprofile.Stereotype stereotype) static Collection<org.modelversioning.emfprofileapplication.StereotypeApplication>getArchitecturalTemplateApplications(org.palladiosimulator.pcm.system.System system) Returns allStereotypeApplications applied to theSystemthat are role-applications (theirStereotypeis aRole).static final Collection<org.modelversioning.emfprofileapplication.ProfileImport>getATProfileImports(EObject eObject) TODO documentationstatic Collection<AT>getATsFromSystem(org.palladiosimulator.pcm.system.System system) Receives the architectural templates attached to a system.static Collection<org.modelversioning.emfprofileapplication.StereotypeApplication>static Collection<AT>Returns allATs that are currently registered.static RolegetRole(org.modelversioning.emfprofile.Stereotype stereotype) Gets theRoleassociated with the givenStereotype.static Collection<org.modelversioning.emfprofileapplication.StereotypeApplication>getRoleApplications(EObject eObject) static org.modelversioning.emfprofile.StereotypegetSystemRoleStereotype(org.modelversioning.emfprofile.Profile profile) Gets theStereotypethat represents the system-role for the givenProfile.static booleanTests whether the givenEObjecthas roles attached.static booleanisArchitecturalTemplate(org.modelversioning.emfprofile.Profile profile) Tests whether aProfileis an Architectural-Template.static booleanisArchitecturalTemplateStereotype(org.modelversioning.emfprofile.Stereotype stereotype) Tests whether aStereotypebelongs to an architectural template.static booleanisArchitecturalTemplateStereotypeApplication(org.modelversioning.emfprofileapplication.StereotypeApplication stereotypeApplication) Tests whether aStereotypeApplicationbelongs to an architectural template.static booleanisRole(org.modelversioning.emfprofile.Stereotype stereotype) Tests whether aStereotypeconforms the role-convention (a tagged-value for the#ROLE_URIexists).static booleanisSystemRole(org.modelversioning.emfprofile.Stereotype stereotype) Tests whether aStereotypeis a system-role.static voidunapplyArchitecturalTemplate(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment resourceenvironment, org.modelversioning.emfprofile.Profile profile) Unapplies the given Architectural-Template-Profilefrom theResourceEnvironment.static voidunapplyArchitecturalTemplate(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment resourceenvironment, AT architecturalTemplate) Unapplies the givenATfrom theResourceEnvironment.static voidunapplyArchitecturalTemplate(org.palladiosimulator.pcm.system.System system, org.modelversioning.emfprofile.Profile profile) Unapplies the given Architectural-Template-Profilefrom theSystem.static voidunapplyArchitecturalTemplate(org.palladiosimulator.pcm.system.System system, AT architecturalTemplate) Unapplies the givenATfrom theSystem.static voidunapplyRole(EObject eObject, org.modelversioning.emfprofile.Stereotype stereotype) Unapplies the given Role-Stereotypefrom theEObject.static voidunapplyRole(EObject eObject, Role role)
-
Method Details
-
getArchitecturalTemplate
-
getRole
Gets theRoleassociated with the givenStereotype.- Parameters:
stereotype- theStereotype- Returns:
- the
Role - Throws:
RuntimeException- if the given stereotype does not conform the role-convention.
-
getArchitecturalTemplate
Gets theATassociated with the givenProfile.- Parameters:
profile- theProfile- 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 aStereotypeconforms the role-convention (a tagged-value for the#ROLE_URIexists). -
isSystemRole
public static boolean isSystemRole(org.modelversioning.emfprofile.Stereotype stereotype) Tests whether aStereotypeis a system-role. -
isArchitecturalTemplateStereotypeApplication
public static boolean isArchitecturalTemplateStereotypeApplication(org.modelversioning.emfprofileapplication.StereotypeApplication stereotypeApplication) Tests whether aStereotypeApplicationbelongs to an architectural template. -
isArchitecturalTemplateStereotype
public static boolean isArchitecturalTemplateStereotype(org.modelversioning.emfprofile.Stereotype stereotype) Tests whether aStereotypebelongs to an architectural template. -
isArchitecturalTemplate
public static boolean isArchitecturalTemplate(org.modelversioning.emfprofile.Profile profile) Tests whether aProfileis an Architectural-Template. -
getSystemRoleStereotype
public static org.modelversioning.emfprofile.Stereotype getSystemRoleStereotype(org.modelversioning.emfprofile.Profile profile) Gets theStereotypethat represents the system-role for the givenProfile.- 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 givenATto theSystem.- Parameters:
system- theSystemarchitecturalTemplate- theAT- Throws:
RuntimeException- if the Architectural Template does not define any roles.- See Also:
-
applyArchitecturalTemplate
public static void applyArchitecturalTemplate(org.palladiosimulator.pcm.system.System system, org.modelversioning.emfprofile.Profile profile) Applies the given Architectural-Template-Profileto theSystem.- Parameters:
system- theSystemprofile- theProfile- 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 givenATto theResourceEnvironment.- Parameters:
system- theResourceEnvironmentarchitecturalTemplate- theAT- Throws:
RuntimeException- if the Architectural Template does not define any roles.- See Also:
-
applyArchitecturalTemplate
public static void applyArchitecturalTemplate(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment resourceenvironment, org.modelversioning.emfprofile.Profile profile) Applies the given Architectural-Template-Profileto theResourceEnvironment.- Parameters:
system- theResourceEnvironmentprofile- theProfile- 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 givenATfrom theSystem.- Parameters:
system- theSystemarchitecturalTemplate- theAT- Throws:
RuntimeException- if the Architectural Template does not define any roles.- See Also:
-
unapplyArchitecturalTemplate
public static void unapplyArchitecturalTemplate(org.palladiosimulator.pcm.system.System system, org.modelversioning.emfprofile.Profile profile) Unapplies the given Architectural-Template-Profilefrom theSystem.- Parameters:
system- theSystemprofile- theProfile- 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 givenATfrom theResourceEnvironment.- Parameters:
system- theResourceEnvironmentarchitecturalTemplate- theAT- Throws:
RuntimeException- if the Architectural Template does not define any roles.- See Also:
-
unapplyArchitecturalTemplate
public static void unapplyArchitecturalTemplate(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment resourceenvironment, org.modelversioning.emfprofile.Profile profile) Unapplies the given Architectural-Template-Profilefrom theResourceEnvironment.- Parameters:
system- theResourceEnvironmentprofile- theProfile- Throws:
RuntimeException- if the profile does not define an Architectural Template.
-
applyRole
-
applyRole
Applies the given Role-Stereotypeto theEObject.- Parameters:
eObject- theEObjectstereotype- theStereotype- Throws:
RuntimeException- if the given stereotype does not conform the role-convention.
-
unapplyRole
-
unapplyRole
public static void unapplyRole(EObject eObject, org.modelversioning.emfprofile.Stereotype stereotype) Unapplies the given Role-Stereotypefrom theEObject.- Parameters:
eObject- theEObjectstereotype- theStereotype- Throws:
RuntimeException- if the given stereotype does not conform the role-convention.
-
getAppliedArchitecturalTemplates
Returns allATs applied to theSystem.- Parameters:
resource- theSystem- Returns:
- applied
ATs
-
getArchitecturalTemplateApplications
public static Collection<org.modelversioning.emfprofileapplication.StereotypeApplication> getArchitecturalTemplateApplications(org.palladiosimulator.pcm.system.System system) Returns allStereotypeApplications applied to theSystemthat are role-applications (theirStereotypeis aRole).- Parameters:
eObject- theEObject- Returns:
- role-
StereotypeApplications
-
getATsFromSystem
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 emptyListis returned.- Returns:
- the architectural template applied to this system; an empty
Listif no such template can be found.
-
getAppliedRoles
-
getRoleApplications
public static Collection<org.modelversioning.emfprofileapplication.StereotypeApplication> getRoleApplications(EObject eObject) Returns allStereotypeApplications applied to theEObjectthat are role-applications (theirStereotypeis aRole).- Parameters:
eObject- theEObject- 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
Returns allATs that are currently registered.- Returns:
- the
ATs
-
getApplicableRoles
-
hasRoles
Tests whether the givenEObjecthas roles attached.- Parameters:
eObject- theEObjectto test- Returns:
- the test result
-
getInitiatorATs
-
getRegisteredATCatlogs
-