class ServiceNowMetaDataExtension extends AbstractMetaDataExtension {

    @Override
    public Optional<MetaData> meta(Map<String, Object> parameters) {
        final String objectType = ConnectorOptions.extractOption(parameters, OBJECT_TYPE);
        final String metaType = ConnectorOptions.extractOption(parameters, META_TYPE, "definition");

        // Retrieve the table definition as json-scheme
        if (ObjectHelper.equalIgnoreCase(objectType, ServiceNowConstants.RESOURCE_TABLE) && ObjectHelper.equalIgnoreCase(metaType, "definition")) {
            final MetaContext context = new MetaContext(parameters);

            // validate meta parameters
            ObjectHelper.notNull(context.getObjectType(), OBJECT_TYPE);
            ObjectHelper.notNull(context.getObjectName(), OBJECT_NAME);

            try {
                return tableDefinition(context);
            } catch (Exception e) {
                throw new IllegalStateException(e);
            }
        }

        // retrieve the list of tables excluding those used for import sets
        if (ObjectHelper.equalIgnoreCase(objectType, ServiceNowConstants.RESOURCE_TABLE) && ObjectHelper.equalIgnoreCase(metaType, "list")) {
            final MetaContext context = new MetaContext(parameters);

            // validate meta parameters
            ObjectHelper.notNull(context.getObjectType(), OBJECT_TYPE);

            try {
                return tableList(context);
            } catch (Exception e) {
                throw new IllegalStateException(e);
            }
        }

        // retrieve the list of import set tables
        if (ObjectHelper.equalIgnoreCase(objectType, ServiceNowConstants.RESOURCE_IMPORT) && ObjectHelper.equalIgnoreCase(metaType, "list")) {
            final MetaContext context = new MetaContext(parameters);

            // validate mate parameters
            ObjectHelper.notNull(context.getObjectType(), OBJECT_TYPE);

            try {
                return importSetList(context);
            } catch (Exception e) {
                throw new IllegalStateException(e);
            }
        }

        throw new UnsupportedOperationException("Unsupported object type <" + objectType + ">");
    }

      ServiceNowMetaDataExtension(CamelContext context);

}