Skip to content

Commit

Permalink
feat: add unlink installation command
Browse files Browse the repository at this point in the history
  • Loading branch information
gcusnieux committed Dec 21, 2023
1 parent c9edfe7 commit 36d1418
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<groupId>io.gravitee.cockpit</groupId>
<artifactId>gravitee-cockpit-api</artifactId>
<version>2.4.0</version>
<version>2.5.0-feat-add-unlink-SNAPSHOT</version>

<name>Gravitee.io - Cockpit - API</name>

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/io/gravitee/cockpit/api/command/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import io.gravitee.cockpit.api.command.healthcheck.HealthCheckCommand;
import io.gravitee.cockpit.api.command.hello.HelloCommand;
import io.gravitee.cockpit.api.command.installation.InstallationCommand;
import io.gravitee.cockpit.api.command.installation.UnlinkInstallationCommand;
import io.gravitee.cockpit.api.command.membership.DeleteMembershipCommand;
import io.gravitee.cockpit.api.command.membership.MembershipCommand;
import io.gravitee.cockpit.api.command.monitoring.MonitoringCommand;
Expand Down Expand Up @@ -74,6 +75,10 @@
value = InstallationCommand.class,
name = "INSTALLATION_COMMAND"
),
@JsonSubTypes.Type(
value = UnlinkInstallationCommand.class,
name = "UNLINK_INSTALLATION_COMMAND"
),
@JsonSubTypes.Type(value = HelloCommand.class, name = "HELLO_COMMAND"),
@JsonSubTypes.Type(value = GoodbyeCommand.class, name = "GOODBYE_COMMAND"),
@JsonSubTypes.Type(value = EchoCommand.class, name = "ECHO_COMMAND"),
Expand Down Expand Up @@ -131,6 +136,7 @@ public enum Type {
MEMBERSHIP_COMMAND,
DELETE_MEMBERSHIP_COMMAND,
INSTALLATION_COMMAND,
UNLINK_INSTALLATION_COMMAND,
ECHO_COMMAND,
NODE_COMMAND,
HEALTHCHECK_COMMAND,
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/io/gravitee/cockpit/api/command/Reply.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import io.gravitee.cockpit.api.command.hello.HelloReply;
import io.gravitee.cockpit.api.command.ignored.IgnoredReply;
import io.gravitee.cockpit.api.command.installation.InstallationReply;
import io.gravitee.cockpit.api.command.installation.UnlinkInstallationReply;
import io.gravitee.cockpit.api.command.membership.DeleteMembershipReply;
import io.gravitee.cockpit.api.command.membership.MembershipReply;
import io.gravitee.cockpit.api.command.monitoring.MonitoringReply;
Expand Down Expand Up @@ -74,6 +75,10 @@
value = InstallationReply.class,
name = "INSTALLATION_REPLY"
),
@JsonSubTypes.Type(
value = UnlinkInstallationReply.class,
name = "UNLINK_INSTALLATION_REPLY"
),
@JsonSubTypes.Type(value = HelloReply.class, name = "HELLO_REPLY"),
@JsonSubTypes.Type(value = GoodbyeReply.class, name = "GOODBYE_REPLY"),
@JsonSubTypes.Type(value = EchoReply.class, name = "ECHO_REPLY"),
Expand Down Expand Up @@ -127,6 +132,7 @@ public enum Type {
MEMBERSHIP_REPLY,
DELETE_MEMBERSHIP_REPLY,
INSTALLATION_REPLY,
UNLINK_INSTALLATION_REPLY,
ECHO_REPLY,
NODE_REPLY,
HEALTHCHECK_REPLY,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright © 2015 The Gravitee team (http://gravitee.io)
*
* 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 io.gravitee.cockpit.api.command.installation;

import io.gravitee.cockpit.api.command.Command;

/**
* @author GraviteeSource Team
*/
public class UnlinkInstallationCommand
extends Command<UnlinkInstallationPayload> {

public UnlinkInstallationCommand() {
super(Type.UNLINK_INSTALLATION_COMMAND);
}

public UnlinkInstallationCommand(UnlinkInstallationPayload payload) {
this();
this.payload = payload;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright © 2015 The Gravitee team (http://gravitee.io)
*
* 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 io.gravitee.cockpit.api.command.installation;

import io.gravitee.cockpit.api.command.Payload;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@NoArgsConstructor
@Getter
@Setter
public class UnlinkInstallationPayload implements Payload {

private String environmentCockpitId;

private String organizationCockpitId;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright © 2015 The Gravitee team (http://gravitee.io)
*
* 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 io.gravitee.cockpit.api.command.installation;

import io.gravitee.cockpit.api.command.CommandStatus;
import io.gravitee.cockpit.api.command.Reply;

public class UnlinkInstallationReply extends Reply {

public UnlinkInstallationReply() {
this(null, null);
}

public UnlinkInstallationReply(
String commandId,
CommandStatus commandStatus
) {
super(Type.UNLINK_INSTALLATION_REPLY, commandId, commandStatus);
}
}

0 comments on commit 36d1418

Please sign in to comment.