Skip to content

Commit 0a30f77

Browse files
committed
DefaultApplications: remove unused methods
1 parent 00f99c9 commit 0a30f77

File tree

2 files changed

+3
-79
lines changed

2 files changed

+3
-79
lines changed

cloudfoundry-operations/src/main/java/org/cloudfoundry/operations/applications/DefaultApplications.java

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@
160160
import org.cloudfoundry.util.DelayTimeoutException;
161161
import org.cloudfoundry.util.ExceptionUtils;
162162
import org.cloudfoundry.util.FileUtils;
163-
import org.cloudfoundry.util.FluentMap;
164163
import org.cloudfoundry.util.JobUtils;
165164
import org.cloudfoundry.util.PaginationUtils;
166165
import org.cloudfoundry.util.ResourceMatchingUtils;
@@ -280,9 +279,7 @@ public Mono<Void> copySource(CopySourceApplicationRequest request) {
280279
@Override
281280
public Mono<Void> delete(DeleteApplicationRequest request) {
282281
return getRoutesAndApplicationId(
283-
request,
284-
spaceId,
285-
Optional.ofNullable(request.getDeleteRoutes()).orElse(false))
282+
request, Optional.ofNullable(request.getDeleteRoutes()).orElse(false))
286283
.flatMap(
287284
function(
288285
(routes, applicationId) ->
@@ -710,14 +707,6 @@ private Mono<Boolean> getSshEnabled(String applicationId) {
710707
.map(GetApplicationSshEnabledResponse::getEnabled);
711708
}
712709

713-
private static Map<String, Object> addToEnvironment(
714-
Map<String, Object> environment, String variableName, Object variableValue) {
715-
return FluentMap.<String, Object>builder()
716-
.entries(environment)
717-
.entry(variableName, variableValue)
718-
.build();
719-
}
720-
721710
private Mono<Void> applyDropletAndWaitForRunning(
722711
String appname, String appId, String dropletId) {
723712
return this.cloudFoundryClient
@@ -987,7 +976,7 @@ private static String eventDescription(Map<String, Object> request, String... en
987976
sb.append(", ");
988977
}
989978
first = false;
990-
sb.append(entryName).append(": ").append(String.valueOf(value));
979+
sb.append(entryName).append(": ").append(value);
991980
}
992981
return sb.toString();
993982
}
@@ -1175,10 +1164,6 @@ private static String[] getEntryNames(String type) {
11751164
return type.contains("crash") ? ENTRY_FIELDS_CRASH : ENTRY_FIELDS_NORMAL;
11761165
}
11771166

1178-
private static Map<String, Object> getEnvironment(AbstractApplicationResource resource) {
1179-
return ResourceUtils.getEntity(resource).getEnvironmentJsons();
1180-
}
1181-
11821167
private static int getInstances(AbstractApplicationResource resource) {
11831168
return Optional.ofNullable(resource.getEntity())
11841169
.map(ApplicationEntity::getInstances)
@@ -1362,8 +1347,7 @@ private Mono<List<org.cloudfoundry.client.v2.routes.Route>> getRoutes(String app
13621347
}
13631348

13641349
private Mono<Tuple2<Optional<List<org.cloudfoundry.client.v2.routes.Route>>, String>>
1365-
getRoutesAndApplicationId(
1366-
DeleteApplicationRequest request, String spaceId, boolean deleteRoutes) {
1350+
getRoutesAndApplicationId(DeleteApplicationRequest request, boolean deleteRoutes) {
13671351
return getApplicationId(request.getName())
13681352
.flatMap(
13691353
applicationId ->
@@ -1607,13 +1591,6 @@ private Flux<Void> pushDocker(
16071591
applicationId, manifest.getName(), request));
16081592
}
16091593

1610-
private static Map<String, Object> removeFromEnvironment(
1611-
Map<String, Object> environment, String variableName) {
1612-
Map<String, Object> modified = new HashMap<>(environment);
1613-
modified.remove(variableName);
1614-
return modified;
1615-
}
1616-
16171594
private Mono<Void> removeServiceBindings(String applicationId) {
16181595
return requestListServiceBindings(applicationId)
16191596
.map(ResourceUtils::getId)
@@ -2191,17 +2168,6 @@ private Mono<UpdateApplicationEnvironmentVariablesResponse> requestUnsetEnvironm
21912168
.build());
21922169
}
21932170

2194-
private Mono<AbstractApplicationResource> requestUpdateApplicationHealthCheckType(
2195-
String applicationId, ApplicationHealthCheck type) {
2196-
return requestUpdateApplication(
2197-
applicationId, builder -> builder.healthCheckType(type.getValue()));
2198-
}
2199-
2200-
private Mono<AbstractApplicationResource> requestUpdateApplicationName(
2201-
String applicationId, String name) {
2202-
return requestUpdateApplication(applicationId, builder -> builder.name(name));
2203-
}
2204-
22052171
private Mono<ApplicationFeature> requestUpdateApplicationSsh(
22062172
String applicationId, boolean enabled) {
22072173
return requestUpdateApplicationFeature(
@@ -2228,11 +2194,6 @@ private Mono<AbstractApplicationResource> requestUpdateApplicationScale(
22282194
builder -> builder.diskQuota(disk).instances(instances).memory(memory));
22292195
}
22302196

2231-
private Mono<AbstractApplicationResource> requestUpdateApplicationSsh(
2232-
String applicationId, Boolean enabled) {
2233-
return requestUpdateApplication(applicationId, builder -> builder.enableSsh(enabled));
2234-
}
2235-
22362197
private Mono<AbstractApplicationResource> requestUpdateApplicationState(
22372198
String applicationId, String state) {
22382199
return requestUpdateApplication(applicationId, builder -> builder.state(state));

cloudfoundry-operations/src/test/java/org/cloudfoundry/operations/applications/DefaultApplicationsTest.java

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4783,43 +4783,6 @@ private static void requestApplicationProcesses(
47834783
.build()));
47844784
}
47854785

4786-
private static void requestApplicationsWithSsh(
4787-
CloudFoundryClient cloudFoundryClient,
4788-
String application,
4789-
String spaceId,
4790-
Boolean sshEnabled) {
4791-
when(cloudFoundryClient
4792-
.spaces()
4793-
.listApplications(
4794-
ListSpaceApplicationsRequest.builder()
4795-
.name(application)
4796-
.spaceId(spaceId)
4797-
.page(1)
4798-
.build()))
4799-
.thenReturn(
4800-
Mono.just(
4801-
fill(ListSpaceApplicationsResponse.builder())
4802-
.resource(
4803-
ApplicationResource.builder()
4804-
.metadata(
4805-
fill(Metadata.builder())
4806-
.id("test-application-id")
4807-
.build())
4808-
.entity(
4809-
fill(
4810-
ApplicationEntity
4811-
.builder(),
4812-
"application-")
4813-
.environmentJson(
4814-
"test-var",
4815-
"test-value")
4816-
.enableSsh(sshEnabled)
4817-
.build())
4818-
.build())
4819-
.totalPages(1)
4820-
.build()));
4821-
}
4822-
48234786
private static void requestAssociateRoute(
48244787
CloudFoundryClient cloudFoundryClient, String applicationId, String routeId) {
48254788
when(cloudFoundryClient

0 commit comments

Comments
 (0)