forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate pulsar client API interfaces in different module (apache#3309)
* Separate pulsar client API interfaces in different module * Added provided protobuf dep * Fixed build and tests * Fixed import name * Fixed AuthenticationTls class name * Fixed AutoProduceSchema name
- Loading branch information
Showing
70 changed files
with
663 additions
and
347 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
79 changes: 0 additions & 79 deletions
79
...base/pulsar-client-1x/src/test/java/org/apache/pulsar/client/impl/MessageBuilderTest.java
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
96 changes: 96 additions & 0 deletions
96
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/AuthenticationFactory.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,96 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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.apache.pulsar.client.api; | ||
|
||
import java.util.Map; | ||
import java.util.function.Supplier; | ||
|
||
import org.apache.pulsar.client.api.PulsarClientException.UnsupportedAuthenticationException; | ||
import org.apache.pulsar.client.internal.DefaultImplementation; | ||
|
||
public final class AuthenticationFactory { | ||
|
||
/** | ||
* Create an authentication provider for token based authentication. | ||
* | ||
* @param token | ||
* the client auth token | ||
*/ | ||
public static Authentication token(String token) { | ||
return DefaultImplementation.newAuthenticationToken(token); | ||
} | ||
|
||
/** | ||
* Create an authentication provider for token based authentication. | ||
* | ||
* @param tokenSupplier | ||
* a supplier of the client auth token | ||
*/ | ||
public static Authentication token(Supplier<String> tokenSupplier) { | ||
return DefaultImplementation.newAuthenticationToken(tokenSupplier); | ||
} | ||
|
||
/** | ||
* Create an authentication provider for TLS based authentication. | ||
* | ||
* @param certFilePath | ||
* the path to the TLS client public key | ||
* @param keyFilePath | ||
* the path to the TLS client private key | ||
*/ | ||
public static Authentication TLS(String certFilePath, String keyFilePath) { | ||
return DefaultImplementation.newAuthenticationTLS(certFilePath, keyFilePath); | ||
} | ||
|
||
/** | ||
* Create an instance of the Authentication-Plugin | ||
* | ||
* @param authPluginClassName | ||
* name of the Authentication-Plugin you want to use | ||
* @param authParamsString | ||
* string which represents parameters for the Authentication-Plugin, e.g., "key1:val1,key2:val2" | ||
* @return instance of the Authentication-Plugin | ||
* @throws UnsupportedAuthenticationException | ||
*/ | ||
public static Authentication create(String authPluginClassName, String authParamsString) | ||
throws UnsupportedAuthenticationException { | ||
try { | ||
return DefaultImplementation.createAuthentication(authPluginClassName, authParamsString); | ||
} catch (Throwable t) { | ||
throw new UnsupportedAuthenticationException(t); | ||
} | ||
} | ||
|
||
/** | ||
* Create an instance of the Authentication-Plugin | ||
* | ||
* @param authPluginClassName name of the Authentication-Plugin you want to use | ||
* @param authParams map which represents parameters for the Authentication-Plugin | ||
* @return instance of the Authentication-Plugin | ||
* @throws UnsupportedAuthenticationException | ||
*/ | ||
public static final Authentication create(String authPluginClassName, Map<String, String> authParams) | ||
throws UnsupportedAuthenticationException { | ||
try { | ||
return DefaultImplementation.createAuthentication(authPluginClassName, authParams); | ||
} catch (Throwable t) { | ||
throw new UnsupportedAuthenticationException(t); | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.