Package de.fraunhofer.iese.mydata
Interface IMyDataEnvironment
-
- All Known Subinterfaces:
IMyDataEnvironmentFullFace
public interface IMyDataEnvironment
This interface describes the public facade to the MyDataEnvironment, regardless whether you use the Library in LOCAL or CLOUD mode. You can use theIMyDataEnvironment
more or less transparent, but you will have to pay special attention when registering PIP/PXP components because they need to be accessible to the PDP. Currently we distinguish three modes in which a service component can be registered to the MyDataEnvironment:- local: component instance will be registered to the
MyDataEnvironment, will be accessible to local PDP and component information
will be published to PMP; no need to provide further information like URL.
see
registerLocalPip(ComponentId, Object)
- managed: component instance will be registered to the
MyDataEnvironment, can programmatically be retrieved via
getManagedPip(ComponentId)
/getManagedPxp(ComponentId)
and the corresponding component information is published to the PMP. You are in charge to make the component accessible for the PDP under the specified URL. seeregisterManagedPip(ComponentId, Object, List)
- unmanaged: component will not be managed by the MyDataEnvironment,
only the component information is published to the PMP. You are in charge
to make the component accessible for the PDP. see
registerUnmanagedPip(PipComponentInformation)
IMyDataEnvironment
instances can be created and retrieved by using theMyDataEnvironmentManager
- See Also:
MyDataEnvironmentManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
constructAndRegisterCustomPep(ComponentId componentId, Class<T> interfaceOfPep)
This method generates a custom PEP from the given interface and registers it to the PMP.<T> T
constructAndRegisterCustomPep(String componentName, Class<T> interfaceOfPep)
This method generates a custom PEP from the given interface and registers it to the PMP.String
getEnvironmentId()
Optional<IPolicyInformationPoint>
getManagedPip(ComponentId componentId)
Retrieves a previously registered managed Pip instanceOptional<IPolicyExecutionPoint>
getManagedPxp(ComponentId componentId)
Retrieves a previously registered managed Pxp instanceOperationalMode
getOperationalMode()
Access to the instance'sOperationalMode
IPolicyEnforcementPoint
getPep()
IBasicManagementService
getPmp()
SolutionId
getSolutionId()
AnIMyDataEnvironment
instance is always associated with exactly one solution.java.time.ZoneId
getTimezone()
Get configured timezone for the associated solutionComponentId
registerLocalPip(ComponentId componentId, Object instance)
Registers a local PipComponent that is managed by theIMyDataEnvironment
and is accessible to local PDP.ComponentId
registerLocalPip(String componentName, Object instance)
Registers a local PipComponent that is managed by theIMyDataEnvironment
and is accessible to local PDP.ComponentId
registerLocalPxp(ComponentId componentId, Object instance)
Registers a local PxpComponent that is managed by theIMyDataEnvironment
and is accessible to local PDP.ComponentId
registerLocalPxp(String componentName, Object instance)
Registers a local PxpComponent that is managed by theIMyDataEnvironment
and is accessible to local PDP.ComponentId
registerManagedPip(ComponentId componentId, Object instance, List<URI> listOfUrl)
Registers a PipComponent that is managed by theIMyDataEnvironment
but you are in charge to expose it accessible to the PDP via the specified URL Managed Components can be retrieved from theIMyDataEnvironment
; seegetManagedPip(ComponentId)
.ComponentId
registerManagedPip(String componentName, Object instance, List<URI> listOfUrl)
Registers a PipComponent that is managed by theIMyDataEnvironment
but you are in charge to expose it accessible to the PDP via the specified URL Managed Components can be retrieved from theIMyDataEnvironment
; seegetManagedPip(ComponentId)
.ComponentId
registerManagedPxp(ComponentId componentId, Object instance, List<URI> listOfUrl)
Registers a PxpComponent that is managed by theIMyDataEnvironment
but you are in charge to expose it accessible to the PDP via the specified URL Managed Components can be retrieved from theIMyDataEnvironment
; seegetManagedPxp(ComponentId)
.ComponentId
registerManagedPxp(String componentName, Object instance, List<URI> listOfUrl)
Registers a PxpComponent that is managed by theIMyDataEnvironment
but you are in charge to expose it accessible to the PDP via the specified URL Managed Components can be retrieved from theIMyDataEnvironment
; seegetManagedPxp(ComponentId)
.ComponentId
registerPep(PepComponentInformation pepComponentInformation)
Registers a PepComponent to the IMyDataEnvironment and its encapsulated PMPComponentId
registerUnmanagedPip(PipComponentInformation pipComponentInformation)
Registers a remote/external PipComponent that is not managed by theIMyDataEnvironment
.ComponentId
registerUnmanagedPxp(PxpComponentInformation pxpComponentInformation)
Registers a remote/external PxpComponent that is not managed by theIMyDataEnvironment
.
-
-
-
Method Detail
-
getEnvironmentId
String getEnvironmentId()
- Returns:
- the
IMyDataEnvironment
s environmentId
-
getSolutionId
SolutionId getSolutionId()
AnIMyDataEnvironment
instance is always associated with exactly one solution.- Returns:
- the solutionId of the solution the
IMyDataEnvironment
instance is associated with.
-
getOperationalMode
OperationalMode getOperationalMode()
Access to the instance'sOperationalMode
- Returns:
- the instance's
OperationalMode
-
registerPep
ComponentId registerPep(PepComponentInformation pepComponentInformation) throws IOException, ResourceUpdateException, ConflictingResourceException, InvalidEntityException, NoSuchEntityException
Registers a PepComponent to the IMyDataEnvironment and its encapsulated PMP- Parameters:
pepComponentInformation
- the PipComponentInformation- Returns:
- the componentId
- Throws:
IOException
- communication failureConflictingResourceException
- the conflicting resource exceptionResourceUpdateException
- the resource update exceptionInvalidEntityException
- the invalid entity exceptionNoSuchEntityException
-
registerUnmanagedPip
ComponentId registerUnmanagedPip(PipComponentInformation pipComponentInformation) throws IOException, ResourceUpdateException, ConflictingResourceException, InvalidEntityException, NoSuchEntityException
Registers a remote/external PipComponent that is not managed by theIMyDataEnvironment
.- Parameters:
pipComponentInformation
- the PipComponentInformation- Returns:
- the componentId
- Throws:
IOException
- communication failureConflictingResourceException
- the conflicting resource exceptionResourceUpdateException
- the resource update exceptionInvalidEntityException
- the invalid entity exceptionNoSuchEntityException
-
registerManagedPip
ComponentId registerManagedPip(ComponentId componentId, Object instance, List<URI> listOfUrl) throws InvalidEntityException, ResourceUpdateException, ConflictingResourceException, IOException, NoSuchEntityException
Registers a PipComponent that is managed by theIMyDataEnvironment
but you are in charge to expose it accessible to the PDP via the specified URL Managed Components can be retrieved from theIMyDataEnvironment
; seegetManagedPip(ComponentId)
.- Parameters:
componentId
- the componentIdinstance
- the instancelistOfUrl
- the URL under which you will expose the PipComponent to be used by the PDP.- Returns:
- the componentId
- Throws:
IOException
- communication failureConflictingResourceException
- the conflicting resource exceptionResourceUpdateException
- the resource update exceptionInvalidEntityException
- the invalid entity exceptionNoSuchEntityException
-
registerManagedPip
ComponentId registerManagedPip(String componentName, Object instance, List<URI> listOfUrl) throws InvalidEntityException, ResourceUpdateException, ConflictingResourceException, IOException, NoSuchEntityException
Registers a PipComponent that is managed by theIMyDataEnvironment
but you are in charge to expose it accessible to the PDP via the specified URL Managed Components can be retrieved from theIMyDataEnvironment
; seegetManagedPip(ComponentId)
.- Parameters:
componentName
- the componentNameinstance
- the instancelistOfUrl
- the URL under which you will expose the PipComponent to be used by the PDP.- Returns:
- the componentId
- Throws:
IOException
- communication failureConflictingResourceException
- the conflicting resource exceptionResourceUpdateException
- the resource update exceptionInvalidEntityException
- the invalid entity exceptionNoSuchEntityException
-
registerLocalPip
ComponentId registerLocalPip(ComponentId componentId, Object instance) throws IOException, InvalidEntityException, ResourceUpdateException, ConflictingResourceException, NoSuchEntityException
Registers a local PipComponent that is managed by theIMyDataEnvironment
and is accessible to local PDP.- Parameters:
componentId
- the componentIdinstance
- the object that should be used as a PipComponent, can implementIPolicyInformationPoint
but does not have to.- Returns:
- the componentId
- Throws:
IOException
- communication failureConflictingResourceException
- the conflicting resource exceptionResourceUpdateException
- the resource update exceptionInvalidEntityException
- the invalid entity exceptionNoSuchEntityException
-
registerLocalPip
ComponentId registerLocalPip(String componentName, Object instance) throws IOException, InvalidEntityException, ResourceUpdateException, ConflictingResourceException, NoSuchEntityException
Registers a local PipComponent that is managed by theIMyDataEnvironment
and is accessible to local PDP.- Parameters:
componentName
- the componentNameinstance
- the object that should be used as a PipComponent, can implementIPolicyInformationPoint
but does not have to.- Returns:
- the componentId
- Throws:
IOException
- communication failureConflictingResourceException
- the conflicting resource exceptionResourceUpdateException
- the resource update exceptionInvalidEntityException
- the invalid entity exceptionNoSuchEntityException
-
registerUnmanagedPxp
ComponentId registerUnmanagedPxp(PxpComponentInformation pxpComponentInformation) throws IOException, ResourceUpdateException, ConflictingResourceException, InvalidEntityException, NoSuchEntityException
Registers a remote/external PxpComponent that is not managed by theIMyDataEnvironment
.- Parameters:
pxpComponentInformation
- the PxpComponentInformation- Returns:
- the componentId
- Throws:
IOException
- communication failureConflictingResourceException
- the conflicting resource exceptionResourceUpdateException
- the resource update exceptionInvalidEntityException
- the invalid entity exceptionNoSuchEntityException
-
registerManagedPxp
ComponentId registerManagedPxp(ComponentId componentId, Object instance, List<URI> listOfUrl) throws InvalidEntityException, ResourceUpdateException, ConflictingResourceException, IOException, NoSuchEntityException
Registers a PxpComponent that is managed by theIMyDataEnvironment
but you are in charge to expose it accessible to the PDP via the specified URL Managed Components can be retrieved from theIMyDataEnvironment
; seegetManagedPxp(ComponentId)
.- Parameters:
componentId
- the componentIdinstance
- the instancelistOfUrl
- the URL under which you will expose the PxpComponent to be used by the PDP.- Returns:
- the componentId
- Throws:
IOException
- communication failureConflictingResourceException
- the conflicting resource exceptionResourceUpdateException
- the resource update exceptionInvalidEntityException
- the invalid entity exceptionNoSuchEntityException
-
registerManagedPxp
ComponentId registerManagedPxp(String componentName, Object instance, List<URI> listOfUrl) throws InvalidEntityException, ResourceUpdateException, ConflictingResourceException, IOException, NoSuchEntityException
Registers a PxpComponent that is managed by theIMyDataEnvironment
but you are in charge to expose it accessible to the PDP via the specified URL Managed Components can be retrieved from theIMyDataEnvironment
; seegetManagedPxp(ComponentId)
.- Parameters:
componentName
- the componentNameinstance
- the instancelistOfUrl
- the URL under which you will expose the PxpComponent to be used by the PDP.- Returns:
- the componentId
- Throws:
IOException
- communication failureConflictingResourceException
- the conflicting resource exceptionResourceUpdateException
- the resource update exceptionInvalidEntityException
- the invalid entity exceptionNoSuchEntityException
-
registerLocalPxp
ComponentId registerLocalPxp(ComponentId componentId, Object instance) throws IOException, InvalidEntityException, ResourceUpdateException, ConflictingResourceException, NoSuchEntityException
Registers a local PxpComponent that is managed by theIMyDataEnvironment
and is accessible to local PDP.- Parameters:
componentId
- the componentIdinstance
- the object that should be used as a PxpComponent, can implementIPolicyExecutionPoint
but does not have to.- Returns:
- the componentId
- Throws:
IOException
- communication failureConflictingResourceException
- the conflicting resource exceptionResourceUpdateException
- the resource update exceptionInvalidEntityException
- the invalid entity exceptionNoSuchEntityException
-
registerLocalPxp
ComponentId registerLocalPxp(String componentName, Object instance) throws IOException, InvalidEntityException, ResourceUpdateException, ConflictingResourceException, NoSuchEntityException
Registers a local PxpComponent that is managed by theIMyDataEnvironment
and is accessible to local PDP.- Parameters:
componentName
- the componentNameinstance
- the object that should be used as a PxpComponent, can implementIPolicyExecutionPoint
but does not have to.- Returns:
- the componentId
- Throws:
IOException
- communication failureConflictingResourceException
- the conflicting resource exceptionResourceUpdateException
- the resource update exceptionInvalidEntityException
- the invalid entity exceptionNoSuchEntityException
-
getManagedPip
Optional<IPolicyInformationPoint> getManagedPip(ComponentId componentId)
Retrieves a previously registered managed Pip instance- Parameters:
componentId
- the componentId- Returns:
- the previously registered managed Pip instance
-
getManagedPxp
Optional<IPolicyExecutionPoint> getManagedPxp(ComponentId componentId)
Retrieves a previously registered managed Pxp instance- Parameters:
componentId
- the componentId- Returns:
- the previously registered managed Pxp instance
-
constructAndRegisterCustomPep
<T> T constructAndRegisterCustomPep(ComponentId componentId, Class<T> interfaceOfPep) throws InitializationException
This method generates a custom PEP from the given interface and registers it to the PMP. Make sure you call this method at most once per componentId/interface.- Type Parameters:
T
- Type of the Interface- Parameters:
componentId
- the componentIdinterfaceOfPep
- The Interface to generate a PEP for.- Returns:
- the generated implementation of the custom PEP
- Throws:
InitializationException
- in case of an error and when there is no PDP available
-
constructAndRegisterCustomPep
<T> T constructAndRegisterCustomPep(String componentName, Class<T> interfaceOfPep) throws InitializationException
This method generates a custom PEP from the given interface and registers it to the PMP. Make sure you call this method at most once per componentId/interface.- Type Parameters:
T
- Type of the Interface- Parameters:
componentName
- the componentNameinterfaceOfPep
- The Interface to generate a PEP for.- Returns:
- the generated implementation of the custom PEP
- Throws:
InitializationException
- in case of an error and when there is no PDP available
-
getTimezone
java.time.ZoneId getTimezone()
Get configured timezone for the associated solution- Returns:
- the
ZoneId
that identifies the timezone
-
getPmp
IBasicManagementService getPmp()
- Returns:
- the
IBasicManagementService
for this environment
-
getPep
IPolicyEnforcementPoint getPep()
- Returns:
- a
DefaultPolicyEnforcementPoint
that can be used for enforcement
-
-