📄 deletebinding.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: DeleteBinding.java
package org.huihoo.openweb.uddiserver.publish;
import java.io.IOException;
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
public class DeleteBinding
{
Connection con;
public DeleteBinding(Connection c)
{
con = c;
}
public UddiObject delete(Delete_Binding db)
throws SQLException, UDDIXmlException, ClassNotFoundException, IOException
{
AuthInfo authinfo = db.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 = db.getBindingKey();
BindingKey bindingKey = null;
while(enum.hasMoreElements())
{
bindingKey = (BindingKey)enum.nextElement();
if(!SqlConnection.isPresent("BindingTemplate", "bindingkey", bindingKey.getValue().trim()))
{
Result result = Result.getResult(10210, "This binding key is invalid: " + bindingKey.getValue());
dr.setResult(result);
return dr;
}
}
if(bindingKey == null)
{
Result result = Result.getResult(10500, "No Binding Key specified");
dr.setResult(result);
return dr;
}
for(enum = db.getBindingKey(); enum.hasMoreElements(); dr.setResult(delete(authinfo, bindingKey)))
bindingKey = (BindingKey)enum.nextElement();
return dr;
}
public Result delete(AuthInfo aInfo, BindingKey bKey)
throws SQLException, ClassNotFoundException, IOException
{
Statement stmt = con.createStatement();
String bindingKey = bKey.getValue().trim();
String authInfo = aInfo.getValue().trim();
String userid = SqlConnection.getUserIdfromBindingKey(bindingKey);
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;
} else
{
String query = "DELETE from InstanceDetails where bindingkey = '" + bindingKey + "'";
stmt.executeUpdate(query);
query = "DELETE from BindingTemplate where bindingkey = '" + bindingKey + "'";
stmt.executeUpdate(query);
stmt.close();
return Result.getResult(0, "successful");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -