Class ArchitecturalTemplateAPI
- java.lang.Object
-
- org.palladiosimulator.architecturaltemplates.api.ArchitecturalTemplateAPI
-
public final class ArchitecturalTemplateAPI extends Object
An API class providing methods to interact with Architectural Templates
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 voidapplyRole(EObject eObject, org.modelversioning.emfprofile.Stereotype stereotype)Applies the given Role-Stereotypeto theEObject.static voidapplyRole(EObject eObject, Role role)static 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 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>getATStereotypeApplicationsWithoutRoles(EObject eObject)static Set<AT>getInitiatorATs()static Collection<AT>getRegisteredArchitecturalTemplates()Returns allATs that are currently registered.static Set<Catalog>getRegisteredATCatlogs()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 booleanhasRoles(EObject eObject)Tests 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 Detail
-
getArchitecturalTemplate
public static AT getArchitecturalTemplate(org.modelversioning.emfprofile.Stereotype stereotype)
-
getRole
public static Role getRole(org.modelversioning.emfprofile.Stereotype stereotype)
Gets theRoleassociated with the givenStereotype.- Parameters:
stereotype- theStereotype- 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 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). {@see #isRole}
-
isSystemRole
public static boolean isSystemRole(org.modelversioning.emfprofile.Stereotype stereotype)
Tests whether aStereotypeis a system-role. {@see #isSystemRole}
-
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. {@see #isArchitecturalTemplate}
-
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(System, Profile)
-
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(System, Profile)
-
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(System, Profile)
-
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(System, Profile)
-
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
public static void applyRole(EObject eObject, org.modelversioning.emfprofile.Stereotype stereotype)
Applies the given Role-Stereotypeto theEObject.- Parameters:
eObject- theEObjectstereotype- theStereotype- Throws:
RuntimeException- if the given stereotype does not conform the role-convention.
-
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
public static Collection<AT> getAppliedArchitecturalTemplates(Resource resource)
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
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 emptyListis returned.- Returns:
- the architectural template applied to this system; an empty
Listif no such template can be found.
-
getAppliedRoles
public static Collection<Role> getAppliedRoles(EObject eObject)
-
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
public static Collection<AT> getRegisteredArchitecturalTemplates()
Returns allATs that are currently registered.- Returns:
- the
ATs
-
getApplicableRoles
public static Collection<Role> getApplicableRoles(EObject eObject)
-
hasRoles
public static boolean hasRoles(EObject eObject)
Tests whether the givenEObjecthas roles attached.- Parameters:
eObject- theEObjectto test- Returns:
- the test result
-
-