private void browse(URI uri) throws IOException { assertState(Desktop.isDesktopSupported(), String.format(CliStrings.DESKSTOP_APP_RUN_ERROR_MESSAGE, System.getProperty("os.name"))); Desktop.getDesktop().browse(uri); }
private void browse(URI uri) throws IOException { assertState(Desktop.isDesktopSupported(), String.format(CliStrings.DESKSTOP_APP_RUN_ERROR_MESSAGE, System.getProperty("os.name"))); Desktop.getDesktop().browse(uri); }
protected List<String> getSpringJars() { File gemfireHomeDirectory= new File(GEMFIRE_HOME); assertArgument(gemfireHomeDirectory.isDirectory(), "Please set the GEMFIRE environment variable to the product installation directory."); List<String> springJarFilePathnames = new ArrayList<>(SPRING_JAR_NAME_PREFIXES.size()); for (File jarFile : new File(gemfireHomeDirectory, "lib").listFiles(new FileFilter() { @Override public boolean accept(final File pathname) { return (pathname.getName().startsWith("spring-") && pathname.getAbsolutePath().endsWith(".jar")); } })) { String jarFileName = jarFile.getName(); String jarFileNamePrefix = jarFileName.substring(0, jarFileName.lastIndexOf("-")); if (SPRING_JAR_NAME_PREFIXES.contains(jarFileNamePrefix.toLowerCase().trim())) { springJarFilePathnames.add(jarFile.getAbsolutePath()); } } assertState(springJarFilePathnames.size() == SPRING_JAR_NAME_PREFIXES.size(), "Unable to find all the necessary Spring JAR files in $GEMFIRE/lib (%1$s): expected (%2$s); but was (%3$s)", gemfireHomeDirectory, SPRING_JAR_NAME_PREFIXES, springJarFilePathnames); return springJarFilePathnames; }
/** * Gets a proxy to the DistributedSystemMXBean from the GemFire Manager's MBeanServer, or null if unable to find * the DistributedSystemMXBean. * </p> * @return a proxy to the DistributedSystemMXBean from the GemFire Manager's MBeanServer, or null if unable to find * the DistributedSystemMXBean. */ protected DistributedSystemMXBean getDistributedSystemMXBean() throws IOException, MalformedObjectNameException { assertState(isConnectedAndReady(), "Gfsh must be connected in order to get proxy to a GemFire DistributedSystemMXBean."); return getGfsh().getOperationInvoker().getDistributedSystemMXBean(); }
/** * Gets a proxy to the DistributedSystemMXBean from the GemFire Manager's MBeanServer, or null if unable to find * the DistributedSystemMXBean. * </p> * @return a proxy to the DistributedSystemMXBean from the GemFire Manager's MBeanServer, or null if unable to find * the DistributedSystemMXBean. */ protected DistributedSystemMXBean getDistributedSystemMXBean() throws IOException, MalformedObjectNameException { assertState(isConnectedAndReady(), "Gfsh must be connected in order to get proxy to a GemFire DistributedSystemMXBean."); return getGfsh().getOperationInvoker().getDistributedSystemMXBean(); }
assertState(new File(getPathToVsd()).exists(), String.format(CliStrings.START_VSD__NOT_FOUND_ERROR_MESSAGE, gemfireHome));
final String gemfireHome = System.getenv("GEMFIRE"); assertState(!StringUtils.isBlank(gemfireHome), CliStrings.GEMFIRE_HOME_NOT_FOUND_ERROR_MESSAGE); assertState(IOUtils.isExistingPathname(dataBrowserPath), String.format(CliStrings.START_DATABROWSER__NOT_FOUND_ERROR_MESSAGE, gemfireHome));
String gemfireHome = System.getenv("GEMFIRE"); assertState(!StringUtils.isBlank(gemfireHome), CliStrings.GEMFIRE_HOME_NOT_FOUND_ERROR_MESSAGE); assertState(IOUtils.isExistingPathname(getPathToVsd()), String.format(CliStrings.START_VSD__NOT_FOUND_ERROR_MESSAGE, gemfireHome));
protected MemberMXBean getMemberMXBean(final String serviceName, final String member) throws IOException { assertState(isConnectedAndReady(), "Gfsh must be connected in order to get proxy to a GemFire Member MBean."); MemberMXBean memberBean = null; try { String objectNamePattern = ManagementConstants.OBJECTNAME__PREFIX; objectNamePattern += (StringUtils.isBlank(serviceName) ? StringUtils.EMPTY_STRING : "service=" + serviceName + StringUtils.COMMA_DELIMITER); objectNamePattern += "type=Member,*"; // NOTE throws a MalformedObjectNameException, however, this should not happen since the ObjectName is constructed // here in a conforming pattern final ObjectName objectName = ObjectName.getInstance(objectNamePattern); final QueryExp query = Query.or( Query.eq(Query.attr("Name"), Query.value(member)), Query.eq(Query.attr("Id"), Query.value(member)) ); final Set<ObjectName> memberObjectNames = getGfsh().getOperationInvoker().queryNames(objectName, query); if (!memberObjectNames.isEmpty()) { memberBean = getGfsh().getOperationInvoker().getMBeanProxy(memberObjectNames.iterator().next(), MemberMXBean.class); } } catch (MalformedObjectNameException e) { getGfsh().logSevere(e.getMessage(), e); } return memberBean; }
String gemfireHome = System.getenv("GEMFIRE"); assertState(!StringUtils.isBlank(gemfireHome), CliStrings.GEMFIRE_HOME_NOT_FOUND_ERROR_MESSAGE); assertState(IOUtils.isExistingPathname(dataBrowserPath), String.format( CliStrings.START_DATABROWSER__NOT_FOUND_ERROR_MESSAGE, gemfireHome));
protected MemberMXBean getMemberMXBean(final String serviceName, final String member) throws IOException { assertState(isConnectedAndReady(), "Gfsh must be connected in order to get proxy to a GemFire Member MBean."); MemberMXBean memberBean = null; try { String objectNamePattern = ManagementConstants.OBJECTNAME__PREFIX; objectNamePattern += (StringUtils.isBlank(serviceName) ? StringUtils.EMPTY_STRING : "service=" + serviceName + StringUtils.COMMA_DELIMITER); objectNamePattern += "type=Member,*"; // NOTE throws a MalformedObjectNameException, however, this should not happen since the ObjectName is constructed // here in a conforming pattern final ObjectName objectName = ObjectName.getInstance(objectNamePattern); final QueryExp query = Query.or( Query.eq(Query.attr("Name"), Query.value(member)), Query.eq(Query.attr("Id"), Query.value(member)) ); final Set<ObjectName> memberObjectNames = getGfsh().getOperationInvoker().queryNames(objectName, query); if (!memberObjectNames.isEmpty()) { memberBean = getGfsh().getOperationInvoker().getMBeanProxy(memberObjectNames.iterator().next(), MemberMXBean.class); } } catch (MalformedObjectNameException e) { getGfsh().logSevere(e.getMessage(), e); } return memberBean; }