• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java UUIDGenerator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.axiom.om.util.UUIDGenerator的典型用法代码示例。如果您正苦于以下问题:Java UUIDGenerator类的具体用法?Java UUIDGenerator怎么用?Java UUIDGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UUIDGenerator类属于org.apache.axiom.om.util包,在下文中一共展示了UUIDGenerator类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createMessageContext

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
/**
 * Create a new axis MessageContext for an incoming message through this transport
 * @return the newly created message context
 */
public MessageContext createMessageContext() {
    MessageContext msgCtx = new MessageContext();
    msgCtx.setConfigurationContext(cfgCtx);

    msgCtx.setIncomingTransportName(getTransportName());
    msgCtx.setTransportOut(transportOut);
    msgCtx.setTransportIn(transportIn);
    msgCtx.setServerSide(true);
    msgCtx.setMessageID(UUIDGenerator.getUUID());

    // There is a discrepency in what I thought, Axis2 spawns a nes threads to
    // send a message is this is TRUE - and I want it to be the other way
    msgCtx.setProperty(MessageContext.CLIENT_API_NON_BLOCKING, Boolean.valueOf(!isNonBlocking));

    // are these relevant?
    //msgCtx.setServiceGroupContextId(UUIDGenerator.getUUID());
    // this is required to support Sandesha 2
    //msgContext.setProperty(RequestResponseTransport.TRANSPORT_CONTROL,
    //        new HttpCoreRequestResponseTransport(msgContext));

    return msgCtx;
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:27,代码来源:AbstractTransportListener.java


示例2: testSetPropertyInServiceGroupContext2

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
public void testSetPropertyInServiceGroupContext2() throws Exception {
    if (!canRunTests) {
        return;
    }

    String sgcID = UUIDGenerator.getUUID();

    ServiceGroupContext serviceGroupContext1 =
            configurationContext1.createServiceGroupContext(serviceGroup1);
    serviceGroupContext1.setId(sgcID);
    configurationContext1.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext1);
    assertNotNull(serviceGroupContext1);

    ServiceGroupContext serviceGroupContext2 =
            configurationContext2.createServiceGroupContext(serviceGroup2);
    serviceGroupContext2.setId(sgcID);
    configurationContext2.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext2);
    assertNotNull(serviceGroupContext2);

    String key1 = "sgCtxKey";
    String val1 = "sgCtxVal1";
    serviceGroupContext1.setProperty(key1, val1);
    ctxMan1.updateContext(serviceGroupContext1);

    assertEquals(val1, serviceGroupContext2.getProperty(key1));
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:27,代码来源:ContextReplicationTest.java


示例3: testDataSourceWithTXTPlusAttachment

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
public void testDataSourceWithTXTPlusAttachment() throws Exception {
        Dispatch<DataSource> dispatch = getDispatch();

        Map attachments = new HashMap();
        Map requestContext = dispatch.getRequestContext();

//        requestContext.put(org.apache.axis2.transport.http.HTTPConstants.SO_TIMEOUT , new 
//        Integer(999999));
//        requestContext.put(org.apache.axis2.transport.http.HTTPConstants.CONNECTION_TIMEOUT, new 
//        Integer(999999));

        requestContext.put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS,
                attachments);
        attachments.put(UUIDGenerator.getUUID(), new DataHandler(attachmentDS));

        DataSource request = txtDS;
        DataSource response = dispatch.invoke(request);
        assertTrue(response != null);
        assertEquals(response.getContentType(),"text/plain");
        String req = new String(getStreamAsByteArray(request.getInputStream()));
        String res = new String(getStreamAsByteArray(response.getInputStream()));
        assertEquals(req, res);
        Map attachments2 = (Map) dispatch.getResponseContext().get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
        assertTrue(attachments2 != null);
        assertEquals(attachments2.size(), 1);
    }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:27,代码来源:DispatchXMessageDataSourceTests.java


