forked from vmware-archive/admiral
-
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.
Implement LB Removal task in Prelude
Implement Load balancer removal task to dispatch removal requests to photon load balancer task Change-Id: I274b5fedfc3c2879e9ce2bcffec8bb53fd814d30 Reviewed-on: http://bellevue-ci.eng.vmware.com:8080/11689 Compute-Verified: jenkins <[email protected]> Upgrade-Verified: jenkins <[email protected]> Closures-Verified: jenkins <[email protected]> Bellevue-Verified: jenkins <[email protected]> CS-Verified: jenkins <[email protected]> Reviewed-by: Peter Mitrov <[email protected]>
- Loading branch information
Kristiyan Georgiev
committed
Jun 20, 2017
1 parent
c2a477e
commit 02487cb
Showing
5 changed files
with
433 additions
and
27 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
...ter/common/src/main/java/com/vmware/admiral/adapter/common/LoadBalancerOperationType.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 @@ | ||
/* | ||
* Copyright (c) 2017 VMware, Inc. All Rights Reserved. | ||
* | ||
* This product is licensed to you under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this product except in compliance with the License. | ||
* | ||
* This product may include a number of subcomponents with separate copyright notices | ||
* and license terms. Your use of these subcomponents is subject to the terms and | ||
* conditions of the subcomponent's license, as noted in the LICENSE file. | ||
*/ | ||
|
||
package com.vmware.admiral.adapter.common; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* Load balancer operation types | ||
*/ | ||
public enum LoadBalancerOperationType { | ||
|
||
CREATE("LoadBalancer.Create"), | ||
DELETE("LoadBalancer.Delete"); | ||
|
||
public final String id; | ||
|
||
LoadBalancerOperationType(String id) { | ||
this.id = id; | ||
} | ||
|
||
private static final Map<String, LoadBalancerOperationType> operationsById = new HashMap<>(); | ||
|
||
static { | ||
for (LoadBalancerOperationType opr : values()) { | ||
operationsById.put(opr.id, opr); | ||
} | ||
} | ||
|
||
public static LoadBalancerOperationType instanceById(String id) { | ||
if (id == null) { | ||
return null; | ||
} | ||
return operationsById.get(id); | ||
} | ||
|
||
public static String extractDisplayName(String id) { | ||
return id.substring(id.lastIndexOf(".") + 1); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return id; | ||
} | ||
|
||
} |
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
Oops, something went wrong.