`
endual
  • 浏览: 3558357 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

juddiv3 client publisher代码

 
阅读更多

package
 juddiv3admin.juddiv3;
 
import
 java.util.ArrayList;
import
 java.util.List;
import
 juddiv3admin.gui.GUI;
import
 org.apache.juddi.api_v3.*;
import
 org.uddi.api_v3.*;
 
public
 class
 QueryBuilder
{
    //--------------------------- Business ---------------------------

    public
 static
 FindBusiness GetFindBusinessAll()
    {
        Name name = new
 Name();
        name.setValue("%"
);
        FindQualifiers qualifiers = new
 FindQualifiers();
        qualifiers.getFindQualifier().add(FindQualifiersAbbreviations.APPROXIMATE_MATCH);
        FindBusiness findBusiness = new
 FindBusiness();
        findBusiness.getName().add(name);
        findBusiness.setFindQualifiers(qualifiers);
        return
 findBusiness;
    }
 
    public
 static
 SaveBusiness GetSaveBusiness(BusinessEntity businessEntity, AuthToken authToken) throws
 Exception
    {
        if
 (businessEntity == null
)
        {
            return
 null
;
        }
        if
 (authToken == null
)
        {
            throw
 GUI.GetExceptionNoAuthorization();
        }
        SaveBusiness sb = new
 SaveBusiness();
        sb.getBusinessEntity().add(businessEntity);
        sb.setAuthInfo(authToken.getAuthInfo());
        return
 sb;
    }
 
    public
 static
 DeleteBusiness GetDeleteBusiness(BusinessEntity businessEntity, AuthToken authToken) throws
 Exception
    {
        if
 (businessEntity == null
)
        {
            return
 null
;
        }
        if
 (authToken == null
)
        {
            throw
 GUI.GetExceptionNoAuthorization();
        }
        DeleteBusiness db = new
 DeleteBusiness();
        db.setAuthInfo(authToken.getAuthInfo());
        db.getBusinessKey().add(businessEntity.getBusinessKey());
        return
 db;
    }
 
    public
 static
 DeleteBusiness GetDeleteBusiness(BusinessDetail businessDetail, AuthToken authToken) throws
 Exception
    {
        if
 (businessDetail == null
)
        {
            return
 null
;
        }
        if
 (businessDetail.getBusinessEntity() == null
)
        {
            return
 null
;
        }
        if
 (authToken == null
)
        {
            throw
 GUI.GetExceptionNoAuthorization();
        }
        DeleteBusiness db = new
 DeleteBusiness();
        db.setAuthInfo(authToken.getAuthInfo());
        for
 (BusinessEntity businessEntity : businessDetail.getBusinessEntity())
        {
            db.getBusinessKey().add(businessEntity.getBusinessKey());
        }
        return
 db;
    }
    //--------------------------- end of Business ---------------------------

    //--------------------------- Service ---------------------------

 
    public
 static
 FindService GetFindServiceAll()
    {
        Name name = new
 Name();
        name.setValue("%"
);
        FindQualifiers qualifiers = new
 FindQualifiers();
        qualifiers.getFindQualifier().add(FindQualifiersAbbreviations.APPROXIMATE_MATCH);
        FindService findService = new
 FindService();
        findService.getName().add(name);
        findService.setFindQualifiers(qualifiers);
        return
 findService;
    }
 
    public
 static
 DeleteService GetDeleteService(BusinessService businessService, AuthToken authToken) throws
 Exception
    {
        if
 (businessService == null
)
        {
            return
 null
;
        }
        if
 (authToken == null
)
        {
            throw
 GUI.GetExceptionNoAuthorization();
        }
        final
 DeleteService ds = new
 DeleteService();
        ds.setAuthInfo(authToken.getAuthInfo());
        ds.getServiceKey().add(businessService.getServiceKey());
        return
 ds;
    }
 
    public
 static
 DeleteService GetDeleteService(ServiceDetail serviceDetail, AuthToken authToken) throws
 Exception
    {
        if
 (serviceDetail == null
)
        {
            return
 null
;
        }
        if
 (serviceDetail.getBusinessService() == null
)
        {
            return
 null
;
        }
        if
 (authToken == null
)
        {
            throw
 GUI.GetExceptionNoAuthorization();
        }
        DeleteService ds = new
 DeleteService();
        ds.setAuthInfo(authToken.getAuthInfo());
        for
 (BusinessService businessService : serviceDetail.getBusinessService())
        {
            ds.getServiceKey().add(businessService.getServiceKey());
        }
        return
 ds;
    }
 
    public
 static
 SaveService GetSaveService(BusinessService businessService, AuthToken authToken) throws
 Exception
    {
        if
 (businessService == null
)
        {
            return
 null
;
        }
        if
 (authToken == null
)
        {
            throw
 GUI.GetExceptionNoAuthorization();
        }
        SaveService ss = new
 SaveService();
        ss.setAuthInfo(authToken.getAuthInfo());
        ss.getBusinessService().add(businessService);
        return
 ss;
    }
 
    public
 static
 SaveService GetSaveService(List<BusinessService> businessServiceList, AuthToken authToken) throws
 Exception
    {
        if
 (businessServiceList == null
)
        {
            return
 null
;
        }
        if
 (businessServiceList.size() <= 0)
        {
            return
 null
;
        }
        if
 (authToken == null
)
        {
            throw
 GUI.GetExceptionNoAuthorization();
        }
        SaveService ss = new
 SaveService();
        ss.setAuthInfo(authToken.getAuthInfo());
        for
 (BusinessService businessService : businessServiceList)
        {
            ss.getBusinessService().add(businessService);
        }
        return
 ss;
    }
    //--------------------------- end of Service---------------------------

    //--------------------------- Publisher ---------------------------

 
    public
 static
 GetAllPublisherDetail GetAllPublisherDetail(AuthToken authToken) throws
 Exception
    {
        if
 (authToken == null
)
        {
            throw
 GUI.GetExceptionNoAuthorization();
        }
        GetAllPublisherDetail gapd = new
 GetAllPublisherDetail();
        gapd.setAuthInfo(authToken.getAuthInfo());
        return
 gapd;
    }
 
    public
 static
 SavePublisher GetSavePublisher(List<Publisher> listPublisher, AuthToken authToken) throws
 Exception
    {
        if
 (listPublisher == null
)
        {
            return
 null
;
        }
        if
 (listPublisher.size() <= 0)
        {
            return
 null
;
        }
        if
 (authToken == null
)
        {
            throw
 GUI.GetExceptionNoAuthorization();
        }
        SavePublisher sp = new
 SavePublisher();
        sp.setAuthInfo(authToken.getAuthInfo());
        sp.getPublisher().addAll(listPublisher);
        return
 sp;
    }
 
    public
 static
 SavePublisher GetSavePublisher(Publisher publisher, AuthToken authToken) throws
 Exception
    {
        List listPublisher = new
 ArrayList<Publisher>();
        listPublisher.add(publisher);
        return
 GetSavePublisher(listPublisher, authToken);
    }
 
    public
 static
 DeletePublisher GetDeletePublisher(List<String> listPublisherId, AuthToken authToken) throws
 Exception
    {
        if
 (authToken == null
)
        {
            throw
 GUI.GetExceptionNoAuthorization();
        }
        DeletePublisher dp = new
 DeletePublisher();
        dp.setAuthInfo(authToken.getAuthInfo());
        dp.getPublisherId().addAll(listPublisherId);
        return
 dp;
    }
 
    public
 static
 DeletePublisher GetDeletePublisher(Publisher publisher, AuthToken authToken) throws
 Exception
    {
        List<String> listPublisherId = new
 ArrayList<String>();
        listPublisherId.add(publisher.getAuthorizedName());
        return
 GetDeletePublisher(listPublisherId, authToken);
    }
 
    public
 static
 DeletePublisher GetDeletePublisher(String publisherId, AuthToken authToken) throws
 Exception
    {
        List<String> listPublisherId = new
 ArrayList<String>();
        listPublisherId.add(publisherId);
        return
 GetDeletePublisher(listPublisherId, authToken);
    }
 
    public
 static
 Publisher MakePublisherSimple(String authorizedName, String publisherName,
            String isAdmin, String isEnabled)
    {
        return
 MakePublisher(authorizedName, publisherName, isAdmin, isEnabled, isAdmin,
                null
, null
, null
, null
);
    }
 
    public
 static
 Publisher MakePublisher(String authorizedName, String publisherName,
            String isAdmin, String isEnabled, String emailAddress,
            Integer maxBindingsPerService, Integer maxBusiness,
            Integer maxServicePerBusiness, Integer maxTModels)
    {
        Publisher p = new
 Publisher();
        p.setAuthorizedName(authorizedName);
        p.setPublisherName(publisherName);
        p.setIsAdmin(isAdmin);
        p.setIsEnabled(isEnabled);
        p.setEmailAddress(emailAddress);
        p.setMaxBindingsPerService(maxBindingsPerService);
        p.setMaxBusinesses(maxBusiness);
        p.setMaxServicePerBusiness(maxServicePerBusiness);
        p.setMaxTModels(maxTModels);
        return
 p;
    }
    //--------------------------- end of Publisher ---------------------------

}

分享到:
评论

相关推荐

    java ftp client server 代码

    java ftp client server 代码 java ftp client server 代码 java ftp client server 代码 java ftp client server 代码

    一个功能强大的FTP Client源代码,可以适应多种OS和FTP Server

    一个功能强大的FTP Client源代码,可以适应多种OS和FTP Server

    udpclient源代码

    socketclient源代码。用于学习socket网络基础

    rmi client和server完整代码

    在这个“rmi client和server完整代码”中,我们将深入探讨RMI的工作原理以及如何构建一个简单的客户端和服务器。 一、RMI基本概念 1. 远程接口(Remote Interface):定义了客户端可以调用的远程方法。这些接口必须...

    Android代码-retrofit1-okhttp3-client

    Retrofit 1 OkHttp 3 Client A OkHttp 3 client implementation for Retrofit 1. Usage Create an instance of Ok3Client wrapping your OkHttpClient or Call.Factory and pass it to setClient. OkHttpClient ...

    live555 rtspClient源代码

    【标题】"live555 rtspClient源代码"涉及的核心技术是实时流协议(RTSP)和live555库的应用。Live555是一个开源的C++库,广泛用于实现多媒体流传输,尤其是互联网上的实时音频和视频。RTSP(Real-Time Streaming ...

    c#OPCClient源代码

    3. **opcasync.net.cs** - 这个文件很可能是源代码的主要部分,实现了异步OPC数据访问。异步访问能提高程序性能,因为它不会阻塞主线程,允许其他任务同时进行。 4. **opcasync.net.csproj** - 这是Visual Studio...

    xfire 的webservice_server端和client端代码,包括复杂类型.

    这个小实例有server和client的代码,server直接用myeclipse导入,然后添加spring2.0 aop和core,xfire1.2即可.client也是直接导入项目,然后导入jax-ws2.1api和jax-ws2.1 runtime libraries即可.这些包通过点击项目...

    XClient客户端 源代码。

    XClient客户端是一款基于开源技术开发的软件,主要由H3C公司推出,旨在提供一种灵活、可定制的客户端解决方案。源代码的开放性使得开发者能够深入理解其内部工作原理,并根据自身需求进行二次开发和定制,这对于提升...

    仿照UNP写的client代码,内有我自己的注释

    仿照UNP写的client代码,内有我自己的注释

    OpenStack HeatClient代码分析1

    《OpenStack HeatClient代码分析1》 OpenStack HeatClient是OpenStack开源云平台中的一个关键组件,它提供了命令行工具和服务API,用于管理和操作热模板(Heat Templates),以实现基础设施即代码(IaC)的概念。这...

    axis2 client源代码

    axis2Demo是演示代码。代码包含使用自定义类型的参数发送webservices、获取自定义类型的返回值的webservices、获取返回List&lt;自定义泛型&gt;类型的数据的webservices。

    OPC client VB源代码

    标题中的“OPC client VB源代码”指的是使用Visual Basic(VB)编程语言编写的客户端应用程序,该程序设计用于与OPC服务器进行通信。OPC,全称是OLE for Process Control,是工业自动化领域的一种标准接口,它允许...

    spring RichClient spring RichClient 示例源码

    3. **数据绑定**:该框架支持数据绑定机制,可以将UI控件直接与模型对象关联,减少了代码量,提高了开发效率。 4. **事件驱动**:Spring RichClient采用事件驱动模型,使得应用程序的响应性和交互性得到提升。用户...

    SIP Client 源代码

    (mailto: dotphoenix@qq.com)ppsip的升级版本,重新设计了架构,修正了大量的bugs,并且兼容旧的接口,建议使用新的接口函数,也就是ppsipv2开头的函数,视频版也即将推出

    远程控制编码server/client代码

    在这个"远程控制编码server/client代码"中,我们将深入探讨其背后的原理和实现方法。 首先,远程控制的基本概念基于TCP/IP协议栈,它允许两台计算机通过互联网或其他网络进行通信。在远程控制场景中,client端发送...

    transport-netty3-client-5.5.1-API文档-中英对照版.zip

    赠送源代码:transport-netty3-client-5.5.1-sources.jar; 赠送Maven依赖信息文件:transport-netty3-client-5.5.1.pom; 包含翻译后的API文档:transport-netty3-client-5.5.1-javadoc-API文档-中文(简体)-英语-...

    OpcClient vb源代码

    这个"OpcClient vb源代码"是一个VB(Visual Basic)编程语言编写的示例项目,专门用于演示如何创建一个OPC客户端。通过这个源代码,开发者可以学习到OPC客户端如何与OPC服务器进行交互,进行连接、读取和写入数据等...

    c# OPC UA .NET Client代码实例

    c# OPC UA .NET Client代码实例,亲测可用。 可与西门子 PLC 连接读写数据,通用型OPC UA 读写

Global site tag (gtag.js) - Google Analytics