private boolean isDas() { return serverEnv.isDas(); }
/** * Lets caller to know if the caller is in DAS */ public boolean isThisDAS() { return serverEnv.isDas(); }
/** * Lets caller to know if the caller is in DAS */ public boolean isThisDAS() { return serverEnv.isDas(); }
@Override public void postConstruct() { /* * Indicate whether this is the DAS or an instance in the security * environment so the provider implementation can see it and use it * in making authorization decisions. */ securityContextService.getEnvironmentAttributes().addAttribute( AuthorizationAdminConstants.ISDAS_ATTRIBUTE, Boolean.toString(serverEnv.isDas()), true); }
private boolean isOrchestrationEnabled(DeploymentContext dc){ return (serverEnvironment.isDas() && isVirtualizationEnabled() && isValidDeploymentTarget(dc)) || Boolean.getBoolean("org.glassfish.paas.orchestrator.enabled"); }
private String getCertAlias() { return (serverEnv.isDas() ? SecureAdmin.Util.DASAlias(secureAdmin) : SecureAdmin.Util.instanceAlias(secureAdmin)); }
private synchronized String getCertAlias() { return (serverEnv.isDas() ? SecureAdmin.Util.DASAlias(secureAdmin) : SecureAdmin.Util.instanceAlias(secureAdmin)); }
private synchronized String getCertAlias() { return (serverEnv.isDas() ? SecureAdmin.Util.DASAlias(secureAdmin) : SecureAdmin.Util.instanceAlias(secureAdmin)); }
public Collection<SupplementalCommand> listSuplementalCommands(String commandName) { List<ServiceHandle<?>> supplementalList = getSupplementalCommandsList().get(commandName); if (supplementalList == null) { return Collections.emptyList(); } Collection<SupplementalCommand> result = new ArrayList<SupplementalCommand>(supplementalList.size()); for (ServiceHandle<?> handle : supplementalList) { AdminCommand cmdObject = (AdminCommand) handle.getService(); SupplementalCommand aCmd = new SupplementalCommandImpl(cmdObject); if( (serverEnv.isDas() && aCmd.whereToRun().contains(RuntimeType.DAS)) || (serverEnv.isInstance() && aCmd.whereToRun().contains(RuntimeType.INSTANCE)) ) { result.add(aCmd); } } return result; }
/** * Starts the application loader service. */ @Override public void postConstruct() { if (startupContext != null) { Properties args = startupContext.getArguments(); if (args != null && Boolean.valueOf(args.getProperty("-upgrade"))) { return; } } if (clusters != null) { if (env.isDas()) { checkAllClusters(clusters); } else { Cluster cluster = server.getCluster(); if (cluster != null) { checkCluster(cluster); } } } }
/** * Starts the application loader service. */ @Override public void postConstruct() { if (startupContext != null) { Properties args = startupContext.getArguments(); if (args != null && Boolean.valueOf(args.getProperty("-upgrade"))) { return; } } if (clusters != null) { if (env.isDas()) { checkAllClusters(clusters); } else { Cluster cluster = server.getCluster(); if (cluster != null) { checkCluster(cluster); } } } }
/** * Chooses what level of admin access to grant an authenticated user. * <p> * If the current node is not the DAS, then we grant only monitoring access * unless the message was authenticated using an internal admin * username and password, in which case we grant full access. * (We do not permit full admin access to instances from end-user clients.) * * If the current node is the DAS, then we grant full admin access only * if the request came from the same host or if secure admin is enabled. * * @return the access to be granted to the authenticated user */ private Access chooseAccess(final String originHost, final String username) { Access grantedAccess = Access.MONITORING; if (isAuthorizedInternalUser(username)) { grantedAccess = Access.FULL; } else { if (serverEnv.isDas()) { if ( NetUtils.isThisHostLocal(originHost) || SecureAdmin.Util.isEnabled(secureAdmin) ) { grantedAccess = Access.FULL; } } } return grantedAccess; }
/** * Shutdown of the application server : * * All running services are stopped. * LookupManager is flushed. */ public void execute(AdminCommandContext context) { if (!env.isDas()) { // This command is asynchronous. We can't return anything so we just // log the error and return String msg = localStrings.getLocalString("stop.domain.notDas", "stop-domain only works with domains, this is a {0}", env.getRuntimeType().toString()); context.getLogger().warning(msg); return; } doExecute(habitat, env, force); } }
private boolean checkEnvAndParams(Logger logger, ActionReport report) { // first check that we're the DAS if (!env.isDas()) { return setFail(logger, report, Strings.get("get.health.onlyRunsOnDas")); } // check that cluster exists Cluster cluster = domain.getClusterNamed(clusterName); if (cluster == null) { return setFail(logger, report, Strings.get("get.health.noCluster", clusterName)); } // ok to go return true; }
private boolean checkEnvAndParams() { // first check that we're the DAS if (!env.isDas()) { return setFail(Strings.get("get.health.onlyRunsOnDas")); } // check that cluster exists Cluster cluster = domain.getClusterNamed(clusterName); if (cluster == null) { return setFail(Strings.get("get.health.noCluster", clusterName)); } // ok to go return true; }
if (!env.isDas()) { String msg = Strings.get("cluster.command.notDas"); logger.warning(msg);
if (!env.isDas()) { String msg = Strings.get("cluster.command.notDas"); logger.warning(msg);
if(!env.isDas()) { String msg = Strings.get("cluster.command.notDas"); logger.warning(msg);
Supplemental ann = cmdObject.getClass().getAnnotation(Supplemental.class); SupplementalCommand aCmd = new SupplementalCommand(cmdObject, ann.on(), ann.ifFailure()); if( (serverEnv.isDas() && aCmd.whereToRun().contains(RuntimeType.DAS)) || (serverEnv.isInstance() && aCmd.whereToRun().contains(RuntimeType.INSTANCE)) ) { if( (time.equals(Supplemental.Timing.Before) && aCmd.toBeExecutedBefore()) ||
if (!env.isDas()) setError(Strings.get("restart.instance.notDas", env.getRuntimeType().toString()));