Package com.degloba.boundedContext.application.api.handlers

Source Code of com.degloba.boundedContext.application.api.handlers.ChangeModalpanelStatusCommandHandler

package com.degloba.boundedContext.application.api.handlers;

import javax.inject.Inject;

import com.degloba.boundedContext.application.api.commands.ChangeModalpanelStatusCommand;
import com.degloba.boundedContext.domain.modalpanel.Modalpanel;
import com.degloba.boundedContext.domain.modalpanel.IModalpanelRepository;

// CQRS
import command.annotations.CommandHandlerAnnotation;
import command.handler.ICommandHandler;


/**
* @author degloba
*
*/
@CommandHandlerAnnotation
public class ChangeModalpanelStatusCommandHandler<K> implements ICommandHandler<ChangeModalpanelStatusCommand>{

  @Inject
  private IModalpanelRepository<Long> modalpanelRepository;

  @Override
  public Void handle(ChangeModalpanelStatusCommand command) {
    Modalpanel modalpanel = modalpanelRepository.load(command.getModalpanelId());
    modalpanel.changeStatus(command.getStatus());
    modalpanelRepository.save(modalpanel);   
    return null;
  }

}
TOP

Related Classes of com.degloba.boundedContext.application.api.handlers.ChangeModalpanelStatusCommandHandler

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.