⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deleteservice.java

📁 OpenWeb-UDDI是UDDI V2标准的实现
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   DeleteService.java

package org.huihoo.openweb.uddiserver.publish;

import java.io.IOException;
import java.io.PrintStream;
import java.sql.*;
import java.util.Enumeration;
import org.huihoo.openweb.uddi.*;
import org.huihoo.openweb.uddiserver.util.SqlConnection;

// Referenced classes of package org.huihoo.openweb.uddiserver.publish:
//            Authority, DeleteBinding

public class DeleteService
{

    Connection con;

    public DeleteService(Connection c)
    {
        con = c;
    }

    public UddiObject delete(Delete_Service ds)
        throws SQLException, UDDIXmlException, ClassNotFoundException, IOException
    {
        AuthInfo authinfo = ds.getAuthInfo();
        DispositionReport dr = new DispositionReport();
        if(authinfo == null || authinfo.getValue() == null || authinfo.getValue().equals(""))
        {
            Result result = Result.getResult(10120, "No auth token given");
            dr.setResult(result);
            return dr;
        }
        Enumeration enum = ds.getServiceKey();
        ServiceKey sKey = null;
        String serviceKey = null;
        while(enum.hasMoreElements()) 
        {
            sKey = (ServiceKey)enum.nextElement();
            serviceKey = sKey.getValue().trim();
            if(!SqlConnection.isPresent("BusinessService", "servicekey", serviceKey))
            {
                Result result = Result.getResult(10210, "This service key is invalid: " + serviceKey);
                dr.setResult(result);
                return dr;
            }
        }
        if(sKey == null)
        {
            Result result = Result.getResult(10500, "No Service Key specified");
            dr.setResult(result);
            return dr;
        }
        for(enum = ds.getServiceKey(); enum.hasMoreElements(); dr.setResult(delete(authinfo, serviceKey)))
        {
            sKey = (ServiceKey)enum.nextElement();
            serviceKey = sKey.getValue().trim();
        }

        return dr;
    }

    public Result delete(AuthInfo aInfo, String serviceKey)
        throws SQLException, ClassNotFoundException, IOException
    {
        String userid = SqlConnection.getUserIdfromServiceKey(serviceKey);
        String authInfo = aInfo.getValue().trim();
        if(!SqlConnection.isPresent("authentiTokens", "keys", authInfo))
        {
            Result result = Result.getResult(10120, "Auth token is not valid");
            return result;
        }
        if(!Authority.isAuthorised(userid, authInfo))
        {
            Result result = Result.getResult(10140, "Binding template not controlled by this user");
            return result;
        }
        Statement stmt = con.createStatement();
        System.out.println("begin!!!!!!");
        String query = "DELETE from BindingTemplate where servicekey = '" + serviceKey + "'";
        System.out.println(query);
        stmt.executeUpdate(query);
        System.out.println("wwwwwwww!!!!!!");
        stmt.close();
        Statement stmt1 = con.createStatement();
        DeleteBinding DB = new DeleteBinding(con);
        query = "select * from BindingTemplate where servicekey = '" + serviceKey + "'";
        System.out.println(query);
        ResultSet rs = stmt1.executeQuery(query);
        System.out.println("iiiiiiiiiiiiiiii!!!!!!");
        String bindingkey;
        for(; rs.next(); DB.delete(aInfo, new BindingKey(bindingkey)))
        {
            bindingkey = rs.getString("bindingkey");
            System.out.println("bindingkey" + bindingkey);
        }

        stmt1.close();
        Statement stmt2 = con.createStatement();
        System.out.println("weqewqewqeqwe!!!!!!");
        query = "DELETE from BusinessService where servicekey = '" + serviceKey + "'";
        stmt2.executeUpdate(query);
        stmt2.close();
        return Result.getResult(0, "successful");
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -