-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial implementation of ID Match client
This is work in progress (only requests are sent, responses are not parsed).
- Loading branch information
Tadeas Chrapovic
committed
Jan 14, 2022
1 parent
062ca96
commit 0291211
Showing
23 changed files
with
814 additions
and
16 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
22 changes: 22 additions & 0 deletions
22
.../src/main/java/com/evolveum/midpoint/model/impl/correlator/idmatch/constants/Channel.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,22 @@ | ||
package com.evolveum.midpoint.model.impl.correlator.idmatch.constants; | ||
|
||
public enum Channel { | ||
|
||
|
||
URL_PREFIX_MAIN_OPERATIONS("/match/api/1/v1/people/"), | ||
URL_PREFIX_GET_MATCH_REQUEST_MATCH_ID("/match/api/1/v1/matchRequests/"), | ||
URL_PREFIX_GET_MATCH_REQUEST_REFERENCE_ID("/match/api/1/v1/matchRequests?referenceId="); | ||
|
||
|
||
private final String url; | ||
|
||
Channel(String envUrl) { | ||
this.url = envUrl; | ||
} | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
} | ||
|
||
|
20 changes: 20 additions & 0 deletions
20
.../main/java/com/evolveum/midpoint/model/impl/correlator/idmatch/constants/MatchStatus.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,20 @@ | ||
package com.evolveum.midpoint.model.impl.correlator.idmatch.constants; | ||
|
||
public enum MatchStatus { | ||
|
||
|
||
PENDING("/match/api/1/v1/matchRequests?status=pending"), | ||
RESOLVED("/match/api/1/v1/matchRequests?status=resolved"); | ||
|
||
|
||
private final String url; | ||
|
||
MatchStatus(String envUrl) { | ||
this.url = envUrl; | ||
} | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
...c/main/java/com/evolveum/midpoint/model/impl/correlator/idmatch/constants/Operations.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,8 @@ | ||
package com.evolveum.midpoint.model.impl.correlator.idmatch.constants; | ||
|
||
public enum Operations { | ||
PUT, | ||
POST, | ||
GET, | ||
DELETE | ||
} |
32 changes: 32 additions & 0 deletions
32
.../src/main/java/com/evolveum/midpoint/model/impl/correlator/idmatch/data/ListResponse.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,32 @@ | ||
package com.evolveum.midpoint.model.impl.correlator.idmatch.data; | ||
|
||
public class ListResponse { | ||
|
||
|
||
String message; | ||
String entity; | ||
String responseCode; | ||
|
||
|
||
public ListResponse(String message, String entity, String responseCode) { | ||
this.message = message; | ||
this.entity = entity; | ||
this.responseCode = responseCode; | ||
} | ||
|
||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
|
||
public String getEntity() { | ||
return entity; | ||
} | ||
|
||
|
||
public String getResponseCode() { | ||
return responseCode; | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
...com/evolveum/midpoint/model/impl/correlator/idmatch/data/structure/JsonListStructure.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,30 @@ | ||
package com.evolveum.midpoint.model.impl.correlator.idmatch.data.structure; | ||
|
||
public class JsonListStructure { | ||
|
||
|
||
public JsonListStructure(String sorLabel, String sorId, String objectToSend) { | ||
this.sorLabel = sorLabel; | ||
this.sorId = sorId; | ||
this.objectToSend = objectToSend; | ||
} | ||
|
||
String sorLabel; | ||
String sorId; | ||
String objectToSend; | ||
|
||
|
||
public String getSorLabel() { | ||
return sorLabel; | ||
} | ||
|
||
|
||
public String getSorId() { | ||
return sorId; | ||
} | ||
|
||
|
||
public String getObjectToSend() { | ||
return objectToSend; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...com/evolveum/midpoint/model/impl/correlator/idmatch/data/structure/UserDataStructure.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,33 @@ | ||
package com.evolveum.midpoint.model.impl.correlator.idmatch.data.structure; | ||
|
||
import java.util.List; | ||
|
||
public class UserDataStructure { | ||
|
||
|
||
String sorLabel; | ||
String sorId; | ||
List<UserSpecParameter> object; | ||
|
||
|
||
public UserDataStructure(String sorLabel, String sorId, List<UserSpecParameter> object) { | ||
this.sorLabel = sorLabel; | ||
this.sorId = sorId; | ||
this.object = object; | ||
} | ||
|
||
|
||
public String getSorLabel() { | ||
return sorLabel; | ||
} | ||
|
||
|
||
public String getSorId() { | ||
return sorId; | ||
} | ||
|
||
public List<UserSpecParameter> getObject() { | ||
return object; | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...com/evolveum/midpoint/model/impl/correlator/idmatch/data/structure/UserSpecParameter.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,39 @@ | ||
package com.evolveum.midpoint.model.impl.correlator.idmatch.data.structure; | ||
|
||
public class UserSpecParameter { | ||
|
||
|
||
String groupName; | ||
String objectName; | ||
String objectType; | ||
String object; | ||
|
||
|
||
public UserSpecParameter(String groupName, String objectName, String objectType, String object) { | ||
this.groupName = groupName; | ||
this.objectName = objectName; | ||
this.objectType = objectType; | ||
this.object = object; | ||
} | ||
|
||
|
||
public String getGroupName() { | ||
return groupName; | ||
} | ||
|
||
|
||
public String getObjectName() { | ||
return objectName; | ||
} | ||
|
||
|
||
public String getObjectType() { | ||
return objectType; | ||
} | ||
|
||
|
||
public String getObject() { | ||
return object; | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
...java/com/evolveum/midpoint/model/impl/correlator/idmatch/operations/ApacheApiRequest.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,13 @@ | ||
package com.evolveum.midpoint.model.impl.correlator.idmatch.operations; | ||
|
||
import com.evolveum.midpoint.model.impl.correlator.idmatch.data.ListResponse; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
public interface ApacheApiRequest { | ||
|
||
void doRequest(String urlPrefix, String urlSuffix, String jsonString) throws IOException; | ||
|
||
List<ListResponse> listResponse(); | ||
} |
24 changes: 24 additions & 0 deletions
24
...in/java/com/evolveum/midpoint/model/impl/correlator/idmatch/operations/ApacheContext.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,24 @@ | ||
package com.evolveum.midpoint.model.impl.correlator.idmatch.operations; | ||
|
||
|
||
import com.evolveum.midpoint.model.impl.correlator.idmatch.operations.auth.AuthenticationProvider; | ||
|
||
import java.io.IOException; | ||
|
||
|
||
public class ApacheContext { | ||
|
||
public ApacheApiRequest apacheApiRequest; | ||
|
||
public ApacheContext(ApacheApiRequest apacheApiRequest) { | ||
this.apacheApiRequest = apacheApiRequest; | ||
} | ||
|
||
public void executeRequest(AuthenticationProvider authenticationProvider, String urlPrefix, String jsonString, String urlSuffix){ | ||
try { | ||
apacheApiRequest.doRequest(urlPrefix,jsonString,urlSuffix); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
Oops, something went wrong.