com.logicboxes.foundation.sfnb.order.sitebuilder
Class SiteBuilder

java.lang.Object
  extended by com.logicboxes.foundation.sfnb.order.sitebuilder.SiteBuilder

public class SiteBuilder
extends java.lang.Object


Constructor Summary
SiteBuilder()
           
 
Method Summary
 java.util.HashMap add(java.lang.String SERVICE_USERNAME, java.lang.String SERVICE_PASSWORD, java.lang.String SERVICE_ROLE, java.lang.String SERVICE_LANGPREF, int SERVICE_PARENTID, java.lang.String productkey, java.lang.String domainName, int customerId, int noOfMonths, java.util.HashMap orderParams, java.lang.String invoiceOption)
          Places a Sitebuilder Lite order for the specified domain name.
 java.util.HashMap del(java.lang.String SERVICE_USERNAME, java.lang.String SERVICE_PASSWORD, java.lang.String SERVICE_ROLE, java.lang.String SERVICE_LANGPREF, int SERVICE_PARENTID, int entityId)
          Deletes order referenced by passed orderID
 java.util.HashMap getAllPackDetails(java.lang.String SERVICE_USERNAME, java.lang.String SERVICE_PASSWORD, java.lang.String SERVICE_ROLE, java.lang.String SERVICE_LANGPREF, int SERVICE_PARENTID)
          Return various costs and parameters associated with every pack
 java.util.HashMap getDeletionRefundAmount(java.lang.String SERVICE_USERNAME, java.lang.String SERVICE_PASSWORD, java.lang.String SERVICE_ROLE, java.lang.String SERVICE_LANGPREF, int SERVICE_PARENTID, int orderId)
          Returns the refund details on deleting a specified order.
 java.util.HashMap getDetails(java.lang.String SERVICE_USERNAME, java.lang.String SERVICE_PASSWORD, java.lang.String SERVICE_ROLE, java.lang.String SERVICE_LANGPREF, int SERVICE_PARENTID, int orderId, java.util.Vector option)
          Returns details for a particular SiteBuilder Order.
 java.util.HashMap getDetailsByDomain(java.lang.String SERVICE_USERNAME, java.lang.String SERVICE_PASSWORD, java.lang.String SERVICE_ROLE, java.lang.String SERVICE_LANGPREF, int SERVICE_PARENTID, java.lang.String domainName, java.util.Vector option, java.lang.String productkey)
          Returns the complete details of a particular order from domainname.
 java.util.HashMap getMonthlyCostAndValidate(java.lang.String SERVICE_USERNAME, java.lang.String SERVICE_PASSWORD, java.lang.String SERVICE_ROLE, java.lang.String SERVICE_LANGPREF, int SERVICE_PARENTID, java.lang.String productkey, java.lang.String packageKey)
          Method returns prorata, setup and monthly cost for a pack
 int getOrderIdByDomain(java.lang.String SERVICE_USERNAME, java.lang.String SERVICE_PASSWORD, java.lang.String SERVICE_ROLE, java.lang.String SERVICE_LANGPREF, int SERVICE_PARENTID, java.lang.String domainName, java.lang.String productkey)
          Returns the orderid of a particular order from domainname.
 java.util.HashMap modOrderFTPDetails(java.lang.String SERVICE_USERNAME, java.lang.String SERVICE_PASSWORD, java.lang.String SERVICE_ROLE, java.lang.String SERVICE_LANGPREF, int SERVICE_PARENTID, int entityId, java.lang.String ftphost, java.lang.String ftpport, java.lang.String ftpusername, java.lang.String ftppassword, java.lang.String ftppath)
           
 java.util.HashMap renew(java.lang.String SERVICE_USERNAME, java.lang.String SERVICE_PASSWORD, java.lang.String SERVICE_ROLE, java.lang.String SERVICE_LANGPREF, int SERVICE_PARENTID, int orderId, int renewMonths)
          Renews an existing Sitebuilder order.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SiteBuilder

