Skip to content
Snippets Groups Projects
Commit cbbbf5c1 authored by MIchael Nguyen's avatar MIchael Nguyen
Browse files

updating

parent 542af9af
No related branches found
No related tags found
1 merge request!6Trusted ibm
Showing
with 36 additions and 207 deletions
......@@ -10,7 +10,7 @@
</parent>
<artifactId>indexer-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.2-SNAPSHOT</version>
<name>indexer-core</name>
<description>Indexer Service Core</description>
<packaging>jar</packaging>
......@@ -36,6 +36,11 @@
</repositories>-->
<dependencies>
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-core-common-model</artifactId>
<version>0.0.1-snapshot</version>
</dependency>
<!-- spring boot dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
......@@ -74,7 +79,7 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>indexer-search-core-lib</artifactId>
<version>1.0.10</version>
<version>1.0.13</version>
</dependency>
<dependency>
......
......@@ -20,15 +20,15 @@ import com.google.gson.Gson;
import com.google.gson.JsonParseException;
import io.swagger.annotations.ApiOperation;
import lombok.extern.java.Log;
import org.opengroup.osdu.core.api.DpsHeaders;
import org.opengroup.osdu.core.common.api.DpsHeaders;
import org.opengroup.osdu.core.is.common.util.AppException;
import org.opengroup.osdu.indexer.SwaggerDoc;
import org.opengroup.osdu.indexer.util.JobStatus;
import org.opengroup.osdu.core.common.util.indexer.JobStatus;
import org.opengroup.osdu.indexer.model.RecordReindexRequest;
import org.opengroup.osdu.indexer.service.IndexerService;
import org.opengroup.osdu.indexer.service.ReindexService;
import org.opengroup.osdu.indexer.util.RecordInfo;
import org.opengroup.osdu.core.common.util.indexer.RecordInfo;
import org.opengroup.osdu.is.core.model.RecordChangedMessages;
import org.opengroup.osdu.is.core.util.AppException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
......
......@@ -14,18 +14,17 @@
package org.opengroup.osdu.indexer.auth;
import lombok.extern.java.Log;
import org.opengroup.osdu.core.api.DpsHeaders;
import org.opengroup.osdu.core.common.api.DpsHeaders;
import org.opengroup.osdu.core.api.entitlements.EntitlementsException;
import org.opengroup.osdu.core.api.entitlements.IEntitlementsFactory;
import org.opengroup.osdu.core.api.entitlements.IEntitlementsService;
import org.opengroup.osdu.core.api.entitlements.models.GroupInfo;
import org.opengroup.osdu.core.api.entitlements.models.Groups;
import org.opengroup.osdu.core.httpclient.HttpResponse;
import org.opengroup.osdu.is.core.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.is.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.is.common.util.AppException;
import org.opengroup.osdu.is.core.model.AuthorizationResponse;
import org.opengroup.osdu.is.core.provider.interfaces.auth.AuthorizationService;
import org.opengroup.osdu.is.core.util.AppException;
import org.opengroup.osdu.is.core.util.HeadersUtil;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
......
......@@ -15,13 +15,13 @@
package org.opengroup.osdu.indexer.logging;
import com.google.common.base.Strings;
import org.opengroup.osdu.core.logging.payload.AuditAction;
import org.opengroup.osdu.core.logging.payload.AuditPayload;
import org.opengroup.osdu.core.logging.payload.AuditStatus;
import org.opengroup.osdu.core.common.logging.payload.AuditAction;
import org.opengroup.osdu.core.common.logging.payload.AuditPayload;
import org.opengroup.osdu.core.common.logging.payload.AuditStatus;
import java.util.List;
import static org.opengroup.osdu.core.logging.payload.AuditPayload.builder;
import static org.opengroup.osdu.core.common.logging.payload.AuditPayload.builder;
public class AuditEvents {
......
......@@ -14,8 +14,8 @@
package org.opengroup.osdu.indexer.logging;
import org.opengroup.osdu.core.logging.payload.AuditPayload;
import org.opengroup.osdu.is.core.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.is.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.logging.payload.AuditPayload;
import org.opengroup.osdu.is.core.provider.interfaces.util.IHeadersInfo;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;
......
......@@ -14,7 +14,7 @@
package org.opengroup.osdu.indexer.logging;
import org.opengroup.osdu.is.core.logging.LogId;
import org.opengroup.osdu.core.is.common.logging.LogId;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;
......
......@@ -2,7 +2,7 @@ package org.opengroup.osdu.indexer.middleware;
import com.google.common.base.Strings;
import lombok.extern.java.Log;
import org.opengroup.osdu.core.api.DpsHeaders;
import org.opengroup.osdu.core.common.api.DpsHeaders;
import org.opengroup.osdu.is.core.model.AuthorizationResponse;
import org.opengroup.osdu.is.core.provider.interfaces.auth.AuthorizationService;
import org.springframework.stereotype.Component;
......
// Copyright 2017-2019, Schlumberger
//
// 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.
package org.opengroup.osdu.indexer.model;
import lombok.Builder;
import lombok.Data;
import java.util.Stack;
@Data
@Builder
public class IndexProgress {
private int statusCode;
private Stack<String> trace;
private String lastUpdateTime;
}
// Copyright 2017-2019, Schlumberger
//
// 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.
package org.opengroup.osdu.indexer.model;
public enum IndexingStatus {
PROCESSING(0),
SUCCESS(1),
WARN(2),
SKIP(3),
FAIL(4);
private final Integer severity;
IndexingStatus(int severity) {
this.severity = severity;
}
public boolean isWorseThan(IndexingStatus other) {
return this.severity > other.severity;
}
}
\ No newline at end of file
// Copyright 2017-2019, Schlumberger
//
// 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.
package org.opengroup.osdu.indexer.model;
public enum OperationType {
/**
* A post operation
*/
create("create"),
/**
* A delete operation
*/
delete("delete"),
/**
* A purge operation
*/
purge("purge"),
/**
* A patch operation
*/
update("update"),
/*
* create schema operation
* */
create_schema("create_schema"),
/*
* purge schema operation
* */
purge_schema("purge_schema");
private final String value;
OperationType(String value) {
this.value = value;
}
public String getValue() {
return value;
}
}
\ No newline at end of file
......@@ -19,6 +19,8 @@ import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.opengroup.osdu.core.common.model.indexer.IndexProgress;
import org.opengroup.osdu.core.common.model.indexer.OperationType;
import java.util.List;
import java.util.Map;
......
// Copyright 2017-2019, Schlumberger
//
// 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.
package org.opengroup.osdu.indexer.model;
import lombok.Builder;
import lombok.Data;
import lombok.ToString;
@Data
@Builder
public class RecordStatus {
private String id;
private String kind;
private String operationType;
private IndexingStatus status;
@ToString.Exclude private IndexProgress indexProgress;
public String getLatestTrace() {
if (indexProgress != null && indexProgress.getTrace() != null && indexProgress.getTrace().size() > 0) {
return indexProgress.getTrace().peek();
}
return null;
}
}
\ No newline at end of file
package org.opengroup.osdu.indexer.provider.interfaces;
import org.opengroup.osdu.indexer.util.JobStatus;
import org.opengroup.osdu.core.api.DpsHeaders;
public interface IPublisher {
public void publishStatusChangedTagsToTopic(DpsHeaders headers, JobStatus indexerBatchStatus) throws Exception;
}
package org.opengroup.osdu.indexer.provider.interfaces;
import org.opengroup.osdu.core.cache.ICache;
public interface ISchemaCache <String,V> extends ICache<String, V> {
}
......@@ -19,16 +19,14 @@ import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.google.gson.internal.LinkedTreeMap;
import com.google.gson.reflect.TypeToken;
import org.apache.http.HttpStatus;
import org.opengroup.osdu.core.common.model.indexer.IndexingStatus;
import org.opengroup.osdu.core.common.util.indexer.JobStatus;
import org.opengroup.osdu.core.is.common.model.Constants;
import org.opengroup.osdu.indexer.model.ElasticType;
import org.opengroup.osdu.indexer.model.IndexSchema;
import org.opengroup.osdu.indexer.model.IndexingStatus;
import org.opengroup.osdu.indexer.util.JobStatus;
import org.opengroup.osdu.indexer.util.parser.DateTimeParser;
import org.opengroup.osdu.indexer.util.parser.NumberParser;
import org.opengroup.osdu.is.core.util.Constants;
import org.springframework.stereotype.Service;
import org.springframework.web.context.annotation.RequestScope;
......
......@@ -18,11 +18,11 @@ package org.opengroup.osdu.indexer.service;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.client.RestHighLevelClient;
import org.opengroup.osdu.is.core.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.is.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.is.common.util.AppException;
import org.opengroup.osdu.is.core.model.IndexInfo;
import org.opengroup.osdu.is.core.provider.interfaces.util.IRequestInfo;
import org.opengroup.osdu.is.core.service.IndicesService;
import org.opengroup.osdu.is.core.util.AppException;
import org.opengroup.osdu.is.core.util.ElasticClientHandler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
......
......@@ -15,14 +15,14 @@
package org.opengroup.osdu.indexer.service;
import org.apache.http.HttpStatus;
import org.opengroup.osdu.core.is.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.is.common.util.AppException;
import org.opengroup.osdu.core.multitenancy.TenantInfo;
import org.opengroup.osdu.is.core.logging.JaxRsDpsLog;
import org.opengroup.osdu.is.core.model.ClusterSettings;
import org.opengroup.osdu.is.core.provider.interfaces.cache.IElasticCredentialsCache;
import org.opengroup.osdu.is.core.provider.interfaces.persistence.ElasticRepository;
import org.opengroup.osdu.is.core.service.ElasticSettingService;
import org.opengroup.osdu.is.core.service.TenantInfoService;
import org.opengroup.osdu.is.core.util.AppException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.inject.Inject;
......
......@@ -15,7 +15,7 @@
package org.opengroup.osdu.indexer.service;
import com.google.gson.internal.LinkedTreeMap;
import org.opengroup.osdu.is.core.util.Constants;
import org.opengroup.osdu.core.is.common.model.Constants;
import org.springframework.stereotype.Service;
import org.springframework.web.context.annotation.RequestScope;
......
......@@ -14,7 +14,8 @@
package org.opengroup.osdu.indexer.service;
import org.opengroup.osdu.is.core.util.AppException;
import org.opengroup.osdu.core.is.common.util.AppException;
import java.io.IOException;
......
......@@ -25,8 +25,9 @@ import org.apache.http.util.EntityUtils;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.RestHighLevelClient;
import org.opengroup.osdu.core.common.api.DpsHeaders;
import org.opengroup.osdu.core.is.common.util.AppException;
import org.opengroup.osdu.indexer.logging.AuditLogger;
import org.opengroup.osdu.core.api.DpsHeaders;
import org.opengroup.osdu.core.multitenancy.TenantInfo;
import org.opengroup.osdu.is.core.model.ClusterSettings;
import org.opengroup.osdu.is.core.provider.interfaces.util.IHeadersInfo;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment