From e1a380a1311471e972a7196c50c25ed1ef7c25e1 Mon Sep 17 00:00:00 2001 From: "Arul.Nambi" Date: Wed, 11 Oct 2017 18:19:37 -0400 Subject: Increase junit coverage Issue-ID: AAI-429 Change-Id: Idd0f52e6b74a2689824dc671d37fe25ccf3e781c Signed-off-by: Arul.Nambi --- src/main/java/org/onap/aai/sparky/HelloWorld.java | 46 -- .../aai/sparky/analytics/AbstractStatistics.java | 28 ++ .../aai/sparky/analytics/HistoricalCounter.java | 56 +++ .../dal/aai/config/ActiveInventoryRestConfig.java | 21 + .../dal/aai/config/ActiveInventorySslConfig.java | 14 + .../dal/elasticsearch/ElasticSearchAdapter.java | 21 + .../sparky/dal/elasticsearch/SearchAdapter.java | 35 ++ .../elasticsearch/config/ElasticSearchConfig.java | 119 +++++ .../security/portal/PortalRestAPIServiceImpl.java | 28 ++ .../synchronizer/ElasticSearchIndexCleaner.java | 147 ++++++ .../synchronizer/IndexIntegrityValidator.java | 56 +++ .../aai/sparky/synchronizer/MyErrorHandler.java | 14 + .../sparky/synchronizer/TaskProcessingStats.java | 56 +++ .../config/SynchronizerConfiguration.java | 56 +++ .../filter/ElasticSearchSynchronizerFilter.java | 21 + .../task/CollectEntitySelfLinkTask.java | 28 ++ .../task/CollectEntityTypeSelfLinksTask.java | 28 ++ .../task/GetCrossEntityReferenceEntityTask.java | 28 ++ .../task/PerformActiveInventoryRetrieval.java | 56 +++ .../synchronizer/task/PerformElasticSearchPut.java | 56 +++ .../task/PerformElasticSearchRetrieval.java | 42 ++ .../task/PerformElasticSearchUpdate.java | 70 +++ .../task/PersistOperationResultToDisk.java | 70 +++ .../task/RetrieveOperationResultFromDisk.java | 42 ++ .../synchronizer/task/StoreDocumentTask.java | 56 +++ .../java/org/onap/aai/sparky/util/NodeUtils.java | 28 ++ .../org/onap/aai/sparky/util/test/Encryptor.java | 84 ++++ .../onap/aai/sparky/util/test/KeystoreBuilder.java | 534 +++++++++++++++++++++ .../viewandinspect/EntityTypeAggregation.java | 7 + .../config/TierSupportUiConstants.java | 316 ++++++++++++ .../viewandinspect/config/VisualizationConfig.java | 21 + .../entity/D3VisualizationOutput.java | 28 ++ .../aai/sparky/viewandinspect/entity/JsonNode.java | 49 ++ .../viewandinspect/entity/RelationshipList.java | 14 + .../sparky/viewandinspect/entity/Violations.java | 14 + .../services/SearchServiceWrapper.java | 168 +++++++ .../services/VisualizationTransformer.java | 72 +++ .../viewandinspect/servlet/SearchServlet.java | 36 ++ .../task/CollectNodeSelfLinkTask.java | 28 ++ 39 files changed, 2547 insertions(+), 46 deletions(-) delete mode 100644 src/main/java/org/onap/aai/sparky/HelloWorld.java create mode 100644 src/main/java/org/onap/aai/sparky/util/test/Encryptor.java create mode 100644 src/main/java/org/onap/aai/sparky/util/test/KeystoreBuilder.java (limited to 'src/main') diff --git a/src/main/java/org/onap/aai/sparky/HelloWorld.java b/src/main/java/org/onap/aai/sparky/HelloWorld.java deleted file mode 100644 index 30d277d..0000000 --- a/src/main/java/org/onap/aai/sparky/HelloWorld.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017 Amdocs - * ================================================================================ - * Licensed 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. - * ============LICENSE_END========================================================= - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. - */ -package org.onap.aai.sparky; - -import org.apache.camel.Exchange; - -/** - * The Class HelloWorld. - */ -public class HelloWorld { - - /** - * Instantiates a new hello world. - */ - public HelloWorld() {} - - /** - * Speak. - * - * @param exc the exc - */ - public final void speak(Exchange exc) { - exc.setOut(exc.getIn()); - exc.getOut().setBody("Hello World!"); - } -} diff --git a/src/main/java/org/onap/aai/sparky/analytics/AbstractStatistics.java b/src/main/java/org/onap/aai/sparky/analytics/AbstractStatistics.java index 3fccab3..aff70ae 100644 --- a/src/main/java/org/onap/aai/sparky/analytics/AbstractStatistics.java +++ b/src/main/java/org/onap/aai/sparky/analytics/AbstractStatistics.java @@ -31,6 +31,34 @@ import java.util.concurrent.atomic.AtomicInteger; public class AbstractStatistics implements ComponentStatistics { private HashMap namedCounters; + /** + * @return the namedCounters + */ + public HashMap getNamedCounters() { + return namedCounters; + } + + /** + * @param namedCounters the namedCounters to set + */ + public void setNamedCounters(HashMap namedCounters) { + this.namedCounters = namedCounters; + } + + /** + * @return the namedHistograms + */ + public HashMap getNamedHistograms() { + return namedHistograms; + } + + /** + * @param namedHistograms the namedHistograms to set + */ + public void setNamedHistograms(HashMap namedHistograms) { + this.namedHistograms = namedHistograms; + } + private HashMap namedHistograms; /** diff --git a/src/main/java/org/onap/aai/sparky/analytics/HistoricalCounter.java b/src/main/java/org/onap/aai/sparky/analytics/HistoricalCounter.java index e7dabe7..47565ac 100644 --- a/src/main/java/org/onap/aai/sparky/analytics/HistoricalCounter.java +++ b/src/main/java/org/onap/aai/sparky/analytics/HistoricalCounter.java @@ -33,6 +33,62 @@ public class HistoricalCounter { private double min; + /** + * @return the totalOfSamples + */ + public double getTotalOfSamples() { + return totalOfSamples; + } + + /** + * @param totalOfSamples the totalOfSamples to set + */ + public void setTotalOfSamples(double totalOfSamples) { + this.totalOfSamples = totalOfSamples; + } + + /** + * @return the maintainSingleValue + */ + public boolean isMaintainSingleValue() { + return maintainSingleValue; + } + + /** + * @param maintainSingleValue the maintainSingleValue to set + */ + public void setMaintainSingleValue(boolean maintainSingleValue) { + this.maintainSingleValue = maintainSingleValue; + } + + /** + * @param min the min to set + */ + public void setMin(double min) { + this.min = min; + } + + /** + * @param max the max to set + */ + public void setMax(double max) { + this.max = max; + } + + /** + * @param numSamples the numSamples to set + */ + public void setNumSamples(long numSamples) { + this.numSamples = numSamples; + } + + /** + * @param value the value to set + */ + public void setValue(double value) { + this.value = value; + } + private double max; private double totalOfSamples; diff --git a/src/main/java/org/onap/aai/sparky/dal/aai/config/ActiveInventoryRestConfig.java b/src/main/java/org/onap/aai/sparky/dal/aai/config/ActiveInventoryRestConfig.java index a99e6c3..4f6fdee 100644 --- a/src/main/java/org/onap/aai/sparky/dal/aai/config/ActiveInventoryRestConfig.java +++ b/src/main/java/org/onap/aai/sparky/dal/aai/config/ActiveInventoryRestConfig.java @@ -36,6 +36,27 @@ public class ActiveInventoryRestConfig { private String host; + /** + * @return the cacheFailures + */ + public boolean isCacheFailures() { + return cacheFailures; + } + + /** + * @param cacheFailures the cacheFailures to set + */ + public void setCacheFailures(boolean cacheFailures) { + this.cacheFailures = cacheFailures; + } + + /** + * @param shallowEntities the shallowEntities to set + */ + public void setShallowEntities(List shallowEntities) { + this.shallowEntities = shallowEntities; + } + private String port; private int connectTimeoutInMs; diff --git a/src/main/java/org/onap/aai/sparky/dal/aai/config/ActiveInventorySslConfig.java b/src/main/java/org/onap/aai/sparky/dal/aai/config/ActiveInventorySslConfig.java index 230c445..98e3eed 100644 --- a/src/main/java/org/onap/aai/sparky/dal/aai/config/ActiveInventorySslConfig.java +++ b/src/main/java/org/onap/aai/sparky/dal/aai/config/ActiveInventorySslConfig.java @@ -198,6 +198,20 @@ public class ActiveInventorySslConfig { return "Basic " + java.util.Base64.getEncoder().encodeToString(usernameAndPassword.getBytes()); } + /** + * @return the enableSslDebug + */ + public boolean isEnableSslDebug() { + return enableSslDebug; + } + + /** + * @param enableSslDebug the enableSslDebug to set + */ + public void setEnableSslDebug(boolean enableSslDebug) { + this.enableSslDebug = enableSslDebug; + } + /* (non-Javadoc) * @see java.lang.Object#toString() */ diff --git a/src/main/java/org/onap/aai/sparky/dal/elasticsearch/ElasticSearchAdapter.java b/src/main/java/org/onap/aai/sparky/dal/elasticsearch/ElasticSearchAdapter.java index d99d51e..19bcf1a 100644 --- a/src/main/java/org/onap/aai/sparky/dal/elasticsearch/ElasticSearchAdapter.java +++ b/src/main/java/org/onap/aai/sparky/dal/elasticsearch/ElasticSearchAdapter.java @@ -159,4 +159,25 @@ public class ElasticSearchAdapter implements ElasticSearchDataProvider { return doGet( url, "application/json"); } + /** + * @return the bulkImportIndexTemplate + */ + public static String getBulkImportIndexTemplate() { + return BULK_IMPORT_INDEX_TEMPLATE; + } + + /** + * @return the restDataProvider + */ + public RestDataProvider getRestDataProvider() { + return restDataProvider; + } + + /** + * @return the esConfig + */ + public ElasticSearchConfig getEsConfig() { + return esConfig; + } + } diff --git a/src/main/java/org/onap/aai/sparky/dal/elasticsearch/SearchAdapter.java b/src/main/java/org/onap/aai/sparky/dal/elasticsearch/SearchAdapter.java index 59c0e5b..0682867 100644 --- a/src/main/java/org/onap/aai/sparky/dal/elasticsearch/SearchAdapter.java +++ b/src/main/java/org/onap/aai/sparky/dal/elasticsearch/SearchAdapter.java @@ -53,6 +53,41 @@ public class SearchAdapter { private RestClient client; + /** + * @return the client + */ + public RestClient getClient() { + return client; + } + + /** + * @param client the client to set + */ + public void setClient(RestClient client) { + this.client = client; + } + + /** + * @return the commonHeaders + */ + public Map> getCommonHeaders() { + return commonHeaders; + } + + /** + * @param commonHeaders the commonHeaders to set + */ + public void setCommonHeaders(Map> commonHeaders) { + this.commonHeaders = commonHeaders; + } + + /** + * @return the log + */ + public static Logger getLog() { + return LOG; + } + private Map> commonHeaders; private SearchServiceConfig sasConfig; diff --git a/src/main/java/org/onap/aai/sparky/dal/elasticsearch/config/ElasticSearchConfig.java b/src/main/java/org/onap/aai/sparky/dal/elasticsearch/config/ElasticSearchConfig.java index 2fe6bb6..f8385a1 100644 --- a/src/main/java/org/onap/aai/sparky/dal/elasticsearch/config/ElasticSearchConfig.java +++ b/src/main/java/org/onap/aai/sparky/dal/elasticsearch/config/ElasticSearchConfig.java @@ -505,6 +505,125 @@ public class ElasticSearchConfig { } + /** + * @return the instance + */ + public static ElasticSearchConfig getInstance() { + return instance; + } + + /** + * @param instance the instance to set + */ + public static void setInstance(ElasticSearchConfig instance) { + ElasticSearchConfig.instance = instance; + } + + /** + * @return the configFile + */ + public static String getConfigFile() { + return CONFIG_FILE; + } + + /** + * @return the ipAddressDefault + */ + public static String getIpAddressDefault() { + return IP_ADDRESS_DEFAULT; + } + + /** + * @return the httpPortDefault + */ + public static String getHttpPortDefault() { + return HTTP_PORT_DEFAULT; + } + + /** + * @return the javaApiPortDefault + */ + public static String getJavaApiPortDefault() { + return JAVA_API_PORT_DEFAULT; + } + + /** + * @return the typeDefault + */ + public static String getTypeDefault() { + return TYPE_DEFAULT; + } + + /** + * @return the clusterNameDefault + */ + public static String getClusterNameDefault() { + return CLUSTER_NAME_DEFAULT; + } + + /** + * @return the indexNameDefault + */ + public static String getIndexNameDefault() { + return INDEX_NAME_DEFAULT; + } + + /** + * @return the auditIndexNameDefault + */ + public static String getAuditIndexNameDefault() { + return AUDIT_INDEX_NAME_DEFAULT; + } + + /** + * @return the topographicalIndexNameDefault + */ + public static String getTopographicalIndexNameDefault() { + return TOPOGRAPHICAL_INDEX_NAME_DEFAULT; + } + + /** + * @return the entityCountHistoryIndexNameDefault + */ + public static String getEntityCountHistoryIndexNameDefault() { + return ENTITY_COUNT_HISTORY_INDEX_NAME_DEFAULT; + } + + /** + * @return the entityAutoSuggestIndexNameDefault + */ + public static String getEntityAutoSuggestIndexNameDefault() { + return ENTITY_AUTO_SUGGEST_INDEX_NAME_DEFAULT; + } + + /** + * @return the entityAutoSuggestSettingsFileDefault + */ + public static String getEntityAutoSuggestSettingsFileDefault() { + return ENTITY_AUTO_SUGGEST_SETTINGS_FILE_DEFAULT; + } + + /** + * @return the entityAutoSuggestMappingsFileDefault + */ + public static String getEntityAutoSuggestMappingsFileDefault() { + return ENTITY_AUTO_SUGGEST_MAPPINGS_FILE_DEFAULT; + } + + /** + * @return the entityDynamicMappingsFileDefault + */ + public static String getEntityDynamicMappingsFileDefault() { + return ENTITY_DYNAMIC_MAPPINGS_FILE_DEFAULT; + } + + /** + * @return the bulkApi + */ + public static String getBulkApi() { + return BULK_API; + } + /* * (non-Javadoc) * diff --git a/src/main/java/org/onap/aai/sparky/security/portal/PortalRestAPIServiceImpl.java b/src/main/java/org/onap/aai/sparky/security/portal/PortalRestAPIServiceImpl.java index 79e9344..798022a 100644 --- a/src/main/java/org/onap/aai/sparky/security/portal/PortalRestAPIServiceImpl.java +++ b/src/main/java/org/onap/aai/sparky/security/portal/PortalRestAPIServiceImpl.java @@ -48,6 +48,34 @@ public class PortalRestAPIServiceImpl implements IPortalRestAPIService { private static final Logger LOG = LoggerFactory.getLogger(PortalRestAPIServiceImpl.class); private static final String ERROR_MESSAGE = "Failed to {0} user [loginId:{1}]"; + /** + * @return the userManager + */ + public UserManager getUserManager() { + return userManager; + } + + /** + * @param userManager the userManager to set + */ + public void setUserManager(UserManager userManager) { + this.userManager = userManager; + } + + /** + * @return the log + */ + public static Logger getLog() { + return LOG; + } + + /** + * @return the errorMessage + */ + public static String getErrorMessage() { + return ERROR_MESSAGE; + } + private UserManager userManager; /** diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/ElasticSearchIndexCleaner.java b/src/main/java/org/onap/aai/sparky/synchronizer/ElasticSearchIndexCleaner.java index 842a416..cf18433 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/ElasticSearchIndexCleaner.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/ElasticSearchIndexCleaner.java @@ -635,6 +635,153 @@ public class ElasticSearchIndexCleaner implements IndexCleaner { } + /** + * @return the before + */ + public ObjectIdCollection getBefore() { + return before; + } + + /** + * @param before the before to set + */ + public void setBefore(ObjectIdCollection before) { + this.before = before; + } + + /** + * @return the after + */ + public ObjectIdCollection getAfter() { + return after; + } + + /** + * @param after the after to set + */ + public void setAfter(ObjectIdCollection after) { + this.after = after; + } + + /** + * @return the host + */ + public String getHost() { + return host; + } + + /** + * @param host the host to set + */ + public void setHost(String host) { + this.host = host; + } + + /** + * @return the port + */ + public String getPort() { + return port; + } + + /** + * @param port the port to set + */ + public void setPort(String port) { + this.port = port; + } + + /** + * @return the indexType + */ + public String getIndexType() { + return indexType; + } + + /** + * @param indexType the indexType to set + */ + public void setIndexType(String indexType) { + this.indexType = indexType; + } + + /** + * @return the scrollContextTimeToLiveInMinutes + */ + public int getScrollContextTimeToLiveInMinutes() { + return scrollContextTimeToLiveInMinutes; + } + + /** + * @param scrollContextTimeToLiveInMinutes the scrollContextTimeToLiveInMinutes to set + */ + public void setScrollContextTimeToLiveInMinutes(int scrollContextTimeToLiveInMinutes) { + this.scrollContextTimeToLiveInMinutes = scrollContextTimeToLiveInMinutes; + } + + /** + * @return the numItemsToGetBulkRequest + */ + public int getNumItemsToGetBulkRequest() { + return numItemsToGetBulkRequest; + } + + /** + * @param numItemsToGetBulkRequest the numItemsToGetBulkRequest to set + */ + public void setNumItemsToGetBulkRequest(int numItemsToGetBulkRequest) { + this.numItemsToGetBulkRequest = numItemsToGetBulkRequest; + } + + /** + * @return the restDataProvider + */ + public RestDataProvider getRestDataProvider() { + return restDataProvider; + } + + /** + * @param restDataProvider the restDataProvider to set + */ + public void setRestDataProvider(RestDataProvider restDataProvider) { + this.restDataProvider = restDataProvider; + } + + /** + * @return the mapper + */ + public ObjectMapper getMapper() { + return mapper; + } + + /** + * @param mapper the mapper to set + */ + public void setMapper(ObjectMapper mapper) { + this.mapper = mapper; + } + + /** + * @return the log + */ + public static Logger getLog() { + return LOG; + } + + /** + * @return the bulkOpLineTemplate + */ + public static String getBulkOpLineTemplate() { + return BULK_OP_LINE_TEMPLATE; + } + + /** + * @return the timestampFormat + */ + public static String getTimestampFormat() { + return TIMESTAMP_FORMAT; + } + /* */ diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/IndexIntegrityValidator.java b/src/main/java/org/onap/aai/sparky/synchronizer/IndexIntegrityValidator.java index 492fddf..0c342bc 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/IndexIntegrityValidator.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/IndexIntegrityValidator.java @@ -39,6 +39,62 @@ public class IndexIntegrityValidator implements IndexValidator { LoggerFactory.getInstance().getLogger(IndexIntegrityValidator.class); private String host; + /** + * @return the host + */ + public String getHost() { + return host; + } + + /** + * @param host the host to set + */ + public void setHost(String host) { + this.host = host; + } + + /** + * @return the port + */ + public String getPort() { + return port; + } + + /** + * @param port the port to set + */ + public void setPort(String port) { + this.port = port; + } + + /** + * @return the tableConfigJson + */ + public String getTableConfigJson() { + return tableConfigJson; + } + + /** + * @param tableConfigJson the tableConfigJson to set + */ + public void setTableConfigJson(String tableConfigJson) { + this.tableConfigJson = tableConfigJson; + } + + /** + * @return the log + */ + public static Logger getLog() { + return LOG; + } + + /** + * @return the restDataProvider + */ + public RestDataProvider getRestDataProvider() { + return restDataProvider; + } + private String port; private String indexName; private String indexType; diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/MyErrorHandler.java b/src/main/java/org/onap/aai/sparky/synchronizer/MyErrorHandler.java index 90665aa..78b6627 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/MyErrorHandler.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/MyErrorHandler.java @@ -36,6 +36,20 @@ public class MyErrorHandler implements ErrorHandler { /** Error handler output goes here. */ private PrintWriter out; + /** + * @return the out + */ + public PrintWriter getOut() { + return out; + } + + /** + * @param out the out to set + */ + public void setOut(PrintWriter out) { + this.out = out; + } + /** * Instantiates a new my error handler. * diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/TaskProcessingStats.java b/src/main/java/org/onap/aai/sparky/synchronizer/TaskProcessingStats.java index ea0c2d2..ef53a75 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/TaskProcessingStats.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/TaskProcessingStats.java @@ -129,5 +129,61 @@ public class TaskProcessingStats extends AbstractStatistics { } + /** + * @return the tASK_AGE_STATS + */ + public static String getTASK_AGE_STATS() { + return TASK_AGE_STATS; + } + + /** + * @param tASK_AGE_STATS the tASK_AGE_STATS to set + */ + public static void setTASK_AGE_STATS(String tASK_AGE_STATS) { + TASK_AGE_STATS = tASK_AGE_STATS; + } + + /** + * @return the tASK_RESPONSE_STATS + */ + public static String getTASK_RESPONSE_STATS() { + return TASK_RESPONSE_STATS; + } + + /** + * @param tASK_RESPONSE_STATS the tASK_RESPONSE_STATS to set + */ + public static void setTASK_RESPONSE_STATS(String tASK_RESPONSE_STATS) { + TASK_RESPONSE_STATS = tASK_RESPONSE_STATS; + } + + /** + * @return the rESPONSE_SIZE_IN_BYTES + */ + public static String getRESPONSE_SIZE_IN_BYTES() { + return RESPONSE_SIZE_IN_BYTES; + } + + /** + * @param rESPONSE_SIZE_IN_BYTES the rESPONSE_SIZE_IN_BYTES to set + */ + public static void setRESPONSE_SIZE_IN_BYTES(String rESPONSE_SIZE_IN_BYTES) { + RESPONSE_SIZE_IN_BYTES = rESPONSE_SIZE_IN_BYTES; + } + + /** + * @return the tPS + */ + public static String getTPS() { + return TPS; + } + + /** + * @param tPS the tPS to set + */ + public static void setTPS(String tPS) { + TPS = tPS; + } + } diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/config/SynchronizerConfiguration.java b/src/main/java/org/onap/aai/sparky/synchronizer/config/SynchronizerConfiguration.java index 2285950..914629f 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/config/SynchronizerConfiguration.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/config/SynchronizerConfiguration.java @@ -453,6 +453,62 @@ public class SynchronizerConfiguration { return syncTime.getTimeInMillis(); } + /** + * @return the instance + */ + public static SynchronizerConfiguration getInstance() { + return instance; + } + + /** + * @param instance the instance to set + */ + public static void setInstance(SynchronizerConfiguration instance) { + SynchronizerConfiguration.instance = instance; + } + + /** + * @return the log + */ + public static Logger getLog() { + return LOG; + } + + /** + * @return the configFile + */ + public static String getConfigFile() { + return CONFIG_FILE; + } + + /** + * @return the depthModifier + */ + public static String getDepthModifier() { + return DEPTH_MODIFIER; + } + + /** + * @return the depthAllModifier + */ + public static String getDepthAllModifier() { + return DEPTH_ALL_MODIFIER; + } + + /** + * @return the depthAndNodesOnlyModifier + */ + public static String getDepthAndNodesOnlyModifier() { + return DEPTH_AND_NODES_ONLY_MODIFIER; + } + + /** + * @return the nodesOnlyModifier + */ + public static String getNodesOnlyModifier() { + return NODES_ONLY_MODIFIER; + } + /* (non-Javadoc) * @see java.lang.Object#toString() */ diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/filter/ElasticSearchSynchronizerFilter.java b/src/main/java/org/onap/aai/sparky/synchronizer/filter/ElasticSearchSynchronizerFilter.java index d5c2c12..b001abb 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/filter/ElasticSearchSynchronizerFilter.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/filter/ElasticSearchSynchronizerFilter.java @@ -104,4 +104,25 @@ public class ElasticSearchSynchronizerFilter implements Filter { } + /** + * @return the syncHelper + */ + public SyncHelper getSyncHelper() { + return syncHelper; + } + + /** + * @param syncHelper the syncHelper to set + */ + public void setSyncHelper(SyncHelper syncHelper) { + this.syncHelper = syncHelper; + } + + /** + * @return the log + */ + public static Logger getLog() { + return LOG; + } + } diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/task/CollectEntitySelfLinkTask.java b/src/main/java/org/onap/aai/sparky/synchronizer/task/CollectEntitySelfLinkTask.java index 3dfef93..34561a6 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/task/CollectEntitySelfLinkTask.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/task/CollectEntitySelfLinkTask.java @@ -71,4 +71,32 @@ public class CollectEntitySelfLinkTask implements Supplier { return txn; } + /** + * @return the txn + */ + public NetworkTransaction getTxn() { + return txn; + } + + /** + * @param txn the txn to set + */ + public void setTxn(NetworkTransaction txn) { + this.txn = txn; + } + + /** + * @return the provider + */ + public ActiveInventoryDataProvider getProvider() { + return provider; + } + + /** + * @param provider the provider to set + */ + public void setProvider(ActiveInventoryDataProvider provider) { + this.provider = provider; + } + } diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/task/CollectEntityTypeSelfLinksTask.java b/src/main/java/org/onap/aai/sparky/synchronizer/task/CollectEntityTypeSelfLinksTask.java index de3f971..9368881 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/task/CollectEntityTypeSelfLinksTask.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/task/CollectEntityTypeSelfLinksTask.java @@ -72,4 +72,32 @@ public class CollectEntityTypeSelfLinksTask implements Supplier getContextMap() { + return contextMap; + } + + /** + * @param contextMap the contextMap to set + */ + public void setContextMap(Map contextMap) { + this.contextMap = contextMap; + } + } diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/task/PerformElasticSearchPut.java b/src/main/java/org/onap/aai/sparky/synchronizer/task/PerformElasticSearchPut.java index 241a64d..c3ce3f5 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/task/PerformElasticSearchPut.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/task/PerformElasticSearchPut.java @@ -79,4 +79,60 @@ public class PerformElasticSearchPut implements Supplier { return txn; } + + /** + * @return the restDataProvider + */ + public RestDataProvider getRestDataProvider() { + return restDataProvider; + } + + /** + * @param restDataProvider the restDataProvider to set + */ + public void setRestDataProvider(RestDataProvider restDataProvider) { + this.restDataProvider = restDataProvider; + } + + /** + * @return the jsonPayload + */ + public String getJsonPayload() { + return jsonPayload; + } + + /** + * @param jsonPayload the jsonPayload to set + */ + public void setJsonPayload(String jsonPayload) { + this.jsonPayload = jsonPayload; + } + + /** + * @return the txn + */ + public NetworkTransaction getTxn() { + return txn; + } + + /** + * @param txn the txn to set + */ + public void setTxn(NetworkTransaction txn) { + this.txn = txn; + } + + /** + * @return the contextMap + */ + public Map getContextMap() { + return contextMap; + } + + /** + * @param contextMap the contextMap to set + */ + public void setContextMap(Map contextMap) { + this.contextMap = contextMap; + } } diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/task/PerformElasticSearchRetrieval.java b/src/main/java/org/onap/aai/sparky/synchronizer/task/PerformElasticSearchRetrieval.java index 1605ee1..b11b023 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/task/PerformElasticSearchRetrieval.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/task/PerformElasticSearchRetrieval.java @@ -63,4 +63,46 @@ public class PerformElasticSearchRetrieval implements Supplier getContextMap() { + return contextMap; + } + + /** + * @param contextMap the contextMap to set + */ + public void setContextMap(Map contextMap) { + this.contextMap = contextMap; + } + } diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/task/PerformElasticSearchUpdate.java b/src/main/java/org/onap/aai/sparky/synchronizer/task/PerformElasticSearchUpdate.java index 1890032..956fe35 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/task/PerformElasticSearchUpdate.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/task/PerformElasticSearchUpdate.java @@ -77,4 +77,74 @@ public class PerformElasticSearchUpdate implements Supplier return operationTracker; } + /** + * @return the esDataProvider + */ + public ElasticSearchDataProvider getEsDataProvider() { + return esDataProvider; + } + + /** + * @param esDataProvider the esDataProvider to set + */ + public void setEsDataProvider(ElasticSearchDataProvider esDataProvider) { + this.esDataProvider = esDataProvider; + } + + /** + * @return the operationTracker + */ + public NetworkTransaction getOperationTracker() { + return operationTracker; + } + + /** + * @param operationTracker the operationTracker to set + */ + public void setOperationTracker(NetworkTransaction operationTracker) { + this.operationTracker = operationTracker; + } + + /** + * @return the updatePayload + */ + public String getUpdatePayload() { + return updatePayload; + } + + /** + * @param updatePayload the updatePayload to set + */ + public void setUpdatePayload(String updatePayload) { + this.updatePayload = updatePayload; + } + + /** + * @return the updateUrl + */ + public String getUpdateUrl() { + return updateUrl; + } + + /** + * @param updateUrl the updateUrl to set + */ + public void setUpdateUrl(String updateUrl) { + this.updateUrl = updateUrl; + } + + /** + * @return the contextMap + */ + public Map getContextMap() { + return contextMap; + } + + /** + * @param contextMap the contextMap to set + */ + public void setContextMap(Map contextMap) { + this.contextMap = contextMap; + } + } diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/task/PersistOperationResultToDisk.java b/src/main/java/org/onap/aai/sparky/synchronizer/task/PersistOperationResultToDisk.java index dee1761..d0a5cc1 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/task/PersistOperationResultToDisk.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/task/PersistOperationResultToDisk.java @@ -80,6 +80,76 @@ public class PersistOperationResultToDisk implements Supplier { return null; } + /** + * @return the fullPath + */ + public String getFullPath() { + return fullPath; + } + + /** + * @param fullPath the fullPath to set + */ + public void setFullPath(String fullPath) { + this.fullPath = fullPath; + } + + /** + * @return the dataToStore + */ + public OperationResult getDataToStore() { + return dataToStore; + } + + /** + * @param dataToStore the dataToStore to set + */ + public void setDataToStore(OperationResult dataToStore) { + this.dataToStore = dataToStore; + } + + /** + * @return the mapper + */ + public ObjectMapper getMapper() { + return mapper; + } + + /** + * @param mapper the mapper to set + */ + public void setMapper(ObjectMapper mapper) { + this.mapper = mapper; + } + + /** + * @return the logger + */ + public Logger getLogger() { + return logger; + } + + /** + * @param logger the logger to set + */ + public void setLogger(Logger logger) { + this.logger = logger; + } + + /** + * @return the contextMap + */ + public Map getContextMap() { + return contextMap; + } + + /** + * @param contextMap the contextMap to set + */ + public void setContextMap(Map contextMap) { + this.contextMap = contextMap; + } + } diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/task/RetrieveOperationResultFromDisk.java b/src/main/java/org/onap/aai/sparky/synchronizer/task/RetrieveOperationResultFromDisk.java index e92462a..7087d38 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/task/RetrieveOperationResultFromDisk.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/task/RetrieveOperationResultFromDisk.java @@ -86,4 +86,46 @@ public class RetrieveOperationResultFromDisk implements Supplier { private IndexDocument doc; + /** + * @return the doc + */ + public IndexDocument getDoc() { + return doc; + } + + /** + * @param doc the doc to set + */ + public void setDoc(IndexDocument doc) { + this.doc = doc; + } + + /** + * @return the txn + */ + public NetworkTransaction getTxn() { + return txn; + } + + /** + * @param txn the txn to set + */ + public void setTxn(NetworkTransaction txn) { + this.txn = txn; + } + + /** + * @return the esDataProvider + */ + public RestDataProvider getEsDataProvider() { + return esDataProvider; + } + + /** + * @param esDataProvider the esDataProvider to set + */ + public void setEsDataProvider(RestDataProvider esDataProvider) { + this.esDataProvider = esDataProvider; + } + + /** + * @return the contextMap + */ + public Map getContextMap() { + return contextMap; + } + + /** + * @param contextMap the contextMap to set + */ + public void setContextMap(Map contextMap) { + this.contextMap = contextMap; + } + private NetworkTransaction txn; private RestDataProvider esDataProvider; diff --git a/src/main/java/org/onap/aai/sparky/util/NodeUtils.java b/src/main/java/org/onap/aai/sparky/util/NodeUtils.java index d15b7ba..3c2466d 100644 --- a/src/main/java/org/onap/aai/sparky/util/NodeUtils.java +++ b/src/main/java/org/onap/aai/sparky/util/NodeUtils.java @@ -68,6 +68,34 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; public class NodeUtils { private static SecureRandom sRandom = new SecureRandom(); + /** + * @return the sRandom + */ + public static SecureRandom getsRandom() { + return sRandom; + } + + /** + * @param sRandom the sRandom to set + */ + public static void setsRandom(SecureRandom sRandom) { + NodeUtils.sRandom = sRandom; + } + + /** + * @return the entityResourceKeyFormat + */ + public static String getEntityResourceKeyFormat() { + return ENTITY_RESOURCE_KEY_FORMAT; + } + + /** + * @return the timeBreakDownFormat + */ + public static String getTimeBreakDownFormat() { + return TIME_BREAK_DOWN_FORMAT; + } + public static synchronized String getRandomTxnId(){ byte bytes[] = new byte[6]; sRandom.nextBytes(bytes); diff --git a/src/main/java/org/onap/aai/sparky/util/test/Encryptor.java b/src/main/java/org/onap/aai/sparky/util/test/Encryptor.java new file mode 100644 index 0000000..9dfc933 --- /dev/null +++ b/src/main/java/org/onap/aai/sparky/util/test/Encryptor.java @@ -0,0 +1,84 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017 Amdocs + * ================================================================================ + * Licensed 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. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.util.test; + +import org.apache.commons.cli.BasicParser; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; +import org.eclipse.jetty.util.security.Password; + +/** + * The Class Encryptor. + */ +public class Encryptor { + + /** + * Instantiates a new encryptor. + */ + public Encryptor() { + } + + /** + * Decrypt value. + * + * @param value the value + * @return the string + */ + public String decryptValue(String value) { + String decyptedValue = ""; + + try { + decyptedValue = Password.deobfuscate(value); + } catch (Exception exc) { + System.err.println("Cannot decrypt '" + value + "': " + exc.toString()); + } + + return decyptedValue; + } + + /** + * Usage. + */ + public static void usage() { + usage(null); + } + + /** + * Usage. + * + * @param msg the msg + */ + public static void usage(String msg) { + if (msg != null) { + System.err.println(msg); + } + System.err.println("Usage: java Encryptor -e value"); + System.err.println("\tEncrypt the given value"); + System.err.println("Usage: java Encryptor -d value"); + System.err.println("\tDecrypt the given value"); + System.exit(1); + } + +} diff --git a/src/main/java/org/onap/aai/sparky/util/test/KeystoreBuilder.java b/src/main/java/org/onap/aai/sparky/util/test/KeystoreBuilder.java new file mode 100644 index 0000000..483c464 --- /dev/null +++ b/src/main/java/org/onap/aai/sparky/util/test/KeystoreBuilder.java @@ -0,0 +1,534 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017 Amdocs + * ================================================================================ + * Licensed 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. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.util.test; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.UnknownHostException; +import java.security.KeyManagementException; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.cert.CertificateEncodingException; +import java.security.cert.CertificateException; +import java.security.cert.CertificateParsingException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManager; +import javax.net.ssl.TrustManagerFactory; +import javax.net.ssl.X509TrustManager; + +/** + * The Class KeystoreBuilder. + */ +public class KeystoreBuilder { + + /** + * The Class EndPoint. + */ + private class EndPoint { + private String hostname; + private int port; + + /** + * Instantiates a new end point. + */ + @SuppressWarnings("unused") + public EndPoint() {} + + /** + * Instantiates a new end point. + * + * @param host the host + * @param port the port + */ + public EndPoint(String host, int port) { + this.hostname = host; + this.port = port; + } + + public String getHostname() { + return hostname; + } + + @SuppressWarnings("unused") + public void setHostname(String hostname) { + this.hostname = hostname; + } + + public int getPort() { + return port; + } + + public void setPort(int port) { + this.port = port; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "EndPoint [hostname=" + hostname + ", port=" + port + "]"; + } + + } + + private List endpoints = new ArrayList(); + + /** + * @return the endpoints + */ + public List getEndpoints() { + return endpoints; + } + + /** + * @param endpoints the endpoints to set + */ + public void setEndpoints(List endpoints) { + this.endpoints = endpoints; + } + + /** + * Initialize end points list. + * + * @param endpointList the endpoint list + */ + private void initializeEndPointsList(String endpointList) { + String[] endpointUris = endpointList.split(";"); + + for (String endpointUri : endpointUris) { + + String ipAndPort = endpointUri.replaceAll("http://", ""); + ipAndPort = endpointUri.replaceAll("https://", ""); + + // System.out.println("ipAndPortUrl = " + ipAndPort); + + String[] hostAndPort = ipAndPort.split(":"); + + String hostname = hostAndPort[0]; + int port = Integer.parseInt(hostAndPort[1]); + + EndPoint ep = new EndPoint(hostname, port); + endpoints.add(ep); + } + + } + + /** + * Instantiates a new keystore builder. + * + * @param endpointList the endpoint list + * @throws NoSuchAlgorithmException the no such algorithm exception + */ + public KeystoreBuilder(String endpointList) throws NoSuchAlgorithmException { + initializeEndPointsList(endpointList); + sha1 = MessageDigest.getInstance("SHA1"); + md5 = MessageDigest.getInstance("MD5"); + } + + private static final String SEP = File.separator; + private SavingTrustManager savingTrustManager; + private SSLSocketFactory sslSocketFactory; + private MessageDigest sha1; + private MessageDigest md5; + private KeyStore ks; + private String keystoreFileName; + private String keystorePassword; + private boolean dumpCertDetails = false; + + public void setDumpCertDetails(boolean shouldSet) { + dumpCertDetails = shouldSet; + } + + /** + * Update keystore. + * + * @param keystoreFileName the keystore file name + * @param keystorePassword the keystore password + * @throws KeyStoreException the key store exception + * @throws NoSuchAlgorithmException the no such algorithm exception + * @throws CertificateException the certificate exception + * @throws IOException Signals that an I/O exception has occurred. + * @throws KeyManagementException the key management exception + */ + public void updateKeystore(String keystoreFileName, String keystorePassword) + throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException, + KeyManagementException { + + this.keystoreFileName = keystoreFileName; + this.keystorePassword = keystorePassword; + + File file = new File(keystoreFileName); + String password = keystorePassword; + + if (file.isFile() == false) { + + File dir = new File(System.getProperty("java.home") + SEP + "lib" + SEP + "security"); + file = new File(dir, "jssecacerts"); + if (file.isFile() == false) { + + file = new File(dir, "cacerts"); + System.out.println("keystore file doesn't exist, preloading new file with cacerts"); + + } else { + System.out.println("keystore file doesn't exist, preloading new file with jssecacerts"); + } + password = "changeit"; + + } + + InputStream in = new FileInputStream(file); + ks = KeyStore.getInstance(KeyStore.getDefaultType()); + ks.load(in, password.toCharArray()); + in.close(); + + SSLContext context = SSLContext.getInstance("TLS"); + TrustManagerFactory tmf = + TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + tmf.init(ks); + X509TrustManager defaultTrustManager = (X509TrustManager) tmf.getTrustManagers()[0]; + savingTrustManager = new SavingTrustManager(defaultTrustManager); + context.init(null, new TrustManager[] {savingTrustManager}, null); + sslSocketFactory = context.getSocketFactory(); + + System.out.println("About to add the following endpoint server certificates to the keystore:"); + for (EndPoint ep : endpoints) { + System.out.println("\t--------------------------"); + System.out.println("\t" + ep.toString()); + + X509Certificate[] certChain = + getCertificateChainForRemoteEndpoint(ep.getHostname(), ep.getPort()); + + if (certChain == null) { + System.out.println("Could not obtain server certificate chain"); + return; + } + + dumpCertChainInfo(certChain); + + updateKeyStoreWithCertChain(certChain); + + } + + } + + /** + * Gets the certificate chain for remote endpoint. + * + * @param hostname the hostname + * @param port the port + * @return the certificate chain for remote endpoint + * @throws UnknownHostException the unknown host exception + * @throws IOException Signals that an I/O exception has occurred. + */ + private X509Certificate[] getCertificateChainForRemoteEndpoint(String hostname, int port) + throws UnknownHostException, IOException { + + System.out.println("Opening connection to "+hostname+":"+port+".."); + SSLSocket socket = (SSLSocket) sslSocketFactory.createSocket(hostname, port); + socket.setSoTimeout(10000); + + try { + System.out.println("Starting SSL handshake..."); + socket.startHandshake(); + socket.close(); + System.out.println("\nNo errors, certificate is already trusted"); + System.exit(0); + } catch (SSLException exc) { + System.out.println("\nCaught SSL exception, we are not authorized to access this server yet"); + // e.printStackTrace(System.out); + } + + return savingTrustManager.chain; + + } + + /** + * Dump cert chain info. + * + * @param chain the chain + * @throws NoSuchAlgorithmException the no such algorithm exception + * @throws CertificateEncodingException the certificate encoding exception + * @throws CertificateParsingException the certificate parsing exception + */ + private void dumpCertChainInfo(X509Certificate[] chain) + throws NoSuchAlgorithmException, CertificateEncodingException, CertificateParsingException { + + System.out.println(); + System.out.println("Server sent " + chain.length + " certificate(s):"); + System.out.println(); + + for (int i = 0; i < chain.length; i++) { + X509Certificate cert = chain[i]; + + if (dumpCertDetails) { + System.out.println("Full cert details @ index = " + i + " \n" + cert.toString()); + } + + System.out.println("Subject: " + cert.getSubjectDN()); + System.out.println("Issuer: " + cert.getIssuerDN()); + System.out.println("SubjectAlternativeNames: "); + + /* + * RFC-5280, pg. 38, section 4.2.1.6 ( Subject Alternative Names ) + * + * Finally, the semantics of subject alternative names that include wildcard characters (e.g., + * as a placeholder for a set of names) are not addressed by this specification. Applications + * with specific requirements MAY use such names, but they must define the semantics. + * + * id-ce-subjectAltName OBJECT IDENTIFIER ::= { id-ce 17 } + * + * SubjectAltName ::= GeneralNames + * + * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName + * + * GeneralName ::= CHOICE { otherName [0] OtherName, rfc822Name [1] IA5String, dNSName [2] + * IA5String, <-- the 2 in the output is a type operand x400Address [3] ORAddress, + * directoryName [4] Name, ediPartyName [5] EDIPartyName, uniformResourceIdentifier [6] + * IA5String, iPAddress [7] OCTET STRING, registeredID [8] OBJECT IDENTIFIER } + * + * OtherName ::= SEQUENCE { type-id OBJECT IDENTIFIER, value [0] EXPLICIT ANY DEFINED BY + * type-id } + * + * EDIPartyName ::= SEQUENCE { nameAssigner [0] DirectoryString OPTIONAL, partyName [1] + * DirectoryString } + * + */ + + Collection> sans = cert.getSubjectAlternativeNames(); + + for (List san : sans) { + + /* + * It seems the structure of the array elements contained within the SAN is: [, + * ]* + * + */ + + int type = ((Integer) san.get(0)).intValue(); + String typeStr = getSanType(type); + String value = (String) san.get(1); + + System.out.println(String.format("\tType:'%s', Value: '%s'.", typeStr, value)); + + } + + } + + } + + /** + * Gets the subject alternative names. + * + * @param cert the cert + * @return the subject alternative names + * @throws CertificateParsingException the certificate parsing exception + */ + private List getSubjectAlternativeNames(X509Certificate cert) + throws CertificateParsingException { + + Collection> sans = cert.getSubjectAlternativeNames(); + List subjectAlternativeNames = new ArrayList(); + + for (List san : sans) { + + /* + * It seems the structure of the array elements contained within the SAN is: [, + * ]* + * + */ + + String value = (String) san.get(1); + subjectAlternativeNames.add(value); + } + + return subjectAlternativeNames; + } + + /** + * Update key store with cert chain. + * + * @param chain the chain + * @throws NoSuchAlgorithmException the no such algorithm exception + * @throws KeyStoreException the key store exception + * @throws CertificateException the certificate exception + * @throws IOException Signals that an I/O exception has occurred. + */ + private void updateKeyStoreWithCertChain(X509Certificate[] chain) + throws NoSuchAlgorithmException, KeyStoreException, CertificateException, IOException { + + for (X509Certificate cert : chain) { + + List sans = getSubjectAlternativeNames(cert); + + for (String san : sans) { + ks.setCertificateEntry(san, cert); + System.out.println( + "Added certificate to keystore '" + keystoreFileName + "' using alias '" + san + "'"); + } + } + + OutputStream out = new FileOutputStream(keystoreFileName); + ks.store(out, keystorePassword.toCharArray()); + out.close(); + + } + + + /** + * The Class SavingTrustManager. + */ + private static class SavingTrustManager implements X509TrustManager { + + private final X509TrustManager tm; + private X509Certificate[] chain; + + /** + * Instantiates a new saving trust manager. + * + * @param tm the tm + */ + SavingTrustManager(X509TrustManager tm) { + this.tm = tm; + } + + @Override + public X509Certificate[] getAcceptedIssuers() { + throw new UnsupportedOperationException(); + } + + /* (non-Javadoc) + * @see javax.net.ssl.X509TrustManager#checkClientTrusted(java.security.cert.X509Certificate[], java.lang.String) + */ + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType) + throws CertificateException { + throw new UnsupportedOperationException(); + } + + /* (non-Javadoc) + * @see javax.net.ssl.X509TrustManager#checkServerTrusted(java.security.cert.X509Certificate[], java.lang.String) + */ + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType) + throws CertificateException { + this.chain = chain; + tm.checkServerTrusted(chain, authType); + } + } + + private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray(); + + /** + * Gets the san type. + * + * @param type the type + * @return the san type + */ + // TODO: convert to enum(int,string) + private String getSanType(int type) { + switch (type) { + case 0: + return "otherName"; + case 1: + return "rfc822Name"; + case 2: + return "dNSName"; + case 3: + return "x400Address"; + case 4: + return "directoryName"; + case 5: + return "ediPartyName"; + case 6: + return "uniformResourceIdentifier"; + case 7: + return "iPAddress"; + case 8: + return "registeredID"; + default: + return "unknownSanType"; + } + } + + + /** + * To hex string. + * + * @param bytes the bytes + * @return the string + */ + private static String toHexString(byte[] bytes) { + StringBuilder sb = new StringBuilder(bytes.length * 3); + for (int b : bytes) { + b &= 0xff; + sb.append(HEXDIGITS[b >> 4]); + sb.append(HEXDIGITS[b & 15]); + sb.append(' '); + } + return sb.toString(); + } + + + + /** + * The main method. + * + * @param args the arguments + * @throws Exception the exception + */ + public static void main(String[] args) throws Exception { + + /* + * Examples: localhost:8440;localhost:8442 d:\1\adhoc_keystore.jks aaiDomain2 false + * localhost:8440;localhost:8442 d:\1\adhoc_keystore.jks aaiDomain2 true + */ + + if (args.length != 4) { + System.out.println( + "Usage: KeyBuilder <[ip:port];*> " + + " "); + System.exit(1); + } + KeystoreBuilder kb = new KeystoreBuilder(args[0]); + kb.setDumpCertDetails(Boolean.parseBoolean(args[3])); + kb.updateKeystore(args[1], args[2]); + + } +} + + diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/EntityTypeAggregation.java b/src/main/java/org/onap/aai/sparky/viewandinspect/EntityTypeAggregation.java index 33f6a7ab..ff8d5d8 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/EntityTypeAggregation.java +++ b/src/main/java/org/onap/aai/sparky/viewandinspect/EntityTypeAggregation.java @@ -37,6 +37,13 @@ public class EntityTypeAggregation { private ConcurrentHashMap counters; + /** + * @param counters the counters to set + */ + public void setCounters(ConcurrentHashMap counters) { + this.counters = counters; + } + /** * Instantiates a new entity type aggregation. */ diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/config/TierSupportUiConstants.java b/src/main/java/org/onap/aai/sparky/viewandinspect/config/TierSupportUiConstants.java index 4e1b102..f7fc4a2 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/config/TierSupportUiConstants.java +++ b/src/main/java/org/onap/aai/sparky/viewandinspect/config/TierSupportUiConstants.java @@ -84,4 +84,320 @@ public class TierSupportUiConstants { return "aggregate_" + entityType + "_index"; } + /** + * @return the aPP_NAME + */ + public static String getAPP_NAME() { + return APP_NAME; + } + + /** + * @param aPP_NAME the aPP_NAME to set + */ + public static void setAPP_NAME(String aPP_NAME) { + APP_NAME = aPP_NAME; + } + + /** + * @return the cONFIG_HOME + */ + public static String getCONFIG_HOME() { + return CONFIG_HOME; + } + + /** + * @param cONFIG_HOME the cONFIG_HOME to set + */ + public static void setCONFIG_HOME(String cONFIG_HOME) { + CONFIG_HOME = cONFIG_HOME; + } + + /** + * @return the aJSC_HOME + */ + public static String getAJSC_HOME() { + return AJSC_HOME; + } + + /** + * @param aJSC_HOME the aJSC_HOME to set + */ + public static void setAJSC_HOME(String aJSC_HOME) { + AJSC_HOME = aJSC_HOME; + } + + /** + * @return the cONFIG_ROOT_LOCATION + */ + public static String getCONFIG_ROOT_LOCATION() { + return CONFIG_ROOT_LOCATION; + } + + /** + * @param cONFIG_ROOT_LOCATION the cONFIG_ROOT_LOCATION to set + */ + public static void setCONFIG_ROOT_LOCATION(String cONFIG_ROOT_LOCATION) { + CONFIG_ROOT_LOCATION = cONFIG_ROOT_LOCATION; + } + + /** + * @return the sTATIC_CONFIG_APP_LOCATION + */ + public static String getSTATIC_CONFIG_APP_LOCATION() { + return STATIC_CONFIG_APP_LOCATION; + } + + /** + * @param sTATIC_CONFIG_APP_LOCATION the sTATIC_CONFIG_APP_LOCATION to set + */ + public static void setSTATIC_CONFIG_APP_LOCATION(String sTATIC_CONFIG_APP_LOCATION) { + STATIC_CONFIG_APP_LOCATION = sTATIC_CONFIG_APP_LOCATION; + } + + /** + * @return the dYNAMIC_CONFIG_APP_LOCATION + */ + public static String getDYNAMIC_CONFIG_APP_LOCATION() { + return DYNAMIC_CONFIG_APP_LOCATION; + } + + /** + * @param dYNAMIC_CONFIG_APP_LOCATION the dYNAMIC_CONFIG_APP_LOCATION to set + */ + public static void setDYNAMIC_CONFIG_APP_LOCATION(String dYNAMIC_CONFIG_APP_LOCATION) { + DYNAMIC_CONFIG_APP_LOCATION = dYNAMIC_CONFIG_APP_LOCATION; + } + + /** + * @return the cONFIG_OXM_LOCATION + */ + public static String getCONFIG_OXM_LOCATION() { + return CONFIG_OXM_LOCATION; + } + + /** + * @param cONFIG_OXM_LOCATION the cONFIG_OXM_LOCATION to set + */ + public static void setCONFIG_OXM_LOCATION(String cONFIG_OXM_LOCATION) { + CONFIG_OXM_LOCATION = cONFIG_OXM_LOCATION; + } + + /** + * @return the cONFIG_AUTH_LOCATION + */ + public static String getCONFIG_AUTH_LOCATION() { + return CONFIG_AUTH_LOCATION; + } + + /** + * @param cONFIG_AUTH_LOCATION the cONFIG_AUTH_LOCATION to set + */ + public static void setCONFIG_AUTH_LOCATION(String cONFIG_AUTH_LOCATION) { + CONFIG_AUTH_LOCATION = cONFIG_AUTH_LOCATION; + } + + /** + * @return the hOST + */ + public static String getHOST() { + return HOST; + } + + /** + * @param hOST the hOST to set + */ + public static void setHOST(String hOST) { + HOST = hOST; + } + + /** + * @return the pORT + */ + public static String getPORT() { + return PORT; + } + + /** + * @param pORT the pORT to set + */ + public static void setPORT(String pORT) { + PORT = pORT; + } + + /** + * @return the rETRIES + */ + public static String getRETRIES() { + return RETRIES; + } + + /** + * @param rETRIES the rETRIES to set + */ + public static void setRETRIES(String rETRIES) { + RETRIES = rETRIES; + } + + /** + * @return the rESOURCE_VERSION + */ + public static String getRESOURCE_VERSION() { + return RESOURCE_VERSION; + } + + /** + * @param rESOURCE_VERSION the rESOURCE_VERSION to set + */ + public static void setRESOURCE_VERSION(String rESOURCE_VERSION) { + RESOURCE_VERSION = rESOURCE_VERSION; + } + + /** + * @return the uRI + */ + public static String getURI() { + return URI; + } + + /** + * @param uRI the uRI to set + */ + public static void setURI(String uRI) { + URI = uRI; + } + + /** + * @return the uSERS_FILE_LOCATION + */ + public static String getUSERS_FILE_LOCATION() { + return USERS_FILE_LOCATION; + } + + /** + * @param uSERS_FILE_LOCATION the uSERS_FILE_LOCATION to set + */ + public static void setUSERS_FILE_LOCATION(String uSERS_FILE_LOCATION) { + USERS_FILE_LOCATION = uSERS_FILE_LOCATION; + } + + /** + * @return the rOLES_FILE_LOCATION + */ + public static String getROLES_FILE_LOCATION() { + return ROLES_FILE_LOCATION; + } + + /** + * @param rOLES_FILE_LOCATION the rOLES_FILE_LOCATION to set + */ + public static void setROLES_FILE_LOCATION(String rOLES_FILE_LOCATION) { + ROLES_FILE_LOCATION = rOLES_FILE_LOCATION; + } + + /** + * @return the pORTAL_AUTHENTICATION_FILE_LOCATION + */ + public static String getPORTAL_AUTHENTICATION_FILE_LOCATION() { + return PORTAL_AUTHENTICATION_FILE_LOCATION; + } + + /** + * @param pORTAL_AUTHENTICATION_FILE_LOCATION the pORTAL_AUTHENTICATION_FILE_LOCATION to set + */ + public static void setPORTAL_AUTHENTICATION_FILE_LOCATION( + String pORTAL_AUTHENTICATION_FILE_LOCATION) { + PORTAL_AUTHENTICATION_FILE_LOCATION = pORTAL_AUTHENTICATION_FILE_LOCATION; + } + + /** + * @return the tEST_CONFIG_FILE + */ + public static String getTEST_CONFIG_FILE() { + return TEST_CONFIG_FILE; + } + + /** + * @param tEST_CONFIG_FILE the tEST_CONFIG_FILE to set + */ + public static void setTEST_CONFIG_FILE(String tEST_CONFIG_FILE) { + TEST_CONFIG_FILE = tEST_CONFIG_FILE; + } + + /** + * @return the uRI_ATTR_NAME + */ + public static String getURI_ATTR_NAME() { + return URI_ATTR_NAME; + } + + /** + * @param uRI_ATTR_NAME the uRI_ATTR_NAME to set + */ + public static void setURI_ATTR_NAME(String uRI_ATTR_NAME) { + URI_ATTR_NAME = uRI_ATTR_NAME; + } + + /** + * @return the filesep + */ + public static String getFilesep() { + return FILESEP; + } + + /** + * @return the esSuggestApi + */ + public static String getEsSuggestApi() { + return ES_SUGGEST_API; + } + + /** + * @return the esCountApi + */ + public static String getEsCountApi() { + return ES_COUNT_API; + } + + /** + * @return the esSearchApi + */ + public static String getEsSearchApi() { + return ES_SEARCH_API; + } + + /** + * @return the entityAutoSuggestIndexNameDefault + */ + public static String getEntityAutoSuggestIndexNameDefault() { + return ENTITY_AUTO_SUGGEST_INDEX_NAME_DEFAULT; + } + + /** + * @return the entityAutoSuggestSettingsFileDefault + */ + public static String getEntityAutoSuggestSettingsFileDefault() { + return ENTITY_AUTO_SUGGEST_SETTINGS_FILE_DEFAULT; + } + + /** + * @return the entityAutoSuggestMappingsFileDefault + */ + public static String getEntityAutoSuggestMappingsFileDefault() { + return ENTITY_AUTO_SUGGEST_MAPPINGS_FILE_DEFAULT; + } + + /** + * @return the entityDynamicMappingsFileDefault + */ + public static String getEntityDynamicMappingsFileDefault() { + return ENTITY_DYNAMIC_MAPPINGS_FILE_DEFAULT; + } + + /** + * @return the uriVersionRegexPattern + */ + public static String getUriVersionRegexPattern() { + return URI_VERSION_REGEX_PATTERN; + } + } diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/config/VisualizationConfig.java b/src/main/java/org/onap/aai/sparky/viewandinspect/config/VisualizationConfig.java index cb842c5..7c09da6 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/config/VisualizationConfig.java +++ b/src/main/java/org/onap/aai/sparky/viewandinspect/config/VisualizationConfig.java @@ -170,6 +170,27 @@ public class VisualizationConfig { this.vnfEntityTypes = vnfEntityTypes; } + /** + * @return the instance + */ + public static VisualizationConfig getInstance() { + return instance; + } + + /** + * @param instance the instance to set + */ + public static void setInstance(VisualizationConfig instance) { + VisualizationConfig.instance = instance; + } + + /** + * @return the makeAllNeighborsBidirectional + */ + public boolean isMakeAllNeighborsBidirectional() { + return makeAllNeighborsBidirectional; + } + @Override public String toString() { return "VisualizationConfig [maxSelfLinkTraversalDepth=" + maxSelfLinkTraversalDepth diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/D3VisualizationOutput.java b/src/main/java/org/onap/aai/sparky/viewandinspect/entity/D3VisualizationOutput.java index 3022524..e29f6df 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/D3VisualizationOutput.java +++ b/src/main/java/org/onap/aai/sparky/viewandinspect/entity/D3VisualizationOutput.java @@ -91,6 +91,34 @@ public class D3VisualizationOutput { this.inlineMessage = inlineMessage; } + /** + * @return the nodes + */ + public List getNodes() { + return nodes; + } + + /** + * @param nodes the nodes to set + */ + public void setNodes(List nodes) { + this.nodes = nodes; + } + + /** + * @return the links + */ + public List getLinks() { + return links; + } + + /** + * @param links the links to set + */ + public void setLinks(List links) { + this.links = links; + } + /** * The main method. * diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNode.java b/src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNode.java index c6f70a7..3f9d0f2 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNode.java +++ b/src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNode.java @@ -177,6 +177,55 @@ public class JsonNode { return isRootNode; } + /** + * @return the inboundNeighbors + */ + public Collection getInboundNeighbors() { + return inboundNeighbors; + } + + /** + * @param inboundNeighbors the inboundNeighbors to set + */ + public void setInboundNeighbors(Collection inboundNeighbors) { + this.inboundNeighbors = inboundNeighbors; + } + + /** + * @return the outboundNeighbors + */ + public Collection getOutboundNeighbors() { + return outboundNeighbors; + } + + /** + * @param outboundNeighbors the outboundNeighbors to set + */ + public void setOutboundNeighbors(Collection outboundNeighbors) { + this.outboundNeighbors = outboundNeighbors; + } + + /** + * @return the log + */ + public static Logger getLog() { + return LOG; + } + + /** + * @param itemProperties the itemProperties to set + */ + public void setItemProperties(Map itemProperties) { + this.itemProperties = itemProperties; + } + + /** + * @param isRootNode the isRootNode to set + */ + public void setRootNode(boolean isRootNode) { + this.isRootNode = isRootNode; + } + @Override public String toString() { return "JsonNode [" + (id != null ? "id=" + id + ", " : "") diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipList.java b/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipList.java index 013a5bd..7ab8f91 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipList.java +++ b/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipList.java @@ -42,6 +42,20 @@ public class RelationshipList { this.relationship = relationship; } + /** + * @return the relationship + */ + public Relationship[] getRelationship() { + return relationship; + } + + /** + * @param relationship the relationship to set + */ + public void setRelationship(Relationship[] relationship) { + this.relationship = relationship; + } + /* (non-Javadoc) * @see java.lang.Object#toString() */ diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/Violations.java b/src/main/java/org/onap/aai/sparky/viewandinspect/entity/Violations.java index 909afb8..4968de4 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/Violations.java +++ b/src/main/java/org/onap/aai/sparky/viewandinspect/entity/Violations.java @@ -107,5 +107,19 @@ public class Violations { this.errorMessage = errorMessage; } + /** + * @return the details + */ + public String getDetails() { + return details; + } + + /** + * @param details the details to set + */ + public void setDetails(String details) { + this.details = details; + } + } diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/services/SearchServiceWrapper.java b/src/main/java/org/onap/aai/sparky/viewandinspect/services/SearchServiceWrapper.java index deca9a5..6db9c05 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/services/SearchServiceWrapper.java +++ b/src/main/java/org/onap/aai/sparky/viewandinspect/services/SearchServiceWrapper.java @@ -801,6 +801,174 @@ public class SearchServiceWrapper { out.close(); } } + + /** + * @return the mapper + */ + public ObjectMapper getMapper() { + return mapper; + } + + /** + * @param mapper the mapper to set + */ + public void setMapper(ObjectMapper mapper) { + this.mapper = mapper; + } + + /** + * @return the serialversionuid + */ + public static long getSerialversionuid() { + return serialVersionUID; + } + + /** + * @return the log + */ + public static Logger getLog() { + return LOG; + } + + /** + * @return the searchString + */ + public static String getSearchString() { + return SEARCH_STRING; + } + + /** + * @return the countString + */ + public static String getCountString() { + return COUNT_STRING; + } + + /** + * @return the querySearch + */ + public static String getQuerySearch() { + return QUERY_SEARCH; + } + + /** + * @return the summaryByEntityTypeApi + */ + public static String getSummaryByEntityTypeApi() { + return SUMMARY_BY_ENTITY_TYPE_API; + } + + /** + * @return the summaryByEntityTypeCountApi + */ + public static String getSummaryByEntityTypeCountApi() { + return SUMMARY_BY_ENTITY_TYPE_COUNT_API; + } + + /** + * @return the valueAnykey + */ + public static String getValueAnykey() { + return VALUE_ANYKEY; + } + + /** + * @return the valueQuery + */ + public static String getValueQuery() { + return VALUE_QUERY; + } + + /** + * @return the keyHashId + */ + public static String getKeyHashId() { + return KEY_HASH_ID; + } + + /** + * @return the keyGroupBy + */ + public static String getKeyGroupBy() { + return KEY_GROUP_BY; + } + + /** + * @return the keySearchResult + */ + public static String getKeySearchResult() { + return KEY_SEARCH_RESULT; + } + + /** + * @return the keyHits + */ + public static String getKeyHits() { + return KEY_HITS; + } + + /** + * @return the keyPayload + */ + public static String getKeyPayload() { + return KEY_PAYLOAD; + } + + /** + * @return the keyDocument + */ + public static String getKeyDocument() { + return KEY_DOCUMENT; + } + + /** + * @return the keyContent + */ + public static String getKeyContent() { + return KEY_CONTENT; + } + + /** + * @return the keySearchTagIds + */ + public static String getKeySearchTagIds() { + return KEY_SEARCH_TAG_IDS; + } + + /** + * @return the keySearchTags + */ + public static String getKeySearchTags() { + return KEY_SEARCH_TAGS; + } + + /** + * @return the keyLink + */ + public static String getKeyLink() { + return KEY_LINK; + } + + /** + * @return the keyEntityType + */ + public static String getKeyEntityType() { + return KEY_ENTITY_TYPE; + } + + /** + * @return the viSuggestionRoute + */ + public static String getViSuggestionRoute() { + return VI_SUGGESTION_ROUTE; + } + + /** + * @return the viuiSearchTemplate + */ + public static String getViuiSearchTemplate() { + return VIUI_SEARCH_TEMPLATE; + } diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationTransformer.java b/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationTransformer.java index 206d8d2..f15640a 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationTransformer.java +++ b/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationTransformer.java @@ -314,4 +314,76 @@ public class VisualizationTransformer { } return false; } + + + /** + * @return the flatNodeArray + */ + public List getFlatNodeArray() { + return flatNodeArray; + } + + + /** + * @param flatNodeArray the flatNodeArray to set + */ + public void setFlatNodeArray(List flatNodeArray) { + this.flatNodeArray = flatNodeArray; + } + + + /** + * @return the enrichableUriPrefixes + */ + public Set getEnrichableUriPrefixes() { + return enrichableUriPrefixes; + } + + + /** + * @param enrichableUriPrefixes the enrichableUriPrefixes to set + */ + public void setEnrichableUriPrefixes(Set enrichableUriPrefixes) { + this.enrichableUriPrefixes = enrichableUriPrefixes; + } + + + /** + * @return the linkArrayOutput + */ + public List getLinkArrayOutput() { + return linkArrayOutput; + } + + + /** + * @param linkArrayOutput the linkArrayOutput to set + */ + public void setLinkArrayOutput(List linkArrayOutput) { + this.linkArrayOutput = linkArrayOutput; + } + + + /** + * @return the visualizationConfig + */ + public VisualizationConfig getVisualizationConfig() { + return visualizationConfig; + } + + + /** + * @param visualizationConfig the visualizationConfig to set + */ + public void setVisualizationConfig(VisualizationConfig visualizationConfig) { + this.visualizationConfig = visualizationConfig; + } + + + /** + * @return the log + */ + public static Logger getLog() { + return LOG; + } } diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/servlet/SearchServlet.java b/src/main/java/org/onap/aai/sparky/viewandinspect/servlet/SearchServlet.java index d7e8720..c9fbc61 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/servlet/SearchServlet.java +++ b/src/main/java/org/onap/aai/sparky/viewandinspect/servlet/SearchServlet.java @@ -55,6 +55,42 @@ public class SearchServlet extends HttpServlet { private static final long serialVersionUID = 1L; + /** + * @return the searchWrapper + */ + public SearchServiceWrapper getSearchWrapper() { + return searchWrapper; + } + + /** + * @param searchWrapper the searchWrapper to set + */ + public void setSearchWrapper(SearchServiceWrapper searchWrapper) { + this.searchWrapper = searchWrapper; + } + + /** + * @return the serialversionuid + */ + public static long getSerialversionuid() { + return serialVersionUID; + } + + /** + * @return the log + */ + public static Logger getLog() { + return LOG; + } + + /** + * @return the keyPayload + */ + public static String getKeyPayload() { + return KEY_PAYLOAD; + } + + private static final Logger LOG = LoggerFactory.getInstance().getLogger(SearchServlet.class); private SearchServiceWrapper searchWrapper = null; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/task/CollectNodeSelfLinkTask.java b/src/main/java/org/onap/aai/sparky/viewandinspect/task/CollectNodeSelfLinkTask.java index 1317948..7205119 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/task/CollectNodeSelfLinkTask.java +++ b/src/main/java/org/onap/aai/sparky/viewandinspect/task/CollectNodeSelfLinkTask.java @@ -33,6 +33,34 @@ import org.onap.aai.sparky.dal.rest.OperationResult; public class CollectNodeSelfLinkTask implements Supplier { private String selfLink; + /** + * @return the selfLink + */ + public String getSelfLink() { + return selfLink; + } + + /** + * @param selfLink the selfLink to set + */ + public void setSelfLink(String selfLink) { + this.selfLink = selfLink; + } + + /** + * @return the aaiProvider + */ + public ActiveInventoryDataProvider getAaiProvider() { + return aaiProvider; + } + + /** + * @param aaiProvider the aaiProvider to set + */ + public void setAaiProvider(ActiveInventoryDataProvider aaiProvider) { + this.aaiProvider = aaiProvider; + } + private ActiveInventoryDataProvider aaiProvider; /** -- cgit 1.2.3-korg