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

📄 smppencoder.java

📁 Java实现的点对点短消息发送协议(smpp)开发包源码
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
            return;
        }
        catch(encoderException encoderexception)
        {
            if(s != null)
                throw new encoderException(encoderexception + s);
            else
                throw encoderexception;
        }
    }

    public void AddressError(AddressError addresserror)
        throws encoderException
    {
        String s = null;
        try
        {
            if(addresserror == null)
            {
                throw new encoderException("missing.AddressError.");
            } else
            {
                s = "address.";
                Address(addresserror.address);
                s = "error.";
                int32(addresserror.error);
                return;
            }
        }
        catch(encoderException encoderexception)
        {
            if(s != null)
                throw new encoderException(encoderexception + s);
            else
                throw encoderexception;
        }
    }

    public void bindResponse(Binding binding)
        throws encoderException
    {
        String s = null;
        try
        {
            if(binding == null)
                throw new encoderException("missing.bindResponse.");
            s = "smsc.";
            if(binding.smsc != null)
            {
                asciiz(binding.smsc, 16);
                return;
            } else
            {
                int8(0);
                return;
            }
        }
        catch(encoderException encoderexception)
        {
            if(s != null)
                throw new encoderException(encoderexception + s);
            else
                throw encoderexception;
        }
    }

    public void queryAll(queryAll queryall)
        throws encoderException
    {
        String s = null;
        try
        {
            if(queryall == null)
            {
                throw new encoderException("missing.queryAll.");
            } else
            {
                s = "source.";
                Address(queryall.source);
                s = "count.";
                int8(queryall.count);
                return;
            }
        }
        catch(encoderException encoderexception)
        {
            if(s != null)
                throw new encoderException(encoderexception + s);
            else
                throw encoderexception;
        }
    }

    public void deleteCustomer(Customer customer)
        throws encoderException
    {
        String s = null;
        try
        {
            if(customer == null)
                throw new encoderException("missing.deleteCustomer.");
            s = "id.";
            if(customer.id != null)
            {
                asciiz(customer.id, 21);
                return;
            } else
            {
                int8(0);
                return;
            }
        }
        catch(encoderException encoderexception)
        {
            if(s != null)
                throw new encoderException(encoderexception + s);
            else
                throw encoderexception;
        }
    }

    public void queryDetails(Message message)
        throws encoderException
    {
        String s = null;
        try
        {
            if(message == null)
                throw new encoderException("missing.queryDetails.");
            s = "id.";
            if(message.id != null)
                asciiz(message.id, 9);
            else
                int8(0);
            s = "from.";
            Address(message.from);
            s = "text_len.";
            int8(message.text_len);
            return;
        }
        catch(encoderException encoderexception)
        {
            if(s != null)
                throw new encoderException(encoderexception + s);
            else
                throw encoderexception;
        }
    }

    public void submitMultiResponse(Message message)
        throws encoderException
    {
        String s = null;
        try
        {
            if(message == null)
                throw new encoderException("missing.submitMultiResponse.");
            s = "id.";
            if(message.id != null)
                asciiz(message.id, 9);
            else
                int8(0);
            s = "fails_len.";
            int8(message.fails_len);
            s = "fails.";
            for(int i = 0; i < lenfix(message.fails_len); i++)
                AddressError(message.fails[i]);

            return;
        }
        catch(encoderException encoderexception)
        {
            if(s != null)
                throw new encoderException(encoderexception + s);
            else
                throw encoderexception;
        }
    }

    public void DLmodification(Object obj)
        throws encoderException
    {
        String s = null;
        try
        {
            if(obj == null)
                throw new encoderException("missing.DLmodification.");
            if(obj instanceof Member)
            {
                s = "Member.";
                int8((byte)1);
                Member((Member)obj);
                return;
            }
            if(obj instanceof String)
            {
                s = "asciiz.";
                int8((byte)2);
                if(obj != null)
                {
                    asciiz((String)obj, 21);
                    return;
                } else
                {
                    int8(0);
                    return;
                }
            } else
            {
                s = null;
                throw new encoderException("unknown.instance.DLmodification.");
            }
        }
        catch(encoderException encoderexception)
        {
            if(s != null)
                throw new encoderException(encoderexception + s);
            else
                throw encoderexception;
        }
    }

    public void query(Message message)
        throws encoderException
    {
        String s = null;
        try
        {
            if(message == null)
                throw new encoderException("missing.query.");
            s = "id.";
            if(message.id != null)
                asciiz(message.id, 9);
            else
                int8(0);
            s = "from.";
            Address(message.from);
            return;
        }
        catch(encoderException encoderexception)
        {
            if(s != null)
                throw new encoderException(encoderexception + s);
            else
                throw encoderexception;
        }
    }

    public void submit(Message message)
        throws encoderException
    {
        String s = null;
        try
        {
            if(message == null)
                throw new encoderException("missing.submit.");
            s = "service.";
            if(message.service != null)
                asciiz(message.service, 6);
            else
                int8(0);
            s = "from.";
            Address(message.from);
            s = "to.";
            Address(message.to);
            s = "esm.";
            int8(message.esm);
            s = "pid.";
            int8(message.pid);
            s = "priority.";
            int8(!message.priority ? 0 : 1);
            s = "schedule.";
            UTC(message.schedule);
            s = "expiry.";
            UTC(message.expiry);
            s = "registered.";
            int8(!message.registered ? 0 : 1);
            s = "replacement.";
            int8(!message.replacement ? 0 : 1);
            s = "dcs.";
            int8(message.dcs);
            s = "predefined.";
            int8(message.predefined);
            s = "text_len.";
            int8(message.text_len);
            s = "text.";
            for(int i = 0; i < lenfix(message.text_len); i++)
                int8(message.text[i]);

            return;
        }
        catch(encoderException encoderexception)
        {
            if(s != null)
                throw new encoderException(encoderexception + s);
            else
                throw encoderexception;
        }
    }

    public void smDL(smDL smdl)
        throws encoderException
    {
        String s = null;
        try
        {
            if(smdl == null)
                throw new encoderException("missing.smDL.");
            s = "source.";
            Address(smdl.source);
            s = "name.";
            if(smdl.name != null)
            {
                asciiz(smdl.name, 21);
                return;
            } else
            {
                int8(0);
                return;
            }
        }
        catch(encoderException encoderexception)
        {
            if(s != null)
                throw new encoderException(encoderexception + s);
            else
                throw encoderexception;
        }
    }

    public void replace(Message message)
        throws encoderException
    {
        String s = null;
        try
        {
            if(message == null)
                throw new encoderException("missing.replace.");
            s = "id.";
            if(message.id != null)
                asciiz(message.id, 9);
            else
                int8(0);
            s = "from.";
            Address(message.from);
            s = "schedule.";
            UTC(message.schedule);
            s = "expiry.";
            UTC(message.expiry);
            s = "registered.";
            int8(!message.registered ? 0 : 1);
            s = "predefined.";
            int8(message.predefined);
            s = "text_len.";
            int8(message.text_len);
            s = "text.";
            for(int i = 0; i < lenfix(message.text_len); i++)
                int8(message.text[i]);

            return;
        }
        catch(encoderException encoderexception)
        {
            if(s != null)
                throw new encoderException(encoderexception + s);
            else
                throw encoderexception;
        }
    }

    public void queryResponse(Message message)
        throws encoderException
    {
        String s = null;
        try
        {
            if(message == null)
                throw new encoderException("missing.queryResponse.");
            s = "id.";
            if(message.id != null)
                asciiz(message.id, 9);
            else
                int8(0);
            s = "timeStamp.";
            UTC(message.timeStamp);
            s = "status.";
            int8(message.status);
            s = "gsmError.";
            int8(message.gsmError);
            return;
        }
        catch(encoderException encoderexception)
        {
            if(s != null)
                throw new encoderException(encoderexception + s);
            else
                throw encoderexception;
        }
    }

    public void Member(Member member)
        throws encoderException
    {
        String s = null;
        try
        {
            if(member == null)
                throw new encoderException("missing.Member.");
            s = "smsAddress.";
            Address(member.smsAddress);
            s = "id.";
            if(member.id != null)
                asciiz(member.id, 21);
            else
                int8(0);
            s = "type.";
            int8(member.type);
            return;
        }
        catch(encoderException encoderexception)
        {
            if(s != null)
                throw new encoderException(encoderexception + s);
            else
                throw encoderexception;
        }
    }
}

⌨️ 快捷键说明

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