Skip to content

Commit

Permalink
Allow directory client to be build only with some clients. e,g, reader
Browse files Browse the repository at this point in the history
  • Loading branch information
BogdanIrimie authored Jan 3, 2024
1 parent 3d8336a commit 29a8c04
Show file tree
Hide file tree
Showing 12 changed files with 236 additions and 297 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.aserto</groupId>
<artifactId>aserto-java</artifactId>
<version>0.20.11</version>
<version>0.21.00</version>

<name>${project.groupId}:${project.artifactId}</name>
<description>Java SDK to interact with aserto services</description>
Expand Down
182 changes: 144 additions & 38 deletions src/main/java/com/aserto/directory/v3/DirectoryClient.java

Large diffs are not rendered by default.

146 changes: 0 additions & 146 deletions src/main/java/com/aserto/directory/v3/DirectoryClientBuilder.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
import java.util.Iterator;

public interface DirectoryClientExporter {
Iterator<ExportResponse> exportData(Option options);
Iterator<ExportResponse> exportData(Option options, Timestamp startFrom);
Iterator<ExportResponse> exportData(Option options) throws UninitilizedClientException;
Iterator<ExportResponse> exportData(Option options, Timestamp startFrom) throws UninitilizedClientException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
import java.util.stream.Stream;

public interface DirectoryClientImporter {
void importData(Stream<ImportElement> importStream) throws InterruptedException;
void importData(Stream<ImportElement> importStream) throws InterruptedException, UninitilizedClientException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.aserto.directory.model.v3.GetManifestResponse;

public interface DirectoryClientModel {
GetManifestResponse getManifest();
void setManifest(String manifest) throws InterruptedException;
DeleteManifestResponse deleteManifest();
GetManifestResponse getManifest() throws UninitilizedClientException;
void setManifest(String manifest) throws InterruptedException, UninitilizedClientException;
DeleteManifestResponse deleteManifest() throws UninitilizedClientException;
}
30 changes: 15 additions & 15 deletions src/main/java/com/aserto/directory/v3/DirectoryClientReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@
import java.util.List;

public interface DirectoryClientReader {
GetObjectResponse getObject(String type, String id);
GetObjectResponse getObject(String type, String id, boolean withRelations);
GetObjectsResponse getObjects(String type);
GetObjectsResponse getObjects(String type, int pageSize, String pageToken);
GetObjectManyResponse getObjectManyRequest(List<ObjectIdentifier> objectIdentifiers);
GetObjectResponse getObject(String type, String id) throws UninitilizedClientException;
GetObjectResponse getObject(String type, String id, boolean withRelations) throws UninitilizedClientException;
GetObjectsResponse getObjects(String type) throws UninitilizedClientException;
GetObjectsResponse getObjects(String type, int pageSize, String pageToken) throws UninitilizedClientException;
GetObjectManyResponse getObjectManyRequest(List<ObjectIdentifier> objectIdentifiers) throws UninitilizedClientException;
GetRelationResponse getRelation(String objectType, String objectId, String relationName,
String subjectType, String subjectId);
String subjectType, String subjectId) throws UninitilizedClientException;
GetRelationResponse getRelation(String objectType, String objectId, String relationName, String subjectType,
String subjectId, String subjectRelation);
String subjectId, String subjectRelation) throws UninitilizedClientException;
GetRelationResponse getRelation(String objectType, String objectId, String relationName, String subjectType,
String subjectId, String subjectRelation, boolean withObjects);
GetRelationsResponse getRelations(GetRelationsRequest relationsRequest);
String subjectId, String subjectRelation, boolean withObjects) throws UninitilizedClientException;
GetRelationsResponse getRelations(GetRelationsRequest relationsRequest) throws UninitilizedClientException;

CheckPermissionResponse checkPermission(String objectType, String objectId, String subjectType,
String subjectId, String permissionName);
String subjectId, String permissionName) throws UninitilizedClientException;
CheckPermissionResponse checkPermission(String objectType, String objectId,
String subjectType, String subjectId, String permissionName, boolean trace);
CheckRelationResponse checkRelation(String objectType, String objectId, String relationName, String subjectType, String subjectId);
String subjectType, String subjectId, String permissionName, boolean trace) throws UninitilizedClientException;
CheckRelationResponse checkRelation(String objectType, String objectId, String relationName, String subjectType, String subjectId) throws UninitilizedClientException;
CheckRelationResponse checkRelation(String objectType, String objectId, String relationName,
String subjectType, String subjectId, boolean trace);
CheckResponse check(String objectType, String objectId, String relationName, String subjectType, String subjectId);
String subjectType, String subjectId, boolean trace) throws UninitilizedClientException;
CheckResponse check(String objectType, String objectId, String relationName, String subjectType, String subjectId) throws UninitilizedClientException;
CheckResponse check(String objectType, String objectId, String relationName,
String subjectType, String subjectId, boolean trace);
String subjectType, String subjectId, boolean trace) throws UninitilizedClientException;
GetGraphResponse getGraph(GetGraphRequest getGraphRequest);
}
18 changes: 9 additions & 9 deletions src/main/java/com/aserto/directory/v3/DirectoryClientWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
import com.google.protobuf.Struct;

public interface DirectoryClientWriter {
public SetObjectResponse setObject(String type, String id);
public SetObjectResponse setObject(String type, String id, String displayName, Struct properties, String hash);
public DeleteObjectResponse deleteObject(String type, String id);
public DeleteObjectResponse deleteObject(String type, String id, boolean withRelations);
public SetObjectResponse setObject(String type, String id) throws UninitilizedClientException;
public SetObjectResponse setObject(String type, String id, String displayName, Struct properties, String hash) throws UninitilizedClientException;
public DeleteObjectResponse deleteObject(String type, String id) throws UninitilizedClientException;
public DeleteObjectResponse deleteObject(String type, String id, boolean withRelations) throws UninitilizedClientException;
public SetRelationResponse setRelation(String objectType, String objectId, String relationName,
String subjectType, String subjectId);
String subjectType, String subjectId) throws UninitilizedClientException;
public SetRelationResponse setRelation(String objectType, String objectId, String relationName,
String subjectType, String subjectId, String subjectRelation);
String subjectType, String subjectId, String subjectRelation) throws UninitilizedClientException;
public SetRelationResponse setRelation(String objectType, String objectId, String relationName,
String subjectType, String subjectId, String subjectRelation, String hash);
String subjectType, String subjectId, String subjectRelation, String hash) throws UninitilizedClientException;
public DeleteRelationResponse deleteRelation(String objectType, String objectId, String relationName,
String subjectType, String subjectId);
String subjectType, String subjectId) throws UninitilizedClientException;
public DeleteRelationResponse deleteRelation(String objectType, String objectId, String relationName,
String subjectType, String subjectId, String subjectRelation);
String subjectType, String subjectId, String subjectRelation) throws UninitilizedClientException;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.aserto.directory.v3;

public class UninitilizedClientException extends Exception {
public UninitilizedClientException(String message) {
super(message);
}
}
58 changes: 0 additions & 58 deletions src/test/java/DirectoryClientBuilderTest.java

This file was deleted.

Loading

0 comments on commit 29a8c04

Please sign in to comment.