Skip to content

Commit

Permalink
feat(config-api): new endpoint for jans service status and file type …
Browse files Browse the repository at this point in the history
…script enhancement (#10014)

* fix(config-api): asset mgt endpoint fixes

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset upload mgt ehancement and fido

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset upload mgt ehancement and fido

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset upload mgt ehancement and fido

Signed-off-by: pujavs <[email protected]>

* fix(config-api): asset upload

Signed-off-by: pujavs <[email protected]>

* fix(config-api): lock review comments

Signed-off-by: pujavs <[email protected]>

* feat(config-api): lock code review comments

Signed-off-by: pujavs <[email protected]>

* feat(config-api): lock master renamed to lock server

Signed-off-by: pujavs <[email protected]>

* feat(config-api): lock master renamed to lock server

Signed-off-by: pujavs <[email protected]>

* feat(config-api): lock master renamed to lock server

Signed-off-by: pujavs <[email protected]>

* feat(config-api): lock master renamed to lock server

Signed-off-by: pujavs <[email protected]>

* feat(config-api): fido2 delete functionality

Signed-off-by: pujavs <[email protected]>

* fix(config-api): acr validation

Signed-off-by: pujavs <[email protected]>

* feat(config-api): doc(config-api): IDP schema attribute descriptions #9187

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sync with main

Signed-off-by: pujavs <[email protected]>

* feat(config-api): uploading assets via API generates 2 entries #9178

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset mgt, fido and IDP changes

Signed-off-by: pujavs <[email protected]>

* feat(config-api): fido2 device endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): fido2 endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): fido2 endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sync with main

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sync with main

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sync with main

Signed-off-by: pujavs <[email protected]>

* feat(config-api): resolved sonar review issues

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sonar review comment fix

Signed-off-by: pujavs <[email protected]>

* feat(config-api): swagger spec

Signed-off-by: pujavs <[email protected]>

* feat(config-api): saml config attribute description

Signed-off-by: pujavs <[email protected]>

* doc(config-api): added SAML attribute description

Signed-off-by: pujavs <[email protected]>

* doc(config-api): added SAML attribute description

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sync with main

Signed-off-by: pujavs <[email protected]>

* fix(jans-lock): code review comment fix isssue#9305

Signed-off-by: pujavs <[email protected]>

* fix(jans-lock): code review comment fix isssue#9305

Signed-off-by: pujavs <[email protected]>

* feat(config-api): lock review point

Signed-off-by: pujavs <[email protected]>

* fix(lock): code review comment

Signed-off-by: pujavs <[email protected]>

* fix(lock): code review comment

Signed-off-by: pujavs <[email protected]>

* fix(config-api): sync with main

Signed-off-by: pujavs <[email protected]>

* feat(config-api): lock endpoint fixes and SAML IDP NPE

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset enhancement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): implement timer for asset mgt to fetch and deploy assets forconfig-api #9403

Signed-off-by: pujavs <[email protected]>

* fix(config-api): scope validation issue #9426

Signed-off-by: pujavs <[email protected]>

* fix(config-api): asset delete error fix

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sysnc with main

Signed-off-by: pujavs <[email protected]>

* fix(config-ap): lock audit endpoint parameter declaration error#9460

Signed-off-by: pujavs <[email protected]>

* feat(config-api): client token functionality

Signed-off-by: pujavs <[email protected]>

* fix(Config-api): lock audit endpoint path param rectification

Signed-off-by: pujavs <[email protected]>

* feat(config-api): clint token endpoint - wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): clint token endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): client token endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): client token endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): token endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): token endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): token endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session ednpoint wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session ednpoint wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session and token endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session and fido2 endpoint

Signed-off-by: pujavs <[email protected]>

* test(config-api): marked session failing test case

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset mgt dir mapping changes wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset mgt dir changes

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset mgt changes for dir

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset mgt endpoint -wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset mgt endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): custom asset mgt wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): custom asset mgt

Signed-off-by: pujavs <[email protected]>

* feat(config-api): custom asset mgt

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint changes to remove sessionId

Signed-off-by: pujavs <[email protected]>

* feat(config-api) session endpoint changes to hide id

Signed-off-by: pujavs <[email protected]>

