Skip to content

Commit

Permalink
imports and formating
Browse files Browse the repository at this point in the history
  • Loading branch information
radoslav-tomov authored Oct 16, 2023
1 parent eb9bb25 commit d6b4a40
Show file tree
Hide file tree
Showing 41 changed files with 554 additions and 523 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/*
* Copyright 2013-2021 the original author or authors.
* Copyright 2013-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

package org.cloudfoundry.reactor.client.v3.securitygroups;
Expand Down Expand Up @@ -46,117 +44,108 @@
/**
* The Reactor-based implementation of {@link ServiceBindingsV3}
*/
public final class ReactorSecurityGroupsV3 extends AbstractClientV3Operations implements SecurityGroupsV3 {
public final class ReactorSecurityGroupsV3 extends AbstractClientV3Operations
implements SecurityGroupsV3 {

/**
* Creates an instance
*
* @param connectionContext the {@link ConnectionContext} to use when
* communicating with the server
* @param root the root URI of the server. Typically something like
* {@code https://api.run.pivotal.io}.
* @param tokenProvider the {@link TokenProvider} to use when communicating
* with the server
* @param requestTags map with custom http headers which will be added to
* web request
* @param connectionContext the {@link ConnectionContext} to use when communicating with the
* server
* @param root the root URI of the server. Typically something like
* {@code https://api.run.pivotal.io}.
* @param tokenProvider the {@link TokenProvider} to use when communicating with the server
* @param requestTags map with custom http headers which will be added to web request
*/
public ReactorSecurityGroupsV3(ConnectionContext connectionContext, Mono<String> root,
TokenProvider tokenProvider,
Map<String, String> requestTags) {
TokenProvider tokenProvider, Map<String, String> requestTags) {
super(connectionContext, root, tokenProvider, requestTags);
}

@Override
public Mono<CreateSecurityGroupResponse> create(CreateSecurityGroupRequest request) {
return post(request, CreateSecurityGroupResponse.class,
builder -> builder.pathSegment("security_groups"))
.checkpoint();
builder -> builder.pathSegment("security_groups")).checkpoint();

}

@Override
public Mono<GetSecurityGroupResponse> get(GetSecurityGroupRequest request) {
return get(request, GetSecurityGroupResponse.class,
builder -> builder.pathSegment("security_groups", request.getSecurityGroupId()))
.checkpoint();
return get(request, GetSecurityGroupResponse.class, builder -> builder
.pathSegment("security_groups", request.getSecurityGroupId()))
.checkpoint();

}

@Override
public Mono<ListSecurityGroupsResponse> list(ListSecurityGroupsRequest request) {
return get(request, ListSecurityGroupsResponse.class,
builder -> builder.pathSegment("security_groups"))
.checkpoint();
builder -> builder.pathSegment("security_groups")).checkpoint();
}

@Override
public Mono<UpdateSecurityGroupResponse> update(UpdateSecurityGroupRequest request) {
return patch(request, UpdateSecurityGroupResponse.class,
builder -> builder.pathSegment("security_groups", request.getSecurityGroupId()))
.checkpoint();
return patch(request, UpdateSecurityGroupResponse.class, builder -> builder
.pathSegment("security_groups", request.getSecurityGroupId()))
.checkpoint();
}

@Override
public Mono<String> delete(DeleteSecurityGroupRequest request) {
return delete(request,
builder -> builder.pathSegment("security_groups", request.getSecurityGroupId()))
.checkpoint();
return delete(request, builder -> builder.pathSegment("security_groups",
request.getSecurityGroupId())).checkpoint();

}

@Override
public Mono<BindRunningSecurityGroupResponse> bindRunningSecurityGroup(
BindRunningSecurityGroupRequest request) {
return post(request, BindRunningSecurityGroupResponse.class,
builder -> builder.pathSegment("security_groups", request.getSecurityGroupId(),
"relationships",
"running_spaces"))
.checkpoint();
builder -> builder.pathSegment("security_groups",
request.getSecurityGroupId(), "relationships",
"running_spaces")).checkpoint();
}

@Override
public Mono<BindStagingSecurityGroupResponse> bindStagingSecurityGroup(
BindStagingSecurityGroupRequest request) {
return post(request, BindStagingSecurityGroupResponse.class,
builder -> builder.pathSegment("security_groups", request.getSecurityGroupId(),
"relationships",
"staging_spaces"))
.checkpoint();
builder -> builder.pathSegment("security_groups",
request.getSecurityGroupId(), "relationships",
"staging_spaces")).checkpoint();
}

