-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SLCORE-818 split assist connection parameters for SQ and SC
- Loading branch information
1 parent
55b6d06
commit b3af88c
Showing
7 changed files
with
217 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...nt/core/rpc/protocol/adapter/EitherAssistSonarQubeSonarCloudConnectionAdapterFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* SonarLint Core - RPC Protocol | ||
* Copyright (C) 2016-2024 SonarSource SA | ||
* mailto:info AT sonarsource DOT com | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package org.sonarsource.sonarlint.core.rpc.protocol.adapter; | ||
|
||
import com.google.gson.reflect.TypeToken; | ||
import org.eclipse.lsp4j.jsonrpc.json.adapters.EitherTypeAdapter; | ||
import org.sonarsource.sonarlint.core.rpc.protocol.client.connection.AssistSonarCloudConnection; | ||
import org.sonarsource.sonarlint.core.rpc.protocol.client.connection.AssistSonarQubeConnection; | ||
import org.sonarsource.sonarlint.core.rpc.protocol.common.Either; | ||
|
||
public class EitherAssistSonarQubeSonarCloudConnectionAdapterFactory extends CustomEitherAdapterFactory<AssistSonarQubeConnection, AssistSonarCloudConnection> { | ||
|
||
private static final TypeToken<Either<AssistSonarQubeConnection, AssistSonarCloudConnection>> ELEMENT_TYPE = new TypeToken<>() { | ||
}; | ||
|
||
public EitherAssistSonarQubeSonarCloudConnectionAdapterFactory() { | ||
super(ELEMENT_TYPE, AssistSonarQubeConnection.class, AssistSonarCloudConnection.class, new EitherTypeAdapter.PropertyChecker("organizationKey")); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...sonarsource/sonarlint/core/rpc/protocol/client/connection/AssistSonarCloudConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* SonarLint Core - RPC Protocol | ||
* Copyright (C) 2016-2024 SonarSource SA | ||
* mailto:info AT sonarsource DOT com | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package org.sonarsource.sonarlint.core.rpc.protocol.client.connection; | ||
|
||
import javax.annotation.CheckForNull; | ||
import javax.annotation.Nullable; | ||
|
||
public class AssistSonarCloudConnection { | ||
private final String serverUrl; | ||
private final String organizationKey; | ||
private final String tokenName; | ||
private final String tokenValue; | ||
|
||
public AssistSonarCloudConnection(String serverUrl, String organizationKey, @Nullable String tokenName, @Nullable String tokenValue) { | ||
this.serverUrl = serverUrl; | ||
this.organizationKey = organizationKey; | ||
this.tokenName = tokenName; | ||
this.tokenValue = tokenValue; | ||
} | ||
|
||
public String getServerUrl() { | ||
return serverUrl; | ||
} | ||
|
||
public String getOrganizationKey() { | ||
return organizationKey; | ||
} | ||
|
||
@CheckForNull | ||
public String getTokenName() { | ||
return tokenName; | ||
} | ||
|
||
@CheckForNull | ||
public String getTokenValue() { | ||
return tokenValue; | ||
} | ||
} |
Oops, something went wrong.