/** * stop() * * @throws Exception */ public void stop() throws Exception { this.ps.deactivateProfile(TRANSIENT_PROFILE_KEY); this.ps.unregisterProfile(TRANSIENT_PROFILE_KEY); }
public ProfileKey getProfileKey() { return new ProfileKey(profileDomain, profileServer, profileName); }
public String getName() { return this.deployment.getName(); }
/** * Obtain the Deployment Manager * @throws Exception */ protected void initDeploymentManager() throws Exception { String profileName = "default"; InitialContext ctx = new InitialContext(); ProfileService ps = (ProfileService) ctx.lookup("ProfileService"); deploymentManager = ps.getDeploymentManager(); ProfileKey defaultKey = new ProfileKey(profileName); deploymentManager.loadProfile(defaultKey); }
/** * 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); }
protected boolean doPrepare(ProfileModificationResponse response) { try { ProfileDeployment deployment = deploymentRepository.getDeployment(deploymentName); deployment.getDeploymentInfo().setFlag(ProfileDeploymentFlag.LOCKED); deploymentRepository.removeDeployment(deploymentName); // Notify response.fireModificationEvent(ProfileModificationEvent.create(ProfileModificationType.DELETE, key)); } catch(Exception e) { response.setFailure(e); return false; } return true; }
@Override public MetaValue createMetaValue(MetaType metaType, ProfileKey key) { if(key == null) { throw new IllegalArgumentException("null profile key"); } return SimpleValueSupport.wrap(key.getName()); }
public DeploymentState(ProfileDeployment deployment) { this.deployment = deployment; this.deployed = deployment.getDeploymentInfo().isDeployed(); }
/** * Cast to VirtualDeploymentRepositoryExt * * @param profile the mutable profile * @return the virtual deployment repository */ static VirtualDeploymentRepository resolveDeploymentRepository(MutableProfile profile) { if(profile instanceof VirtualDeploymentRepositoryExt == false) { throw new IllegalStateException("Failed to get the deployment repository for profile " + profile.getKey()); } return VirtualDeploymentRepositoryExt.class.cast(profile).getDeploymentRepository(); }
protected DeploymentAction<? extends DeploymentActionContext> createWoraroundDistributeAction(ProfileKey key, DeploymentID dtID, InputStream contentIS, MutableProfile profile) throws Exception { if(profileRepository.getProfileKeys().contains(key)) { DeploymentRepository repository = profileRepository.getProfileDeploymentRepository(key); return new RepositoryDistributeAction(dtID, contentIS, profile, repository, null); } return null; }
public String toString() { StringBuilder builder = new StringBuilder("ModificationInfo{"); builder.append("name=").append(deployment.getSimpleName()); builder.append(", status=").append(status); builder.append(", lastModified=").append(lastModified).append("}"); return builder.toString(); }
public boolean equals(Object o) { if(o == this) return true; if(o instanceof ProfileKey) return compareTo(ProfileKey.class.cast(o)) == 0; return false; }
VirtualDeploymentRepository resolveVirtualDeploymentRepository(MutableProfile profile) { if(profile instanceof VirtualDeploymentRepositoryExt) { return VirtualDeploymentRepositoryExt.class.cast(profile).getDeploymentRepository(); } return null; }
/** * Get the target profile to upload contents. * If the DeploymentManager was not loaded, the * default key is used. * * @return the target profile key */ protected ProfileKey getTargetProfile() { if(this.activeProfileKey.get() == null) return this.defaultKey; ProfileKey active = this.activeProfileKey.get(); if(active.isDefaultKey()) return this.defaultKey; return active; }
/** * {@inheritDoc} */ public ProfileDeployment getDeployment(String name) throws NoSuchDeploymentException { ProfileDeployment deployment = resolveDeployment(name); if(deployment == null) { throw new NoSuchDeploymentException(name); } return deployment; }
private void initDeploymentManager() throws Exception { Context ctx = createContext(); profileService = (ProfileService) ctx.lookup("ProfileService"); deploymentManager = profileService.getDeploymentManager(); ProfileKey defaultKey = new ProfileKey(DEFAULT_PROFILE_KEY_NAME); deploymentManager.loadProfile(defaultKey); }
protected DeploymentAction<? extends DeploymentActionContext> createWoraroundRemoveAction(ProfileKey key, ManagedProfile profile, String name) throws Exception { if(profileRepository.getProfileKeys().contains(key)) { DeploymentRepository repository = profileRepository.getProfileDeploymentRepository(key); return new RepositoryRemoveAction(key, repository, name, null); } return null; } }
private void initDeploymentManager() throws Exception { String profileName = configuration.getProfileName(); InitialContext ctx = new InitialContext(); ProfileService ps = (ProfileService) ctx.lookup("ProfileService"); deploymentManager = ps.getDeploymentManager(); ProfileKey defaultKey = new ProfileKey(profileName); deploymentManager.loadProfile(defaultKey); VFS.init(); }
private void initProfileService(Server server) throws Exception { Context ctx = server.getNamingContext(); contextInst.set(ctx); profileService = (ProfileService) ctx.lookup("ProfileService"); deploymentManager = profileService.getDeploymentManager(); ProfileKey defaultKey = new ProfileKey(DEFAULT_PROFILE_KEY_NAME); deploymentManager.loadProfile(defaultKey); }