-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #169 from Infosys/feature-flutter
Critical Bug Fixes
- Loading branch information
Showing
104 changed files
with
1,043 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
android/app/src/main/java/io/mosip/registration_client/api_services/AuditDetailsApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package io.mosip.registration_client.api_services; | ||
|
||
import android.util.Log; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import java.util.Arrays; | ||
import java.util.Objects; | ||
|
||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
|
||
import io.mosip.registration.clientmanager.constant.AuditEvent; | ||
import io.mosip.registration.clientmanager.constant.Components; | ||
import io.mosip.registration.clientmanager.spi.AuditManagerService; | ||
import io.mosip.registration_client.model.AuditResponsePigeon; | ||
|
||
@Singleton | ||
public class AuditDetailsApi implements AuditResponsePigeon.AuditResponseApi { | ||
AuditManagerService auditManagerService; | ||
|
||
@Inject | ||
public AuditDetailsApi(AuditManagerService auditManagerService) { | ||
this.auditManagerService = auditManagerService; | ||
} | ||
|
||
@Override | ||
public void audit(@NonNull String id, @NonNull String componentId, @NonNull AuditResponsePigeon.Result<Void> result) { | ||
try { | ||
Arrays.stream(AuditEvent.values()).forEach((event) -> { | ||
if(Objects.equals(event.getId(), id)) { | ||
auditEvent(event, componentId); | ||
} | ||
}); | ||
} catch (Exception e) { | ||
Log.e(getClass().getSimpleName(), "Exception in system audit event!", e); | ||
} | ||
} | ||
|
||
private void auditEvent(AuditEvent auditEvent, String componentId) { | ||
Arrays.stream(Components.values()).forEach((component) -> { | ||
if(Objects.equals(component.getId(), componentId)) { | ||
auditManagerService.audit(auditEvent, component); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.