Class ConnectorFactory
- java.lang.Object
-
- de.fraunhofer.iese.mydata.component.connector.ConnectorFactory
-
public class ConnectorFactory extends Object
Helper class for establishing connections to the MYDATA components by using a URI. It uses reflection to determine the type of the connector needed for a certain protocol.
-
-
Constructor Summary
Constructors Constructor Description ConnectorFactory()
Constructor without any additional packageNames to look for Connector classes.ConnectorFactory(Set<String> additionalPackageNames)
Constructor with the ability to specify additional packageNames where we should look for Connector classes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IBasicManagementService
getBasicManagementService(BasicManagementServiceComponentInformation component, String preferredConnectorType)
Tries to establish a connection to a PMP client by using the passed url variable.IManagementService
getManagementService(URI url)
Gets the management service.IManagementService
getManagementService(URI url, OAuthCredentials oAuthCredentials)
Tries to establish a connection to a PMP server by using the passed url variable.IPolicyDecisionPoint
getPdp(PdpComponentInformation component, Authentication credentials)
Tries to establish a connection to a PDP by using the passed url variable.IPolicyDecisionPoint
getPdp(PdpComponentInformation component, String preferredConnectorType, Map<String,Authentication> protocolToAuthentication)
Tries to establish a connection to a PDP by using the passed url variable.IPolicyDecisionPoint
getPdp(PdpComponentInformation component, String preferredConnectorType, Map<String,Authentication> protocolToAuthentication, String[] activeprofiles)
Tries to establish a connection to a PDP by using the passed url variable.IPolicyDecisionPoint
getPdp(URI url)
Tries to establish a connection to a PDP by using the passed url variable.IPolicyDecisionPoint
getPdp(URI url, Authentication credentials)
Tries to establish a connection to a PDP by using the passed url variable.IPolicyInformationPoint
getPip(PipComponentInformation component, String preferredConnectorType)
Tries to establish a connection to a PIP by using the passed url variable.IPolicyInformationPoint
getPip(URI url)
Tries to establish a connection to a PIP by using the passed url variable.IBasicManagementService
getPmpClient(URI url)
Tries to establish a connection to a PMP client by using the passed url variable.IBasicManagementService
getPmpClient(URI url, OAuthCredentials oAuthCredentials)
Tries to establish a connection to a PMP client by using the passed url variable.IManagementService
getPmpServer(URI url)
Tries to establish a connection to a PMP server by using the passed url variable.IPolicyExecutionPoint
getPxp(PxpComponentInformation component, String preferredConnectorType)
Tries to establish a connection to a PXP by using the passed url variable.IPolicyExecutionPoint
getPxp(URI url)
Tries to establish a connection to a PXP by using the passed url variable.
-
-
-
Constructor Detail
-
ConnectorFactory
public ConnectorFactory()
Constructor without any additional packageNames to look for Connector classes.- See Also:
ConnectorFactory(Set)
-
-
Method Detail
-
getPdp
public IPolicyDecisionPoint getPdp(PdpComponentInformation component, Authentication credentials)
Tries to establish a connection to a PDP by using the passed url variable.- Parameters:
component
- The Component containing the URL used to connect to the component, like rmi://localhost:1111/pdpRmicredentials
- the protocol to authentication- Returns:
- A connector suitable for the specified protocol, null in case of an error
-
getPdp
public IPolicyDecisionPoint getPdp(PdpComponentInformation component, String preferredConnectorType, Map<String,Authentication> protocolToAuthentication)
Tries to establish a connection to a PDP by using the passed url variable.- Parameters:
component
- The Component containing the URL used to connect to the component, like rmi://localhost:1111/pdpRmipreferredConnectorType
- The preferred connector type (optional). If null, if the preferredConnectorType string is not found or if there is only one url, the connector will be selected according to the priorities list. This parameter is not case sensitive.protocolToAuthentication
- the protocol to authentication- Returns:
- A connector suitable for the specified protocol, null in case of an error
-
getPdp
public IPolicyDecisionPoint getPdp(PdpComponentInformation component, String preferredConnectorType, Map<String,Authentication> protocolToAuthentication, String[] activeprofiles)
Tries to establish a connection to a PDP by using the passed url variable.- Parameters:
component
- The Component containing the URL used to connect to the component, like rmi://localhost:1111/pdpRmipreferredConnectorType
- The preferred connector type (optional). If null, if the preferredConnectorType string is not found or if there is only one url, the connector will be selected according to the priorities list. This parameter is not case sensitive.protocolToAuthentication
- the protocol to authenticationactiveprofiles
- the activeprofiles- Returns:
- A connector suitable for the specified protocol, null in case of an error
-
getPdp
public IPolicyDecisionPoint getPdp(URI url)
Tries to establish a connection to a PDP by using the passed url variable.- Parameters:
url
- The URL used to connect to the component, like rmi://localhost:1111/pdpRmi- Returns:
- A connector suitable for the specified protocol, null in case of an error
-
getPdp
public IPolicyDecisionPoint getPdp(URI url, Authentication credentials)
Tries to establish a connection to a PDP by using the passed url variable.- Parameters:
url
- The URL used to connect to the component, like rmi://localhost:1111/pdpRmicredentials
- API Key (Oauth)- Returns:
- A connector suitable for the specified protocol, null in case of an error
-
getPip
public IPolicyInformationPoint getPip(PipComponentInformation component, String preferredConnectorType)
Tries to establish a connection to a PIP by using the passed url variable.- Parameters:
component
- The Component containing the URL used to connect to the component, like rmi://localhost:1111/pipRmipreferredConnectorType
- The preferred connector type (optional). If null, if the preferredConnectorType string is not found or if there is only one url, the connector will be selected according to the priorities list. This parameter is not case sensitive.- Returns:
- A connector suitable for the specified protocol, null in case of an error
-
getPip
public IPolicyInformationPoint getPip(URI url)
Tries to establish a connection to a PIP by using the passed url variable.- Parameters:
url
- The URL used to connect to the component, like rmi://localhost:1111/pipRmi- Returns:
- A connector suitable for the specified protocol, null in case of an error
-
getBasicManagementService
public IBasicManagementService getBasicManagementService(BasicManagementServiceComponentInformation component, String preferredConnectorType)
Tries to establish a connection to a PMP client by using the passed url variable.- Parameters:
component
- The Component containing the URL used to connect to the component, like rmi://localhost:1111/pmpRmipreferredConnectorType
- The preferred connector type (optional). If null, if the preferredConnectorType string is not found or if there is only one url, the connector will be selected according to the priorities list. This parameter is not case sensitive.- Returns:
- A connector suitable for the specified protocol, null in case of an error
-
getPmpClient
public IBasicManagementService getPmpClient(URI url, OAuthCredentials oAuthCredentials)
Tries to establish a connection to a PMP client by using the passed url variable.- Parameters:
url
- The URL used to connect to the component, like rmi://localhost:1111/pmpRmioAuthCredentials
- Credentials to login.- Returns:
- A connector suitable for the specified protocol, null in case of an error
-
getPmpClient
public IBasicManagementService getPmpClient(URI url)
Tries to establish a connection to a PMP client by using the passed url variable.- Parameters:
url
- The URL used to connect to the component, like rmi://localhost:1111/pmpRmi- Returns:
- A connector suitable for the specified protocol, null in case of an error
-
getManagementService
public IManagementService getManagementService(URI url)
Gets the management service.- Parameters:
url
- the url- Returns:
- the management service
-
getManagementService
public IManagementService getManagementService(URI url, OAuthCredentials oAuthCredentials)
Tries to establish a connection to a PMP server by using the passed url variable.- Parameters:
url
- the urloAuthCredentials
- the o auth credentials- Returns:
- A connector suitable for the specified protocol, null in case of an error
-
getPmpServer
public IManagementService getPmpServer(URI url)
Tries to establish a connection to a PMP server by using the passed url variable.- Parameters:
url
- The URL used to connect to the component, like rmi://localhost:1111/pmpRmi- Returns:
- A connector suitable for the specified protocol, null in case of an error
-
getPxp
public IPolicyExecutionPoint getPxp(PxpComponentInformation component, String preferredConnectorType)
Tries to establish a connection to a PXP by using the passed url variable.- Parameters:
component
- The Component containing the URL used to connect to the component, like rmi://localhost:1111/pxpRmipreferredConnectorType
- The preferred connector type (optional). If null, if the preferredConnectorType string is not found or if there is only one url, the connector will be selected according to the priorities list. This parameter is not case sensitive.- Returns:
- A connector suitable for the specified protocol, null in case of an error
-
getPxp
public IPolicyExecutionPoint getPxp(URI url)
Tries to establish a connection to a PXP by using the passed url variable.- Parameters:
url
- The URL used to connect to the component, like rmi://localhost:1111/pxpRmi- Returns:
- A connector suitable for the specified protocol, null in case of an error
-
-