Class WSO2MIResourceConnector

java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.adapters.connectors.wso2mi.resource.WSO2MIResourceConnector
All Implemented Interfaces:
AuditLoggingComponent, SecureConnectorExtension, VirtualConnectorExtension

public class WSO2MIResourceConnector extends ConnectorBase implements AuditLoggingComponent
WSO2MIResourceConnector is the resource connector for a WSO2 Micro Integrator instance. It talks to the Micro Integrator's Management API (default port 9164, base path /management).

Authentication is a two step exchange, unlike the JDBC- and OAuth2-based connectors in this family:

  1. GET /management/login with HTTP Basic Auth (username:password) returns { "AccessToken": "..." }.
  2. That token is presented as a Bearer token on every subsequent Management API call.

Open design point (odpi/egeria#9245): the exact wiring of this login/session-token exchange into Egeria's RESTClientFactory / secrets-store machinery is still being agreed with the Egeria maintainers. The current implementation obtains the base client from the factory (which applies the configured Basic credentials) for the login call, then holds the resulting bearer token on this connector. This will be revised to match whatever session-token pattern Egeria settles on.

v1 scope is deliberately minimal: authenticate, then list the deployed APIs. Proxy Services, Sequences, Endpoints, Inbound Endpoints, Connectors, Message Stores/Processors, Templates and Tasks are follow-up increments.

  • Constructor Details

    • WSO2MIResourceConnector

      public WSO2MIResourceConnector()
  • Method Details

    • setAuditLog

      public void setAuditLog(AuditLog auditLog)
      Receive an audit log object that can be used to record audit log messages. The caller has initialized it with the correct component description and log destinations.
      Specified by:
      setAuditLog in interface AuditLoggingComponent
      Parameters:
      auditLog - audit log object
    • getConnectorComponentDescription

      public ComponentDescription getConnectorComponentDescription()
      Return the component description that is used by this connector in the audit log.
      Specified by:
      getConnectorComponentDescription in interface AuditLoggingComponent
      Returns:
      id, name, description, wiki page URL.
    • setWSO2InstanceName

      public void setWSO2InstanceName(String wso2InstanceName)
      Set up a new instance name (must be called before start()).
      Parameters:
      wso2InstanceName - new instance name
    • start

      Indicates that the connector is completely configured and can begin processing.
      Overrides:
      start in class ConnectorBase
      Throws:
      ConnectorCheckedException - the connector detected a problem.
      UserNotAuthorizedException - connector disconnected
    • login

      public void login() throws PropertyServerException
      Exchange the configured Basic credentials for a short-lived bearer token via GET /management/login, and hold it for subsequent calls.
      Throws:
      PropertyServerException - the login call failed or returned no token
    • getBearerToken

      public String getBearerToken()
      Return the bearer token obtained from the last login() call, or null if not yet authenticated.
      Returns:
      string token
    • listAPIs

      public List<APIInfo> listAPIs() throws PropertyServerException
      List the REST APIs currently deployed on the Micro Integrator.
      Returns:
      list of APIInfo; an empty list if none are deployed
      Throws:
      PropertyServerException - problem with the call
    • getAPI

      public APIInfo getAPI(String apiName) throws PropertyServerException
      Return the detail for a single deployed API by name (GET /management/apis?apiName={name}).
      Parameters:
      apiName - name of the API
      Returns:
      APIInfo, or null if the Micro Integrator has no API with that name
      Throws:
      PropertyServerException - problem with the call