* feat(config-api) session endpoint changes to hide id

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint mgt

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session enhancement for removing id

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint changes to remove session id

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint changes to remove session id

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint changes to remove session id

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint changes to remove session id

Signed-off-by: pujavs <[email protected]>

* feat(config-api): search fieldValuePair enhancement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): search fieldValuePair enhancement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session field filter enhancement - wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session field search enhancement wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint search enhancemnt

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint search enhancemnt

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint search enhancement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session and token endpoint enhacement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session and token search enhancement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session search changes for session attribute

Signed-off-by: pujavs <[email protected]>

* feat(config-api): fido2 search endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): fido2 entry search

Signed-off-by: pujavs <[email protected]>

* feat(config-api): pagination implemented in fido2, session and token endpoints

Signed-off-by: pujavs <[email protected]>

* feat(Config-ap): acr enhacement for agama

Signed-off-by: pujavs <[email protected]>

* feat(Config-ap): made asset error message descriptive

Signed-off-by: pujavs <[email protected]>

* feat(config-api): token date format changes

Signed-off-by: pujavs <[email protected]>

* feat(config-api): date time changes for tkken comparison:

Signed-off-by: pujavs <[email protected]>

* feat(config-api): date time changes for tkken comparison

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sync with main

Signed-off-by: pujavs <[email protected]>

* feat(config-api): date check

Signed-off-by: pujavs <[email protected]>

* feat(config-api): date format enhancement - wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): service status endpoint wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): new endpoint for jans service status and file type script enhancement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): new endpoint for jans service status and file type script enhancement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): new endpoint for jans service status and file type script enhancement

Signed-off-by: pujavs <[email protected]>

---------

Signed-off-by: pujavs <[email protected]>
Co-authored-by: YuriyZ <[email protected]>
  • Loading branch information
pujavs and yuriyz authored Nov 5, 2024
1 parent 8e3cc21 commit 7c036f5
Show file tree
Hide file tree
Showing 9 changed files with 285 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ private ApiConstants() {}
public static final String SEARCH = "/search";
public static final String JANSID_PATH = "/id";
public static final String SID_PATH = "/sid";
public static final String SERVICE_STATUS_PATH = "/service-status";

public static final String APP_VERSION = "/app-version";
public static final String SERVER_STAT = "/server-stat";
Expand Down Expand Up @@ -145,6 +146,7 @@ private ApiConstants() {}
public static final String TOKEN_CODE = "tknCde";
public static final String OUTSIDE_SID = "outsideSid";
public static final String JANS_SESS_ATTR = "jansSessAttr";
public static final String JANS_SERVICE_NAME = "service";


public static final String ALL = "all";
Expand Down
68 changes: 61 additions & 7 deletions jans-config-api/docs/jans-config-api-swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,60 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/StatsData'
examples:
Response json example:
description: Response json example
value: |
{
"dbType": "sql",
"lastUpdate": "2024-11-01T12:11:01",
"facterData": {
"memoryfree": "39.7%",
"swapfree": "0.0%",
"hostname": "pujavs-amazed-rat.gluu.info",
"ipaddress": "167.99.13.66",
"uptime": "1 day, 3:54",
"free_disk_space": "95.4%",
"load_average": "0.13623046875"
}
}
"500":
description: InternalServerError
/api/v1/health/service-status:
get:
tags:
- Health - Check
summary: Fetch service status
description: Fetch service status
operationId: get-service-status
parameters:
- name: service
in: query
description: Service name to check status
schema:
type: string
default: all
responses:
"200":
description: Ok
content:
application/json:
schema:
type: string
examples:
Response json example:
description: Response json example
value: |
{
"jans-auth": "Running",
"jans-config-api": "Down",
"jans-casa": "Not present",
"jans-fido2": "Running",
"jans-scim": "Running",
"jans-link": "Running",
"jans-lock": "Running",
"keycloak": "Running"
}
"500":
description: InternalServerError
/api/v1/acrs:
Expand Down Expand Up @@ -9217,12 +9271,12 @@ components:
type: boolean
adminCanView:
type: boolean
userCanView:
type: boolean
adminCanEdit:
type: boolean
userCanEdit:
type: boolean
userCanView:
type: boolean
adminCanAccess:
type: boolean
userCanAccess:
Expand Down Expand Up @@ -9851,7 +9905,7 @@ components:
type: boolean
disableU2fEndpoint:
type: boolean
deviceSessionLifetimeInSeconds:
authorizationChallengeSessionLifetimeInSeconds:
type: integer
format: int32
rotateDeviceSecret:
Expand Down Expand Up @@ -10074,8 +10128,6 @@ components:
type: boolean
lockMessageConfig:
$ref: '#/components/schemas/LockMessageConfig'
fapi:
type: boolean
allResponseTypesSupported:
uniqueItems: true
type: array
Expand All @@ -10085,6 +10137,8 @@ components:
- code
- token
- id_token
fapi:
type: boolean
AuthenticationFilter:
required:
- baseDn
Expand Down Expand Up @@ -11628,10 +11682,10 @@ components:
ttl:
type: integer
format: int32
persisted:
type: boolean
opbrowserState:
type: string
persisted:
type: boolean
SessionIdAccessMap:
type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

