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 void
applyArchitecturalTemplate
(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment resourceenvironment, org.modelversioning.emfprofile.Profile profile) Applies the given Architectural-Template-Profile
to theResourceEnvironment
.static void
applyArchitecturalTemplate
(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment resourceenvironment, AT architecturalTemplate) Applies the givenAT
to theResourceEnvironment
.static void
applyArchitecturalTemplate
(org.palladiosimulator.pcm.system.System system, org.modelversioning.emfprofile.Profile profile) Applies the given Architectural-Template-Profile
to theSystem
.static void
applyArchitecturalTemplate
(org.palladiosimulator.pcm.system.System system, AT architecturalTemplate) Applies the givenAT
to theSystem
.static void
Applies the given Role-Stereotype
to theEObject
.static void
static Collection<Role>
getApplicableRoles
(EObject eObject) static Collection<AT>
getAppliedArchitecturalTemplates
(Resource resource) Returns allAT
s applied to theSystem
.static Collection<Role>
getAppliedRoles
(EObject eObject) static AT
getArchitecturalTemplate
(org.modelversioning.emfprofile.Profile profile) Gets theAT
associated with the givenProfile
.static AT
getArchitecturalTemplate
(org.modelversioning.emfprofile.Stereotype stereotype) static Collection<org.modelversioning.emfprofileapplication.StereotypeApplication>
getArchitecturalTemplateApplications
(org.palladiosimulator.pcm.system.System system) Returns allStereotypeApplication
s applied to theSystem
that are role-applications (theirStereotype
is 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 allAT
s that are currently registered.static Role
getRole
(org.modelversioning.emfprofile.Stereotype stereotype) Gets theRole
associated with the givenStereotype
.static Collection<org.modelversioning.emfprofileapplication.StereotypeApplication>
getRoleApplications
(EObject eObject) static org.modelversioning.emfprofile.Stereotype
getSystemRoleStereotype
(org.modelversioning.emfprofile.Profile profile) Gets theStereotype
that represents the system-role for the givenProfile
.static boolean
Tests whether the givenEObject
has roles attached.static boolean
isArchitecturalTemplate
(org.modelversioning.emfprofile.Profile profile) Tests whether aProfile
is an Architectural-Template.static boolean
isArchitecturalTemplateStereotype
(org.modelversioning.emfprofile.Stereotype stereotype) Tests whether aStereotype
belongs to an architectural template.static boolean
isArchitecturalTemplateStereotypeApplication
(org.modelversioning.emfprofileapplication.StereotypeApplication stereotypeApplication) Tests whether aStereotypeApplication
belongs to an architectural template.static boolean
isRole
(org.modelversioning.emfprofile.Stereotype stereotype) Tests whether aStereotype
conforms the role-convention (a tagged-value for the#ROLE_URI
exists).static boolean
isSystemRole
(org.modelversioning.emfprofile.Stereotype stereotype) Tests whether aStereotype
is a system-role.static void
unapplyArchitecturalTemplate
(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment resourceenvironment, org.modelversioning.emfprofile.Profile profile) Unapplies the given Architectural-Template-Profile
from theResourceEnvironment
.static void
unapplyArchitecturalTemplate
(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment resourceenvironment, AT architecturalTemplate) Unapplies the givenAT
from theResourceEnvironment
.static void
unapplyArchitecturalTemplate
(org.palladiosimulator.pcm.system.System system, org.modelversioning.emfprofile.Profile profile) Unapplies the given Architectural-Template-Profile
from theSystem
.static void
unapplyArchitecturalTemplate
(org.palladiosimulator.pcm.system.System system, AT architecturalTemplate) Unapplies the givenAT
from theSystem
.static void
unapplyRole
(EObject eObject, org.modelversioning.emfprofile.Stereotype stereotype) Unapplies the given Role-Stereotype
from theEObject
.static void
unapplyRole
(EObject eObject, Role role)
-
Method Details
-
getArchitecturalTemplate
-
getRole
Gets theRole
associated with the givenStereotype
.- Parameters:
stereotype
- theStereotype
- Returns:
- the
Role
- Throws:
RuntimeException
- if the given stereotype does not conform the role-convention.
-
getArchitecturalTemplate
Gets theAT
associated 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 aStereotype
conforms the role-convention (a tagged-value for the#ROLE_URI
exists). -
isSystemRole
public static boolean isSystemRole(org.modelversioning.emfprofile.Stereotype stereotype) Tests whether aStereotype
is a system-role. -
isArchitecturalTemplateStereotypeApplication
public static boolean isArchitecturalTemplateStereotypeApplication(org.modelversioning.emfprofileapplication.StereotypeApplication stereotypeApplication) Tests whether aStereotypeApplication
belongs to an architectural template. -
isArchitecturalTemplateStereotype
public static boolean isArchitecturalTemplateStereotype(org.modelversioning.emfprofile.Stereotype stereotype) Tests whether aStereotype
belongs to an architectural template. -
isArchitecturalTemplate
public static boolean isArchitecturalTemplate(org.modelversioning.emfprofile.Profile profile) Tests whether aProfile
is an Architectural-Template. -
getSystemRoleStereotype
public static org.modelversioning.emfprofile.Stereotype getSystemRoleStereotype(org.modelversioning.emfprofile.Profile profile) Gets theStereotype
that 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 givenAT
to theSystem
.- Parameters:
system
- theSystem
architecturalTemplate
- 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-Profile
to theSystem
.- Parameters:
system
- theSystem
profile
- 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 givenAT
to theResourceEnvironment
.- Parameters:
system
- theResourceEnvironment
architecturalTemplate
- 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-Profile
to theResourceEnvironment
.- Parameters:
system
- theResourceEnvironment
profile
- 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 givenAT
from theSystem
.- Parameters:
system
- theSystem
architecturalTemplate
- 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-Profile
from theSystem
.- Parameters:
system
- theSystem
profile
- 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 givenAT
from theResourceEnvironment
.- Parameters:
system
- theResourceEnvironment
architecturalTemplate
- 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-Profile
from theResourceEnvironment
.- Parameters:
system
- theResourceEnvironment
profile
- theProfile
- Throws:
RuntimeException
- if the profile does not define an Architectural Template.
-
applyRole
-
applyRole
Applies the given Role-Stereotype
to theEObject
.- Parameters:
eObject
- theEObject
stereotype
- 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-Stereotype
from theEObject
.- Parameters:
eObject
- theEObject
stereotype
- theStereotype
- Throws:
RuntimeException
- if the given stereotype does not conform the role-convention.
-
getAppliedArchitecturalTemplates
Returns allAT
s applied to theSystem
.- Parameters:
resource
- theSystem
- Returns:
- applied
AT
s
-
getArchitecturalTemplateApplications
public static Collection<org.modelversioning.emfprofileapplication.StereotypeApplication> getArchitecturalTemplateApplications(org.palladiosimulator.pcm.system.System system) Returns allStereotypeApplication
s applied to theSystem
that are role-applications (theirStereotype
is aRole
).- Parameters:
eObject
- theEObject
- Returns:
- role-
StereotypeApplication
s
-
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 emptyList
is returned.- Returns:
- the architectural template applied to this system; an empty
List
if no such template can be found.
-
getAppliedRoles
-
getRoleApplications
public static Collection<org.modelversioning.emfprofileapplication.StereotypeApplication> getRoleApplications(EObject eObject) Returns allStereotypeApplication
s applied to theEObject
that are role-applications (theirStereotype
is aRole
).- Parameters:
eObject
- theEObject
- Returns:
- role-
StereotypeApplication
s
-
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 allAT
s that are currently registered.- Returns:
- the
AT
s
-
getApplicableRoles
-
hasRoles
Tests whether the givenEObject
has roles attached.- Parameters:
eObject
- theEObject
to test- Returns:
- the test result
-
getInitiatorATs
-
getRegisteredATCatlogs
-