Search in sources :

Example 21 with Notification

use of org.oasis_open.docs.ws_tx.wsat._2006._06.Notification in project narayana by jbosstm.

the class CompletionCoordinatorPortTypeImpl method commitOperation.

/**
 * @param parameters
 */
@WebMethod(operationName = "CommitOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit")
@Oneway
@Action(input = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit")
public void commitOperation(@WebParam(name = "Commit", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters") Notification parameters) {
    MessageContext ctx = webServiceCtx.getMessageContext();
    final Notification commit = parameters;
    final MAP inboundMap = AddressingHelper.inboundMap(ctx);
    final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
    TaskManager.getManager().queueTask(new Task() {

        public void executeTask() {
            CompletionCoordinatorProcessor.getProcessor().commit(commit, inboundMap, arjunaContext);
        }
    });
}
Also used : Task(com.arjuna.services.framework.task.Task) MessageContext(javax.xml.ws.handler.MessageContext) ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP) Notification(org.oasis_open.docs.ws_tx.wsat._2006._06.Notification) Action(javax.xml.ws.Action)

Example 22 with Notification

use of org.oasis_open.docs.ws_tx.wsat._2006._06.Notification in project narayana by jbosstm.

the class CoordinatorPortTypeImpl method preparedOperation.

/**
 * @param parameters
 */
@WebMethod(operationName = "PreparedOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Prepared")
@Oneway
@Action(input = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Prepared")
public void preparedOperation(@WebParam(name = "Prepared", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters") Notification parameters) {
    MessageContext ctx = webServiceCtx.getMessageContext();
    final Notification prepared = parameters;
    final MAP inboundMap = AddressingHelper.inboundMap(ctx);
    final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
    TaskManager.getManager().queueTask(new Task() {

        public void executeTask() {
            CoordinatorProcessor.getProcessor().prepared(prepared, inboundMap, arjunaContext);
        }
    });
}
Also used : Task(com.arjuna.services.framework.task.Task) MessageContext(javax.xml.ws.handler.MessageContext) ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP) Notification(org.oasis_open.docs.ws_tx.wsat._2006._06.Notification) Action(javax.xml.ws.Action)

Example 23 with Notification

use of org.oasis_open.docs.ws_tx.wsat._2006._06.Notification in project narayana by jbosstm.

the class CoordinatorPortTypeImpl method committedOperation.

/**
 * @param parameters
 */
@WebMethod(operationName = "CommittedOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Committed")
@Oneway
@Action(input = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Committed")
public void committedOperation(@WebParam(name = "Committed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters") Notification parameters) {
    MessageContext ctx = webServiceCtx.getMessageContext();
    final Notification committed = parameters;
    final MAP inboundMap = AddressingHelper.inboundMap(ctx);
    final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
    TaskManager.getManager().queueTask(new Task() {

        public void executeTask() {
            CoordinatorProcessor.getProcessor().committed(committed, inboundMap, arjunaContext);
        }
    });
}
Also used : Task(com.arjuna.services.framework.task.Task) MessageContext(javax.xml.ws.handler.MessageContext) ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP) Notification(org.oasis_open.docs.ws_tx.wsat._2006._06.Notification) Action(javax.xml.ws.Action)

Example 24 with Notification

use of org.oasis_open.docs.ws_tx.wsat._2006._06.Notification in project narayana by jbosstm.

the class CoordinatorPortTypeImpl method readOnlyOperation.

/**
 * @param parameters
 */
@WebMethod(operationName = "ReadOnlyOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/ReadOnly")
@Oneway
@Action(input = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/ReadOnly")
public void readOnlyOperation(@WebParam(name = "ReadOnly", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters") Notification parameters) {
    MessageContext ctx = webServiceCtx.getMessageContext();
    final Notification readOnly = parameters;
    final MAP inboundMap = AddressingHelper.inboundMap(ctx);
    final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
    TaskManager.getManager().queueTask(new Task() {

        public void executeTask() {
            CoordinatorProcessor.getProcessor().readOnly(readOnly, inboundMap, arjunaContext);
        }
    });
}
Also used : Task(com.arjuna.services.framework.task.Task) MessageContext(javax.xml.ws.handler.MessageContext) ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP) Notification(org.oasis_open.docs.ws_tx.wsat._2006._06.Notification) Action(javax.xml.ws.Action)

Example 25 with Notification

use of org.oasis_open.docs.ws_tx.wsat._2006._06.Notification in project ORCID-Source by ORCID.

the class JpaJaxbNotificationAdapterTest method testCustomEntityToNotification.

@Test
public void testCustomEntityToNotification() {
    NotificationCustomEntity notificationEntity = new NotificationCustomEntity();
    notificationEntity.setId(123L);
    notificationEntity.setNotificationType(NotificationType.CUSTOM);
    notificationEntity.setSubject("Test subject");
    notificationEntity.setDateCreated(DateUtils.convertToDate("2014-01-01T09:17:56"));
    notificationEntity.setReadDate(DateUtils.convertToDate("2014-03-04T17:43:06"));
    Notification notification = jpaJaxbNotificationAdapter.toNotification(notificationEntity);
    assertNotNull(notification);
    assertTrue(notification instanceof NotificationCustom);
    NotificationCustom notificationCustom = (NotificationCustom) notification;
    assertEquals(NotificationType.CUSTOM, notification.getNotificationType());
    assertEquals("Test subject", notificationCustom.getSubject());
    assertEquals("2014-01-01T09:17:56.000Z", notification.getCreatedDate().toXMLFormat());
    assertEquals("2014-03-04T17:43:06.000Z", notification.getReadDate().toXMLFormat());
}
Also used : NotificationCustom(org.orcid.jaxb.model.notification.custom_v2.NotificationCustom) NotificationCustomEntity(org.orcid.persistence.jpa.entities.NotificationCustomEntity) Notification(org.orcid.jaxb.model.notification_v2.Notification) Test(org.junit.Test)

Aggregations

Notification (org.oasis_open.docs.ws_tx.wsat._2006._06.Notification)28 Notification (org.orcid.jaxb.model.notification_v2.Notification)18 ArjunaContext (com.arjuna.webservices11.wsarj.ArjunaContext)15 MAP (org.jboss.ws.api.addressing.MAP)15 MessageContext (javax.xml.ws.handler.MessageContext)13 Task (com.arjuna.services.framework.task.Task)11 Action (javax.xml.ws.Action)11 MAPEndpoint (org.jboss.ws.api.addressing.MAPEndpoint)11 HashMap (java.util.HashMap)8 Test (org.junit.Test)8 AccessControl (org.orcid.core.security.visibility.aop.AccessControl)6 NotificationAmended (org.orcid.jaxb.model.notification.amended_v2.NotificationAmended)5 NotificationPermission (org.orcid.jaxb.model.notification.permission_v2.NotificationPermission)5 NotificationInstitutionalConnection (org.orcid.model.notification.institutional_sign_in_v2.NotificationInstitutionalConnection)5 ArrayList (java.util.ArrayList)4 NotificationCustom (org.orcid.jaxb.model.notification.custom_v2.NotificationCustom)4 ProfileEntity (org.orcid.persistence.jpa.entities.ProfileEntity)4 DBUnitTest (org.orcid.test.DBUnitTest)4 URISyntaxException (java.net.URISyntaxException)3 HashSet (java.util.HashSet)3