Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed "Traffik til IO" #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
public class FlowStoreServiceConstants {
public static final String FLOWS = "flows";
public static final String FLOW_BINDERS = "binders";
public static final String FLOW_COMPONENTS = "components";
public static final String SUBMITTERS = "submitters";
public static final String SINKS = "sinks";

Expand Down Expand Up @@ -42,9 +41,6 @@ public class FlowStoreServiceConstants {
public static final String HARVESTER_CONFIGS_TYPE_ENABLED = "harvester-configs/types/{type}/enabled";
public static final String HARVESTER_CONFIG = "harvester-configs/{id}";

public static final String GATEKEEPER_DESTINATIONS = "gatekeeper/destinations";
public static final String GATEKEEPER_DESTINATION = "gatekeeper/destinations/{id}";

private FlowStoreServiceConstants() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import dk.dbc.dataio.commons.types.FlowContent;
import dk.dbc.dataio.commons.types.FlowStoreError;
import dk.dbc.dataio.commons.types.FlowView;
import dk.dbc.dataio.commons.types.GatekeeperDestination;
import dk.dbc.dataio.commons.types.Sink;
import dk.dbc.dataio.commons.types.SinkContent;
import dk.dbc.dataio.commons.types.Submitter;
Expand Down Expand Up @@ -854,120 +853,6 @@ public List<FlowBinder> queryFlowBinders(String query) throws FlowStoreServiceCo
}
}

// ************************************************** GatekeeperDestinations *****************************************

/**
* persists the given GatekeeperDestination
*
* @param gatekeeperDestination to persist
* @return GatekeeperDestination
* @throws NullPointerException if given null-valued argument
* @throws ProcessingException on general communication error
* @throws FlowStoreServiceConnectorUnexpectedStatusCodeException if gatekeeperDestination creation failed due to invalid input data
* @throws FlowStoreServiceConnectorException on general failure to create gatekeeperDestination
*/
public GatekeeperDestination createGatekeeperDestination(GatekeeperDestination gatekeeperDestination) throws FlowStoreServiceConnectorException {
final StopWatch stopWatch = new StopWatch();
try {
InvariantUtil.checkNotNullOrThrow(gatekeeperDestination, "gatekeeperDestination");
log.trace("FlowStoreServiceConnector: createGatekeeperDestination({}, {}, {}, {})",
gatekeeperDestination.getSubmitterNumber(),
gatekeeperDestination.getDestination(),
gatekeeperDestination.getPackaging(),
gatekeeperDestination.getFormat());
try (Response response = new HttpPost(failSafeHttpClient)
.withBaseUrl(baseUrl)
.withPathElements(FlowStoreServiceConstants.GATEKEEPER_DESTINATIONS)
.withJsonData(gatekeeperDestination)
.execute()) {
verifyResponseStatus(response, Response.Status.CREATED);
return readResponseEntity(response, GatekeeperDestination.class);
}
} finally {
log.debug("FlowStoreServiceConnector: createGatekeeperDestination took {} milliseconds", stopWatch.getElapsedTime());
}
}

/**
* Retrieves all gatekeeperDestinations from the flow-store
*
* @return a list containing the gatekeeperDestinations found sorted by submitterNumber in ascending order
* @throws ProcessingException on general communication error
* @throws FlowStoreServiceConnectorException on failure to retrieve gatekeeperDestinations
*/
public List<GatekeeperDestination> findAllGatekeeperDestinations() throws ProcessingException, FlowStoreServiceConnectorException {
final StopWatch stopWatch = new StopWatch();
try {
log.trace("FlowStoreServiceConnector: findAllGatekeeperDestinations();");
try (Response response = new HttpGet(failSafeHttpClient)
.withBaseUrl(baseUrl)
.withPathElements(FlowStoreServiceConstants.GATEKEEPER_DESTINATIONS)
.execute()) {
verifyResponseStatus(response, Response.Status.OK);
return readResponseGenericTypeEntity(response, new GenericType<List<GatekeeperDestination>>() {
});
}
} finally {
log.debug("FlowStoreServiceConnector: findAllGatekeeperDestinations took {} milliseconds", stopWatch.getElapsedTime());
}
}

/**
* Deletes an existing gatekeeperDestination from the flow-store
*
* @param id, the database related ID
* @throws ProcessingException on general communication error
* @throws FlowStoreServiceConnectorUnexpectedStatusCodeException if an unexpected HTTP code is returned
*/
public void deleteGatekeeperDestination(long id) throws ProcessingException, FlowStoreServiceConnectorUnexpectedStatusCodeException {
final StopWatch stopWatch = new StopWatch();
try {
log.trace("FlowStoreServiceConnector: deleteGatekeeperDestination({})", id);
final PathBuilder pathBuilder = new PathBuilder(FlowStoreServiceConstants.GATEKEEPER_DESTINATION)
.bind(FlowStoreServiceConstants.ID_VARIABLE, Long.toString(id));

try (Response response = new HttpDelete(failSafeHttpClient)
.withBaseUrl(baseUrl)
.withPathElements(pathBuilder.build())
.execute()) {
verifyResponseStatus(response, NO_CONTENT);
}
} finally {
log.debug("FlowStoreServiceConnector: deleteGatekeeperDestination took {} milliseconds", stopWatch.getElapsedTime());
}
}

/**
* Updates an existing gatekeeper destination from the flow-store
*
* @param gatekeeperDestination containing the updated values
* @return the updated gatekeeperDestination
* @throws ProcessingException on general communication error
* @throws FlowStoreServiceConnectorException on failure to update the gatekeeper destination
*/
public GatekeeperDestination updateGatekeeperDestination(GatekeeperDestination gatekeeperDestination) throws ProcessingException, FlowStoreServiceConnectorException {
final StopWatch stopWatch = new StopWatch();
try {
log.trace("FlowStoreServiceConnector: updateGatekeeperDestination()");
InvariantUtil.checkNotNullOrThrow(gatekeeperDestination, "gatekeeperDestination");

final PathBuilder path = new PathBuilder(FlowStoreServiceConstants.GATEKEEPER_DESTINATION)
.bind(FlowStoreServiceConstants.ID_VARIABLE, Long.toString(gatekeeperDestination.getId()));

try (Response response = new HttpPost(failSafeHttpClient)
.withBaseUrl(baseUrl)
.withPathElements(path.build())
.withJsonData(gatekeeperDestination)
.execute()) {
verifyResponseStatus(response, Response.Status.OK);
return readResponseEntity(response, GatekeeperDestination.class);
}
} finally {
log.debug("FlowStoreServiceConnector: updateGatekeeperDestination took {} milliseconds", stopWatch.getElapsedTime());
}
}


// ************************************************** HarvesterConfig *********************************************

/**
Expand Down

This file was deleted.

This file was deleted.

Loading