Subversion Repositories XServices

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
192 brianR 1
/*
2
 *   Copyright 2017 Brian Rosenberger (Brutex Network)
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
 
17
package net.brutex.xservices.ws;
18
 
19
import java.util.GregorianCalendar;
20
import java.util.List;
21
 
22
import javax.jws.WebMethod;
23
import javax.jws.WebParam;
24
import javax.jws.WebService;
25
import javax.jws.soap.SOAPBinding;
26
import javax.xml.bind.annotation.XmlElement;
27
 
193 brianR 28
import org.apache.cxf.annotations.WSDLDocumentation;
29
 
192 brianR 30
import net.brutex.mgmt.api.xml.AnyEntity;
31
import net.brutex.mgmt.api.xml.Customer;
32
import net.brutex.mgmt.api.xml.Project;
33
import net.brutex.mgmt.api.xml.TimesheetEntry;
34
import net.brutex.mgmt.api.xml.TimesheetFilter;
35
import net.brutex.mgmt.api.xml.User;
36
import net.brutex.xservices.types.ant.AttachmentType;
37
import net.brutex.xservices.util.BrutexNamespaces;
38
 
39
 
40
 
41
/**
42
 * OpenAir proxy services
43
 * @author Brian Rosenberger
44
 * @since 20160531
45
 *
46
 */
