KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sellwin > server > ServerInterface


1 package sellwin.server;
2
3 import sellwin.domain.*;
4 import java.rmi.*;
5 import java.util.*;
6
7 // SellWin http://sourceforge.net/projects/sellwincrm
8
//Contact support@open-app.com for commercial help with SellWin
9
//This software is provided "AS IS", without a warranty of any kind.
10

11 /**
12  * This interface is implemented by the BizServices class for
13  * remote services offered to clients. The LocalServerImpl class
14  * implements this class to offer the same services on the
15  * local user's laptop when operating in 'disconnected' mode.
16  *
17  * By having this shared interface, we can view services as
18  * remote or local.
19  */

20 public interface ServerInterface extends java.rmi.Remote JavaDoc {
21
22     /**
23      * get US tax table
24      * @param lastSyncDate a user's last sync date which limits
25      * the query, null means there is no limit
26      * @return the ArrayList of StateTax objects
27      */

28      public ArrayList getStateTax(java.util.Date JavaDoc lastSyncDate)
29         throws RemoteException, AngError;
30
31     /**
32      * load a StateTax row
33      * @param row the StateTax to load
34      */

35     public void loadTax(StateTax row)
36         throws RemoteException, AngError;
37
38     /**
39      * update a StateTax row
40      * @param row the StateTax to update
41      */

42     public void updateTax(StateTax row)
43         throws RemoteException, AngError;
44
45     /**
46      * get a StateTax row
47      * @param stateCode the state code
48      */

49     public StateTax getTax(String JavaDoc stateCode)
50         throws RemoteException, AngError;
51
52     /**
53      * delete all StateTax rows
54      */

55     public void deleteAllTax()
56         throws RemoteException, AngError;
57
58
59     /**
60      * get an index of Opportunities for a given user
61      * @param u the SalesPerson we are searching for
62      * @return the ArrayList of OppIndex objects that were found
63      * @exception AngError thrown when an app error occurs
64      */

65     public ArrayList getOpportunityIndex(SalesPerson u)
66         throws RemoteException, AngError;
67
68     /**
69      * get the list of Products that are offered
70      * @return the ArrayList of Products found
71      * @exception AngError thrown when an app error occurs
72      */

73     public ArrayList getProductMatrix()
74         throws RemoteException, AngError;
75
76     /**
77      * get the list of Product Groups
78      * @return the ArrayList of product groups that were found
79      * @exception AngError thrown when an app error occurs
80      */

81     public ArrayList getProductGroups()
82         throws RemoteException, AngError;
83
84     /**
85      * get the list of product lines
86      * @param group search using this passed product group as key
87      * @return the ArrayList of product lines that was found
88      * @exception AngError thrown when an app error occurs
89      */

90     public ArrayList getProductLines(String JavaDoc group)
91         throws RemoteException, AngError;
92
93     /**
94      * get the products for a product line and group
95      * @param group the product group to search in
96      * @param line the product line to search in
97      * @return the ArrayList of products found
98      * @exception AngError thrown when an app error occurs
99      */

100     public ArrayList getProductsForLine(String JavaDoc group, String JavaDoc line)
101         throws RemoteException, AngError;
102
103     /**
104      * get a product
105      * @param group product group to search in
106      * @param line product line to search in
107      * @param name product name to search for
108      * @return the Product that was found
109      * @exception AngError thrown when an app error occurs
110      */

111     public Product getProduct(String JavaDoc group, String JavaDoc line, String JavaDoc name)
112         throws RemoteException, AngError;
113
114     /**
115      * get a product by its primary key
116      * @param pk the primary key
117      * @return the Product if found, null if not found
118      */

119     public Product getProduct(long pk)
120         throws RemoteException, AngError;
121
122     /**
123      * update a product
124      * @param product the Product to update
125      */

126     public void updateProduct(Product product)
127         throws RemoteException, AngError;
128
129     /**
130      * add a forecast
131      * @param opportunityPK the containing Opportunity primary key
132      * @param a the Forecast we are adding
133      * @return the primary key of the new Forecast
134      * @exception AngError thrown when an app error occurs
135      */

136     public long addForecast(long opportunityPK, Forecast a)
137         throws RemoteException, AngError;
138
139     /**
140      * update a Forecast
141      * @param oppPK the containing Opportunity primary key
142      * @param a the Forecast we are updating
143      * @exception AngError thrown when an app error occurs
144      */

145     public void updateForecast(long oppPK, Forecast a)
146         throws RemoteException, AngError;
147
148     /**
149      * delete a Forecast
150      * @param opportunityPK the containing Opportunity primary key
151      * @param forecastPK the Forecast primary key we delete with
152      * @exception AngError thrown when an app error occurs
153      */

154     public void deleteForecast(long opportunityPK, long forecastPK)
155         throws RemoteException, AngError;
156
157     /**
158      * add an Order
159      * @param oppPK the containing Opportunity primary key
160      * @param o the Order we are adding
161      * @return the primary key of the new Order
162      * @exception AngError thrown when an app error occurs
163      */

164     public long addOrder(long oppPK, Order o)
165         throws RemoteException, AngError;
166
167     /**
168      * update an Order
169      * @param oppPK the containing Opportunity primary key
170      * @param o the Order we are updating
171      * @exception AngError thrown when an app error occurs
172      */

173     public void updateOrder(long oppPK, Order o)
174         throws RemoteException, AngError;
175
176     /**
177      * add a Quote
178      * @param oppPK the containing Opportunity primary key
179      * @param q the Quote being added
180      * @return the primary key of the new Quote
181      * @exception AngError thrown when an app error occurs
182      */

183     public long addQuote(long oppPK, Quote q)
184         throws RemoteException, AngError;
185
186     /**
187      * update a Quote
188      * @param oppPK the containing Opportunity primary key
189      * @param q the Quote being updated
190      * @exception AngError thrown when an app error occurs
191      */

192     public void updateQuote(long oppPK, Quote q)
193         throws RemoteException, AngError;
194
195     /**
196      *
197      * @param name description
198      * @return description
199      * @exception AngError thrown when an app error occurs
200      */

201     public void deleteQuote(long opportuntityPK, long quotePK)
202         throws RemoteException, AngError;
203
204     /**
205      * add a QuoteLine
206      * @param oppPK the containing Opportunity primary key
207      * @param quotePK the containing Quote primary key
208      * @param a the QuoteLine being added
209      * @return the primary key of the newly added QuoteLine
210      * @exception AngError thrown when an app error occurs
211      */

212     public long addQuoteLine(long oppPK, long quotePK, QuoteLine a)
213         throws RemoteException, AngError;
214
215     /**
216      *
217      * @param name description
218      * @return description
219      * @exception AngError thrown when an app error occurs
220      */

221     public void deleteQuoteLine(long opportuntityPK, long quotePK, long linePK)
222         throws RemoteException, AngError;
223
224     /**
225      * get the Alarms for a user
226      * @param salesPersonPK the primary key of the user to search for
227      * @return the ArrayList of Alarms found
228      * @exception AngError thrown when an app error occurs
229      */

230     public ArrayList getAlarms(long salesPersonPK)
231         throws RemoteException, AngError;
232         
233     /**
234      * add an Activity
235      * @param opportunityPK the containing Opportunity primary key
236      * @param a the Activity we are adding
237      * @return the newly added Activity primary key
238      * @exception AngError thrown when an app error occurs
239      */

240     public long addActivity(long opportunityPK, Activity a)
241         throws RemoteException, AngError;
242
243     /**
244      * update an Actvitity
245      * @param opportunityPK the containing Opportunity primary key
246      * @param a the Activity being updated
247      * @exception AngError thrown when an app error occurs
248      */

249     public void updateActivity(long opportunityPK, Activity a)
250         throws RemoteException, AngError;
251
252     /**
253      * delete an Activity
254      * @param opportunityPK the containing Opportunity primary key
255      * @param activityPK the Activity primary key we delete with
256      * @exception AngError thrown when an app error occurs
257      */

258     public void deleteActivity(long opportunityPK, long activityPK)
259         throws RemoteException, AngError;
260
261
262     /**
263      * get all the user roles
264      * @param a date to compare against in the query
265      * @return the ArrayList of found user roles
266      * @exception AngError thrown when an app error occurs
267      */

268     public ArrayList getAllUserRoles(java.util.Date JavaDoc lastSyncDate)
269         throws RemoteException, AngError;
270
271     /**
272      * add a user role
273      * @param role the UserRole we are adding to the system
274      * @exception AngError thrown when an app error occurs
275      */

276     public void addUserRole(UserRole role)
277         throws RemoteException, AngError;
278     /**
279      * load a user role
280      * @param role the UserRole we are loading to the system
281      * @exception AngError thrown when an app error occurs
282      */

283     public void loadUserRole(UserRole role)
284         throws RemoteException, AngError;
285
286     /**
287      * delete a user role
288      * @param pk the pk of the user role we are deleting
289      * @exception AngError thrown when an app error occurs
290      */

291     public void deleteUserRole(long pk)
292         throws RemoteException, AngError;
293
294     /**
295      * delete all user roles
296      * @exception AngError thrown when an app error occurs
297      */

298     public void deleteAllUserRole()
299         throws RemoteException, AngError;
300
301     /**
302      * udpate a user role
303      * @param role the UserRole we are updating
304      * @exception AngError thrown when an app error occurs
305      */

306     public void updateUserRole(UserRole role)
307         throws RemoteException, AngError;
308     
309     /**
310      * get a user role
311      * @param name the name of the user role we search for
312      * @return the UserRole that was found
313      * @exception AngError thrown when an app error occurs
314      */

315     public UserRole getUserRole(String JavaDoc name)
316         throws RemoteException, AngError;
317
318     /**
319      * logon to SellWin
320      * @param id the user ID to try
321      * @param psw the password to try
322      * @return a Login object if successful
323      * @exception AngError thrown when an app error occurs
324      */

325     public Login logon(String JavaDoc id, String JavaDoc psw)
326         throws RemoteException, AngError;
327
328     /**
329      * delete a Customer
330      * @param pk the pk of the Customer we are to delete
331      * @exception AngError thrown when an app error occurs
332      */

333     public void deleteCustomer(Customer cust)
334         throws RemoteException, AngError;
335
336     /**
337      * delete a Customer
338      * @param name the name of the Customer we are to delete
339      * @exception AngError thrown when an app error occurs
340      */

341     public void deleteCustomer(String JavaDoc name)
342         throws RemoteException, AngError;
343
344     /**
345      * update a Customer
346      * @param c the Customer we are updating
347      * @exception AngError thrown when an app error occurs
348      */

349     public void updateCustomer(Customer c)
350         throws RemoteException, AngError;
351
352     /**
353      * load a Customer
354      * @param c the Customer we are loading
355      * @exception AngError thrown when an app error occurs
356      */

357     public void loadCustomer(Customer c)
358         throws RemoteException, AngError;
359
360     /**
361      * add a Customer
362      * @param c the Customer we are adding
363      * @return the new Customer's primary key
364      * @exception AngError thrown when an app error occurs
365      */

366     public long addCustomer(Customer c)
367         throws RemoteException, AngError;
368
369     /**
370      * get a Customer
371      * @param name the name of the Customer we are to get
372      * @return the Customer that was found
373      * @exception AngError thrown when an app error occurs
374      */

375     public Customer getCustomer(String JavaDoc name)
376         throws RemoteException, AngError;
377
378     /**
379      * get all the customer names in the system
380      * @return an array of the customer names
381      * @exception AngError thrown when an app error occurs
382      */

383     public Object JavaDoc[] getAllCustomerNames()
384         throws RemoteException, AngError;
385
386     /**
387      * get all the customers in the system
388      * @param lastSyncDate a user's last sync date used to limit the
389      * query or null if no limit
390      * @return an ArrayList of Customers
391      * @exception AngError thrown when an app error occurs
392      */

393     public ArrayList getCustomers(java.util.Date JavaDoc lastSyncDate)
394         throws RemoteException, AngError;
395
396     /**
397      * add a Product
398      * @param p the Product we are adding
399      * @exception AngError thrown when an app error occurs
400      */

401     public void addProduct(Product p)
402         throws RemoteException, AngError;
403
404     /**
405      * load a Product
406      * @param p the Product we are loading
407      * @exception AngError thrown when an app error occurs
408      */

409     public void loadProduct(Product p)
410         throws RemoteException, AngError;
411     
412     /**
413      * get all Products
414      * @param a date to compare rows against in the query
415      * @return an ArrayList of products that was found
416      * @exception AngError thrown when an app error occurs
417      */

418     public ArrayList getProducts(java.util.Date JavaDoc afterDate)
419         throws RemoteException, AngError;
420
421     /**
422      * delete product
423      * @param prod Product to delete
424      * @exception AngError thrown when an app error occurs
425      */

426     public void deleteProduct(Product prod)
427         throws RemoteException, AngError;
428
429     /**
430      * get all the Opportunity names for a user
431      * @param u the user we are searching for
432      * @return an ArrayList of opportunity names
433      * @exception AngError thrown when an app error occurs
434      */

435     public ArrayList getOpportunityNames(SalesPerson u)
436         throws RemoteException, AngError;
437
438     /**
439      * get all the Opportunities for a user
440      * @param u the user we are searching for
441      * @param lastSyncDate a user's last sync date to limit the query or
442      * null if no limit
443      * @return an ArrayList of Opportunities
444      * @exception AngError thrown when an app error occurs
445      */

446     public ArrayList getOpportunities(SalesPerson u, java.util.Date JavaDoc lastSyncDate)
447         throws RemoteException, AngError;
448
449     /**
450      * get an Opportunity
451      * @param pk an Opportunity primary key we are searching for
452      * @return an Opportunity
453      * @exception AngError thrown when an app error occurs
454      */

455     public Opportunity getOpportunity(long pk)
456         throws RemoteException, AngError;
457
458     /**
459      * load an Opportunity
460      * @param o the Opportunity we are loading
461      * @exception AngError thrown when an app error occurs
462      */

463     public void loadOpportunity(Opportunity o)
464         throws RemoteException, AngError;
465
466     /**
467      * add an Opportunity
468      * @param o the Opportunity we are adding
469      * @return the primary key of the newly added object
470      * @exception AngError thrown when an app error occurs
471      */

472     public long addOpportunity(Opportunity o)
473         throws RemoteException, AngError;
474
475     /**
476      * update an Opportunity
477      * @param o the Opportunity we are updating
478      * @exception AngError thrown when an app error occurs
479      */

480     public void updateOpportunity(Opportunity o)
481         throws RemoteException, AngError;
482
483     /**
484      * delete an Opportunity
485      * @param pk the primary key of the Opportunity to delete
486      * @exception AngError thrown when an app error occurs
487      */

488     public void deleteOpportunity(long pk)
489         throws RemoteException, AngError;
490
491     /**
492      * delete a contact
493      * @param oppPK the containing Opportunity's primary key
494      * @param contPK the Contact's primary key we delete with
495      * @exception AngError thrown when an app error occurs
496      */

497     public void deleteContact(long oppPk, long contPk)
498         throws RemoteException, AngError;
499
500     /**
501      * add a contact
502      * @param oppPK the containing Opportunity's primary key
503      * @param c the Contact we are adding
504      * @return the primary key of the new Contact
505      * @exception AngError thrown when an app error occurs
506      */

507     public long addContact(long oppPk, Contact c)
508         throws RemoteException, AngError;
509
510     /**
511      * update a contact
512      * @param oppPK the containing Opportunity primary key
513      * @param c the contact we are updating
514      * @exception AngError thrown when an app error occurs
515      */

516     public void updateContact(long oppPK, Contact c)
517         throws RemoteException, AngError;
518
519     /**
520      * get a sales person
521      * @param pk the primary key to search with
522      * @return the SalesPerson that was found
523      * @exception AngError thrown when an app error occurs
524      */

525     public SalesPerson getSalesPerson(long pk)
526         throws RemoteException, AngError;
527
528     /**
529      * update a sales person
530      * @param s the sales person we are updating
531      * @exception AngError thrown when an app error occurs
532      */

533     public void updateSalesPerson(SalesPerson s)
534         throws RemoteException, AngError;
535
536     /**
537      * delete all sales persons
538      * @exception AngError thrown when an app error occurs
539      */

540     public void deleteAllSalesPerson()
541         throws RemoteException, AngError;
542
543     /**
544      * delete a sales person
545      * @param per the SalesPerson to delete
546      * @exception AngError thrown when an app error occurs
547      */

548     public void deleteSalesPerson(SalesPerson per)
549         throws RemoteException, AngError;
550
551     /**
552      * add a sales person
553      * @param s the sales person we are adding
554      * @return the primary key of the newly added person
555      * @exception AngError thrown when an app error occurs
556      */

557     public long addSalesPerson(SalesPerson s)
558         throws RemoteException, AngError;
559
560     /**
561      * load a sales person
562      * @param s the sales person we are loading
563      * @exception AngError thrown when an app error occurs
564      */

565     public void loadSalesPerson(SalesPerson s)
566         throws RemoteException, AngError;
567
568     /**
569      * get all sales person logon IDs
570      * @return an ArrayList of user IDs
571      * @exception AngError thrown when an app error occurs
572      */

573     public ArrayList getSalesPersonIDs()
574         throws RemoteException, AngError;
575
576     /**
577      * get all sales person names
578      * @return an ArrayList of sales person names
579      * @exception AngError thrown when an app error occurs
580      */

581     public ArrayList getSalesPersonNames()
582         throws RemoteException, AngError;
583
584     /**
585      * get all sales persons
586      * @param lastSyncDate a user's last sync date, which if not null,
587      * limits the query results
588      * @return an array of SalesPerson objects
589      * @exception AngError thrown when an app error occurs
590      */

591     public Object JavaDoc[] getSalesPersons(java.util.Date JavaDoc lastSyncDate)
592         throws RemoteException, AngError;
593
594
595     /**
596      * get the groups a user belongs to
597      * @param userPK the user primary key to search with
598      * @return an ArrayList of UserGroup objects
599      */

600     public ArrayList getGroupsForUser(long userPK)
601         throws RemoteException, AngError;
602
603     /**
604      * add a user to a user group
605      * @param userPK the user primary key to add
606      * @param group the user group to add to
607      * @exception AngError thrown when an app error occurs
608      */

609     public void addUserToGroup(long userPK, UserGroup group)
610         throws RemoteException, AngError;
611
612
613      //THIS NEEDS TO BE OPTIMIZED, TO ONLY RETURN NAMES, NOT THE
614
//FULL SP
615
/**
616      * get all users in a group
617      *
618      * @param groupName the group we are searching with
619      * @return an array of SalesPersons that were found in the group
620      * @exception AngError thrown when an app error occurs
621      */

622     public Object JavaDoc[] getUsersInGroup(String JavaDoc groupName)
623         throws RemoteException, AngError;
624
625     /**
626      * get a UserGroup using a user_group primary key
627      * @param userGroupPK user group primary key value
628      * @return a UserGroup if found, null if not found
629      * @exception AngError thrown when an app error occurs
630      */

631     public UserGroup getUserGroup(long pk)
632         throws RemoteException, AngError;
633
634     /**
635      * get all user groups
636      * @param lastSyncDate a user's last sync date which limits the query
637      * @return an array of UserGroup
638      * @exception AngError thrown when an app error occurs
639      */

640     public Object JavaDoc[] getUserGroups(java.util.Date JavaDoc lastSyncDate)
641         throws RemoteException, AngError;
642
643     /**
644      * add a user group
645      * @param g the user group to add
646      * @exception AngError thrown when an app error occurs
647      */

648     public void addUserGroup(UserGroup g)
649         throws RemoteException, AngError;
650
651     /**
652      * load a user group
653      * @param g the user group to load
654      * @exception AngError thrown when an app error occurs
655      */

656     public void loadUserGroup(UserGroup g)
657         throws RemoteException, AngError;
658
659     /**
660      * delete a user group
661      * @param groupName the user group name we are to delete
662      * @exception AngError thrown when an app error occurs
663      */

664     public void deleteUserGroup(String JavaDoc groupName)
665         throws RemoteException, AngError;
666
667     /**
668      * delete all user groups
669      * @exception AngError thrown when an app error occurs
670      */

671     public void deleteAllUserGroup()
672         throws RemoteException, AngError;
673
674     /**
675      * delete a user in a group
676      * @param g the user group to search in
677      * @param userPK the user primary key to delete
678      * @exception AngError thrown when an app error occurs
679      */

680     public void deleteUserInGroup(UserGroup g, long userPK)
681         throws RemoteException, AngError;
682
683     /**
684      * get a Lead
685      * @param pk the Lead primary key
686      * @return the Lead that was found or null if not found
687      */

688     public Lead getLead(long pk)
689         throws RemoteException, AngError;
690
691     /**
692      * update a lead
693      * @param campaignPK the containing Campaign primary key
694      * @param l the Lead we are to update
695      * @exception AngError thrown when an app error occurs
696      */

697     public void updateLead(long campaignPK, Lead l)
698         throws RemoteException, AngError;
699
700     /**
701      * get all campaigns
702      * @param lastSyncDate a user's last sync date which limits the
703      * query or null if no limit
704      * @return an ArrayList of campaigns
705      * @exception AngError thrown when an app error occurs
706      */

707     public ArrayList getCampaigns(java.util.Date JavaDoc lastSyncDate)
708         throws RemoteException, AngError;
709     /**
710      * load campaign
711      * @param c campaign to load
712      * @exception AngError thrown when an app error occurs
713      */

714     public void loadCampaign(Campaign c)
715         throws RemoteException, AngError;
716
717     /**
718      * delete all campaigns
719      * @exception AngError thrown when an app error occurs
720      */

721     public void deleteAllCampaign()
722         throws RemoteException, AngError;
723
724     
725     /**
726      * get all leads for a campaign
727      * @param campaignPK the campaign primary key to search with
728      * @return an ArrayList of campaign leads that were found
729      * @exception AngError thrown when an app error occurs
730      */

731     public ArrayList getCampaignLeads(long campaignPK)
732         throws RemoteException, AngError;
733
734     /**
735      * get all leads
736      * @param lastSyncDate a user's last sync date used to limit
737      * the query or null if no limit
738      * @return an ArrayList of campaign leads that were found
739      * @exception AngError thrown when an app error occurs
740      */

741     public ArrayList getCampaignLeads(java.util.Date JavaDoc lastSyncDate)
742         throws RemoteException, AngError;
743
744     /**
745      * delete a CustomerInventory
746      * @param ci the CustomerInventory we are to delete
747      * @exception AngError thrown when an app error occurs
748      */

749     public void deleteCustomerInventory(CustomerInventory ci)
750         throws RemoteException, AngError;
751
752     /**
753      * add a CustomerInventory
754      * @param ci the CustomerInventory we are adding
755      * @return the new CustomerInventory's primary key
756      * @exception AngError thrown when an app error occurs
757      */

758     public long addCustomerInventory(CustomerInventory ci)
759         throws RemoteException, AngError;
760
761     /**
762      * get CustomerInventory for a given customer
763      * @param custPK the Customer's PK we are searching with
764      * @return the list of CustomerInventory
765      * @exception AngError thrown when an app error occurs
766      */

767     public ArrayList getCustomerInventory(long custPK)
768         throws RemoteException, AngError;
769
770
771     /**
772      * upload all the info needed about the objects that
773      * were deleted on the user's local client while
774      * operating in a disconnected mode in order to
775      * sync the remote database with the changes
776      * @param deleteList an ArrayList of deleted object
777      * info
778      */

779     public void uploadDeletes(ArrayList deletes)
780         throws RemoteException, AngError;
781
782
783     /**
784      * get all the user group members
785      *
786      * @param lastSyncDate a user's last sync date or null, which
787      * is used to limit the query
788      * @return an ArrayList of UserGroupMembers
789      */

790     public ArrayList getGroupMembers(java.util.Date JavaDoc lastSyncDate)
791         throws RemoteException, AngError;
792
793     /**
794      * get a UserGroupMember row
795      * @param pk the UserGroupMember primary key
796      * @return the UserGroupMember or null if not found
797      */

798     public UserGroupMember getGroupMember(long pk)
799         throws RemoteException, AngError;
800
801     /**
802      * load a UserGroupMember row
803      * @param row the UserGroupMember row being loaded
804      */

805     public void loadGroupMember(UserGroupMember row)
806         throws RemoteException, AngError;
807 }
808
Popular Tags