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 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
applyRole(EObject eObject, org.modelversioning.emfprofile.Stereotype stereotype)
Applies the given Role-Stereotype
to theEObject
.static void
applyRole(EObject eObject, Role role)
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 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 allAT
s that are currently registered.static Set<Catalog>
getRegisteredATCatlogs()
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
hasRoles(EObject eObject)
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 Detail
-
getArchitecturalTemplate
public static AT getArchitecturalTemplate(org.modelversioning.emfprofile.Stereotype stereotype)
-
getRole
public static Role getRole(org.modelversioning.emfprofile.Stereotype stereotype)
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
public static AT getArchitecturalTemplate(org.modelversioning.emfprofile.Profile profile)
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). {@see #isRole}
-
isSystemRole
public static boolean isSystemRole(org.modelversioning.emfprofile.Stereotype stereotype)
Tests whether aStereotype
is a system-role. {@see #isSystemRole}
-
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. {@see #isArchitecturalTemplate}
-
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(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 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(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 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(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 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(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 theResourceEnvironment
.- Parameters:
system
- theResourceEnvironment
profile
- 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-Stereotype
to theEObject
.- Parameters:
eObject
- theEObject
stereotype
- 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-Stereotype
from theEObject
.- Parameters:
eObject
- theEObject
stereotype
- theStereotype
- Throws:
RuntimeException
- if the given stereotype does not conform the role-convention.
-
getAppliedArchitecturalTemplates
public static Collection<AT> getAppliedArchitecturalTemplates(Resource resource)
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
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 emptyList
is returned.- Returns:
- the architectural template applied to this system; an empty
List
if 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 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
public static Collection<AT> getRegisteredArchitecturalTemplates()
Returns allAT
s that are currently registered.- Returns:
- the
AT
s
-
getApplicableRoles
public static Collection<Role> getApplicableRoles(EObject eObject)
-
hasRoles
public static boolean hasRoles(EObject eObject)
Tests whether the givenEObject
has roles attached.- Parameters:
eObject
- theEObject
to test- Returns:
- the test result
-
-