package io.jans.configapi.rest.health;

import static io.jans.as.model.util.Util.escapeLog;

import com.fasterxml.jackson.databind.JsonNode;

import io.jans.configapi.core.model.HealthStatus;
Expand All @@ -21,6 +23,7 @@
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.ExampleObject;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
Expand All @@ -32,6 +35,7 @@

import org.slf4j.Logger;
import java.util.ArrayList;
import java.util.Map;

@Path(ApiConstants.HEALTH)
@Consumes(MediaType.APPLICATION_JSON)
Expand Down Expand Up @@ -133,7 +137,7 @@ public Response getReadinessResponse() {
@Operation(summary = "Returns application server status", description = "Returns application server status", operationId = "get-server-stat", tags = {
"Health - Check" })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Ok", content = @Content(mediaType = MediaType.APPLICATION_JSON, schema = @Schema(implementation = StatsData.class))),
@ApiResponse(responseCode = "200", description = "Ok", content = @Content(mediaType = MediaType.APPLICATION_JSON, schema = @Schema(implementation = StatsData.class), examples = @ExampleObject(name = "Response json example", value = "example/health/server-stat.json"))),
@ApiResponse(responseCode = "500", description = "InternalServerError") })
@GET
@Path(ApiConstants.SERVER_STAT)
Expand All @@ -160,7 +164,25 @@ public Response getApplicationVersion(@Parameter(description = "artifact name fo
return Response.ok(statusCheckerTimer.getAppVersionData(artifact)).build();
}


@Operation(summary = "Fetch service status", description = "Fetch service status", operationId = "get-service-status", tags = {
"Health - Check" })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Ok", content = @Content(mediaType = MediaType.APPLICATION_JSON, schema = @Schema(implementation = Map.class), examples = @ExampleObject(name = "Response json example", value = "example/health/service-status.json"))),
@ApiResponse(responseCode = "500", description = "InternalServerError") })
@GET
@ProtectedApi(scopes = { ApiAccessConstants.SUPER_ADMIN_READ_ACCESS }, groupScopes = {}, superScopes = {})
@Path(ApiConstants.SERVICE_STATUS_PATH)
public Response getServiceStatus(
@Parameter(description = "Service name to check status") @DefaultValue(ApiConstants.ALL) @QueryParam(value = ApiConstants.JANS_SERVICE_NAME) String service) {
if (logger.isInfoEnabled()) {
logger.info("Fetch ServiceStatus info - service:{}", escapeLog(service));
}

Map<String, String> serviceStatus = statusCheckerTimer.getServiceStatus(service);
logger.debug("serviceStatus:{}", serviceStatus);
return Response.ok(serviceStatus).build();
}

