// FrontEnd Plus for JAD
// DeCompiled : smppEncoder.class
package sms;
import utils.*;
// Referenced classes of package sms:
// Message, Customer, smDL, param,
// messageId, smppHeader, Address, listDLResponse,
// queryAllResponse, Binding, DLName, modDL,
// viewDLresponse, AddressError, queryAll, Member
class smppEncoder extends encoder
{
public void cancel(Message message)
throws encoderException
{
String s = null;
try
{
if(message == null)
throw new encoderException("missing.cancel.");
s = "service.";
if(message.service != null)
asciiz(message.service, 6);
else
int8(0);
s = "id.";
if(message.id != null)
asciiz(message.id, 9);
else
int8(0);
s = "from.";
Address(message.from);
s = "to.";
Address(message.to);
return;
}
catch(encoderException encoderexception)
{
if(s != null)
throw new encoderException(encoderexception + s);
else
throw encoderexception;
}
}
public void modifyCustomer(Customer customer)
throws encoderException
{
String s = null;
try
{
if(customer == null)
throw new encoderException("missing.modifyCustomer.");
s = "id.";
if(customer.id != null)
asciiz(customer.id, 21);
else
int8(0);
s = "name.";
if(customer.name != null)
asciiz(customer.name, 21);
else
int8(0);
s = "streetAddress.";
if(customer.streetAddress != null)
asciiz(customer.streetAddress, 31);
else
int8(0);
s = "smsAddress.";
Address(customer.smsAddress);
s = "serviceLevel.";
int32(customer.serviceLevel);
s = "smsAllowed.";
int8(!customer.smsAllowed ? 0 : 1);
s = "ocos.";
int32(customer.ocos);
s = "tcos.";
int32(customer.tcos);
s = "password.";
if(customer.password != null)
{
asciiz(customer.password, 9);
return;
} else
{
int8(0);
return;
}
}
catch(encoderException encoderexception)
{
if(s != null)
throw new encoderException(encoderexception + s);
else
throw encoderexception;
}
}
public void submitResponse(Message message)
throws encoderException
{
String s = null;
try
{
if(message == null)
throw new encoderException("missing.submitResponse.");
s = "id.";
if(message.id != null)
{
asciiz(message.id, 9);
return;
} else
{
int8(0);
return;
}
}
catch(encoderException encoderexception)
{
if(s != null)
throw new encoderException(encoderexception + s);
else
throw encoderexception;
}
}
public void addDL(smDL smdl)
throws encoderException
{
String s = null;
try
{
if(smdl == null)
throw new encoderException("missing.addDL.");
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 paramGet(param param1)
throws encoderException
{
String s = null;
try
{
if(param1 == null)
throw new encoderException("missing.paramGet.");
s = "name.";
if(param1.name != null)
{
asciiz(param1.name, 32);
return;
} else
{
int8(0);
return;
}
}
catch(encoderException encoderexception)
{
if(s != null)
throw new encoderException(encoderexception + s);
else
throw encoderexception;
}
}
public void messageId(messageId messageid)
throws encoderException
{
String s = null;
try
{
if(messageid == null)
throw new encoderException("missing.messageId.");
s = "id.";
if(messageid.id != null)
{
asciiz(messageid.id, 9);
return;
} else
{
int8(0);
return;
}
}
catch(encoderException encoderexception)
{
if(s != null)
throw new encoderException(encoderexception + s);
else
throw encoderexception;
}
}
public void viewDL(smDL smdl)
throws encoderException
{
String s = null;
try
{
if(smdl == null)
throw new encoderException("missing.viewDL.");
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 smppHeader(smppHeader smppheader)
throws encoderException
{
String s = null;
try
{
if(smppheader == null)
{
throw new encoderException("missing.smppHeader.");
} else
{
s = "length.";
int32(smppheader.length);
s = "command.";
int32(smppheader.command);
s = "status.";
int32(smppheader.status);
s = "sequence.";
int32(smppheader.sequence);
return;
}
}
catch(encoderException encoderexception)
{
if(s != null)
throw new encoderException(encoderexception + s);
else
throw encoderexception;
}
}
public void Address(Address address)
throws encoderException
{
String s = null;
try
{
if(address == null)
throw new encoderException("missing.Address.");
s = "ton.";
int8(address.ton);
s = "npi.";
int8(address.npi);
s = "msisdn.";
if(address.msisdn != null)
{
asciiz(address.msisdn, 21);