public SiteBuilder()
Method Detail

getMonthlyCostAndValidate

public java.util.HashMap getMonthlyCostAndValidate(java.lang.String SERVICE_USERNAME,
                                                   java.lang.String SERVICE_PASSWORD,
                                                   java.lang.String SERVICE_ROLE,
                                                   java.lang.String SERVICE_LANGPREF,
                                                   int SERVICE_PARENTID,
                                                   java.lang.String productkey,
                                                   java.lang.String packageKey)
Method returns prorata, setup and monthly cost for a pack

Parameters:
productkey - Productkey, valid values are sblite and sbpro
packageKey - : Identifier key of the plan for which the order needs to be added
Returns:
HashMap with following keys
  • setupcosts - One time setup cost
  • monthlycost - Monthly cost for this pack
  • proratedcost - Prorata cost for current month
Throws:
LogicBoxesException - If productkey or pack is not valid

add

public java.util.HashMap add(java.lang.String SERVICE_USERNAME,
                             java.lang.String SERVICE_PASSWORD,
                             java.lang.String SERVICE_ROLE,
                             java.lang.String SERVICE_LANGPREF,
                             int SERVICE_PARENTID,
                             java.lang.String productkey,
                             java.lang.String domainName,
                             int customerId,
                             int noOfMonths,
                             java.util.HashMap orderParams,
                             java.lang.String invoiceOption)
Places a Sitebuilder Lite order for the specified domain name. Since this is a billable action your reseller account must have sufficient funds to add the Email Hosting order.

Parameters:
productkey - The product key identifies the type of the Sitebuilder Order. The current acceptable values for this parameter is sblite
domainName - The domain name for which the order is placed.
customerId - The customer under whom the orders should be added.
noOfMonths - The number of months for which the order is placed. The minimum period for which the order can be added is 6 months.
orderParams - For adding a pre-defined package, the orderParams Hashtable should contain a "packid" key having the PlanId (PackageId) as its value.
  • packid - It should be one of the value of "packid" key returned in getAllPackDetails
  • ftphost - Host name(domain name) for which hosting is bought
  • ftpport - Port number..if ResellerClub Hosting then 21
  • ftpusername - The username added in the FTP details
  • ftppassword - The FTP password that relates to the above username
  • ftppath-Either default path or path specific to the user access
invoiceOption -

This parameter will decide how the Customer Invoices will be handled.

NoInvoice - If this value is passed, then no customer invoice will be generated for the domains.

PayInvoice - If this value is passed, then a customer invoice will be generated for the domains in the first step. If there is sufficient balance in the Customer's Debit Account, then the invoices will be paid and the domains will be registered. If a customer has less balance than required, then as many domains as possible will be registered with the existing funds. All other orders will remain pending in the system.

KeepInvoice - If this value is passed, then a customer invoice will be generated for the domains. However, these invoices will not be paid. They will be kept pending, while the orders will be executed.

OnlyAdd - The order will simply be added but NOT executed in the system. A customer invoice will be generated. However, the invoice will not be paid.

Returns:
HashMap A HashMap with the result of Order addition.

The HashMap will have key-values as follows:

entityid=434 (orderid) description=apitest04.info status=Success

Incase you have chosen "KeepInvoice" or "PayInvoice", the return HashMap will also contain the following data:

customerid=8 invoiceid=727 sellingcurrencysymbol=INR sellingamount=-500.000 unutilisedsellingamount=-500.000

invoiceid is the Id that you will need to pass to Fund.payCustomerTransaction if you wish to pay the invoice at a later date.

selllingamount is the Invoice amount in your Selling Currency

unutilisedselllingamount is the Pending Invoice amount in your Selling Currency.

In case of "KeepInvoice", the pending amount will always be equal to the invoice amount.

