Package com.ebasetech.xi.api
Class ServicesImpl
java.lang.Object
com.ebasetech.xi.api.ServicesImpl
- All Implemented Interfaces:
com.ebasetech.ufs.runtime.events.rhinojavascript.debugging.DebuggerSubstitution,Services,java.io.Serializable
public class ServicesImpl extends java.lang.Object implements Services, java.io.Serializable, com.ebasetech.ufs.runtime.events.rhinojavascript.debugging.DebuggerSubstitution
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description ServicesImpl() -
Method Summary
Modifier and Type Method Description DatabaseServicesgetDatabase()Returns the database services containing methods associated with databases.DateServicesgetDate()Returns the date services containing methods associated with dates.EncryptionServicesgetEncryption()Returns the encryption services containing methods associated with Ebase encryption.ErrorsgetErrors()TheErrorsis a server side JavaScript object that contains functions that allows the creation of customizable error handling functionality specifically returned from the server, for example a 404 HTTP Not Found error.FileServicesgetFile()Returns the file services containing methods associated with system files.LdapServicesgetLdap()Returns the LDAP services containing methods that provide authentication and search methods against an LDAP Registry.PostcodeAnywhereServicesgetPostcodeAnywhere()Returns the postcode anywhere services containing methods to access the PostcodeAnywhere service.PushNotificationgetPushNotification()RestServicesgetRest()Returns the REST services that supports REST based operations.SchedulerServicesgetScheduler()Returns the scheduler services containing methods that enable Scheduled Tasks to be started from a form, workflow job or Integration Service.ServicesSecuritygetSecurity()Returns the services security containing any security implementations required byServices.VelocityServicesgetVelocity()Returns the Velocity services containing methods to invoke a Velocity template.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ServicesImpl
public ServicesImpl()
-
-
Method Details
-
getRest
Description copied from interface:ServicesReturns the REST services that supports REST based operations. -
getPushNotification
- Specified by:
getPushNotificationin interfaceServices
-
getDate
Description copied from interface:ServicesReturns the date services containing methods associated with dates. -
getEncryption
Description copied from interface:ServicesReturns the encryption services containing methods associated with Ebase encryption.- Specified by:
getEncryptionin interfaceServices
-
getFile
Description copied from interface:ServicesReturns the file services containing methods associated with system files. -
getLdap
Description copied from interface:ServicesReturns the LDAP services containing methods that provide authentication and search methods against an LDAP Registry. -
getPostcodeAnywhere
Description copied from interface:ServicesReturns the postcode anywhere services containing methods to access the PostcodeAnywhere service.- Specified by:
getPostcodeAnywherein interfaceServices
-
getScheduler
Description copied from interface:ServicesReturns the scheduler services containing methods that enable Scheduled Tasks to be started from a form, workflow job or Integration Service.- Specified by:
getSchedulerin interfaceServices
-
getVelocity
Description copied from interface:ServicesReturns the Velocity services containing methods to invoke a Velocity template.- Specified by:
getVelocityin interfaceServices
-
getSecurity
Description copied from interface:ServicesReturns the services security containing any security implementations required byServices.- Specified by:
getSecurityin interfaceServices
-
getDatabase
Description copied from interface:ServicesReturns the database services containing methods associated with databases.- Specified by:
getDatabasein interfaceServices
-
getErrors
Description copied from interface:ServicesTheErrorsis a server side JavaScript object that contains functions that allows the creation of customizable error handling functionality specifically returned from the server, for example a 404 HTTP Not Found error. The error handlers are created using a description string and an error code. The errors are as follows:HttpRequestError- This is typically used to create HTTP response failure errors, for example the server responds with a 400 Bad Request codeHttpAuthorisationError- This should be used when generating Authentication errors, for example the server responds with a 401 Unauthorized codeHttpNotFoundError- This should be used when generating not found errors, for example the server responds with a 404 Not Found codeHttpServerError- This should be used when generating generic server errors, for example the server responds with a 500 Server Error codeHttpUnknownError- This should be used when generating an unknown or unrecognized error, for example the HTTP code is not recognized
JavaScript example:
// call Users REST API function callUsersAPI() { var response = services.rest.get("http://example.com/rest/users"); if(!response.isSuccess()) { switch(response.code) { case 401: // Send an email stating that the service is authorized fields.unauthorizedError.value = response.body; resources.sysAdmin.sendMail(); throw services.errors.createAuthorisationError("Unauthorized", response.code); default: throw services.errors.createRequestError("Request error", response.code); } //process result }
-