示例4: testDataSourceWithImagePlusAttachment

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
public void testDataSourceWithImagePlusAttachment() throws Exception {
    Dispatch<DataSource> dispatch = getDispatch();

    Map attachments = new HashMap();
    Map requestContext = dispatch.getRequestContext();

    requestContext.put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS,
            attachments);
    attachments.put(UUIDGenerator.getUUID(), new DataHandler(attachmentDS));
    
    DataSource request = imageDS;
    DataSource response = dispatch.invoke(request);
    assertTrue(response != null);
    assertEquals(response.getContentType(),"image/jpeg");
    assertTrue(Arrays.equals(getStreamAsByteArray(request.getInputStream()), 
            getStreamAsByteArray(response.getInputStream())));
    Map attachments2 = (Map) dispatch.getResponseContext().get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
    assertTrue(attachments2 != null);
    assertEquals(attachments2.size(), 1);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:21,代码来源:DispatchXMessageDataSourceTests.java


示例5: testDataSourceWithTXTPlusTwoAttachments

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
public void testDataSourceWithTXTPlusTwoAttachments() throws Exception {
    Dispatch<DataSource> dispatch = getDispatch();

    Map attachments = new HashMap();
    Map requestContext = dispatch.getRequestContext();

    requestContext.put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS,
            attachments);
    attachments.put(UUIDGenerator.getUUID(), new DataHandler(attachmentDS));
    attachments.put(UUIDGenerator.getUUID(), new DataHandler(imageDS));

    DataSource request = txtDS;
    DataSource response = dispatch.invoke(request);
    assertTrue(response != null);
    assertEquals(response.getContentType(),"text/plain");
    String req = new String(getStreamAsByteArray(request.getInputStream()));
    String res = new String(getStreamAsByteArray(response.getInputStream()));
    assertEquals(req, res);
    Map attachments2 = (Map) dispatch.getResponseContext().get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
    assertTrue(attachments2 != null);
    assertEquals(attachments2.size(), 2);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:23,代码来源:DispatchXMessageDataSourceTests.java


