Java 类ims.core.vo.domain.QueuedNotificationVoAssembler 实例源码

项目:AvoinApotti    文件:NotificationsProvider.java   
public IQueuedNotification[] queueNotification(int userId, NotificationPriority priority, String message, String source, String entityName, Integer entityId, NotificationDelivery[] delivery) throws Exception     
{
    IQueuedNotification[] result = new IQueuedNotification[delivery.length]; 

    DomainFactory factory =  getDomainFactory();
    for(int x = 0; x < delivery.length; x++)
    {
        QueuedNotificationVo valueObject = new QueuedNotificationVo();

        valueObject.setDateTime(new DateTime());
        valueObject.setUserId(userId);
        valueObject.setPriority(priority.getId());
        valueObject.setMessage(message);
        valueObject.setSource(source);
        valueObject.setEntityType(entityName);
        valueObject.setEntityId(entityId);
        valueObject.setDeliveryMethod(delivery[x].getId());

        String[] errors = valueObject.validate();
        if(errors != null && errors.length > 0)
            throw new Exception("Unable to queue notifications because of validation errors");

        QueuedNotification domainObject = QueuedNotificationVoAssembler.extractQueuedNotification(factory, valueObject);
        factory.save(domainObject);
        valueObject = QueuedNotificationVoAssembler.create(domainObject);
        result[x] = valueObject;
    }

    return result;
}
项目:openMAXIMS    文件:NotificationsProvider.java   
public IQueuedNotification[] queueNotification(int userId, NotificationPriority priority, String message, String source, String entityName, Integer entityId, NotificationDelivery[] delivery) throws Exception     
{
    IQueuedNotification[] result = new IQueuedNotification[delivery.length]; 

    DomainFactory factory =  getDomainFactory();
    for(int x = 0; x < delivery.length; x++)
    {
        QueuedNotificationVo valueObject = new QueuedNotificationVo();

        valueObject.setDateTime(new DateTime());
        valueObject.setUserId(userId);
        valueObject.setPriority(priority.getId());
        valueObject.setMessage(message);
        valueObject.setSource(source);
        valueObject.setEntityType(entityName);
        valueObject.setEntityId(entityId);
        valueObject.setDeliveryMethod(delivery[x].getId());

        String[] errors = valueObject.validate();
        if(errors != null && errors.length > 0)
            throw new Exception("Unable to queue notifications because of validation errors");

        QueuedNotification domainObject = QueuedNotificationVoAssembler.extractQueuedNotification(factory, valueObject);
        factory.save(domainObject);
        valueObject = QueuedNotificationVoAssembler.create(domainObject);
        result[x] = valueObject;
    }

    return result;
}
项目:openMAXIMS    文件:NotificationsProvider.java   
public IQueuedNotification[] queueNotification(int userId, NotificationPriority priority, String message, String source, String entityName, Integer entityId, NotificationDelivery[] delivery) throws Exception     
{
    IQueuedNotification[] result = new IQueuedNotification[delivery.length]; 

    DomainFactory factory =  getDomainFactory();
    for(int x = 0; x < delivery.length; x++)
    {
        QueuedNotificationVo valueObject = new QueuedNotificationVo();

        valueObject.setDateTime(new DateTime());
        valueObject.setUserId(userId);
        valueObject.setPriority(priority.getId());
        valueObject.setMessage(message);
        valueObject.setSource(source);
        valueObject.setEntityType(entityName);
        valueObject.setEntityId(entityId);
        valueObject.setDeliveryMethod(delivery[x].getId());

        String[] errors = valueObject.validate();
        if(errors != null && errors.length > 0)
            throw new Exception("Unable to queue notifications because of validation errors");

        QueuedNotification domainObject = QueuedNotificationVoAssembler.extractQueuedNotification(factory, valueObject);
        factory.save(domainObject);
        valueObject = QueuedNotificationVoAssembler.create(domainObject);
        result[x] = valueObject;
    }

    return result;
}
项目:openmaxims-linux    文件:NotificationsProvider.java   
public IQueuedNotification[] queueNotification(int userId, NotificationPriority priority, String message, String source, String entityName, Integer entityId, NotificationDelivery[] delivery) throws Exception     
{
    IQueuedNotification[] result = new IQueuedNotification[delivery.length]; 

    DomainFactory factory =  getDomainFactory();
    for(int x = 0; x < delivery.length; x++)
    {
        QueuedNotificationVo valueObject = new QueuedNotificationVo();

        valueObject.setDateTime(new DateTime());
        valueObject.setUserId(userId);
        valueObject.setPriority(priority.getId());
        valueObject.setMessage(message);
        valueObject.setSource(source);
        valueObject.setEntityType(entityName);
        valueObject.setEntityId(entityId);
        valueObject.setDeliveryMethod(delivery[x].getId());

        String[] errors = valueObject.validate();
        if(errors != null && errors.length > 0)
            throw new Exception("Unable to queue notifications because of validation errors");

        QueuedNotification domainObject = QueuedNotificationVoAssembler.extractQueuedNotification(factory, valueObject);
        factory.save(domainObject);
        valueObject = QueuedNotificationVoAssembler.create(domainObject);
        result[x] = valueObject;
    }

    return result;
}
项目:AvoinApotti    文件:NotificationsProvider.java   
public IQueuedNotification getQueuedNotification(int queuedNotificationId) 
{
    return QueuedNotificationVoAssembler.create((QueuedNotification)getDomainFactory().getDomainObject(QueuedNotification.class, queuedNotificationId));
}
项目:openMAXIMS    文件:NotificationsProvider.java   
public IQueuedNotification getQueuedNotification(int queuedNotificationId) 
{
    return QueuedNotificationVoAssembler.create((QueuedNotification)getDomainFactory().getDomainObject(QueuedNotification.class, queuedNotificationId));
}
项目:openMAXIMS    文件:NotificationsProvider.java   
public IQueuedNotification getQueuedNotification(int queuedNotificationId) 
{
    return QueuedNotificationVoAssembler.create((QueuedNotification)getDomainFactory().getDomainObject(QueuedNotification.class, queuedNotificationId));
}
项目:openmaxims-linux    文件:NotificationsProvider.java   
public IQueuedNotification getQueuedNotification(int queuedNotificationId) 
{
    return QueuedNotificationVoAssembler.create((QueuedNotification)getDomainFactory().getDomainObject(QueuedNotification.class, queuedNotificationId));
}