Skip to content

Commit a20eac1

Browse files
cleanup code
1 parent 47babd2 commit a20eac1

5 files changed

Lines changed: 2 additions & 446 deletions

File tree

src/main/java/org/databunker/DatabunkerproApi.java

Lines changed: 0 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.databunker.options.LegalBasisOptions;
1616

1717
import org.databunker.options.AgreementAcceptOptions;
18-
import org.databunker.options.ConnectorOptions;
1918
import org.databunker.options.TenantOptions;
2019
import org.databunker.options.ProcessingActivityOptions;
2120

@@ -803,139 +802,6 @@ public Map<String, Object> unlinkProcessingActivityFromLegalBasis(String activit
803802
return makeRequest("ProcessingActivityUnlinkLegalBasis", data, requestMetadata);
804803
}
805804

806-
// Connector Management
807-
public Map<String, Object> listSupportedConnectors(Map<String, Object> requestMetadata) throws IOException {
808-
return makeRequest("ConnectorListSupportedConnectors", null, requestMetadata);
809-
}
810-
811-
public Map<String, Object> listConnectors(Map<String, Object> requestMetadata) throws IOException {
812-
return makeRequest("ConnectorListConnectors", null, requestMetadata);
813-
}
814-
815-
/**
816-
* Creates a connector with typed options
817-
*
818-
* @param options Typed options for connector creation
819-
* @param requestMetadata Optional request metadata
820-
* @return The created connector information
821-
* @throws IOException If an I/O error occurs
822-
*/
823-
public Map<String, Object> createConnector(ConnectorOptions options, Map<String, Object> requestMetadata) throws IOException {
824-
Map<String, Object> data = new HashMap<>();
825-
if (options != null) {
826-
data.putAll(OptionsConverter.toMap(options));
827-
}
828-
return makeRequest("ConnectorCreate", data, requestMetadata);
829-
}
830-
831-
/**
832-
* Updates a connector with typed options
833-
*
834-
* @param connectorid Connector ID
835-
* @param options Typed options for connector update
836-
* @param requestMetadata Optional request metadata
837-
* @return The updated connector information
838-
* @throws IOException If an I/O error occurs
839-
*/
840-
public Map<String, Object> updateConnector(String connectorid, ConnectorOptions options, Map<String, Object> requestMetadata) throws IOException {
841-
Map<String, Object> data = new HashMap<>();
842-
data.put("connectorid", Integer.parseInt(connectorid));
843-
if (options != null) {
844-
data.putAll(OptionsConverter.toMap(options));
845-
}
846-
return makeRequest("ConnectorUpdate", data, requestMetadata);
847-
}
848-
849-
/**
850-
* Validates connector connectivity with typed options
851-
*
852-
* @param connectorref Connector reference (ID or name)
853-
* @param options Typed options for connector validation (can be null)
854-
* @param requestMetadata Optional request metadata
855-
* @return The validation result
856-
* @throws IOException If an I/O error occurs
857-
*/
858-
public Map<String, Object> validateConnectorConnectivity(String connectorref, ConnectorOptions options, Map<String, Object> requestMetadata) throws IOException {
859-
Map<String, Object> data = new HashMap<>();
860-
if (options != null) {
861-
data.putAll(OptionsConverter.toMap(options));
862-
}
863-
if (connectorref.matches("\\d+")) {
864-
data.put("connectorid", Integer.parseInt(connectorref));
865-
} else {
866-
data.put("connectorname", connectorref);
867-
}
868-
return makeRequest("ConnectorValidateConnectivity", data, requestMetadata);
869-
}
870-
871-
public Map<String, Object> deleteConnector(String connectorref, Map<String, Object> requestMetadata) throws IOException {
872-
Map<String, Object> data = new HashMap<>();
873-
if (connectorref.matches("\\d+")) {
874-
data.put("connectorid", Integer.parseInt(connectorref));
875-
} else {
876-
data.put("connectorname", connectorref);
877-
}
878-
return makeRequest("ConnectorDelete", data, requestMetadata);
879-
}
880-
881-
/**
882-
* Gets table metadata with typed options
883-
*
884-
* @param connectorref Connector reference (ID or name)
885-
* @param options Typed options for getting table metadata
886-
* @param requestMetadata Optional request metadata
887-
* @return The table metadata
888-
* @throws IOException If an I/O error occurs
889-
*/
890-
public Map<String, Object> getTableMetadata(String connectorref, ConnectorOptions options, Map<String, Object> requestMetadata) throws IOException {
891-
Map<String, Object> data = new HashMap<>();
892-
if (options != null) {
893-
data.putAll(OptionsConverter.toMap(options));
894-
}
895-
if (connectorref.matches("\\d+")) {
896-
data.put("connectorid", Integer.parseInt(connectorref));
897-
} else {
898-
data.put("connectorname", connectorref);
899-
}
900-
return makeRequest("ConnectorGetTableMetaData", data, requestMetadata);
901-
}
902-
903-
public Map<String, Object> connectorGetUserData(String mode, String identity, String connectorref, Map<String, Object> requestMetadata) throws IOException {
904-
Map<String, Object> data = new HashMap<>();
905-
data.put("mode", mode);
906-
data.put("identity", identity);
907-
if (connectorref.matches("\\d+")) {
908-
data.put("connectorid", Integer.parseInt(connectorref));
909-
} else {
910-
data.put("connectorname", connectorref);
911-
}
912-
return makeRequest("ConnectorGetUserData", data, requestMetadata);
913-
}
914-
915-
public Map<String, Object> connectorGetUserExtraData(String mode, String identity, String connectorref, Map<String, Object> requestMetadata) throws IOException {
916-
Map<String, Object> data = new HashMap<>();
917-
data.put("mode", mode);
918-
data.put("identity", identity);
919-
if (connectorref.matches("\\d+")) {
920-
data.put("connectorid", Integer.parseInt(connectorref));
921-
} else {
922-
data.put("connectorname", connectorref);
923-
}
924-
return makeRequest("ConnectorGetUserExtraData", data, requestMetadata);
925-
}
926-
927-
public Map<String, Object> connectorDeleteUser(String mode, String identity, String connectorref, Map<String, Object> requestMetadata) throws IOException {
928-
Map<String, Object> data = new HashMap<>();
929-
data.put("mode", mode);
930-
data.put("identity", identity);
931-
if (connectorref.matches("\\d+")) {
932-
data.put("connectorid", Integer.parseInt(connectorref));
933-
} else {
934-
data.put("connectorname", connectorref);
935-
}
936-
return makeRequest("ConnectorDeleteUser", data, requestMetadata);
937-
}
938-
939805
// Group Management
940806
/**
941807
* Creates a group with typed options

src/main/java/org/databunker/examples/TypedOptionsExample.java

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import org.databunker.options.SharedRecordOptions;
77
import org.databunker.options.LegalBasisOptions;
88
import org.databunker.options.AgreementAcceptOptions;
9-
import org.databunker.options.ConnectorOptions;
109
import org.databunker.options.TenantOptions;
1110
import org.databunker.options.ProcessingActivityOptions;
1211
import org.databunker.options.GroupOptions;
@@ -103,25 +102,8 @@ public static void main(String[] args) {
103102

104103
Map<String, Object> agreement = api.acceptAgreement("email", "user@example.com", "marketing-consent", agreementOptions, null);
105104
System.out.println("Accepted agreement: " + agreement.get("status"));
106-
107-
// Example 7: Create connector with typed ConnectorOptions
108-
ConnectorOptions connectorOptions = ConnectorOptions.builder()
109-
.connectorname("my-connector")
110-
.connectortype("mysql")
111-
.apikey("api-key-123")
112-
.username("dbuser")
113-
.connectordesc("MySQL database connector")
114-
.dbhost("localhost")
115-
.dbport(3306)
116-
.dbname("mydb")
117-
.tablename("users")
118-
.status("active")
119-
.build();
120-
121-
Map<String, Object> connector = api.createConnector(connectorOptions, null);
122-
System.out.println("Created connector: " + connector.get("connectorid"));
123-
124-
// Example 8: Create processing activity with typed ProcessingActivityOptions
105+
106+
// Example 7: Create processing activity with typed ProcessingActivityOptions
125107
ProcessingActivityOptions activityOptions = ProcessingActivityOptions.builder()
126108
.activity("data-processing")
127109
.title("Data Processing Activity")

src/main/java/org/databunker/options/ConnectorOptions.java

Lines changed: 0 additions & 209 deletions
This file was deleted.

0 commit comments

Comments
 (0)