Class AccessServiceAdmin
- java.lang.Object
-
- org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceAdmin
-
public abstract class AccessServiceAdmin extends Object
AccessServiceAdmin is the interface that an access service implements to receive its configuration. The java class that implements this interface is created with a default constructor and then the initialize method is called. It is configured in the AccessServiceDescription enumeration.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringdefaultZonesPropertyNameprotected StringkarmaPointIncrementPropertyNameprotected StringkarmaPointPlateauPropertyNameprotected StringpublishZonesPropertyNameprotected StringsupportedZonesPropertyName
-
Constructor Summary
Constructors Constructor Description AccessServiceAdmin()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected List<String>extractDefaultZones(Map<String,Object> accessServiceOptions, String accessServiceFullName, AuditLog auditLog)Extract the default zones property from the access services option.protected intextractKarmaPointIncrement(Map<String,Object> accessServiceOptions, String accessServiceFullName, AuditLog auditLog)Extract the karma point plateau property from the access services option.protected intextractKarmaPointPlateau(Map<String,Object> accessServiceOptions, String accessServiceFullName, AuditLog auditLog)Extract the karma point plateau property from the access services option.protected List<String>extractPublishZones(Map<String,Object> accessServiceOptions, String accessServiceFullName, AuditLog auditLog)Extract the publish zones property from the access services option.protected List<String>extractSupportedZones(Map<String,Object> accessServiceOptions, String accessServiceFullName, AuditLog auditLog)Extract the supported zones property from the access services option.StringgetFullServiceName()Return the cached service name.protected OpenMetadataTopicConnectorgetInTopicEventBusConnector(Connection inTopicConnection, String accessServiceFullName, AuditLog parentAuditLog)Create the connector for this access services' In Topic.protected ConnectiongetOutTopicConnection(Connection outTopicEventBusConnection, String accessServiceFullName, String accessServiceConnectorProviderClassName, AuditLog auditLog)Create the connector for this access services' Out Topic.protected OpenMetadataTopicConnectorgetOutTopicEventBusConnector(Connection outTopicEventBusConnection, String accessServiceName, AuditLog parentAuditLog)Create the event bus connector for this access services' Out Topic.<T> TgetTopicConnector(Connection topicConnection, Class<T> topicConnectorClass, AuditLog auditLog, String accessServiceFullName, String methodName)Create an instance of an open metadata topic connector using the supplied connection.protected StringgetTopicName(Connection connection)Return the name of the topic extracted from the endpoint of the topic's Connection.voidinitialize(AccessServiceConfig accessServiceConfigurationProperties, OMRSTopicConnector enterpriseOMRSTopicConnector, OMRSRepositoryConnector enterpriseOMRSRepositoryConnector, AuditLog auditLog, String serverUserName)Initialize the access service.voidinitialize(AccessServiceConfig accessServiceConfigurationProperties, OMRSTopicConnector enterpriseOMRSTopicConnector, OMRSRepositoryConnector enterpriseOMRSRepositoryConnector, OMRSAuditLog auditLog, String serverUserName)Deprecated.protected voidregisterWithEnterpriseTopic(String accessServiceFullName, String serverName, OMRSTopicConnector omrsTopicConnector, OMRSTopicListener omrsTopicListener, AuditLog auditLog)Register a listener with the enterprise topic connector.voidsetFullServiceName(String fullServiceName)Set up the cached service name.abstract voidshutdown()Shutdown the access service.protected voidthrowUnexpectedInitializationException(String actionDescription, String fullAccessServiceName, Throwable error)Log that an unexpected exception was received during start up.
-
-
-
Field Detail
-
supportedZonesPropertyName
protected String supportedZonesPropertyName
-
defaultZonesPropertyName
protected String defaultZonesPropertyName
-
publishZonesPropertyName
protected String publishZonesPropertyName
-
karmaPointPlateauPropertyName
protected String karmaPointPlateauPropertyName
-
karmaPointIncrementPropertyName
protected String karmaPointIncrementPropertyName
-
-
Method Detail
-
initialize
@Deprecated public void initialize(AccessServiceConfig accessServiceConfigurationProperties, OMRSTopicConnector enterpriseOMRSTopicConnector, OMRSRepositoryConnector enterpriseOMRSRepositoryConnector, OMRSAuditLog auditLog, String serverUserName) throws OMAGConfigurationErrorException
Deprecated.Initialize the access service.- Parameters:
accessServiceConfigurationProperties- specific configuration properties for this access service.enterpriseOMRSTopicConnector- connector for receiving OMRS Events from the cohortsenterpriseOMRSRepositoryConnector- connector for querying the cohort repositoriesauditLog- audit log component for logging messages.serverUserName- user id to use on OMRS calls where there is no end user.- Throws:
OMAGConfigurationErrorException- invalid parameters in the configuration properties.
-
initialize
public void initialize(AccessServiceConfig accessServiceConfigurationProperties, OMRSTopicConnector enterpriseOMRSTopicConnector, OMRSRepositoryConnector enterpriseOMRSRepositoryConnector, AuditLog auditLog, String serverUserName) throws OMAGConfigurationErrorException
Initialize the access service.- Parameters:
accessServiceConfigurationProperties- specific configuration properties for this access service.enterpriseOMRSTopicConnector- connector for receiving OMRS Events from the cohortsenterpriseOMRSRepositoryConnector- connector for querying the cohort repositoriesauditLog- audit log component for logging messages.serverUserName- user id to use on OMRS calls where there is no end user.- Throws:
OMAGConfigurationErrorException- invalid parameters in the configuration properties.
-
getFullServiceName
public String getFullServiceName()
Return the cached service name.- Returns:
- string name
-
setFullServiceName
public void setFullServiceName(String fullServiceName)
Set up the cached service name.- Parameters:
fullServiceName- string name
-
shutdown
public abstract void shutdown()
Shutdown the access service.
-
extractSupportedZones
protected List<String> extractSupportedZones(Map<String,Object> accessServiceOptions, String accessServiceFullName, AuditLog auditLog) throws OMAGConfigurationErrorException
Extract the supported zones property from the access services option.- Parameters:
accessServiceOptions- options passed to the access service.accessServiceFullName- name of calling serviceauditLog- audit log for error messages- Returns:
- null or list of zone names
- Throws:
OMAGConfigurationErrorException- the supported zones property is not a list of zone names.
-
extractPublishZones
protected List<String> extractPublishZones(Map<String,Object> accessServiceOptions, String accessServiceFullName, AuditLog auditLog) throws OMAGConfigurationErrorException
Extract the publish zones property from the access services option.- Parameters:
accessServiceOptions- options passed to the access service.accessServiceFullName- name of calling serviceauditLog- audit log for error messages- Returns:
- null or list of zone names
- Throws:
OMAGConfigurationErrorException- the supported zones property is not a list of zone names.
-
extractDefaultZones
protected List<String> extractDefaultZones(Map<String,Object> accessServiceOptions, String accessServiceFullName, AuditLog auditLog) throws OMAGConfigurationErrorException
Extract the default zones property from the access services option.- Parameters:
accessServiceOptions- options passed to the access service.accessServiceFullName- name of calling serviceauditLog- audit log for error messages- Returns:
- null or list of zone names
- Throws:
OMAGConfigurationErrorException- the supported zones property is not a list of zone names.
-
extractKarmaPointIncrement
protected int extractKarmaPointIncrement(Map<String,Object> accessServiceOptions, String accessServiceFullName, AuditLog auditLog) throws OMAGConfigurationErrorException
Extract the karma point plateau property from the access services option.- Parameters:
accessServiceOptions- options passed to the access service.accessServiceFullName- name of calling serviceauditLog- audit log for error messages- Returns:
- null or list of zone names
- Throws:
OMAGConfigurationErrorException- the supported zones property is not a list of zone names.
-
extractKarmaPointPlateau
protected int extractKarmaPointPlateau(Map<String,Object> accessServiceOptions, String accessServiceFullName, AuditLog auditLog) throws OMAGConfigurationErrorException
Extract the karma point plateau property from the access services option.- Parameters:
accessServiceOptions- options passed to the access service.accessServiceFullName- name of calling serviceauditLog- audit log for error messages- Returns:
- null or list of zone names
- Throws:
OMAGConfigurationErrorException- the supported zones property is not a list of zone names.
-
registerWithEnterpriseTopic
protected void registerWithEnterpriseTopic(String accessServiceFullName, String serverName, OMRSTopicConnector omrsTopicConnector, OMRSTopicListener omrsTopicListener, AuditLog auditLog) throws OMAGConfigurationErrorException
Register a listener with the enterprise topic connector.- Parameters:
accessServiceFullName- name of calling access serviceserverName- name of OMAG Server instanceomrsTopicConnector- topic connector to register withomrsTopicListener- listener to registerauditLog- audit log to record messages- Throws:
OMAGConfigurationErrorException- problem with topic connection
-
getTopicName
protected String getTopicName(Connection connection)
Return the name of the topic extracted from the endpoint of the topic's Connection.- Parameters:
connection- connection object- Returns:
- topic name
-
getInTopicEventBusConnector
protected OpenMetadataTopicConnector getInTopicEventBusConnector(Connection inTopicConnection, String accessServiceFullName, AuditLog parentAuditLog) throws OMAGConfigurationErrorException
Create the connector for this access services' In Topic.- Parameters:
inTopicConnection- connection from the configuration propertiesaccessServiceFullName- name of the calling access serviceparentAuditLog- audit log from the admin component- Returns:
- connector to access the topic
- Throws:
OMAGConfigurationErrorException- problem creating connector
-
getOutTopicEventBusConnector
protected OpenMetadataTopicConnector getOutTopicEventBusConnector(Connection outTopicEventBusConnection, String accessServiceName, AuditLog parentAuditLog) throws OMAGConfigurationErrorException
Create the event bus connector for this access services' Out Topic.- Parameters:
outTopicEventBusConnection- connection from the configuration properties - the event busaccessServiceName- name of the calling access serviceparentAuditLog- audit log from the admin component- Returns:
- connector to access the topic
- Throws:
OMAGConfigurationErrorException- problem creating connector
-
getOutTopicConnection
protected Connection getOutTopicConnection(Connection outTopicEventBusConnection, String accessServiceFullName, String accessServiceConnectorProviderClassName, AuditLog auditLog) throws OMAGConfigurationErrorException
Create the connector for this access services' Out Topic.- Parameters:
outTopicEventBusConnection- connection from the configuration properties - the event busaccessServiceFullName- name of the calling access serviceaccessServiceConnectorProviderClassName- class name of connector providerauditLog- audit log from the admin component- Returns:
- connector to access the topic
- Throws:
OMAGConfigurationErrorException- problem creating connector
-
throwUnexpectedInitializationException
protected void throwUnexpectedInitializationException(String actionDescription, String fullAccessServiceName, Throwable error) throws OMAGConfigurationErrorException
Log that an unexpected exception was received during start up.- Parameters:
actionDescription- calling methodfullAccessServiceName- name of the access serviceerror- exception that was caught- Throws:
OMAGConfigurationErrorException- wrapped exception
-
getTopicConnector
public <T> T getTopicConnector(Connection topicConnection, Class<T> topicConnectorClass, AuditLog auditLog, String accessServiceFullName, String methodName) throws OMAGConfigurationErrorException
Create an instance of an open metadata topic connector using the supplied connection.- Type Parameters:
T- type name- Parameters:
topicConnection- connection needed to create the connectortopicConnectorClass- class to cast toaccessServiceFullName- name of the calling access serviceauditLog- audit log for this connectormethodName- calling method- Returns:
- connector to access the topic
- Throws:
OMAGConfigurationErrorException- problem creating connector
-
-