-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: align DID operations with DR (#450)
* chore: align DID operations with DR * checkstyle * fix test, deactivate PC before delete
- Loading branch information
1 parent
a8e4b5f
commit f906ff9
Showing
13 changed files
with
299 additions
and
94 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
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
57 changes: 57 additions & 0 deletions
57
...rg/eclipse/edc/identityhub/participantcontext/ParticipantContextCoordinatorExtension.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,57 @@ | ||
/* | ||
* Copyright (c) 2024 Metaform Systems, Inc. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* Metaform Systems, Inc. - initial API and implementation | ||
* | ||
*/ | ||
|
||
package org.eclipse.edc.identityhub.participantcontext; | ||
|
||
import org.eclipse.edc.identithub.spi.did.DidDocumentService; | ||
import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; | ||
import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextCreated; | ||
import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextDeleting; | ||
import org.eclipse.edc.runtime.metamodel.annotation.Extension; | ||
import org.eclipse.edc.runtime.metamodel.annotation.Inject; | ||
import org.eclipse.edc.spi.event.EventRouter; | ||
import org.eclipse.edc.spi.system.ServiceExtension; | ||
import org.eclipse.edc.spi.system.ServiceExtensionContext; | ||
|
||
import java.time.Clock; | ||
|
||
import static org.eclipse.edc.identityhub.participantcontext.ParticipantContextExtension.NAME; | ||
|
||
@Extension(NAME) | ||
public class ParticipantContextCoordinatorExtension implements ServiceExtension { | ||
public static final String NAME = "ParticipantContext Coordinator Extension"; | ||
|
||
@Inject | ||
private DidDocumentService didDocumentService; | ||
@Inject | ||
private KeyPairService keyPairService; | ||
@Inject | ||
private Clock clock; | ||
@Inject | ||
private EventRouter eventRouter; | ||
|
||
@Override | ||
public String name() { | ||
return NAME; | ||
} | ||
|
||
@Override | ||
public void initialize(ServiceExtensionContext context) { | ||
var coordinator = new ParticipantContextEventCoordinator(context.getMonitor().withPrefix("ParticipantContextEventCoordinator"), | ||
didDocumentService, keyPairService); | ||
|
||
eventRouter.registerSync(ParticipantContextCreated.class, coordinator); | ||
eventRouter.registerSync(ParticipantContextDeleting.class, coordinator); | ||
} | ||
} |
Oops, something went wrong.