In case of "PayInvoice", if the Customer does not have sufficient funds to pay the entire invoice amount, unutilisedsellingamount will reflect the balance amount that is pending.

If the invoice has been completely paid, the unutilisedsellingamount will be 0.

Throws:
LogicBoxesException

renew

public java.util.HashMap renew(java.lang.String SERVICE_USERNAME,
                               java.lang.String SERVICE_PASSWORD,
                               java.lang.String SERVICE_ROLE,
                               java.lang.String SERVICE_LANGPREF,
                               int SERVICE_PARENTID,
                               int orderId,
                               int renewMonths)
Renews an existing Sitebuilder order. Since this is a billable action your reseller account must have sufficient funds to add the Email Hosting order.

Parameters:
orderId - The OrderId which is to be renewed.
renewMonths - The no of months for which the order is to be renewed
Returns:
HashMap with following keys
  • invoiceid - ID for invoice generated
  • customercost - Cost for customer
  • customerid - customer's ID to which renewed order belongs
  • domainname - domain for which order is renewed
Certain other information related to the action is also returned as a part of the HashMap
Throws:
LogicBoxesException

getDeletionRefundAmount

public java.util.HashMap getDeletionRefundAmount(java.lang.String SERVICE_USERNAME,
                                                 java.lang.String SERVICE_PASSWORD,
                                                 java.lang.String SERVICE_ROLE,
                                                 java.lang.String SERVICE_LANGPREF,
                                                 int SERVICE_PARENTID,
                                                 int orderId)
Returns the refund details on deleting a specified order.

Parameters:
orderId - The OrderId for which the Refund details are required.
Returns:
Returns HashMap containing refund details The Keys of the HashMap are as follows:

childtype - Could be customer or reseller. If the order being deleted belongs to a direct customer, the childtype would be customer If the order being deleted belongs to a sub reseller, the childtype would be reseller

childcompany - The company of the customer / sub reseller

childname - Name of the customer / sub reseller

childrefund - The amount that will be refunded to the customer / sub reseller

userrefund - The amount that will be refunded to the reseller

Throws:
LogicBoxesException

del

public java.util.HashMap del(java.lang.String SERVICE_USERNAME,
                             java.lang.String SERVICE_PASSWORD,
                             java.lang.String SERVICE_ROLE,
                             java.lang.String SERVICE_LANGPREF,
                             int SERVICE_PARENTID,
                             int entityId)
Deletes order referenced by passed orderID

Parameters:
entityId - order identifier which has to be deleted
Returns:
HashMap with key "status". If value for this key is "success" than operation was successful
Certain other information related to the action is also returned as a part of the HashMap
Throws:
LogicBoxesException - if order does not belong to reseller who has invoked this method

getDetails

public java.util.HashMap getDetails(java.lang.String SERVICE_USERNAME,
                                    java.lang.String SERVICE_PASSWORD,
                                    java.lang.String SERVICE_ROLE,
                                    java.lang.String SERVICE_LANGPREF,
                                    int SERVICE_PARENTID,
                                    int orderId,
                                    java.util.Vector option)
Returns details for a particular SiteBuilder Order.

Parameters:
orderId - The Orderid for which the details are required.
option - Vector of different option for details listing. Allowed Option values are All, StatusDetails, PricingDetails, ExecutionInfoParams, OrderDetails
Returns:
HashMap - key/value pair for all fields depending upon the option
Throws:
LogicBoxesException

getDetailsByDomain

public java.util.HashMap getDetailsByDomain(java.lang.String SERVICE_USERNAME,
                                            java.lang.String SERVICE_PASSWORD,
                                            java.lang.String SERVICE_ROLE,
                                            java.lang.String SERVICE_LANGPREF,
                                            int SERVICE_PARENTID,
                                            java.lang.String domainName,
                                            java.util.Vector option,
                                            java.lang.String productkey)
Returns the complete details of a particular order from domainname.

