-
Notifications
You must be signed in to change notification settings - Fork 147
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 #1312 from dhanendra06/mosip-26
ES-558: Merged the changes from ES-842 to release-1.2.1.x
- Loading branch information
Showing
47 changed files
with
142 additions
and
3,224 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ on: | |
- 1.* | ||
- develop | ||
- MOSIP* | ||
- ES-842 | ||
|
||
jobs: | ||
build-maven-authentication: | ||
|
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
25 changes: 25 additions & 0 deletions
25
...rc/main/java/io/mosip/authentication/common/service/impl/idevent/RemoveIdStatusEvent.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,25 @@ | ||
package io.mosip.authentication.common.service.impl.idevent; | ||
|
||
import java.util.Map; | ||
|
||
import io.mosip.authentication.common.service.websub.dto.EventInterface; | ||
import lombok.Data; | ||
|
||
/** | ||
* Instantiates a new remove id status event. | ||
* | ||
* @author Ritik Jain | ||
*/ | ||
@Data | ||
public class RemoveIdStatusEvent implements EventInterface { | ||
|
||
/** The id. */ | ||
private String id; | ||
|
||
/** The timestamp. */ | ||
private String timestamp; | ||
|
||
/** The data. */ | ||
private Map<String, Object> data; | ||
|
||
} |
92 changes: 92 additions & 0 deletions
92
...java/io/mosip/authentication/common/service/websub/impl/RemoveIdStatusEventPublisher.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,92 @@ | ||
package io.mosip.authentication.common.service.websub.impl; | ||
|
||
import static io.mosip.authentication.core.constant.IdAuthConfigKeyConstants.REMOVE_ID_STATUS_TOPIC; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.stereotype.Component; | ||
|
||
import io.mosip.authentication.common.service.helper.WebSubHelper; | ||
import io.mosip.authentication.common.service.impl.idevent.RemoveIdStatusEvent; | ||
import io.mosip.authentication.core.constant.IdAuthCommonConstants; | ||
import io.mosip.authentication.core.logger.IdaLogger; | ||
import io.mosip.kernel.core.logger.spi.Logger; | ||
import io.mosip.kernel.core.util.DateUtils; | ||
|
||
/** | ||
* The Class RemoveIdStatusEventPublisher. | ||
* | ||
* @author Ritik Jain | ||
*/ | ||
@Component | ||
public class RemoveIdStatusEventPublisher extends BaseWebSubEventsInitializer { | ||
|
||
/** The Constant logger. */ | ||
private static final Logger logger = IdaLogger.getLogger(RemoveIdStatusEventPublisher.class); | ||
|
||
/** The remove id status topic. */ | ||
@Value("${" + REMOVE_ID_STATUS_TOPIC + "}") | ||
private String removeIdStatusTopic; | ||
|
||
/** The web sub event publish helper. */ | ||
@Autowired | ||
private WebSubHelper webSubHelper; | ||
|
||
private static final String ID_HASH = "id_hash"; | ||
|
||
/** | ||
* Do subscribe. | ||
*/ | ||
@Override | ||
protected void doSubscribe() { | ||
// Nothing to do here since we are just publishing event for this topic. | ||
} | ||
|
||
/** | ||
* Try register topic remove id status event. | ||
*/ | ||
private void tryRegisterTopic() { | ||
try { | ||
logger.debug(IdAuthCommonConstants.SESSION_ID, "tryRegisterTopic", "", | ||
"Trying to register topic: " + removeIdStatusTopic); | ||
webSubHelper.registerTopic(removeIdStatusTopic); | ||
logger.info(IdAuthCommonConstants.SESSION_ID, "tryRegisterTopic", "", | ||
"Registered topic: " + removeIdStatusTopic); | ||
} catch (Exception e) { | ||
logger.info(IdAuthCommonConstants.SESSION_ID, "tryRegisterTopic", e.getClass().toString(), | ||
"Error registering topic: " + removeIdStatusTopic + "\n" + e.getMessage()); | ||
} | ||
} | ||
|
||
@Override | ||
protected void doRegister() { | ||
logger.info(IdAuthCommonConstants.SESSION_ID, "doRegister", this.getClass().getSimpleName(), | ||
"Registering topic.."); | ||
tryRegisterTopic(); | ||
} | ||
|
||
public void publishRemoveIdStatusEvent(String idHash) { | ||
RemoveIdStatusEvent removeIdStatusEvent = createRemoveIdStatusEvent(idHash); | ||
webSubHelper.publishEvent(removeIdStatusTopic, | ||
webSubHelper.createEventModel(removeIdStatusTopic, removeIdStatusEvent)); | ||
} | ||
|
||
/** | ||
* Creates the remove id status event. | ||
* | ||
* @param idHash the idHash | ||
* @return the remove id status event | ||
*/ | ||
private RemoveIdStatusEvent createRemoveIdStatusEvent(String idHash) { | ||
RemoveIdStatusEvent removeIdStatusEvent = new RemoveIdStatusEvent(); | ||
Map<String, Object> dataMap = new HashMap<String, Object>(); | ||
dataMap.put(ID_HASH, idHash); | ||
removeIdStatusEvent.setData(dataMap); | ||
removeIdStatusEvent.setTimestamp(DateUtils.formatToISOString(DateUtils.getUTCCurrentDateTime())); | ||
return removeIdStatusEvent; | ||
} | ||
|
||
} |
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
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 was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
...tion-impl/src/main/java/io/mosip/authentication/esignet/integration/dto/AuditRequest.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
...ion-impl/src/main/java/io/mosip/authentication/esignet/integration/dto/AuditResponse.java
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
...c/main/java/io/mosip/authentication/esignet/integration/dto/ClientIdSecretKeyRequest.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.