47
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
48
public interface OpenAirProxyService {
49
 
50
	public static final String SERVICE_NAME = "OpenAirProxyService";
51
	final String OPERATION_GETTIMEENTRIES = "getTimeentries";
52
	final String OPERATION_GETEXCELTIMESHEET = "getExcelTimesheet";
53
	final String OPERATION_GETEXCELTIMESHEET2 = "getExcelTimesheet2";
54
	final String OPERATION_GETPROJECTBYEXTERNALID = "getProjectsByExternalId";
55
	final String OPERATION_GETPROJECTBYOPPID = "getProjectsByOppId";
56
	final String OPERATION_GETCUSTOMERBYID = "getCustomerById";
57
	final String OPERATION_GETUSERBYID = "getUserById";
58
	final String OPERATION_GETUSERBYUSERNAME = "getUserByUsername";
59
	final String OPERATION_GETANYOBJECT = "getAnyObject";
60
	final String OPERATION_GETUPDATEDCOMPANIES = "getUpdatedCustomer";
61
	final String OPERATION_GETUPDATEDPROJECTS = "getUpdatedProject";
62
 
63
 
64
	final String PARAM_PROJECTID = "oa_projectid";
65
	final String PARAM_CUSTOMERID = "oa_customerid";
66
	final String PARAM_USERID = "oa_userid";
67
	final String PARAM_USERNAME = "oa_username";
68
	final String PARAM_TEMPLATE ="template";
69
	final String PARAM_STARTDATE = "startdate";
70
	final String PARAM_ENDDATE = "enddate";
71
	final String PARAM_ENTRYLIST = "timeentries";
72
	final String PARAM_EXTERNALID = "externalid";
73
	final String PARAM_OPPID = "oppid";
74
	final String PARAM_INCLUDENONBILLABLE = "includeNonBillable";
75
	final String PARAM_OBJECTTYPE = "objecttype";
76
	final String PARAM_QUERIES = "queries";
77
	final String PARAM_DATE = "datetime";
78
	final String PARAM_OFFSET = "offset_minutes";
79
	final String PARAM_TIMESHEETSTATUS = "timesheetstatus";
80
 
81
	/**
82
	 * Get a list of time entries.
83
	 *
84
	 * @return List of time entries
85
	 * @throws XServicesFault
86
	 */
87
	@WebMethod(operationName=OPERATION_GETTIMEENTRIES)
88
	@WSDLDocumentation(value="Get list of time entries")
89
	public abstract List<TimesheetEntry> getTimeEntryList(
90
			@WebParam(name=PARAM_PROJECTID) int oa_projectid,
91
			@WebParam(name=PARAM_CUSTOMERID) int oa_customerid,
92
			@WebParam(name=PARAM_USERID) int oa_userid,
93
			@WebParam(name=PARAM_STARTDATE) GregorianCalendar startdate,
94
			@WebParam(name=PARAM_ENDDATE) GregorianCalendar enddate,
95
			@WebParam(name=PARAM_INCLUDENONBILLABLE) boolean includeNonBillable,
96
			@WebParam(name=PARAM_TIMESHEETSTATUS) java.util.List<TimesheetFilter.TimesheetFilterType> filter)
97
					throws XServicesFault;
98
 
99
 
100
 
101
	/**
102
	 * Get an excel time sheet file.
103
	 *
104
	 * @return List of time entries
105
	 * @throws XServicesFault
106
	 */
107
	@WebMethod(operationName=OPERATION_GETEXCELTIMESHEET)
108
	@WSDLDocumentation(value="Get an excel time sheet file.")
109
	public abstract AttachmentType getExcelTimesheet(
110
			@WebParam(name=PARAM_PROJECTID) int oa_projectid,
111
			@WebParam(name=PARAM_CUSTOMERID) int oa_customerid,
112
			@WebParam(name=PARAM_USERID) int oa_userid,
113
			@WebParam(name=PARAM_STARTDATE) GregorianCalendar startdate,
114
			@WebParam(name=PARAM_ENDDATE) GregorianCalendar enddate,
115
			@WebParam(name=PARAM_INCLUDENONBILLABLE) boolean includeNonBillable,
116
			@WebParam(name=PARAM_TIMESHEETSTATUS) java.util.List<TimesheetFilter.TimesheetFilterType> filter,
117
			@WebParam(name=PARAM_TEMPLATE) AttachmentType templatefile) throws XServicesFault;
118
 
119
	/**
120
	 * Get an excel time sheet file.
121
	 *
122
	 * @return List of time entries
123
	 * @throws XServicesFault
124
	 */
125
	@WebMethod(operationName=OPERATION_GETEXCELTIMESHEET2)
126
	@WSDLDocumentation(value="Get an excel time sheet file.")
127
	public abstract AttachmentType getExcelTimesheet2(
128
			@WebParam(name=PARAM_ENTRYLIST) List<TimesheetEntry> entries,
129
			@WebParam(name=PARAM_INCLUDENONBILLABLE) boolean includeNonBillable,
130
			@WebParam(name=PARAM_TEMPLATE) AttachmentType templatefile) throws XServicesFault;
131
 
132
 
133
	/**
134
	 * Get a project from External Id
135
	 *
136
	 * @return List of projects with this ExternalId
137
	 * @throws XServicesFault
138
	 */
139
	@WebMethod(operationName=OPERATION_GETPROJECTBYEXTERNALID)
140
	@WSDLDocumentation(value="Get a project from External Id")
141
	public abstract List<Project> getProjectsByExternalId(
142
			@WebParam(name=PARAM_EXTERNALID) String externalid) throws XServicesFault;
143
 
144
	/**
145
	 * Get a project from Opportunity
146
	 *
147
	 * @return List of projects with this Opportunity
148
	 * @throws XServicesFault
149
	 */
150
	@WebMethod(operationName=OPERATION_GETPROJECTBYOPPID)
151
	@WSDLDocumentation(value="Get a project from Opportunity Id")
152
	public abstract List<Project> getProjectsByOppId(
153
			@WebParam(name=PARAM_OPPID) String oppid) throws XServicesFault;
154
 
155
	/**
156
	 * Get a customer by its ID
157
	 *
158
	 * @return Customer object
159
	 * @throws XServicesFault
160
	 */
161
	@WebMethod(operationName=OPERATION_GETCUSTOMERBYID)
162
	@WSDLDocumentation(value="Get a customer by its Id")
163
	public abstract Customer getCustomerById(
164
			@WebParam(name=PARAM_CUSTOMERID) int customerid) throws XServicesFault;
165
 
166
	/**
167
	 * Get a user record by its ID
168
	 *
169
	 * @return user object
170
	 * @throws XServicesFault
171
	 */
172
	@WebMethod(operationName=OPERATION_GETUSERBYID)
173
	@WSDLDocumentation(value="Get a user by its Id")
174
	public abstract User getUserById(
175
			@WebParam(name=PARAM_USERID) int userid) throws XServicesFault;
176
 
177
 
178
	/**
179
	 * Get a user record by its username
180
	 *
181
	 * @return user object
182
	 * @throws XServicesFault
183
	 */
184
	@WebMethod(operationName=OPERATION_GETUSERBYUSERNAME)
185
	@WSDLDocumentation(value="Get a user by its username")
186
	public abstract User getUserByUsername(
187
			@WebParam(name=PARAM_USERNAME) String username) throws XServicesFault;
188
 
189
	@WebMethod(operationName=OPERATION_GETANYOBJECT)
190
	@WSDLDocumentation(value="Get any Object by Query")
191
	public abstract List<AnyEntity> getAnyObject(
192
			@WebParam(name=PARAM_OBJECTTYPE) @XmlElement(required=true) String objecttype,
193
			@WebParam(name=PARAM_QUERIES) List<QueryParameter> queries) throws XServicesFault;
194
 
195
 
196
	@WebMethod(operationName=OPERATION_GETUPDATEDCOMPANIES)
197
	@WSDLDocumentation(value="Get updated customers")
198
	public abstract List<Customer> getUpdatedCustomer(
199
			@WebParam(name=PARAM_DATE) @XmlElement(required=true) GregorianCalendar date,
200
			@WebParam(name=PARAM_OFFSET) @XmlElement(required=true) int offset)
201
			throws XServicesFault;
202
 
203
	@WebMethod(operationName=OPERATION_GETUPDATEDPROJECTS)
204
	@WSDLDocumentation(value="Get updated projects")
205
 
206
	public abstract List<Project> getUpdatedProjects(
207
			@WebParam(name=PARAM_DATE) @XmlElement(required=true) GregorianCalendar date,
208
			@WebParam(name=PARAM_OFFSET) @XmlElement(required=true) int offset)
209
			throws XServicesFault;
210
 
211
 
212
	public class QueryParameter {
213
		@XmlElement(required=true)
214
		public String field;
215
		@XmlElement(required=true)
216
		public String value;
217
	}
218
}