Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/odpi/egeria into egeria-code
Browse files Browse the repository at this point in the history
  • Loading branch information
mandy-chessell committed Nov 14, 2022
2 parents f16dab8 + ace7188 commit 2e304c1
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 240 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,6 @@ public SubjectAreaOMASAPIResponse<Project> updateProject(String userId, String g
response.setExceptionInfo(e, className);
}

if (log.isDebugEnabled()) {
log.debug("<== successful method : " + methodName + ",userId=" + userId + ",response=" + response);
}
return response;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
import org.odpi.openmetadata.accessservices.subjectarea.properties.objects.graph.Relationship;
import org.odpi.openmetadata.accessservices.subjectarea.properties.objects.term.Term;
import org.odpi.openmetadata.accessservices.subjectarea.responses.SubjectAreaOMASAPIResponse;
import org.odpi.openmetadata.commonservices.ffdc.RESTCallLogger;
import org.odpi.openmetadata.commonservices.ffdc.RESTCallToken;
import org.odpi.openmetadata.frameworks.auditlog.AuditLog;
import org.odpi.openmetadata.frameworks.connectors.ffdc.OCFCheckedExceptionBase;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;
Expand All @@ -25,8 +26,9 @@

public class SubjectAreaCategoryRESTServices extends SubjectAreaRESTServicesInstance {
private static final String className = SubjectAreaTermHandler.class.getName();
private static final Logger log = LoggerFactory.getLogger(SubjectAreaCategoryHandler.class);
private static final SubjectAreaInstanceHandler instanceHandler = new SubjectAreaInstanceHandler();
private static final RESTCallLogger restCallLogger = new RESTCallLogger(LoggerFactory.getLogger(SubjectAreaCategoryRESTServices.class),
instanceHandler.getServiceName());

/**
* Default constructor
Expand Down Expand Up @@ -65,9 +67,7 @@ public SubjectAreaCategoryRESTServices() {

public SubjectAreaOMASAPIResponse<Category> createCategory(String serverName, String userId, Category suppliedCategory) {
final String methodName = "createCategory";
if (log.isDebugEnabled()) {
log.debug("==> Method: " + methodName + ",userId=" + userId);
}
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
SubjectAreaOMASAPIResponse<Category> response = new SubjectAreaOMASAPIResponse<>();
AuditLog auditLog = null;
try {
Expand All @@ -79,9 +79,7 @@ public SubjectAreaOMASAPIResponse<Category> createCategory(String serverName, St
} catch (Exception exception) {
response = getResponseForException(exception, auditLog, className, methodName);
}
if (log.isDebugEnabled()) {
log.debug("<== successful method : " + methodName + ",userId=" + userId + ", response =" + response);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
}

Expand All @@ -100,9 +98,7 @@ public SubjectAreaOMASAPIResponse<Category> createCategory(String serverName, St
*/
public SubjectAreaOMASAPIResponse<Category> getCategory(String serverName, String userId, String guid) {
final String methodName = "getCategoryByGuid";
if (log.isDebugEnabled()) {
log.debug("==> Method: " + methodName + ",userId=" + userId + ",guid=" + guid);
}
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
SubjectAreaOMASAPIResponse<Category> response = new SubjectAreaOMASAPIResponse<>();
AuditLog auditLog = null;
try {
Expand All @@ -115,9 +111,7 @@ public SubjectAreaOMASAPIResponse<Category> getCategory(String serverName, Strin
} catch (Exception exception) {
response = getResponseForException(exception, auditLog, className, methodName);
}
if (log.isDebugEnabled()) {
log.debug("<== successful method : " + methodName + ",userId=" + userId + ", response =" + response);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
}

Expand Down Expand Up @@ -155,9 +149,7 @@ public SubjectAreaOMASAPIResponse<Category> findCategory(String serverName,
String sequencingProperty) {

final String methodName = "findCategory";
if (log.isDebugEnabled()) {
log.debug("==> Method: " + methodName + ",userId=" + userId);
}
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
SubjectAreaOMASAPIResponse<Category> response = new SubjectAreaOMASAPIResponse<>();
AuditLog auditLog = null;
try {
Expand All @@ -170,9 +162,7 @@ public SubjectAreaOMASAPIResponse<Category> findCategory(String serverName,
} catch (Exception exception) {
response = getResponseForException(exception, auditLog, className, methodName);
}
if (log.isDebugEnabled()) {
log.debug("<== successful method : " + methodName + ",userId=" + userId + ", response =" + response);
}
restCallLogger.logRESTCallReturn(token, response.toString());

return response;
}
Expand Down Expand Up @@ -210,9 +200,7 @@ public SubjectAreaOMASAPIResponse<Relationship> getCategoryRelationships(String

final String methodName = "getCategoryRelationships";

if (log.isDebugEnabled()) {
log.debug("==> Method: " + methodName + ",userId=" + userId + ",guid=" + guid);
}
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
SubjectAreaOMASAPIResponse<Relationship> response = new SubjectAreaOMASAPIResponse<>();
AuditLog auditLog = null;
try {
Expand All @@ -230,9 +218,7 @@ public SubjectAreaOMASAPIResponse<Relationship> getCategoryRelationships(String
} catch (Exception exception) {
response = getResponseForException(exception, auditLog, className, methodName);
}
if (log.isDebugEnabled()) {
log.debug("<== successful method : " + methodName + ",userId=" + userId + ", response =" + response);
}
restCallLogger.logRESTCallReturn(token, response.toString());

return response;
}
Expand All @@ -258,9 +244,7 @@ public SubjectAreaOMASAPIResponse<Relationship> getCategoryRelationships(String
*/
public SubjectAreaOMASAPIResponse<Category> updateCategory(String serverName, String userId, String guid, Category suppliedCategory, boolean isReplace) {
final String methodName = "updateCategory";
if (log.isDebugEnabled()) {
log.debug("==> Method: " + methodName + ",userId=" + userId + ",guid=" + guid);
}
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
SubjectAreaOMASAPIResponse<Category> response = new SubjectAreaOMASAPIResponse<>();
AuditLog auditLog = null;
try {
Expand All @@ -272,9 +256,7 @@ public SubjectAreaOMASAPIResponse<Category> updateCategory(String serverName, St
} catch (Exception exception) {
response = getResponseForException(exception, auditLog, className, methodName);
}
if (log.isDebugEnabled()) {
log.debug("<== successful method : " + methodName + ",userId=" + userId + ", response =" + response);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
}

Expand Down Expand Up @@ -302,9 +284,7 @@ public SubjectAreaOMASAPIResponse<Category> updateCategory(String serverName, St
*/
public SubjectAreaOMASAPIResponse<Category> deleteCategory(String serverName, String userId, String guid) {
final String methodName = "deleteCategory";
if (log.isDebugEnabled()) {
log.debug("==> Method: " + methodName + ",userId=" + userId + ",guid=" + guid);
}
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
SubjectAreaOMASAPIResponse<Category> response = new SubjectAreaOMASAPIResponse<>();
AuditLog auditLog = null;
try {
Expand All @@ -316,9 +296,7 @@ public SubjectAreaOMASAPIResponse<Category> deleteCategory(String serverName, St
} catch (Exception exception) {
response = getResponseForException(exception, auditLog, className, methodName);
}
if (log.isDebugEnabled()) {
log.debug("<== successful method : " + methodName + ",userId=" + userId + ", response =" + response);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
}

Expand All @@ -339,9 +317,7 @@ public SubjectAreaOMASAPIResponse<Category> deleteCategory(String serverName, St
*/
public SubjectAreaOMASAPIResponse<Category> restoreCategory(String serverName, String userId, String guid) {
final String methodName = "restoreCategory";
if (log.isDebugEnabled()) {
log.debug("==> Method: " + methodName + ",userId=" + userId + ",guid=" + guid);
}
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
SubjectAreaOMASAPIResponse<Category> response = new SubjectAreaOMASAPIResponse<>();
AuditLog auditLog = null;
try {
Expand All @@ -353,9 +329,7 @@ public SubjectAreaOMASAPIResponse<Category> restoreCategory(String serverName, S
} catch (Exception exception) {
response = getResponseForException(exception, auditLog, className, methodName);
}
if (log.isDebugEnabled()) {
log.debug("<== successful method : " + methodName + ",userId=" + userId + ", response =" + response);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
}

Expand All @@ -380,9 +354,7 @@ public SubjectAreaOMASAPIResponse<Category> restoreCategory(String serverName, S
**/
public SubjectAreaOMASAPIResponse<Term> getCategorizedTerms(String serverName, String userId, String guid,String searchCriteria, boolean exactValue, boolean ignoreCase, Integer startingFrom, Integer pageSize) {
final String methodName = "getCategorizedTerms";
if (log.isDebugEnabled()) {
log.debug("==> Method: " + methodName + ",userId=" + userId + ",guid=" + guid);
}
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
SubjectAreaOMASAPIResponse<Term> response = new SubjectAreaOMASAPIResponse<>();
AuditLog auditLog = null;
try {
Expand All @@ -394,9 +366,7 @@ public SubjectAreaOMASAPIResponse<Term> getCategorizedTerms(String serverName, S
} catch (Exception exception) {
response = getResponseForException(exception, auditLog, className, methodName);
}
if (log.isDebugEnabled()) {
log.debug("<== successful method : " + methodName + ",userId=" + userId + ", response =" + response);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
}
/**
Expand All @@ -420,9 +390,7 @@ public SubjectAreaOMASAPIResponse<Term> getCategorizedTerms(String serverName, S
**/
public SubjectAreaOMASAPIResponse<Category> getCategoryChildren(String serverName, String userId, String guid, String searchCriteria, boolean exactValue, boolean ignoreCase, Integer startingFrom, Integer pageSize) {
final String methodName = "getCategoryChildren";
if (log.isDebugEnabled()) {
log.debug("==> Method: " + methodName + ",userId=" + userId + ",guid=" + guid);
}
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
SubjectAreaOMASAPIResponse<Category> response = new SubjectAreaOMASAPIResponse<>();
AuditLog auditLog = null;
try {
Expand All @@ -434,9 +402,7 @@ public SubjectAreaOMASAPIResponse<Category> getCategoryChildren(String serverNam
} catch (Exception exception) {
response = getResponseForException(exception, auditLog, className, methodName);
}
if (log.isDebugEnabled()) {
log.debug("<== successful method : " + methodName + ",userId=" + userId + ", response =" + response);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
import org.odpi.openmetadata.accessservices.subjectarea.handlers.SubjectAreaConfigHandler;
import org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.Config;
import org.odpi.openmetadata.accessservices.subjectarea.responses.SubjectAreaOMASAPIResponse;
import org.odpi.openmetadata.commonservices.ffdc.RESTCallLogger;
import org.odpi.openmetadata.commonservices.ffdc.RESTCallToken;
import org.odpi.openmetadata.frameworks.auditlog.AuditLog;
import org.odpi.openmetadata.frameworks.connectors.ffdc.OCFCheckedExceptionBase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
Expand All @@ -16,9 +17,10 @@
*/

public class SubjectAreaConfigRESTServices extends SubjectAreaRESTServicesInstance {
private static final Logger log = LoggerFactory.getLogger(SubjectAreaConfigRESTServices.class);
private static final SubjectAreaInstanceHandler instanceHandler = new SubjectAreaInstanceHandler();
private static final String className = SubjectAreaConfigRESTServices.class.getName();
private static final RESTCallLogger restCallLogger = new RESTCallLogger(LoggerFactory.getLogger(SubjectAreaConfigRESTServices.class),
instanceHandler.getServiceName());

/**
* Default constructor
Expand All @@ -35,9 +37,7 @@ public SubjectAreaConfigRESTServices() {
*/
public SubjectAreaOMASAPIResponse<Config> getConfig(String serverName, String userId) {
final String methodName = "getConfig";
if (log.isDebugEnabled()) {
log.debug("==> Method: " + methodName + ",userId=" + userId);
}
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
SubjectAreaOMASAPIResponse<Config> response = new SubjectAreaOMASAPIResponse<>();
AuditLog auditLog = null;
try {
Expand All @@ -50,9 +50,7 @@ public SubjectAreaOMASAPIResponse<Config> getConfig(String serverName, String us
} catch (Exception exception) {
response = getResponseForException(exception, auditLog, className, methodName);
}
if (log.isDebugEnabled()) {
log.debug("<== successful method : " + methodName + ",userId=" + userId + ", response =" + response);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
}
}
Loading

0 comments on commit 2e304c1

Please sign in to comment.