View Javadoc

1   /*
2    * Copyright 2004 Carlos Sanchez.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package net.sf.oness.party.model.facade;
17  
18  import net.sf.oness.common.model.exceptions.ExistingInstanceException;
19  import net.sf.oness.common.model.util.PaginatedList;
20  import net.sf.oness.party.model.contact.bo.ContactInfo;
21  import net.sf.oness.party.model.party.bo.Party;
22  
23  /***
24   * Facade that models the service of party management
25   * 
26   * @author Carlos Sanchez
27   * @version $Revision: 1.13 $
28   */
29  public interface PartyFacadeDelegate {
30  
31      // ------------------------ Party ------------------------
32  
33      /***
34       * Create a party, calls createParty(party, true)
35       * 
36       * @param party
37       * @return The party created
38       * @throws org.springframework.dao.DataAccessException
39       */
40      public abstract Party createParty(Party party)
41              throws ExistingInstanceException;
42  
43      /***
44       * Create a party
45       * 
46       * If ignoreExisting is false and a similar Party already exists then a
47       * ExistingInstanceException will be thrown with the similar parties
48       * 
49       * @param party
50       * @param ignoreExisting
51       * @return The party created
52       * @throws ExistingInstanceException
53       * @throws org.springframework.dao.DataAccessException
54       */
55      public abstract Party createParty(Party party, final boolean ignoreExisting)
56              throws ExistingInstanceException;
57  
58      /***
59       * Update a party
60       * 
61       * @param party
62       * @return The party updated
63       * @throws org.springframework.dao.DataAccessException
64       */
65      public abstract Party updateParty(final Party party);
66  
67      /***
68       * Retrieves a list of parties, filtering with properties on a party object
69       * 
70       * @param party
71       *            properties to filter on
72       * @param firstElement
73       * @param maxElements
74       * @return List of Party objects
75       * @throws org.springframework.dao.DataAccessException
76       */
77      public abstract PaginatedList findParty(final Party party,
78              final int firstElement, final int maxElements);
79  
80      /***
81       * Retrieve a party without related entities.
82       * 
83       * @param id
84       *            Party identifier
85       * @return The party
86       * @throws org.springframework.dao.DataRetrievalFailureException
87       * @throws org.springframework.dao.DataAccessException
88       */
89      public abstract Party findParty(final Long id);
90  
91      /***
92       * Retrieve a party and all related entities by its identifier.
93       * 
94       * @param id
95       *            Party identifier
96       * @return The party
97       * @throws org.springframework.dao.DataRetrievalFailureException
98       * @throws org.springframework.dao.DataAccessException
99       */
100     public abstract Party findPartyWithDetails(final Long id);
101 
102     /***
103      * Delete a party
104      * 
105      * @param id
106      *            Party identifier
107      * @throws org.springframework.dao.DataRetrievalFailureException
108      * @throws org.springframework.dao.DataAccessException
109      */
110     public abstract void deleteParty(final Long id);
111 
112     // ------------------------ ContactInfo ------------------------
113 
114     /***
115      * Create a contact info
116      * 
117      * @param contactInfo
118      * @return the contact info created
119      * @throws org.springframework.dao.DataAccessException
120      */
121     public abstract ContactInfo createContactInfo(ContactInfo contactInfo);
122 
123     /***
124      * Update a contact info
125      * 
126      * @param contactInfo
127      * @return The contact info updated
128      * @throws org.springframework.dao.DataAccessException
129      */
130     public abstract ContactInfo updateContactInfo(final ContactInfo contactInfo);
131 
132     /***
133      * Retrieves a list of contact infos, filtering with properties on a contact
134      * info object
135      * 
136      * @param contactInfo
137      *            properties to filter on
138      * @param firstElement
139      * @param maxElements
140      * @return List of ContactInfo objects
141      * @throws org.springframework.dao.DataAccessException
142      */
143     public abstract PaginatedList findContactInfo(
144             final ContactInfo contactInfo, final int firstElement,
145             final int maxElements);
146 
147     /***
148      * View a contact info
149      * 
150      * @param id
151      *            Contact info identifier
152      * @return The contact info
153      * @throws org.springframework.dao.DataRetrievalFailureException
154      * @throws org.springframework.dao.DataAccessException
155      */
156     public abstract ContactInfo findContactInfo(final Long id);
157 
158     /***
159      * Delete a contact info
160      * 
161      * @param id
162      *            Contact info identifier
163      * @throws org.springframework.dao.DataRetrievalFailureException
164      * @throws org.springframework.dao.DataAccessException
165      */
166     public abstract void deleteContactInfo(final Long id);
167 }