Skip to content

Commit

Permalink
Incorporate review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeshLK committed Jun 7, 2024
1 parent 425feb7 commit c7b2b96
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* A {@link ThreadFactory} object that creates new threads on demand for ASB admin network actions.
*/
public class AdminNetworkThreadFactory implements ThreadFactory {
private final String threadGroupName = "admin-network-thread";
private final String threadGroupName = "asb-admin-network-thread";

@Override
public Thread newThread(Runnable runnable) {
Expand Down
48 changes: 24 additions & 24 deletions native/src/main/java/org/ballerinax/asb/admin/Administrator.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static Object initializeAdministrator(BObject administratorClient, String
*/
public static Object createTopic(Environment env, BObject administratorClient, BString topicName,
BMap<BString, Object> topicProperties) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
TopicProperties topicProp;
Expand Down Expand Up @@ -140,7 +140,7 @@ public static Object createTopic(Environment env, BObject administratorClient, B
* @return topicProperties
*/
public static Object getTopic(Environment env, BObject administratorClient, BString topicName) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -174,7 +174,7 @@ public static Object getTopic(Environment env, BObject administratorClient, BStr
*/
public static Object updateTopic(Environment env, BObject administratorClient, BString topicName,
BMap<BString, Object> topicProperties) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -207,7 +207,7 @@ public static Object updateTopic(Environment env, BObject administratorClient, B
* @return topicProperties
*/
public static Object listTopics(Environment env, BObject administratorClient) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -255,7 +255,7 @@ private static BMap<BString, Object> constructTopicPropertiesArray(PagedIterable
* @return null
*/
public static Object deleteTopic(Environment env, BObject administratorClient, BString topicName) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -283,7 +283,7 @@ public static Object deleteTopic(Environment env, BObject administratorClient, B
* @return null
*/
public static Object topicExists(Environment env, BObject administratorClient, BString topicName) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -322,7 +322,7 @@ public static Object topicExists(Environment env, BObject administratorClient, B
public static Object createSubscription(Environment env, BObject administratorClient,
BString topicName, BString subscriptionName,
BMap<BString, Object> subscriptionProperties) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
SubscriptionProperties subscriptionProps;
Expand Down Expand Up @@ -360,7 +360,7 @@ public static Object createSubscription(Environment env, BObject administratorCl
*/
public static Object getSubscription(Environment env, BObject administratorClient, BString topicName,
BString subscriptionName) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -393,7 +393,7 @@ public static Object getSubscription(Environment env, BObject administratorClien
*/
public static Object updateSubscription(Environment env, BObject administratorClient, BString topicName,
BString subscriptionName, BMap<BString, Object> subscriptionProperties) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -430,7 +430,7 @@ public static Object updateSubscription(Environment env, BObject administratorCl
* @return subscriptionProperties
*/
public static Object listSubscriptions(Environment env, BObject administratorClient, BString topicName) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -483,7 +483,7 @@ private static BMap<BString, Object> constructSubscriptionPropertiesArray(
*/
public static Object deleteSubscription(Environment env, BObject administratorClient, BString topicName,
BString subscriptionName) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -513,7 +513,7 @@ public static Object deleteSubscription(Environment env, BObject administratorCl
*/
public static Object subscriptionExists(Environment env, BObject administratorClient, BString topicName,
BString subscriptionName) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -554,7 +554,7 @@ public static Object subscriptionExists(Environment env, BObject administratorCl
public static Object createRule(Environment env, BObject administratorClient,
BString topicName, BString subscriptionName, BString ruleName,
BMap<BString, Object> ruleProperties) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
RuleProperties ruleProp;
Expand Down Expand Up @@ -593,7 +593,7 @@ public static Object createRule(Environment env, BObject administratorClient,
*/
public static Object getRule(Environment env, BObject administratorClient, BString topicName,
BString subscriptionName, BString ruleName) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -631,7 +631,7 @@ public static Object getRule(Environment env, BObject administratorClient, BStri
public static Object updateRule(Environment env, BObject administratorClient, BString topicName,
BString subscriptionName, BString ruleName,
BMap<BString, Object> updateRuleProperties) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -668,7 +668,7 @@ public static Object updateRule(Environment env, BObject administratorClient, BS
*/
public static Object listRules(Environment env, BObject administratorClient, BString topicName,
BString subscriptionName) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -721,7 +721,7 @@ private static BMap<BString, Object> constructRulePropertiesArray(PagedIterable<
*/
public static Object deleteRule(Environment env, BObject administratorClient, BString topicName,
BString subscriptionName, BString ruleName) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -751,7 +751,7 @@ public static Object deleteRule(Environment env, BObject administratorClient, BS
*/
public static Object createQueue(Environment env, BObject administratorClient,
BString queueName, BMap<BString, Object> queueProperties) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -786,7 +786,7 @@ public static Object createQueue(Environment env, BObject administratorClient,
* @return queueProperties object
*/
public static Object getQueue(Environment env, BObject administratorClient, BString queueName) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -817,7 +817,7 @@ public static Object getQueue(Environment env, BObject administratorClient, BStr
*/
public static Object updateQueue(Environment env, BObject administratorClient, BString queueName,
BMap<BString, Object> queueProperties) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -850,7 +850,7 @@ public static Object updateQueue(Environment env, BObject administratorClient, B
* @return queueProperties object
*/
public static Object listQueues(Environment env, BObject administratorClient) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -898,7 +898,7 @@ private static BMap<BString, Object> constructQueuePropertiesArray(PagedIterable
* @return null
*/
public static Object deleteQueue(Environment env, BObject administratorClient, BString queueName) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -926,7 +926,7 @@ public static Object deleteQueue(Environment env, BObject administratorClient, B
* @return null
*/
public static Object queueExists(Environment env, BObject administratorClient, BString queueName) {
ServiceBusAdministrationClient clientEp = getAdminFromBObject(administratorClient);
ServiceBusAdministrationClient clientEp = getNativeAdminClient(administratorClient);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
try {
Expand Down Expand Up @@ -1095,7 +1095,7 @@ private static Map<String, Object> populateQueueOptionalFieldsMap(QueuePropertie
return map;
}

private static ServiceBusAdministrationClient getAdminFromBObject(BObject adminObject) {
private static ServiceBusAdministrationClient getNativeAdminClient(BObject adminObject) {
return (ServiceBusAdministrationClient) adminObject.getNativeData(ASBConstants.ADMINISTRATOR_CLIENT);
}

Expand Down

0 comments on commit c7b2b96

Please sign in to comment.