示例6: addPolicyToAllBindings

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
public void addPolicyToAllBindings(AxisService axisService, Policy policy)
        throws ServerException {
    try {
        if (policy.getId() == null) {
            // Generate an ID
            policy.setId(UUIDGenerator.getUUID());
        }
        Map endPointMap = axisService.getEndpoints();
        for (Object o : endPointMap.entrySet()) {
            Map.Entry entry = (Map.Entry) o;
            AxisEndpoint point = (AxisEndpoint) entry.getValue();
            AxisBinding binding = point.getBinding();
            String bindingName = binding.getName().getLocalPart();

            //only UTOverTransport is allowed for HTTP
            if (bindingName.endsWith("HttpBinding") &&
                    (!policy.getAttributes().containsValue("UTOverTransport"))) {
                continue;
            }
            binding.getPolicySubject().attachPolicy(policy);
            // Add the new policy to the registry
        }
    } catch (Exception e) {
        log.error("Error in adding security policy to all bindings", e);
        throw new ServerException("addPoliciesToService", e);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:28,代码来源:SecurityDeploymentInterceptor.java


示例7: addSecurityPolicyToAllBindings

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
/**
 * This method add Policy to service at the Registry. Does not add the
 * policy to Axis2. To all Bindings available
 *
 * @param axisService Service
 * @param policy      Policy
 * @throws org.wso2.carbon.utils.ServerException se
 */
public void addSecurityPolicyToAllBindings(AxisService axisService, Policy policy)
        throws ServerException {
    try {
        if (policy.getId() == null) {
            policy.setId(UUIDGenerator.getUUID());
        }

        Map endPointMap = axisService.getEndpoints();
        for (Object o : endPointMap.entrySet()) {
            Map.Entry entry = (Map.Entry) o;
            AxisEndpoint point = (AxisEndpoint) entry.getValue();
            AxisBinding binding = point.getBinding();
            String bindingName = binding.getName().getLocalPart();

            //only UTOverTransport is allowed for HTTP
            if (bindingName.endsWith("HttpBinding") &&
                    (!policy.getAttributes().containsValue("UTOverTransport"))) {
                continue;
            }
            binding.getPolicySubject().attachPolicy(policy);

        }
    } catch (Exception e) {
        log.error("Error in adding security policy to all bindings", e);
        throw new ServerException("addPoliciesToService", e);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:36,代码来源:SecurityServiceAdmin.java


示例8: createMessageContext

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
private MessageContext createMessageContext() throws AxisFault {
    MessageContext msgCtx = createSynapseMessageContext();
    org.apache.axis2.context.MessageContext axis2MsgCtx = ((Axis2MessageContext) msgCtx).getAxis2MessageContext();
    axis2MsgCtx.setServerSide(true);
    axis2MsgCtx.setMessageID(UUIDGenerator.getUUID());
    return msgCtx;
}
 
开发者ID:wso2-extensions,项目名称:esb-connector-file,代码行数:8,代码来源:FileMoveUnitTest.java


示例9: createMessageContext

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
/**
 * Create the message context.
 */
private MessageContext createMessageContext() {
    MessageContext msgCtx = this.synapseEnvironment.createMessageContext();
    org.apache.axis2.context.MessageContext axis2MsgCtx = ((Axis2MessageContext) msgCtx).getAxis2MessageContext();
    axis2MsgCtx.setServerSide(true);
    axis2MsgCtx.setMessageID(UUIDGenerator.getUUID());
    return msgCtx;
}
 
开发者ID:wso2-extensions,项目名称:esb-inbound-amazonsqs,代码行数:11,代码来源:AmazonSQSPollingConsumer.java


示例10: addSecurityPolicyToAllBindings

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
/**
 * This method add Policy to service at the Registry. Does not add the
 * policy to Axis2. To all Bindings available
 *
 * @param axisService Service
 * @param policy      Policy
 * @throws org.wso2.carbon.utils.ServerException se
 */
public void addSecurityPolicyToAllBindings(AxisService axisService, Policy policy)
        throws ServerException {
    String serviceGroupId = axisService.getAxisServiceGroup().getServiceGroupName();
    try {
        if (policy.getId() == null) {
            policy.setId(UUIDGenerator.getUUID());
        }

        Map endPointMap = axisService.getEndpoints();
        for (Object o : endPointMap.entrySet()) {
            Map.Entry entry = (Map.Entry) o;
            AxisEndpoint point = (AxisEndpoint) entry.getValue();
            AxisBinding binding = point.getBinding();
            String bindingName = binding.getName().getLocalPart();

            //only UTOverTransport is allowed for HTTP
            if (bindingName.endsWith("HttpBinding") &&
                    (!policy.getAttributes().containsValue("UTOverTransport"))) {
                continue;
            }
            binding.getPolicySubject().attachPolicy(policy);

        }
    } catch (Exception e) {
        log.error("Error in adding security policy to all bindings", e);
        throw new ServerException("addPoliciesToService", e);
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:37,代码来源:SecurityServiceAdmin.java


示例11: updateMessageID

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
@Override
protected void updateMessageID() throws MessagingException {
    // although MailConstants.MAIL_HEADER_X_MESSAGE_ID solves the gmail problem with axis2-axis2
    // invocations it is not a generic solution.
    // we can over come gmail problem by setting the message id as follows with a valid gmail address
    // <[email protected]> this can be achived by appending from address at the end of uuid
 if (getHeader(MailConstants.MAIL_HEADER_MESSAGE_ID) == null) {
        String uuid = "<" + UUIDGenerator.getUUID().replaceAll(":",".") + fromAddress +">";
        setHeader(MailConstants.MAIL_HEADER_MESSAGE_ID, uuid);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:12,代码来源:WSMimeMessage.java


示例12: sendMessage

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
protected String sendMessage(ContentType contentType, byte[] message) throws Exception {
    String msgId = UUIDGenerator.getUUID();
    MimeMessage msg = new MimeMessage(session);
    msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(channel.getRecipient().getAddress()));
    msg.setFrom(new InternetAddress(channel.getSender().getAddress()));
    msg.setSentDate(new Date());
    msg.setHeader(MailConstants.MAIL_HEADER_MESSAGE_ID, msgId);
    msg.setHeader(MailConstants.MAIL_HEADER_X_MESSAGE_ID, msgId);
    DataHandler dh = new DataHandler(new ByteArrayDataSource(message, contentType.toString()));
    layout.setupMessage(msg, dh);
    Transport.send(msg);
    return msgId;
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:14,代码来源:MailClient.java


示例13: createMessageContext

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
private MessageContext createMessageContext(OperationContext oc, ConfigurationContext cc,
                                                int flowType) throws Exception {
        MessageContext mc = cc.createMessageContext();

        mc.setFLOW(flowType);
        mc.setTransportIn(transportIn);
        mc.setTransportOut(transportOut);

        mc.setServerSide(true);
//        mc.setProperty(MessageContext.TRANSPORT_OUT, System.out);

        SOAPFactory omFac = OMAbstractFactory.getSOAP11Factory();
        mc.setEnvelope(omFac.getDefaultEnvelope());

        AxisOperation axisOperation = oc.getAxisOperation();
        String action = axisOperation.getName().getLocalPart();
        mc.setSoapAction(action);
//        System.out.flush();

        mc.setMessageID(UUIDGenerator.getUUID());

        axisOperation.registerOperationContext(mc, oc);
        mc.setOperationContext(oc);

        ServiceContext sc = oc.getServiceContext();
        mc.setServiceContext(sc);

        mc.setTo(new EndpointReference("axis2/services/NullService"));
        mc.setWSAAction("DummyOp");

        AxisMessage axisMessage = axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        mc.setAxisMessage(axisMessage);

        return mc;
    }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:36,代码来源:MessageContextSaveCTest.java


示例14: createMessageContext

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
private MessageContext createMessageContext(OperationContext oc) throws Exception {
        MessageContext mc = configurationContext.createMessageContext();
        mc.setTransportIn(transportIn);
        mc.setTransportOut(transportOut);

        mc.setServerSide(true);
//        mc.setProperty(MessageContext.TRANSPORT_OUT, System.out);

        SOAPFactory omFac = OMAbstractFactory.getSOAP11Factory();
        mc.setEnvelope(omFac.getDefaultEnvelope());

        AxisOperation axisOperation = oc.getAxisOperation();
        String action = axisOperation.getName().getLocalPart();
        mc.setSoapAction(action);
//        System.out.flush();

        mc.setMessageID(UUIDGenerator.getUUID());

        axisOperation.registerOperationContext(mc, oc);
        mc.setOperationContext(oc);

        ServiceContext sc = oc.getServiceContext();
        mc.setServiceContext(sc);

        mc.setTo(new EndpointReference("axis2/services/NullService"));
        mc.setWSAAction("DummyOp");

        AxisMessage axisMessage = axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        mc.setAxisMessage(axisMessage);

        return mc;
    }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:33,代码来源:MessageContextSaveBTest.java


示例15: testRemovePropertyFromServiceGroupContext2

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
public void testRemovePropertyFromServiceGroupContext2() throws Exception {
    if (!canRunTests) {
        return;
    }

    // Add the property
    String sgcID = UUIDGenerator.getUUID();

    ServiceGroupContext serviceGroupContext1 =
            configurationContext1.createServiceGroupContext(serviceGroup1);
    serviceGroupContext1.setId(sgcID);
    configurationContext1.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext1);
    assertNotNull(serviceGroupContext1);

    ServiceGroupContext serviceGroupContext2 =
            configurationContext2.createServiceGroupContext(serviceGroup2);
    serviceGroupContext2.setId(sgcID);
    configurationContext2.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext2);
    assertNotNull(serviceGroupContext2);

    String key1 = "sgCtxKey";
    String val1 = "sgCtxVal1";
    serviceGroupContext1.setProperty(key1, val1);
    ctxMan1.updateContext(serviceGroupContext1);

    assertEquals(val1, serviceGroupContext2.getProperty(key1));

    // Remove the property
    serviceGroupContext2.removeProperty(key1);
    assertNull(serviceGroupContext2.getProperty(key1));
    ctxMan2.updateContext(serviceGroupContext2);
    assertNull(serviceGroupContext1.getProperty(key1));
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:34,代码来源:ContextReplicationTest.java


示例16: getContentID

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
/**
 * @return ContentID
 */
public String getContentID() {
    if (cid == null) {
        cid = UUIDGenerator.getUUID();
        // Per spec, use the partName in the content-id
        // http://www.ws-i.org/Profiles/AttachmentsProfile-1.0.html#Value-space_of_Content-Id_Header
        if (partName != null) {
            cid = partName + "=" + cid;
        }
    }
    return cid;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:15,代码来源:Attachment.java


示例17: setUp

import org.apache.axiom.om.util.UUIDGenerator; //导入依赖的package包/类
protected void setUp() throws Exception {
    //org.apache.log4j.BasicConfigurator.configure();

    invokecallcount = 0;

    mc = cfgContext.createMessageContext();
    mc.setTransportIn(transportIn);
    mc.setTransportOut(transportOut);

    mc.setServerSide(true);
    mc.setProperty(MessageContext.TRANSPORT_OUT, System.out);

    SOAPFactory omFac = OMAbstractFactory.getSOAP11Factory();
    mc.setEnvelope(omFac.getDefaultEnvelope());

    phase1 = new Phase("1");
    phase1.addHandler(new TempHandler02(0));
    phase1.addHandler(new TempHandler02(1));

    phase2 = new Phase("2");
    phase2.addHandler(new TempHandler02(2));
    phase2.addHandler(handler02);
    phase2.addHandler(new TempHandler02(3));

    phase3 = new Phase("3");
    phase3.addHandler(new TempHandler02(4));
    phase3.addHandler(subhandler);
    phase3.addHandler(handler02);  // same instance, second insertion
    phase3.addHandler(new TempHandler02(5));

    /*
     * TODO:  WARNING WARNING WARNING
     * Ideally inserting subPhase here would make the axis2 engine call
     * the invoke of nested subhandler.  It does not do this.  Please see the
     * warning at bottom of testPause06 method.
     */
    subPhase = new Phase("sub");
    subPhase.addHandler(subhandler);
    phase3.addHandler(subPhase);
    phase3.addHandler(new TempHandler02(6));
    phase3.addHandler(new TempHandler02(7));

    axisOperation.getRemainingPhasesInFlow().add(phase1);
    axisOperation.getRemainingPhasesInFlow().add(phase2);
    axisOperation.getRemainingPhasesInFlow().add(phase3);


    mc.setMessageID(UUIDGenerator.getUUID());

    //operationContext.addMessageContext(mc);  gets done via the register
    axisOperation.registerOperationContext(mc, operationContext);
    mc.setOperationContext(operationContext);
    mc.setServiceContext(serviceContext);

    mc.setTo(new EndpointReference("axis2/services/NullService"));

    mc.setWSAAction(operationName.getLocalPart());
    mc.setSoapAction(operationName.getLocalPart());

}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:61,代码来源:MessageContextSelfManagedDataTest.java



注:本文中的org.apache.axiom.om.util.UUIDGenerator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DBFException类代码示例发布时间:2022-05-23
下一篇:
Java IDocument类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap