本文整理汇总了Java中org.springframework.shell.core.annotation.CliAvailabilityIndicator类的典型用法代码示例。如果您正苦于以下问题:Java CliAvailabilityIndicator类的具体用法?Java CliAvailabilityIndicator怎么用?Java CliAvailabilityIndicator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CliAvailabilityIndicator类属于org.springframework.shell.core.annotation包,在下文中一共展示了CliAvailabilityIndicator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: arePCJCommandsAvailable
import org.springframework.shell.core.annotation.CliAvailabilityIndicator; //导入依赖的package包/类
/**
* Enables commands that are available when the Shell is connected to a Rya Instance that supports PCJ Indexing.
*/
@CliAvailabilityIndicator({
CREATE_PCJ_CMD,
DELETE_PCJ_CMD})
public boolean arePCJCommandsAvailable() {
// The PCJ commands are only available if the Shell is connected to an instance of Rya
// that is new enough to use the RyaDetailsRepository and is configured to maintain PCJs.
final ShellState shellState = state.getShellState();
if(shellState.getConnectionState() == ConnectionState.CONNECTED_TO_INSTANCE) {
final GetInstanceDetails getInstanceDetails = shellState.getConnectedCommands().get().getGetInstanceDetails();
final String ryaInstanceName = state.getShellState().getRyaInstanceName().get();
try {
final Optional<RyaDetails> instanceDetails = getInstanceDetails.getDetails( ryaInstanceName );
if(instanceDetails.isPresent()) {
return instanceDetails.get().getPCJIndexDetails().isEnabled();
}
} catch (final RyaClientException e) {
return false;
}
}
return false;
}
示例2: arePeriodicPCJCommandsAvailable
import org.springframework.shell.core.annotation.CliAvailabilityIndicator; //导入依赖的package包/类
/**
* Enables commands that are available when the Shell is connected to a Rya Instance that supports PCJ Indexing.
*/
@CliAvailabilityIndicator({
CREATE_PERIODIC_PCJ_CMD,
DELETE_PERIODIC_PCJ_CMD,
LIST_INCREMENTAL_QUERIES})
public boolean arePeriodicPCJCommandsAvailable() {
// The PCJ commands are only available if the Shell is connected to an instance of Rya
// that is new enough to use the RyaDetailsRepository and is configured to maintain PCJs.
final ShellState shellState = state.getShellState();
if(shellState.getConnectionState() == ConnectionState.CONNECTED_TO_INSTANCE &&
shellState.getStorageType().get() == StorageType.ACCUMULO) {
final GetInstanceDetails getInstanceDetails = shellState.getConnectedCommands().get().getGetInstanceDetails();
final String ryaInstanceName = state.getShellState().getRyaInstanceName().get();
try {
final Optional<RyaDetails> instanceDetails = getInstanceDetails.getDetails( ryaInstanceName );
if(instanceDetails.isPresent()) {
return instanceDetails.get().getPCJIndexDetails().isEnabled();
}
} catch (final RyaClientException e) {
return false;
}
}
return false;
}
示例3: clientCommandsAvailable
import org.springframework.shell.core.annotation.CliAvailabilityIndicator; //导入依赖的package包/类
@CliAvailabilityIndicator({CliStrings.LIST_CLIENTS, CliStrings.DESCRIBE_CLIENT})
public boolean clientCommandsAvailable() {
boolean isAvailable = true; // always available on server
if (CliUtil.isGfshVM()) { // in gfsh check if connected
isAvailable = getGfsh() != null && getGfsh().isConnectedAndReady();
}
return isAvailable;
}
示例4: sharedConfigCommandsAvailable
import org.springframework.shell.core.annotation.CliAvailabilityIndicator; //导入依赖的package包/类
@CliAvailabilityIndicator({CliStrings.EXPORT_SHARED_CONFIG, CliStrings.IMPORT_SHARED_CONFIG})
public boolean sharedConfigCommandsAvailable() {
boolean isAvailable = true; // always available on server
if (CliUtil.isGfshVM()) { // in gfsh check if connected
isAvailable = getGfsh() != null && getGfsh().isConnectedAndReady();
}
return isAvailable;
}
示例5: dataCommandsAvailable
import org.springframework.shell.core.annotation.CliAvailabilityIndicator; //导入依赖的package包/类
@CliAvailabilityIndicator({CliStrings.REBALANCE, CliStrings.GET, CliStrings.PUT,
CliStrings.REMOVE, CliStrings.LOCATE_ENTRY, CliStrings.QUERY, CliStrings.IMPORT_DATA,
CliStrings.EXPORT_DATA})
public boolean dataCommandsAvailable() {
boolean isAvailable = true; // always available on server
if (CliUtil.isGfshVM()) { // in gfsh check if connected
isAvailable = getGfsh() != null && getGfsh().isConnectedAndReady();
}
return isAvailable;
}
示例6: functionCommandsAvailable
import org.springframework.shell.core.annotation.CliAvailabilityIndicator; //导入依赖的package包/类
@CliAvailabilityIndicator({CliStrings.EXECUTE_FUNCTION, CliStrings.DESTROY_FUNCTION,
CliStrings.LIST_FUNCTION})
public boolean functionCommandsAvailable() {
boolean isAvailable = true; // always available on server
if (CliUtil.isGfshVM()) { // in gfsh check if connected
isAvailable = getGfsh() != null && getGfsh().isConnectedAndReady();
}
return isAvailable;
}
示例7: shutdownCommandAvailable
import org.springframework.shell.core.annotation.CliAvailabilityIndicator; //导入依赖的package包/类
@CliAvailabilityIndicator({CliStrings.SHUTDOWN, CliStrings.GC, CliStrings.SHOW_DEADLOCK,
CliStrings.SHOW_METRICS, CliStrings.SHOW_LOG, CliStrings.EXPORT_STACKTRACE,
CliStrings.NETSTAT, CliStrings.EXPORT_LOGS, CliStrings.CHANGE_LOGLEVEL})
public boolean shutdownCommandAvailable() {
boolean isAvailable = true; // always available on server
if (CliUtil.isGfshVM()) { // in gfsh check if connected
isAvailable = getGfsh() != null && getGfsh().isConnectedAndReady();
}
return isAvailable;
}
示例8: isWanCommandsAvailable
import org.springframework.shell.core.annotation.CliAvailabilityIndicator; //导入依赖的package包/类
@CliAvailabilityIndicator({CliStrings.CREATE_GATEWAYSENDER, CliStrings.START_GATEWAYSENDER,
CliStrings.PAUSE_GATEWAYSENDER, CliStrings.RESUME_GATEWAYSENDER,
CliStrings.STOP_GATEWAYSENDER, CliStrings.CREATE_GATEWAYRECEIVER,
CliStrings.START_GATEWAYRECEIVER, CliStrings.STOP_GATEWAYRECEIVER, CliStrings.LIST_GATEWAY,
CliStrings.STATUS_GATEWAYSENDER, CliStrings.STATUS_GATEWAYRECEIVER,
CliStrings.LOAD_BALANCE_GATEWAYSENDER, CliStrings.DESTROY_GATEWAYSENDER})
public boolean isWanCommandsAvailable() {
boolean isAvailable = true; // always available on server
if (CliUtil.isGfshVM()) {
isAvailable = getGfsh() != null && getGfsh().isConnectedAndReady();
}
return isAvailable;
}
示例9: configCommandsAvailable
import org.springframework.shell.core.annotation.CliAvailabilityIndicator; //导入依赖的package包/类
@CliAvailabilityIndicator({CliStrings.DESCRIBE_CONFIG, CliStrings.EXPORT_CONFIG,
CliStrings.ALTER_RUNTIME_CONFIG})
public boolean configCommandsAvailable() {
boolean isAvailable = true; // always available on server
if (CliUtil.isGfshVM()) { // in gfsh check if connected
isAvailable = getGfsh() != null && getGfsh().isConnectedAndReady();
}
return isAvailable;
}
示例10: isRegionCommandAvailable
import org.springframework.shell.core.annotation.CliAvailabilityIndicator; //导入依赖的package包/类
@CliAvailabilityIndicator({CliStrings.ALTER_REGION, CliStrings.CREATE_REGION,
CliStrings.DESTROY_REGION})
public boolean isRegionCommandAvailable() {
boolean isAvailable = true; // always available on server
if (CliUtil.isGfshVM()) { // in gfsh check if connected //TODO - Abhishek: make this better
isAvailable = getGfsh() != null && getGfsh().isConnectedAndReady();
}
return isAvailable;
}
示例11: launcherCommandsAvailable
import org.springframework.shell.core.annotation.CliAvailabilityIndicator; //导入依赖的package包/类
@CliAvailabilityIndicator({CliStrings.START_LOCATOR, CliStrings.STOP_LOCATOR,
CliStrings.STATUS_LOCATOR, CliStrings.START_SERVER, CliStrings.STOP_SERVER,
CliStrings.STATUS_SERVER, CliStrings.START_MANAGER, CliStrings.START_PULSE,
CliStrings.START_VSD, CliStrings.START_DATABROWSER})
public boolean launcherCommandsAvailable() {
return true;
}
示例12: queueCommandsAvailable
import org.springframework.shell.core.annotation.CliAvailabilityIndicator; //导入依赖的package包/类
@CliAvailabilityIndicator({CliStrings.CREATE_ASYNC_EVENT_QUEUE,
CliStrings.LIST_ASYNC_EVENT_QUEUES})
public boolean queueCommandsAvailable() {
boolean isAvailable = true;
if (CliUtil.isGfshVM()) {
isAvailable = getGfsh() != null && getGfsh().isConnectedAndReady();
}
return isAvailable;
}
示例13: isRegionCommandAvailable
import org.springframework.shell.core.annotation.CliAvailabilityIndicator; //导入依赖的package包/类
@CliAvailabilityIndicator({CliStrings.LIST_REGION, CliStrings.DESCRIBE_REGION})
public boolean isRegionCommandAvailable() {
boolean isAvailable = true; // always available on server
if (CliUtil.isGfshVM()) { // in gfsh check if connected //TODO - Abhishek: make this better
isAvailable = getGfsh() != null && getGfsh().isConnectedAndReady();
}
return isAvailable;
}
示例14: durableCommandsAvailable
import org.springframework.shell.core.annotation.CliAvailabilityIndicator; //导入依赖的package包/类
@CliAvailabilityIndicator({CliStrings.LIST_DURABLE_CQS, CliStrings.CLOSE_DURABLE_CLIENTS,
CliStrings.CLOSE_DURABLE_CQS, CliStrings.COUNT_DURABLE_CQ_EVENTS})
public boolean durableCommandsAvailable() {
boolean isAvailable = true;
if (CliUtil.isGfshVM()) {
isAvailable = getGfsh() != null && getGfsh().isConnectedAndReady();
}
return isAvailable;
}
示例15: diskStoreCommandsAvailable
import org.springframework.shell.core.annotation.CliAvailabilityIndicator; //导入依赖的package包/类
@CliAvailabilityIndicator({CliStrings.BACKUP_DISK_STORE, CliStrings.COMPACT_DISK_STORE,
CliStrings.DESCRIBE_DISK_STORE, CliStrings.LIST_DISK_STORE,
CliStrings.REVOKE_MISSING_DISK_STORE, CliStrings.SHOW_MISSING_DISK_STORE,
CliStrings.CREATE_DISK_STORE, CliStrings.DESTROY_DISK_STORE})
public boolean diskStoreCommandsAvailable() {
// these disk store commands are always available in GemFire
return (!CliUtil.isGfshVM() || (getGfsh() != null && getGfsh().isConnectedAndReady()));
}