Parameters:
domainName - The domainName for which details are required
option - The various details that are required for the order. Valid entries are:

OrderDetails StatusDetails ContactIds RegistrantContactDetails AdminContactDetails TechContactDetails BillingContactDetails NsDetails DomainStatus PricingDetails

All

Returns:
Hashtable with name-value pairs for all the details of the order

orderid=123 entityid=123 description=foundationapi.org ns2=ns3.logicboxes.com ns1=ns1.logicboxes.com entitytypeid=7 eaqid=0 currentstatus=Active customercost=10.0 parentkey=1 domainstatus=[] orderstatus=[] creationtime=1060855310 classname=com.logicboxes.foundation.sfnb.order.domorg.DomOrg classkey=domorg domsecret=JKz42pbB5H cns={}, endtime=1092457910 domainname=foundationapi.org registrantcontactid=320 admincontactid=320 techcontactid=320 billingcontactid=320

If you have requested for the contact details as well, you will get keys as registrantcontact, billingcontact, admincontact and techcontact. The value for these keys will be a Hashtable with the following keys:

contactid=320 name=Contact company=FAPI customerid=21 parentkey=1 emailaddr=contact@fapi.com address1=Somewhere address2= address3= city=Someplace state= country=SH zip=12345 telnocc=123 telno=135435456 faxnocc= faxno= contacttype=[domorg]

Throws:
LogicBoxesException - if option value is null or Invalid SqlException if any Database related Exception occurs LogicBoxesException if any internal errors occur

getOrderIdByDomain

public int getOrderIdByDomain(java.lang.String SERVICE_USERNAME,
                              java.lang.String SERVICE_PASSWORD,
                              java.lang.String SERVICE_ROLE,
                              java.lang.String SERVICE_LANGPREF,
                              int SERVICE_PARENTID,
                              java.lang.String domainName,
                              java.lang.String productkey)
Returns the orderid of a particular order from domainname.

Parameters:
domainName - The domainName for which details are required
productkey - Productkey i.e. domcno, domorg, dotin etc
Returns:
int orderid of the domain name
Throws:
LogicBoxesException - if option value is null or Invalid SqlException if any Database related Exception occurs LogicBoxesException if any internal errors occur

getAllPackDetails

public java.util.HashMap getAllPackDetails(java.lang.String SERVICE_USERNAME,
                                           java.lang.String SERVICE_PASSWORD,
                                           java.lang.String SERVICE_ROLE,
                                           java.lang.String SERVICE_LANGPREF,
                                           int SERVICE_PARENTID)
Return various costs and parameters associated with every pack

Returns:
HashMap with format ( String(key), HashMap(value) )
key starts from 1 amd ends at "number of packs" for every key corresponding value is HasMap with following structure
  • setupcosts - One time setup cost
  • monthlycost - Monthly cost for this pack
  • proratedcost - Prorata cost for current month
  • displayname - Customized name for the pack
  • packid - Unique id of the pack
  • page - Maximum number of pages website can host
  • pricingcolname - Pricing column name, it is used by functions like mod etc
Throws:
LogicBoxesException -

Example Usuage
HashMap details = SiteBuilderLite.getAllPackDetails();
for( int count = 1; count <= details.size(); count++ )
{
HashMap packDetails = (HashMap)details.get( "" + count )
String monthlycost = (String)packDetails.get( "monthlycost" );
...
}


modOrderFTPDetails

public java.util.HashMap modOrderFTPDetails(java.lang.String SERVICE_USERNAME,
                                            java.lang.String SERVICE_PASSWORD,
                                            java.lang.String SERVICE_ROLE,
                                            java.lang.String SERVICE_LANGPREF,
                                            int SERVICE_PARENTID,
                                            int entityId,
                                            java.lang.String ftphost,
                                            java.lang.String ftpport,
                                            java.lang.String ftpusername,
                                            java.lang.String ftppassword,
                                            java.lang.String ftppath)