diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_ClientMapCacheService.java b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_ClientMapCacheService.java index 634ebd93c2..3991584ab5 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_ClientMapCacheService.java +++ b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_ClientMapCacheService.java @@ -34,7 +34,6 @@ import org.apache.nifi.distributed.cache.client.DistributedMapCacheClient; import org.apache.nifi.distributed.cache.client.Serializer; import org.apache.nifi.expression.ExpressionLanguageScope; import org.apache.nifi.distributed.cache.client.Deserializer; -import java.io.ByteArrayOutputStream; import org.apache.nifi.reporting.InitializationException; import java.nio.charset.StandardCharsets; @@ -46,12 +45,14 @@ import org.apache.nifi.hbase.put.PutColumn; import org.apache.nifi.processor.util.StandardValidators; +import static org.apache.nifi.hbase.VisibilityLabelUtils.AUTHORIZATIONS; + @Tags({"distributed", "cache", "state", "map", "cluster","hbase"}) @SeeAlso(classNames = {"org.apache.nifi.hbase.HBase_1_1_2_ClientService"}) @CapabilityDescription("Provides the ability to use an HBase table as a cache, in place of a DistributedMapCache." + " Uses a HBase_1_1_2_ClientService controller to communicate with HBase.") -public class HBase_1_1_2_ClientMapCacheService extends AbstractControllerService implements DistributedMapCacheClient, VisibilityLabelService { +public class HBase_1_1_2_ClientMapCacheService extends AbstractControllerService implements DistributedMapCacheClient { static final PropertyDescriptor HBASE_CLIENT_SERVICE = new PropertyDescriptor.Builder() .name("HBase Client Service") @@ -120,7 +121,7 @@ public class HBase_1_1_2_ClientMapCacheService extends AbstractControllerService hBaseColumnFamilyBytes = hBaseColumnFamily.getBytes(StandardCharsets.UTF_8); hBaseColumnQualifierBytes = hBaseColumnQualifier.getBytes(StandardCharsets.UTF_8); - authorizations = getAuthorizations(context); + authorizations = VisibilityLabelUtils.getAuthorizations(context); } private byte[] serialize(final T value, final Serializer serializer) throws IOException { diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_RecordLookupService.java b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_RecordLookupService.java index 12fb6cf556..50e526ee28 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_RecordLookupService.java +++ b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_RecordLookupService.java @@ -51,10 +51,12 @@ import java.util.Map; import java.util.Optional; import java.util.Set; +import static org.apache.nifi.hbase.VisibilityLabelUtils.AUTHORIZATIONS; + @Tags({"hbase", "record", "lookup", "service"}) @CapabilityDescription("A lookup service that retrieves one or more columns from HBase and returns them as a record. The lookup coordinates " + "must contain 'rowKey' which will be the HBase row id.") -public class HBase_1_1_2_RecordLookupService extends AbstractControllerService implements LookupService, VisibilityLabelService { +public class HBase_1_1_2_RecordLookupService extends AbstractControllerService implements LookupService { static final String ROW_KEY_KEY = "rowKey"; private static final Set REQUIRED_KEYS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(ROW_KEY_KEY))); @@ -170,7 +172,7 @@ public class HBase_1_1_2_RecordLookupService extends AbstractControllerService i this.tableName = context.getProperty(TABLE_NAME).getValue(); this.columns = getColumns(context.getProperty(RETURN_COLUMNS).getValue()); this.charset = Charset.forName(context.getProperty(CHARSET).getValue()); - this.authorizations = getAuthorizations(context); + this.authorizations = VisibilityLabelUtils.getAuthorizations(context); } @OnDisabled diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/IntegrationTestClientService.java b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/IntegrationTestClientService.java deleted file mode 100644 index 452f6c2bdd..0000000000 --- a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/IntegrationTestClientService.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.nifi.hbase; - -import org.apache.hadoop.hbase.client.Connection; -import org.apache.nifi.annotation.lifecycle.OnEnabled; -import org.apache.nifi.components.ValidationContext; -import org.apache.nifi.components.ValidationResult; -import org.apache.nifi.controller.ConfigurationContext; -import org.apache.nifi.reporting.InitializationException; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; - -public class IntegrationTestClientService extends HBase_1_1_2_ClientService { - IntegrationTestClientService(Connection hbaseConnection) { - super(); - setConnection(hbaseConnection); - } - - - @Override - protected Collection customValidate(ValidationContext validationContext) { - return new ArrayList<>(); - } - - @OnEnabled - public void onEnabled(final ConfigurationContext context) throws InitializationException, IOException, InterruptedException { - - } -} diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/VisibilityLabelService.java b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/VisibilityLabelUtils.java similarity index 90% rename from nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/VisibilityLabelService.java rename to nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/VisibilityLabelUtils.java index 9c9ab72be2..8366696553 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/VisibilityLabelService.java +++ b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/VisibilityLabelUtils.java @@ -26,8 +26,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -public interface VisibilityLabelService { - PropertyDescriptor AUTHORIZATIONS = new PropertyDescriptor.Builder() +class VisibilityLabelUtils { + static final PropertyDescriptor AUTHORIZATIONS = new PropertyDescriptor.Builder() .name("hb-lu-authorizations") .displayName("Authorizations") .description("The list of authorization tokens to be used with cell visibility if it is enabled. These will be used to " + @@ -36,7 +36,7 @@ public interface VisibilityLabelService { .addValidator(StandardValidators.NON_EMPTY_VALIDATOR) .build(); - default List getAuthorizations(ConfigurationContext context) { + static List getAuthorizations(ConfigurationContext context) { List tokens = new ArrayList<>(); String authorizationString = context.getProperty(AUTHORIZATIONS).isSet() ? context.getProperty(AUTHORIZATIONS).getValue()