public class ComponentRegistry extends Object
InterfaceDescriptionDiscovery to find all
Component related Methods, that can be registered as
MethodInterfaceDescription at PMP. Therefor the discovery lists all
methods that is annotated with an Annotation of Type
ActionDescription and creates an instance of
MethodInterfaceDescription with the information provided by the
MethodSignature, the annotation and the ActionParameterDescription
annotations of each method parameter.
For Example The Method
@ActionDescription(description = "Retreives the authority (role) of an user")
public String getAuthority(@ActionParameterDescription(name = "username", description = "The user the authority should be evaluated for.", mandatory = true) String username) {
}
Results in an InterfaceDescription with:
MyPipService serviceThatContainsMethodsWithActionDescription = ..;
ComponentRegistry registry = new ComponentRegistry(ComponentType.PIP,pmp);
boolean isRegistered = registry.componentId(new
ComponentId("urn:component:test:pip:1234"))
.addService(serviceThatContainsMethodsWithActionDescription)
.url("http://localhost:8008") .register(); | Constructor and Description |
|---|
ComponentRegistry(ComponentType type,
URI pmpUrl,
de.fraunhofer.iese.ind2uce.connectors.OAuthCredentials credentials)
Instantiates a new component registry.
|
| Modifier and Type | Method and Description |
|---|---|
Map<de.fraunhofer.iese.ind2uce.api.component.description.MethodInterfaceDescription,Method> |
addService(Object componentService)
Adds the service.
|
ComponentRegistry |
componentId(de.fraunhofer.iese.ind2uce.api.component.identifier.ComponentId componentId)
Component id.
|
ComponentRegistry |
componentId(String componentId)
Component id.
|
ComponentRegistry |
enforcementScopeId(de.fraunhofer.iese.ind2uce.api.component.identifier.EnforcementScopeId enforcementScopeId)
Enforcement scope id.
|
boolean |
register()
Register.
|
String |
toString() |
ComponentRegistry |
url(String url)
Url.
|
public ComponentRegistry(ComponentType type, URI pmpUrl, de.fraunhofer.iese.ind2uce.connectors.OAuthCredentials credentials)
type - the typepmpUrl - the pmp urlcredentials - OAuthCredentials used to connectpublic Map<de.fraunhofer.iese.ind2uce.api.component.description.MethodInterfaceDescription,Method> addService(Object componentService)
componentService - the component servicepublic ComponentRegistry componentId(de.fraunhofer.iese.ind2uce.api.component.identifier.ComponentId componentId)
componentId - the component idpublic ComponentRegistry componentId(String componentId)
componentId - the component idpublic ComponentRegistry enforcementScopeId(de.fraunhofer.iese.ind2uce.api.component.identifier.EnforcementScopeId enforcementScopeId)
enforcementScopeId - the enforcement scope idpublic boolean register()
public ComponentRegistry url(String url)
url - the urlCopyright © 2018. All rights reserved.