Class 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 Detail

      • ConnectorFactory

        public ConnectorFactory()
        Constructor without any additional packageNames to look for Connector classes.
        See Also:
        ConnectorFactory(Set)
      • ConnectorFactory

        public ConnectorFactory​(Set<String> additionalPackageNames)
        Constructor with the ability to specify additional packageNames where we should look for Connector classes.
        Parameters:
        additionalPackageNames - set of package names
    • 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/pdpRmi
        credentials - 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/pdpRmi
        preferredConnectorType - 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/pdpRmi
        preferredConnectorType - 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
        activeprofiles - 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/pdpRmi
        credentials - 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/pipRmi
        preferredConnectorType - 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/pmpRmi
        preferredConnectorType - 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/pmpRmi
        oAuthCredentials - 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 url
        oAuthCredentials - 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/pxpRmi
        preferredConnectorType - 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