congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.eclipse.che.api.workspace.server.event
Code IndexAdd Tabnine to your IDE (free)

How to use org.eclipse.che.api.workspace.server.event

Best Java code snippets using org.eclipse.che.api.workspace.server.event (Showing top 12 results out of 315)

origin: org.eclipse.che.multiuser/che-multiuser-machine-authentication

 @Override
 public void onCascadeEvent(BeforeWorkspaceRemovedEvent event) throws Exception {
  signatureKeyDao.remove(event.getWorkspace().getId());
 }
}
origin: org.eclipse.che.core/che-core-api-workspace

@Transactional(rollbackOn = {RuntimeException.class, ServerException.class})
protected void doRemove(String id) throws ServerException {
 final EntityManager manager = managerProvider.get();
 final StackImpl stack = manager.find(StackImpl.class, id);
 if (stack != null) {
  eventService.publish(new BeforeStackRemovedEvent(new StackImpl(stack))).propagateException();
  manager.remove(stack);
  manager.flush();
 }
}
origin: org.eclipse.che.multiuser/che-multiuser-permission-workspace

@Override
public void onCascadeEvent(BeforeStackRemovedEvent event) throws Exception {
 removeStackPermissions(event.getStack().getId(), PAGE_SIZE);
}
origin: org.eclipse.che.core/che-core-api-workspace

@Transactional(rollbackOn = {RuntimeException.class, ServerException.class})
protected Optional<WorkspaceImpl> doRemove(String id) throws ServerException {
 final WorkspaceImpl workspace = managerProvider.get().find(WorkspaceImpl.class, id);
 if (workspace == null) {
  return Optional.empty();
 }
 final EntityManager manager = managerProvider.get();
 eventService
   .publish(new BeforeWorkspaceRemovedEvent(new WorkspaceImpl(workspace)))
   .propagateException();
 manager.remove(workspace);
 manager.flush();
 return Optional.of(workspace);
}
origin: org.eclipse.che.core/che-core-api-workspace

@Transactional(rollbackOn = {RuntimeException.class, ApiException.class})
protected void doCreate(StackImpl stack) throws ConflictException, ServerException {
 if (stack.getWorkspaceConfig() != null) {
  stack.getWorkspaceConfig().getProjects().forEach(ProjectConfigImpl::prePersistAttributes);
 }
 EntityManager manager = managerProvider.get();
 manager.persist(stack);
 manager.flush();
 eventService.publish(new StackPersistedEvent(stack)).propagateException();
}
origin: org.eclipse.che.core/che-core-api-workspace

 @Override
 public void onEvent(RuntimeAbnormalStoppingEvent event) {
  RuntimeIdentity identity = event.getIdentity();
  String workspaceId = identity.getWorkspaceId();
  WorkspaceStatus previousStatus;
  try (Unlocker ignored = lockService.writeLock(workspaceId)) {
   previousStatus = statuses.replace(workspaceId, STOPPING);
  }
  if (previousStatus == null) {
   LOG.error(
     "Runtime '{}:{}:{}' became abnormally stopping but it was not considered as active before",
     workspaceId,
     identity.getEnvName(),
     identity.getOwnerId());
  }
  LOG.info(
    "Runtime '{}:{}:{}' is stopping abnormally. Reason: {}",
    workspaceId,
    identity.getEnvName(),
    identity.getOwnerId(),
    event.getReason());
  publishWorkspaceStatusEvent(
    workspaceId,
    STOPPING,
    previousStatus,
    "Workspace is going to be STOPPED. Reason: " + event.getReason());
 }
}
origin: org.eclipse.che.core/che-core-api-workspace

@Override
public void onEvent(RuntimeAbnormalStoppedEvent event) {
 RuntimeIdentity identity = event.getIdentity();
 String workspaceId = identity.getWorkspaceId();
   identity.getEnvName(),
   identity.getOwnerId(),
   event.getReason());
   STOPPED,
   previousStatus,
   "Workspace is stopped. Reason: " + event.getReason());
 setAbnormalStopAttributes(workspaceId, event.getReason());
origin: org.eclipse.che.multiuser/che-multiuser-permission-workspace

@Override
public void onCascadeEvent(StackPersistedEvent event) throws Exception {
 final Subject subject = EnvironmentContext.getCurrent().getSubject();
 if (!subject.isAnonymous()) {
  permissionsManager.storePermission(
    new StackPermissionsImpl(
      subject.getUserId(), event.getStack().getId(), StackDomain.getActions()));
 }
}
origin: org.eclipse.che.multiuser/che-multiuser-permission-workspace

@Transactional(rollbackOn = {RuntimeException.class, ServerException.class})
protected void doRemove(String id) throws ServerException {
 final EntityManager manager = managerProvider.get();
 final StackImpl stack = manager.find(StackImpl.class, id);
 if (stack != null) {
  eventService.publish(new BeforeStackRemovedEvent(new StackImpl(stack))).propagateException();
  manager.remove(stack);
  manager.flush();
 }
}
origin: org.eclipse.che.multiuser/che-multiuser-permission-workspace

@Transactional(rollbackOn = {RuntimeException.class, ServerException.class})
protected Optional<WorkspaceImpl> doRemove(String id) throws ServerException {
 final WorkspaceImpl workspace = managerProvider.get().find(WorkspaceImpl.class, id);
 if (workspace == null) {
  return Optional.empty();
 }
 final EntityManager manager = managerProvider.get();
 eventService
   .publish(new BeforeWorkspaceRemovedEvent(new WorkspaceImpl(workspace)))
   .propagateException();
 manager.remove(workspace);
 manager.flush();
 return Optional.of(workspace);
}
origin: org.eclipse.che.multiuser/che-multiuser-permission-workspace

@Transactional(rollbackOn = {RuntimeException.class, ApiException.class})
protected void doCreate(StackImpl stack) throws ConflictException, ServerException {
 if (stack.getWorkspaceConfig() != null) {
  stack.getWorkspaceConfig().getProjects().forEach(ProjectConfigImpl::prePersistAttributes);
 }
 EntityManager manager = managerProvider.get();
 manager.persist(stack);
 manager.flush();
 eventService.publish(new StackPersistedEvent(stack)).propagateException();
}
origin: org.eclipse.che.multiuser/che-multiuser-permission-workspace

@Override
public void onCascadeEvent(BeforeWorkspaceRemovedEvent event) throws Exception {
 removeWorkers(event.getWorkspace().getId(), PAGE_SIZE);
}
org.eclipse.che.api.workspace.server.event

Most used classes

  • BeforeWorkspaceRemovedEvent
    Published before WorkspaceImpl removed.
  • BeforeStackRemovedEvent
    Pre-removal event of StackImpl.
  • StackPersistedEvent
    Published after stack instance is persisted.
  • RuntimeAbnormalStoppedEvent
    Should be propagated after Infrastructure stopped a runtime because of any fatal error.
  • RuntimeAbnormalStoppingEvent
    Should be propagated before Infrastructure stops a runtime because of any fatal error.
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now