@Experimental public abstract class GfshCommand extends Object implements org.springframework.shell.core.CommandMarker
Modifier and Type | Field and Description |
---|---|
static String |
EXPERIMENTAL |
Constructor and Description |
---|
GfshCommand() |
Modifier and Type | Method and Description |
---|---|
boolean |
affectsClusterConfiguration()
For those commands that could possibly change the cluster configuration, they need to
override this method to return true.
|
void |
authorize(ResourcePermission.Resource resource,
ResourcePermission.Operation operation,
ResourcePermission.Target target) |
void |
authorize(ResourcePermission.Resource resource,
ResourcePermission.Operation operation,
String target) |
void |
authorize(ResourcePermission.Resource resource,
ResourcePermission.Operation operation,
String target,
String key) |
List<org.apache.geode.management.internal.functions.CliFunctionResult> |
executeAndGetFunctionResult(Function<?> function,
Object args,
Set<DistributedMember> targetMembers) |
ResultCollector<?,?> |
executeFunction(Function<?> function,
Object args,
DistributedMember targetMember) |
ResultCollector<?,?> |
executeFunction(Function<?> function,
Object args,
Set<DistributedMember> targetMembers) |
org.apache.geode.management.internal.functions.CliFunctionResult |
executeFunctionAndGetFunctionResult(Function<?> function,
Object args,
DistributedMember targetMember) |
Set<DistributedMember> |
findAllLocators() |
Set<DistributedMember> |
findAllOtherLocators() |
Set<DistributedMember> |
findAnyMembersForRegion(String regionPath) |
DistributedMember |
findMember(String memberName)
this will return the member found or null if no member with that name
|
Set<DistributedMember> |
findMembers(String[] groups,
String[] members)
if no members matches these names, an empty set would return, this does not include locators
|
Set<DistributedMember> |
findMembersForRegion(String regionPath) |
Set<DistributedMember> |
findMembersIncludingLocators(String[] groups,
String[] members)
if no members matches these names, an empty set would return
|
Set<DistributedMember> |
getAllMembers()
Gets all members in the GemFire distributed system/cache, including locators
|
Set<DistributedMember> |
getAllNormalMembers()
Get All members, excluding locators
|
Cache |
getCache() |
ClusterManagementService |
getClusterManagementService() |
<T extends ConfigurationPersistenceService> |
getConfigurationPersistenceService() |
<T extends ManagementService> |
getManagementService() |
DistributedMember |
getMember(String memberName)
this either returns a non-null member or throw an exception if member is not found.
|
Set<DistributedMember> |
getMembers(String[] groups,
String[] members)
if no members matches these names, a UserErrorException will be thrown
|
Execution |
getMembersFunctionExecutor(Set<DistributedMember> members) |
Set<DistributedMember> |
getMembersIncludingLocators(String[] groups,
String[] members)
if no members matches these names, a UserErrorException will be thrown
|
Set<DistributedMember> |
getNormalMembersWithSameOrNewerVersion(org.apache.geode.internal.serialization.KnownVersion version)
Get All members >= a specific version, excluding locators
|
org.apache.shiro.subject.Subject |
getSubject() |
boolean |
isOnlineCommandAvailable() |
boolean |
isSharedConfigurationRunning() |
boolean |
poll(long timeout,
TimeUnit unit,
Supplier<Boolean> function)
Very basic polling functionality that executes a function until it returns true or the timeout
is reached.
|
void |
setCache(Cache cache) |
public static final String EXPERIMENTAL
public boolean isOnlineCommandAvailable()
public boolean affectsClusterConfiguration()
public void authorize(ResourcePermission.Resource resource, ResourcePermission.Operation operation, ResourcePermission.Target target)
public void authorize(ResourcePermission.Resource resource, ResourcePermission.Operation operation, String target)
public void authorize(ResourcePermission.Resource resource, ResourcePermission.Operation operation, String target, String key)
public Cache getCache()
public <T extends ManagementService> T getManagementService()
public <T extends ConfigurationPersistenceService> T getConfigurationPersistenceService()
public ClusterManagementService getClusterManagementService()
public void setCache(Cache cache)
public boolean isSharedConfigurationRunning()
public org.apache.shiro.subject.Subject getSubject()
public DistributedMember getMember(String memberName)
memberName
- the member name of the member to findpublic DistributedMember findMember(String memberName)
memberName
- the member name of the member to findpublic Set<DistributedMember> getAllMembers()
public Set<DistributedMember> getAllNormalMembers()
public Set<DistributedMember> getNormalMembersWithSameOrNewerVersion(org.apache.geode.internal.serialization.KnownVersion version)
version
- a KnownVersion
to compare with the version of memberspublic Execution getMembersFunctionExecutor(Set<DistributedMember> members)
public Set<DistributedMember> findMembers(String[] groups, String[] members)
groups
- names of groups to which returned members belongmembers
- member names or IDs which returned members matchpublic Set<DistributedMember> findAllOtherLocators()
public Set<DistributedMember> findAllLocators()
public Set<DistributedMember> getMembers(String[] groups, String[] members)
groups
- names of groups to which returned members belongmembers
- member names or IDs which returned members matchpublic Set<DistributedMember> findMembersIncludingLocators(String[] groups, String[] members)
groups
- names of groups to which returned members belongmembers
- member names or IDs which returned members matchpublic Set<DistributedMember> getMembersIncludingLocators(String[] groups, String[] members)
groups
- names of groups to which returned members belongmembers
- member names or IDs which returned members matchpublic Set<DistributedMember> findMembersForRegion(String regionPath)
public Set<DistributedMember> findAnyMembersForRegion(String regionPath)
public ResultCollector<?,?> executeFunction(Function<?> function, Object args, Set<DistributedMember> targetMembers)
public ResultCollector<?,?> executeFunction(Function<?> function, Object args, DistributedMember targetMember)
public org.apache.geode.management.internal.functions.CliFunctionResult executeFunctionAndGetFunctionResult(Function<?> function, Object args, DistributedMember targetMember)
public List<org.apache.geode.management.internal.functions.CliFunctionResult> executeAndGetFunctionResult(Function<?> function, Object args, Set<DistributedMember> targetMembers)
public boolean poll(long timeout, TimeUnit unit, Supplier<Boolean> function)
timeout
- the maximum amount of time to wait for the function to returnunit
- the TimeUnit
for the timeoutfunction
- a Supplier<Boolean>
function that will poll for the
condition