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 DatabaseServices
getDatabase()
Returns the database services containing methods associated with databases.DateServices
getDate()
Returns the date services containing methods associated with dates.EncryptionServices
getEncryption()
Returns the encryption services containing methods associated with Ebase encryption.Errors
getErrors()
TheErrors
is 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.FileServices
getFile()
Returns the file services containing methods associated with system files.LdapServices
getLdap()
Returns the LDAP services containing methods that provide authentication and search methods against an LDAP Registry.PostcodeAnywhereServices
getPostcodeAnywhere()
Returns the postcode anywhere services containing methods to access the PostcodeAnywhere service.PushNotification
getPushNotification()
RestServices
getRest()
Returns the REST services that supports REST based operations.SchedulerServices
getScheduler()
Returns the scheduler services containing methods that enable Scheduled Tasks to be started from a form, workflow job or Integration Service.ServicesSecurity
getSecurity()
Returns the services security containing any security implementations required byServices
.VelocityServices
getVelocity()
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:Services
Returns the REST services that supports REST based operations. -
getPushNotification
- Specified by:
getPushNotification
in interfaceServices
-
getDate
Description copied from interface:Services
Returns the date services containing methods associated with dates. -
getEncryption
Description copied from interface:Services
Returns the encryption services containing methods associated with Ebase encryption.- Specified by:
getEncryption
in interfaceServices
-
getFile
Description copied from interface:Services
Returns the file services containing methods associated with system files. -
getLdap
Description copied from interface:Services
Returns the LDAP services containing methods that provide authentication and search methods against an LDAP Registry. -
getPostcodeAnywhere
Description copied from interface:Services
Returns the postcode anywhere services containing methods to access the PostcodeAnywhere service.- Specified by:
getPostcodeAnywhere
in interfaceServices
-
getScheduler
Description copied from interface:Services
Returns the scheduler services containing methods that enable Scheduled Tasks to be started from a form, workflow job or Integration Service.- Specified by:
getScheduler
in interfaceServices
-
getVelocity
Description copied from interface:Services
Returns the Velocity services containing methods to invoke a Velocity template.- Specified by:
getVelocity
in interfaceServices
-
getSecurity
Description copied from interface:Services
Returns the services security containing any security implementations required byServices
.- Specified by:
getSecurity
in interfaceServices
-
getDatabase
Description copied from interface:Services
Returns the database services containing methods associated with databases.- Specified by:
getDatabase
in interfaceServices
-
getErrors
Description copied from interface:Services
TheErrors
is 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 }
-