@Override public MetaValue createMetaValue(MetaType metaType, ProfileKey key) { if(key == null) { throw new IllegalArgumentException("null profile key"); } return SimpleValueSupport.wrap(key.getName()); }
@Override public MetaValue createMetaValue(MetaType metaType, ProfileKey key) { if(key == null) { throw new IllegalArgumentException("null profile key"); } return SimpleValueSupport.wrap(key.getName()); }
public String toString() { StringBuilder tmp = new StringBuilder(); tmp.append(getClass().getSimpleName()); tmp.append('@').append(Integer.toHexString(System.identityHashCode(this))); tmp.append('['); tmp.append("domain="); tmp.append(getDomain()); tmp.append(", server="); tmp.append(getServer()); tmp.append(", name="); tmp.append(getName()); tmp.append(']'); return tmp.toString(); }
/** * Is this a default key. A default key is one where all * fields are {@link #DEFAULT} * @return true if default, false otherwise. */ public boolean isDefaultKey() { return DEFAULT.equalsIgnoreCase(getDomain()) && DEFAULT.equalsIgnoreCase(getServer()) && DEFAULT.equalsIgnoreCase(getName()); }
/** * start() * * @throws Exception */ public void start() throws Exception { Profile profile = new TransientDeploymentsProfile(); TRANSIENT_PROFILE_KEY = this.ps.registerProfile(new EmptyProfileMetaData(TRANSIENT_PROFILE_KEY.getName()), profile); this.ps.activateProfile(TRANSIENT_PROFILE_KEY); this.ps.validateProfile(TRANSIENT_PROFILE_KEY); }
/** * Stop a set of deployments. * * @param deploymentNames the deployment names * @throws Exception for any error */ protected void stopDeployments(String... deploymentNames) throws Exception { Map<ProfileKey, Set<String>> mappings = resolveProfiles(deploymentNames, false, true); BasicProfileModificationRequest actions = new BasicProfileModificationRequest(ProfileModificationType.UPDATE); for(ProfileKey key : mappings.keySet()) { ManagedProfile managed = actionController.getManagedProfile(key); if(managed == null) { throw new NoSuchProfileException(key.getName()); } actions.addAction(key, new DeploymentStopAction(managed, mappings.get(key), null)); } checkStatus(actionController.perform(actions)); }
/** * Start a set of deployments. * * @param deploymentNames the deployment names * @throws Exception for any error */ protected void startDeployments(String... deploymentNames) throws Exception { Map<ProfileKey, Set<String>> mappings = resolveProfiles(deploymentNames, false, true); BasicProfileModificationRequest actions = new BasicProfileModificationRequest(ProfileModificationType.UPDATE); for(ProfileKey key : mappings.keySet()) { ManagedProfile managed = actionController.getManagedProfile(key); if(managed == null) { throw new NoSuchProfileException(key.getName()); } actions.addAction(key, new DeploymentStartAction(managed, mappings.get(key), null)); } checkStatus(actionController.perform(actions)); }
/** * Remove a set of deployments. * * @param deploymentNames the deployment names * @throws Exception for any error */ protected void removeDeployments(String... deploymentNames) throws Exception { Map<ProfileKey, Set<String>> mappings = resolveProfiles(deploymentNames, true, true); BasicProfileModificationRequest actions = new BasicProfileModificationRequest(ProfileModificationType.DELETE); for(ProfileKey key : mappings.keySet()) { ManagedProfile managed = actionController.getManagedProfile(key); if(managed == null) { throw new NoSuchProfileException(key.getName()); } Set<String> names = mappings.get(key); for(final String deploymentName : names) { DeploymentAction<? extends DeploymentActionContext> action = createWoraroundRemoveAction(key, managed, deploymentName); if(action == null) { action = new DeploymentRemoveAction(managed, deploymentName, null); } actions.addAction(key, action); } } checkStatus(actionController.perform(actions)); }
String profileName = key.getName(); String repoDeploymentName = createDeploymentName(vf); deploymentRepository.lockDeploymentContent(repoDeploymentName);