private void checkDatabaseConnection() {
configurationService.findConf();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@
import java.util.Set;
import java.util.UUID;

import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.StringUtils;

@Path(ApiConstants.CONFIG + ApiConstants.SCRIPTS)
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class CustomScriptResource extends ConfigBaseResource {

private static final String CUSTOM_FILE_SCRIPT_DEFAULT_LOCATION = "/opt/jans/jetty/jans-auth/custom/script/";
private static final String CUSTOM_SCRIPT = "custom script";
private static final String PATH_SEPARATOR = "/";

Expand Down Expand Up @@ -220,6 +222,10 @@ public Response createScript(@Valid CustomScript customScript,
updateRevision(customScript, null);
customScript.setDn(customScriptService.buildDn(inum));
customScript.setInum(inum);

//custom handling of if ScriptLocationType.FILE - issues#9979
updateFileTypeCustomScript(customScript);

customScriptService.add(customScript);
logger.debug("Custom Script added {}", customScript);
return Response.status(Response.Status.CREATED).entity(customScript).build();
Expand All @@ -245,6 +251,9 @@ public Response updateScript(@Valid @NotNull CustomScript customScript) {
updateRevision(customScript, existingScript);
logger.debug("Custom Script to be updated {}", customScript);

//custom handling of if ScriptLocationType.FILE - issues#9979
updateFileTypeCustomScript(customScript);

customScriptService.update(customScript);

logger.debug("Check if script is enabled:{}", existingScript.isEnabled());
Expand Down Expand Up @@ -469,4 +478,24 @@ private void removeAuthenticationMethod() {
configurationService.merge(gluuConfiguration);
}

private CustomScript updateFileTypeCustomScript(CustomScript customScript) {
logger.info("Handling CustomScript if location type is File - customScript:{}", customScript);
// Handling for File type customScript
if (customScript == null) {
return customScript;
}
logger.info("Handling CustomScript if location type is File - customScript.getLocationType().getValue():{}, customScript.getLocationPath():{}", customScript.getLocationType().getValue(), customScript.getLocationPath());
if (ScriptLocationType.FILE.getValue().equalsIgnoreCase(customScript.getLocationType().getValue())) {
logger.info("Modifying customScript as getLocationType is File - customScript:{}", customScript);
String fileName = CUSTOM_FILE_SCRIPT_DEFAULT_LOCATION;
if (StringUtils.isNotBlank(customScript.getLocationPath())) {
fileName = fileName + FilenameUtils.getName(customScript.getLocationPath());
customScript.setLocationPath(fileName);
}
}

logger.info("Handling CustomScript if location type is File - customScript.getLocationType().getValue():{}, customScript.getLocationPath():{}", customScript.getLocationType().getValue(), customScript.getLocationPath());
return customScript;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,22 @@ public PagedResult<TokenEntity> searchToken(SearchRequest searchRequest) {
searchRequest.getFilterAssertionValue());
for (String assertionValue : searchRequest.getFilterAssertionValue()) {
logger.info("Session Search with assertionValue:{}", assertionValue);
String[] targetArray = new String[] { assertionValue };
Filter grantIdFilter = Filter.createSubstringFilter("grtId", null, targetArray, null);
Filter userIdFilter = Filter.createSubstringFilter("usrId", null, targetArray, null);
Filter userDnFilter = Filter.createSubstringFilter("jansUsrDN", null, targetArray, null);
Filter clientIdFilter = Filter.createSubstringFilter("clnId", null, targetArray, null);
Filter scopeFilter = Filter.createSubstringFilter("scp", null, targetArray, null);
Filter tokenTypeFilter = Filter.createSubstringFilter("tknTyp", null, targetArray, null);
Filter grantTypeFilter = Filter.createSubstringFilter("grtTyp", null, targetArray, null);
Filter inumFilter = Filter.createSubstringFilter("jansId", null, targetArray, null);
filters.add(Filter.createORFilter(grantIdFilter, userIdFilter, userDnFilter, clientIdFilter,
scopeFilter, tokenTypeFilter, grantTypeFilter, inumFilter));
if (StringUtils.isNotBlank(assertionValue)) {
String[] targetArray = new String[] { assertionValue };
Filter grantIdFilter = Filter.createSubstringFilter("grtId", null, targetArray, null);
Filter userIdFilter = Filter.createSubstringFilter("usrId", null, targetArray, null);
Filter userDnFilter = Filter.createSubstringFilter("jansUsrDN", null, targetArray, null);
Filter clientIdFilter = Filter.createSubstringFilter("clnId", null, targetArray, null);
Filter scopeFilter = Filter.createSubstringFilter("scp", null, targetArray, null);
Filter tokenTypeFilter = Filter.createSubstringFilter("tknTyp", null, targetArray, null);
Filter grantTypeFilter = Filter.createSubstringFilter("grtTyp", null, targetArray, null);
Filter inumFilter = Filter.createSubstringFilter("jansId", null, targetArray, null);
filters.add(Filter.createORFilter(grantIdFilter, userIdFilter, userDnFilter, clientIdFilter,
scopeFilter, tokenTypeFilter, grantTypeFilter, inumFilter));

}
searchFilter = Filter.createORFilter(filters);
}
searchFilter = Filter.createORFilter(filters);
logger.trace("Search Token searchFilter :{}", searchFilter);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@

package io.jans.configapi.service.status;

import io.jans.util.process.ProcessHelper;


import com.fasterxml.jackson.databind.JsonNode;

import static io.jans.as.model.util.Util.escapeLog;

import io.jans.configapi.configuration.ConfigurationFactory;
import io.jans.configapi.core.util.Jackson;
import io.jans.configapi.model.status.StatsData;
Expand All @@ -21,11 +24,13 @@
import io.jans.service.timer.event.TimerEvent;
import io.jans.service.timer.schedule.TimerSchedule;
import io.jans.util.StringHelper;
import io.jans.util.process.ProcessHelper;

import static java.nio.charset.StandardCharsets.UTF_8;
import java.io.ByteArrayOutputStream;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;

import jakarta.annotation.PostConstruct;
Expand All @@ -48,6 +53,7 @@ public class StatusCheckerTimer {
private static final int DEFAULT_INTERVAL = 5 * 60; // 1 minute
public static final String PROGRAM_FACTER = "facter";
public static final String PROGRAM_SHOW_VERSION = "/opt/jans/printVersion.py";
public static final String SERVICE_STATUS = "/opt/jans/bin/jans_services_status.py";

@Inject
private Logger log;
Expand Down Expand Up @@ -164,7 +170,9 @@ private FacterData getFacterData() {
}

public JsonNode getAppVersionData(String artifact) {
log.debug("Getting application version for artifact:{}", artifact);
if (log.isInfoEnabled()) {
log.debug("Getting application version for artifact:{}", escapeLog(artifact));
}

JsonNode appVersion = null;
if (!isLinux()) {
Expand Down Expand Up @@ -204,6 +212,50 @@ public JsonNode getAppVersionData(String artifact) {
return appVersion;
}

public Map<String, String> getServiceStatus(String serviceName) {
if (log.isInfoEnabled()) {
log.info("Getting status for serviceName:{}", escapeLog(serviceName));
}

Map<String, String> serviceStatus = null;
ObjectMapper mapper = new ObjectMapper();
if (!isLinux()) {
return serviceStatus;
}

CommandLine commandLine = new CommandLine(SERVICE_STATUS);
if (StringUtils.isNotBlank(serviceName) && !serviceName.equalsIgnoreCase(ApiConstants.ALL)) {
commandLine.addArgument(" " + serviceName);
}
commandLine.addArgument("--json");
log.debug("Getting service status for commandLine:{}", commandLine);

String resultOutput;
try (ByteArrayOutputStream bos = new ByteArrayOutputStream(4096);) {

boolean result = ProcessHelper.executeProgram(commandLine, false, 0, bos);
if (!result) {
return serviceStatus;
}

resultOutput = new String(bos.toByteArray(), UTF_8);
log.info("resultOutput:{}", resultOutput);

if (StringUtils.isNotBlank(resultOutput)) {
serviceStatus = mapper.readValue(resultOutput, Map.class);
}

} catch (UnsupportedEncodingException uex) {
log.error("Failed to parse serviceStatus data program {} output", SERVICE_STATUS, uex);
return serviceStatus;
} catch (Exception ex) {
log.error("Failed to execute serviceStatus program {} output", SERVICE_STATUS, ex);
return serviceStatus;
}
log.debug("Service Status data - serviceStatus:{}", serviceStatus);
return serviceStatus;
}

private void printDirectory() {
log.debug("printDirectory");

Expand Down
Loading

0 comments on commit 7c036f5

Please sign in to comment.