@Override
public Mono<Void> unbindStagingSecurityGroup(
UnbindStagingSecurityGroupRequest request) {
public Mono<Void> unbindStagingSecurityGroup(UnbindStagingSecurityGroupRequest request) {
return delete(request, Void.class,
builder -> builder.pathSegment("security_groups", request.getSecurityGroupId(),
"relationships",
builder -> builder.pathSegment("security_groups",
request.getSecurityGroupId(), "relationships",
"staging_spaces", request.getSpaceId()))
.checkpoint();
.checkpoint();
}

@Override
public Mono<Void> unbindRunningSecurityGroup(
UnbindRunningSecurityGroupRequest request) {
public Mono<Void> unbindRunningSecurityGroup(UnbindRunningSecurityGroupRequest request) {
return delete(request, Void.class,
builder -> builder.pathSegment("security_groups", request.getSecurityGroupId(),
"relationships",
builder -> builder.pathSegment("security_groups",
request.getSecurityGroupId(), "relationships",
"running_spaces", request.getSpaceId()))
.checkpoint();
.checkpoint();
}

@Override
public Mono<ListRunningSecurityGroupsResponse> listRunning(ListRunningSecurityGroupsRequest request) {
public Mono<ListRunningSecurityGroupsResponse> listRunning(
ListRunningSecurityGroupsRequest request) {
return get(request, ListRunningSecurityGroupsResponse.class,
builder -> builder.pathSegment("spaces", request.getSpaceId(),
"running_security_groups"))
.checkpoint();
"running_security_groups")).checkpoint();
}

@Override
public Mono<ListStagingSecurityGroupsResponse> listStaging(ListStagingSecurityGroupsRequest request) {
public Mono<ListStagingSecurityGroupsResponse> listStaging(
ListStagingSecurityGroupsRequest request) {
return get(request, ListStagingSecurityGroupsResponse.class,
builder -> builder.pathSegment("spaces", request.getSpaceId(),
"staging_security_groups"))
.checkpoint();
"staging_security_groups")).checkpoint();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
import java.util.Collections;

import static io.netty.handler.codec.http.HttpMethod.GET;
import static io.netty.handler.codec.http.HttpMethod.DELETE;;
import static io.netty.handler.codec.http.HttpMethod.DELETE;
import static io.netty.handler.codec.http.HttpMethod.PATCH;
import static io.netty.handler.codec.http.HttpMethod.POST;
import static io.netty.handler.codec.http.HttpResponseStatus.CREATED;
import static io.netty.handler.codec.http.HttpResponseStatus.OK;
import static io.netty.handler.codec.http.HttpResponseStatus.ACCEPTED;
import static io.netty.handler.codec.http.HttpResponseStatus.NO_CONTENT;;
import static io.netty.handler.codec.http.HttpResponseStatus.NO_CONTENT;

public final class ReactorSecurityGroupsV3Test extends AbstractClientApiTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
/*
* Copyright 2013-2021 the original author or authors.
* Copyright 2013-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

package org.cloudfoundry.client.v3.securitygroups;

import java.util.List;

import org.cloudfoundry.client.v3.Relationship;
import org.cloudfoundry.client.v3.ToManyRelationship;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
/*
* Copyright 2013-2021 the original author or authors.
* Copyright 2013-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

package org.cloudfoundry.client.v3.securitygroups;

import java.util.List;
import java.util.Map;

import org.cloudfoundry.AllowNulls;
import org.cloudfoundry.Nullable;
import org.cloudfoundry.client.v3.Link;
import org.cloudfoundry.client.v3.Relationship;
import org.cloudfoundry.client.v3.ToManyRelationship;


import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
Expand All @@ -32,8 +28,8 @@
public abstract class AbstractBindSecurityGroupResponse {

/**
* A relationship to the spaces where the security_group is applied to
* applications during runtime
* A relationship to the spaces where the security_group is applied to applications during
* runtime
*/
@JsonProperty("data")
abstract List<Relationship> getBoundSpaces();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
/*
* Copyright 2013-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.cloudfoundry.client.v3.securitygroups;

import java.util.List;

import org.cloudfoundry.Nullable;
import org.cloudfoundry.client.v2.PaginatedRequest;
import org.cloudfoundry.client.v3.FilterParameter;

import com.fasterxml.jackson.annotation.JsonIgnore;

public abstract class AbstractListSecurityGroupRequest extends PaginatedRequest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/*
* Copyright 2013-2021 the original author or authors.
* Copyright 2013-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

package org.cloudfoundry.client.v3.securitygroups;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/*
* Copyright 2013-2021 the original author or authors.
* Copyright 2013-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

package org.cloudfoundry.client.v3.securitygroups;
Expand All @@ -20,7 +18,7 @@
import com.fasterxml.jackson.annotation.JsonValue;

/**
* The protocol of a {@link RuleEntity}
* The protocol of a Security Group
*/
public enum Protocol {

Expand Down
Loading

0 comments on commit d6b4a40

Please sign in to comment.