diff --git a/src/java/net/brutex/xservices/ws/OpenAirProxyService.java b/src/java/net/brutex/xservices/ws/OpenAirProxyService.java new file mode 100644 index 0000000..1fc9e9f --- /dev/null +++ b/src/java/net/brutex/xservices/ws/OpenAirProxyService.java @@ -0,0 +1,216 @@ +/* + * Copyright 2017 Brian Rosenberger (Brutex Network) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.brutex.xservices.ws; + +import java.util.GregorianCalendar; +import java.util.List; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebService; +import javax.jws.soap.SOAPBinding; +import javax.xml.bind.annotation.XmlElement; + +import net.brutex.mgmt.api.xml.AnyEntity; +import net.brutex.mgmt.api.xml.Customer; +import net.brutex.mgmt.api.xml.Project; +import net.brutex.mgmt.api.xml.TimesheetEntry; +import net.brutex.mgmt.api.xml.TimesheetFilter; +import net.brutex.mgmt.api.xml.User; +import net.brutex.xservices.types.ant.AttachmentType; +import net.brutex.xservices.util.BrutexNamespaces; + + + +/** + * OpenAir proxy services + * @author Brian Rosenberger + * @since 20160531 + * + */ +@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES) +public interface OpenAirProxyService { + + public static final String SERVICE_NAME = "OpenAirProxyService"; + final String OPERATION_GETTIMEENTRIES = "getTimeentries"; + final String OPERATION_GETEXCELTIMESHEET = "getExcelTimesheet"; + final String OPERATION_GETEXCELTIMESHEET2 = "getExcelTimesheet2"; + final String OPERATION_GETPROJECTBYEXTERNALID = "getProjectsByExternalId"; + final String OPERATION_GETPROJECTBYOPPID = "getProjectsByOppId"; + final String OPERATION_GETCUSTOMERBYID = "getCustomerById"; + final String OPERATION_GETUSERBYID = "getUserById"; + final String OPERATION_GETUSERBYUSERNAME = "getUserByUsername"; + final String OPERATION_GETANYOBJECT = "getAnyObject"; + final String OPERATION_GETUPDATEDCOMPANIES = "getUpdatedCustomer"; + final String OPERATION_GETUPDATEDPROJECTS = "getUpdatedProject"; + + + final String PARAM_PROJECTID = "oa_projectid"; + final String PARAM_CUSTOMERID = "oa_customerid"; + final String PARAM_USERID = "oa_userid"; + final String PARAM_USERNAME = "oa_username"; + final String PARAM_TEMPLATE ="template"; + final String PARAM_STARTDATE = "startdate"; + final String PARAM_ENDDATE = "enddate"; + final String PARAM_ENTRYLIST = "timeentries"; + final String PARAM_EXTERNALID = "externalid"; + final String PARAM_OPPID = "oppid"; + final String PARAM_INCLUDENONBILLABLE = "includeNonBillable"; + final String PARAM_OBJECTTYPE = "objecttype"; + final String PARAM_QUERIES = "queries"; + final String PARAM_DATE = "datetime"; + final String PARAM_OFFSET = "offset_minutes"; + final String PARAM_TIMESHEETSTATUS = "timesheetstatus"; + + /** + * Get a list of time entries. + * + * @return List of time entries + * @throws XServicesFault + */ + @WebMethod(operationName=OPERATION_GETTIMEENTRIES) + @WSDLDocumentation(value="Get list of time entries") + public abstract List getTimeEntryList( + @WebParam(name=PARAM_PROJECTID) int oa_projectid, + @WebParam(name=PARAM_CUSTOMERID) int oa_customerid, + @WebParam(name=PARAM_USERID) int oa_userid, + @WebParam(name=PARAM_STARTDATE) GregorianCalendar startdate, + @WebParam(name=PARAM_ENDDATE) GregorianCalendar enddate, + @WebParam(name=PARAM_INCLUDENONBILLABLE) boolean includeNonBillable, + @WebParam(name=PARAM_TIMESHEETSTATUS) java.util.List filter) + throws XServicesFault; + + + + /** + * Get an excel time sheet file. + * + * @return List of time entries + * @throws XServicesFault + */ + @WebMethod(operationName=OPERATION_GETEXCELTIMESHEET) + @WSDLDocumentation(value="Get an excel time sheet file.") + public abstract AttachmentType getExcelTimesheet( + @WebParam(name=PARAM_PROJECTID) int oa_projectid, + @WebParam(name=PARAM_CUSTOMERID) int oa_customerid, + @WebParam(name=PARAM_USERID) int oa_userid, + @WebParam(name=PARAM_STARTDATE) GregorianCalendar startdate, + @WebParam(name=PARAM_ENDDATE) GregorianCalendar enddate, + @WebParam(name=PARAM_INCLUDENONBILLABLE) boolean includeNonBillable, + @WebParam(name=PARAM_TIMESHEETSTATUS) java.util.List filter, + @WebParam(name=PARAM_TEMPLATE) AttachmentType templatefile) throws XServicesFault; + + /** + * Get an excel time sheet file. + * + * @return List of time entries + * @throws XServicesFault + */ + @WebMethod(operationName=OPERATION_GETEXCELTIMESHEET2) + @WSDLDocumentation(value="Get an excel time sheet file.") + public abstract AttachmentType getExcelTimesheet2( + @WebParam(name=PARAM_ENTRYLIST) List entries, + @WebParam(name=PARAM_INCLUDENONBILLABLE) boolean includeNonBillable, + @WebParam(name=PARAM_TEMPLATE) AttachmentType templatefile) throws XServicesFault; + + + /** + * Get a project from External Id + * + * @return List of projects with this ExternalId + * @throws XServicesFault + */ + @WebMethod(operationName=OPERATION_GETPROJECTBYEXTERNALID) + @WSDLDocumentation(value="Get a project from External Id") + public abstract List getProjectsByExternalId( + @WebParam(name=PARAM_EXTERNALID) String externalid) throws XServicesFault; + + /** + * Get a project from Opportunity + * + * @return List of projects with this Opportunity + * @throws XServicesFault + */ + @WebMethod(operationName=OPERATION_GETPROJECTBYOPPID) + @WSDLDocumentation(value="Get a project from Opportunity Id") + public abstract List getProjectsByOppId( + @WebParam(name=PARAM_OPPID) String oppid) throws XServicesFault; + + /** + * Get a customer by its ID + * + * @return Customer object + * @throws XServicesFault + */ + @WebMethod(operationName=OPERATION_GETCUSTOMERBYID) + @WSDLDocumentation(value="Get a customer by its Id") + public abstract Customer getCustomerById( + @WebParam(name=PARAM_CUSTOMERID) int customerid) throws XServicesFault; + + /** + * Get a user record by its ID + * + * @return user object + * @throws XServicesFault + */ + @WebMethod(operationName=OPERATION_GETUSERBYID) + @WSDLDocumentation(value="Get a user by its Id") + public abstract User getUserById( + @WebParam(name=PARAM_USERID) int userid) throws XServicesFault; + + + /** + * Get a user record by its username + * + * @return user object + * @throws XServicesFault + */ + @WebMethod(operationName=OPERATION_GETUSERBYUSERNAME) + @WSDLDocumentation(value="Get a user by its username") + public abstract User getUserByUsername( + @WebParam(name=PARAM_USERNAME) String username) throws XServicesFault; + + @WebMethod(operationName=OPERATION_GETANYOBJECT) + @WSDLDocumentation(value="Get any Object by Query") + public abstract List getAnyObject( + @WebParam(name=PARAM_OBJECTTYPE) @XmlElement(required=true) String objecttype, + @WebParam(name=PARAM_QUERIES) List queries) throws XServicesFault; + + + @WebMethod(operationName=OPERATION_GETUPDATEDCOMPANIES) + @WSDLDocumentation(value="Get updated customers") + public abstract List getUpdatedCustomer( + @WebParam(name=PARAM_DATE) @XmlElement(required=true) GregorianCalendar date, + @WebParam(name=PARAM_OFFSET) @XmlElement(required=true) int offset) + throws XServicesFault; + + @WebMethod(operationName=OPERATION_GETUPDATEDPROJECTS) + @WSDLDocumentation(value="Get updated projects") + + public abstract List getUpdatedProjects( + @WebParam(name=PARAM_DATE) @XmlElement(required=true) GregorianCalendar date, + @WebParam(name=PARAM_OFFSET) @XmlElement(required=true) int offset) + throws XServicesFault; + + + public class QueryParameter { + @XmlElement(required=true) + public String field; + @XmlElement(required=true) + public String value; + } +}