public class

ServiceNowConnector

extends Object
java.lang.Object
   ↳ org.mule.modules.servicenow.ServiceNowConnector
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Cloud Connector to connect to the service now This class provides the mirror methods to connect to the service now web services.

Summary

Constants
String ASSET_SOAP
String INCIDENT_SOAP
String SYSUSER_GROUP_MEMBER_SOAP
String SYSUSER_HAS_ROLE_SOAP
String SYSUSER_SOAP
Fields
private AssetSoapClient assetSoapClient ServiceNow service asset client
private IncidentSoapClient incidentSoapClient ServiceNow service incident client
private String password The password to access ServiceNow Web Services
private String serviceEndpoint The serviceEndpoint location to access ServiceNow Web Services
private SysUserGroupMemberSoapClient sysUserGroupMemberSoapClient ServiceNow service User Group Member client
private SysUserHasRoleSoapClient sysUserHasRoleSoapClient ServiceNow service User Role client
private SysUserSoapClient sysUserSoapClient ServiceNow service user client
private String username The username to access ServiceNow Web Services
Public Constructors
ServiceNowConnector()
Public Methods
synchronized void connect(String username, String password, String serviceEndpoint)
Initializes the connector
String connectionId()
DeleteRecordResponse deleteAssetRecord(DeleteRecord deleteAssetRequest)
Delete a record from the Asset table.
DeleteRecordResponse deleteIncidentRecord(DeleteRecord deleteIncidentRecordRequest)
Delete a record from the Incident table.
DeleteMultipleResponse deleteMultipleIncident(DeleteMultiple deleteMultipleIncidentRequest)
Delete multiple record from the Incident table.
DeleteMultipleResponse deleteMultipleUser(DeleteMultiple deleteMultipleUserRequest)
Delete multiple record from the User table.
DeleteRecordResponse deleteUserGroupRecord(DeleteRecord deleteUserGroupRequest)
Delete a record from the Group Member table.
DeleteRecordResponse deleteUserRecord(DeleteRecord deleteUserRecordRequest)
Delete a record from the User table.
DeleteRecordResponse deleteUserRoleRecord(DeleteRecord deleteRecordRequest)
Delete a record from the User Role table.
synchronized void disconnect()
Disconnect/release the service now service client
GetResponse getAsset(Get getAssetRequest)
Query a single record from the Asset table and return the record and its fields.
GetRecordsResponse getAssetRecords(GetRecords assetsRecordsRequest)
Query the Asset table by example values and return all matching records and their fields.
AssetSoapClient getAssetSoapClient()
Creates the instance of service now Asset client class.
GetResponse getIncident(Get getIncidentRequest)
Query a single record from the Incident table and return the record and its fields.
GetKeysResponse getIncidentKeys(GetKeys getIncidentKeysRequest)
Query the Incident table by example values and return a comma delimited list of sys_id.
GetRecordsResponse getIncidentRecords(GetRecords getIncidentRecordsRequest)
Query the Incident table by example values and return all matching records and their fields.
IncidentSoapClient getIncidentSoapClient()
Creates the instance of service now service client class.
String getPassword()
String getServiceEndpoint()
SysUserGroupMemberSoapClient getSysUserGroupMemberSoapClient()
Creates the instance of ServiceNow SysUserGroupMember client class.
SysUserHasRoleSoapClient getSysUserHasRoleSoapClient()
Creates the instance of service now SysUserHasRole client class.
SysUserSoapClient getSysUserSoapClient()
Creates the instance of service now SysUser client class.
GetResponse getUser(Get getUserRequest)
Query a single record from the User table and return the record and its fields.
GetRecordsResponse getUserGroupRecords(GetRecords getUserGroupRecordsRequest)
Query the Group Member table by example values and return all matching records and their fields.
GetKeysResponse getUserKeys(GetKeys getUserKeysRequest)
Query the User table by example values and return a comma delimited list of sys_id.
GetRecordsResponse getUserRecords(GetRecords getUserRecordsRequest)
Query the User table by example values and return all matching records and their fields.
GetRecordsResponse getUserRoleRecords(GetRecords getUserRoleRecordsRequest)
Query the User Role table by example values and return all matching records and their fields.
String getUsername()
InsertResponse insertAsset(Insert insertAssetRequest)
Creates a new record for the Asset table.
InsertResponse insertIncident(Insert insertIncidentRequest)
Creates a new record for the Incident table.
InsertResponse insertUser(Insert insertUserRequest)
Creates a new record for the User table.
InsertResponse insertUserGroup(Insert insertUserGroupRequest)
Creates a new record for the Group Member table.
InsertResponse insertUserRole(Insert insertUserRoleRequest)
Creates a new record for the User Role table.
boolean isConnected()
Is service now instance connected?
void setAssetSoapClient(AssetSoapClient assetSoapClient)
void setIncidentSoapClient(IncidentSoapClient incidentSoapClient)
void setPassword(String password)
void setServiceEndpoint(String serviceEndpoint)
void setSysUserGroupMemberSoapClient(SysUserGroupMemberSoapClient sysUserGroupMemberSoapClient)
void setSysUserHasRoleSoapClient(SysUserHasRoleSoapClient sysUserHasRoleSoapClient)
void setSysUserSoapClient(SysUserSoapClient sysUserSoapClient)
void setUsername(String username)
UpdateResponse updateAsset(Update updateAssetRequest)
Updates an existing record in the Asset table.
UpdateResponse updateIncident(Update updateIncidentRequest)
Updates an existing record in the Incident table.
UpdateResponse updateUser(Update updateUserRequest)
Updates an existing record in the User table.
UpdateResponse updateUserGroup(Update updateUserGroupRequest)
Updates an existing record in the Group Member table.
UpdateResponse updateUserRole(Update updateUserRoleRequest)
Updates an existing record in the User Role table.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String ASSET_SOAP

Constant Value: "/alm_asset.do?SOAP"

public static final String INCIDENT_SOAP

Constant Value: "/incident.do?SOAP"

public static final String SYSUSER_GROUP_MEMBER_SOAP

Constant Value: "/sys_user_grmember.do?SOAP"

public static final String SYSUSER_HAS_ROLE_SOAP

Constant Value: "/sys_user_has_role.do?SOAP"

public static final String SYSUSER_SOAP

Constant Value: "/sys_user.do?SOAP"

Fields

private AssetSoapClient assetSoapClient

ServiceNow service asset client

private IncidentSoapClient incidentSoapClient

ServiceNow service incident client

private String password

The password to access ServiceNow Web Services

private String serviceEndpoint

The serviceEndpoint location to access ServiceNow Web Services

private SysUserGroupMemberSoapClient sysUserGroupMemberSoapClient

ServiceNow service User Group Member client

private SysUserHasRoleSoapClient sysUserHasRoleSoapClient

ServiceNow service User Role client

private SysUserSoapClient sysUserSoapClient

ServiceNow service user client

private String username

The username to access ServiceNow Web Services

Public Constructors

public ServiceNowConnector ()

Public Methods

public synchronized void connect (String username, String password, String serviceEndpoint)

Initializes the connector

Parameters
username A username to connect to the service now
password A password to connect to the service now
serviceEndpoint Tenant URL in ServiceNow. E.g.:https://dev1.service-now.com
Throws
ConnectionException

public String connectionId ()

public DeleteRecordResponse deleteAssetRecord (DeleteRecord deleteAssetRequest)

Delete a record from the Asset table.

Parameters
deleteAssetRequest Delete Asset data
Returns
  • DeleteResponse Object containing results of the operation
Throws
Exception if any error occurs

public DeleteRecordResponse deleteIncidentRecord (DeleteRecord deleteIncidentRecordRequest)

Delete a record from the Incident table.

Parameters
deleteIncidentRecordRequest DeleteRecord object represents the incident to be deleted from servie now
Returns
  • DeleteRecordResponse object contains the count of deleted record
Throws
Exception if any error occurs

public DeleteMultipleResponse deleteMultipleIncident (DeleteMultiple deleteMultipleIncidentRequest)

Delete multiple record from the Incident table.

Parameters
deleteMultipleIncidentRequest DeleteMultiple object for deleting multiple incident records from service now
Returns
  • DeleteMultipleResponse object contains the count of deleted records
Throws
Exception if any error occurs

public DeleteMultipleResponse deleteMultipleUser (DeleteMultiple deleteMultipleUserRequest)

Delete multiple record from the User table.

Parameters
deleteMultipleUserRequest DeleteMultiple object for deleting multiple user records from service now
Returns
  • DeleteMultipleResponse object contains the count of deleted records
Throws
Exception if any error occurs

public DeleteRecordResponse deleteUserGroupRecord (DeleteRecord deleteUserGroupRequest)

Delete a record from the Group Member table.

Parameters
deleteUserGroupRequest Delete user role data
Returns
  • DeleteRecordResponse Object containing results of the operation
Throws
Exception if any error occurs

public DeleteRecordResponse deleteUserRecord (DeleteRecord deleteUserRecordRequest)

Delete a record from the User table.

Parameters
deleteUserRecordRequest DeleteRecord object represents the user to be deleted from servie now
Returns
  • DeleteRecordResponse object contains the count of deleted record
Throws
Exception if any error occurs

public DeleteRecordResponse deleteUserRoleRecord (DeleteRecord deleteRecordRequest)

Delete a record from the User Role table.

Parameters
deleteRecordRequest Delete user role data
Returns
  • DeleteRecordResponse Object containing results of the operation
Throws
Exception if any error occurs

public synchronized void disconnect ()

Disconnect/release the service now service client

public GetResponse getAsset (Get getAssetRequest)

Query a single record from the Asset table and return the record and its fields.

Parameters
getAssetRequest Get object for retrieving user
Returns
  • GetResponse object contains the user information
Throws
Exception if any error occurs

public GetRecordsResponse getAssetRecords (GetRecords assetsRecordsRequest)

Query the Asset table by example values and return all matching records and their fields.

Parameters
assetsRecordsRequest Request data
Returns
  • InsertResponse Object containing results of the operation
Throws
Exception if any error occurs

public AssetSoapClient getAssetSoapClient ()

Creates the instance of service now Asset client class.

Returns
  • SOAP client for specific service now module serviceEndpoint
Throws
ConnectionException

public GetResponse getIncident (Get getIncidentRequest)

Query a single record from the Incident table and return the record and its fields.

Parameters
getIncidentRequest Get object for retrieving incident
Returns
  • GetResponse object contains the incident information
Throws
Exception if any error occurs

public GetKeysResponse getIncidentKeys (GetKeys getIncidentKeysRequest)

Query the Incident table by example values and return a comma delimited list of sys_id.

Parameters
getIncidentKeysRequest GetKeys object for retrieving incident keys
Returns
  • GetKeysResponse object contains the incident keys information
Throws
Exception if any error occurs

public GetRecordsResponse getIncidentRecords (GetRecords getIncidentRecordsRequest)

Query the Incident table by example values and return all matching records and their fields.

Parameters
getIncidentRecordsRequest GetRecords object for retrieving incident records
Returns
  • GetRecordResponse object contains the incident record information
Throws
Exception if any error occurs

public IncidentSoapClient getIncidentSoapClient ()

Creates the instance of service now service client class.

Returns
  • SOAP client for specific service now module serviceEndpoint
Throws
ConnectionException

public String getPassword ()

public String getServiceEndpoint ()

public SysUserGroupMemberSoapClient getSysUserGroupMemberSoapClient ()

Creates the instance of ServiceNow SysUserGroupMember client class.

Returns
  • SOAP client for specific service now module serviceEndpoint
Throws
ConnectionException

public SysUserHasRoleSoapClient getSysUserHasRoleSoapClient ()

Creates the instance of service now SysUserHasRole client class.

Returns
  • SOAP client for specific service now module serviceEndpoint
Throws
ConnectionException

public SysUserSoapClient getSysUserSoapClient ()

Creates the instance of service now SysUser client class.

Returns
  • SOAP client for specific service now module serviceEndpoint
Throws
ConnectionException

public GetResponse getUser (Get getUserRequest)

Query a single record from the User table and return the record and its fields.

Parameters
getUserRequest Get object for retrieving user
Returns
  • GetResponse object contains the user information
Throws
Exception if any error occurs

public GetRecordsResponse getUserGroupRecords (GetRecords getUserGroupRecordsRequest)

Query the Group Member table by example values and return all matching records and their fields.

Parameters
getUserGroupRecordsRequest Get user role record data
Returns
  • GetRecordsResponse Object containing results of the operation
Throws
Exception if any error occurs

public GetKeysResponse getUserKeys (GetKeys getUserKeysRequest)

Query the User table by example values and return a comma delimited list of sys_id.

Parameters
getUserKeysRequest GetKeys object for retrieving user keys
Returns
  • GetKeysResponse object contains the user keys information
Throws
Exception if any error occurs

public GetRecordsResponse getUserRecords (GetRecords getUserRecordsRequest)

Query the User table by example values and return all matching records and their fields.

Parameters
getUserRecordsRequest GetRecords object for retrieving user records
Returns
  • GetRecordResponse object contains the user record information
Throws
Exception if any error occurs

public GetRecordsResponse getUserRoleRecords (GetRecords getUserRoleRecordsRequest)

Query the User Role table by example values and return all matching records and their fields.

Parameters
getUserRoleRecordsRequest Get user role record data
Returns
  • GetRecordsResponse Object containing results of the operation
Throws
Exception if any error occurs

public String getUsername ()

public InsertResponse insertAsset (Insert insertAssetRequest)

Creates a new record for the Asset table.

Parameters
insertAssetRequest Insert Asset data
Returns
  • InsertResponse Object containing results of the operation
Throws
Exception if any error occurs

public InsertResponse insertIncident (Insert insertIncidentRequest)

Creates a new record for the Incident table.

Parameters
insertIncidentRequest Insert object to be inserted into servie now system
Returns
  • InsertResponse object contains the incident which has been inserted into the servie now system
Throws
Exception if any error occurs

public InsertResponse insertUser (Insert insertUserRequest)

Creates a new record for the User table.

Parameters
insertUserRequest User to be added to service now system
Returns
  • InsertResponse object contains the user which has been inserted into the servie now system
Throws
Exception if any error occurs

public InsertResponse insertUserGroup (Insert insertUserGroupRequest)

Creates a new record for the Group Member table.

Parameters
insertUserGroupRequest User Group data
Returns
  • InsertResponse Object containing results of the operation
Throws
Exception if any error occurs

public InsertResponse insertUserRole (Insert insertUserRoleRequest)

Creates a new record for the User Role table.

Parameters
insertUserRoleRequest Insert user role data
Returns
  • InsertResponse Object containing results of the operation
Throws
Exception if any error occurs

public boolean isConnected ()

Is service now instance connected?

public void setAssetSoapClient (AssetSoapClient assetSoapClient)

Parameters
assetSoapClient

public void setIncidentSoapClient (IncidentSoapClient incidentSoapClient)

Parameters
incidentSoapClient

public void setPassword (String password)

Parameters
password

public void setServiceEndpoint (String serviceEndpoint)

Parameters
serviceEndpoint

public void setSysUserGroupMemberSoapClient (SysUserGroupMemberSoapClient sysUserGroupMemberSoapClient)

Parameters
sysUserGroupMemberSoapClient

public void setSysUserHasRoleSoapClient (SysUserHasRoleSoapClient sysUserHasRoleSoapClient)

Parameters
sysUserHasRoleSoapClient

public void setSysUserSoapClient (SysUserSoapClient sysUserSoapClient)

Parameters
sysUserSoapClient

public void setUsername (String username)

Parameters
username

public UpdateResponse updateAsset (Update updateAssetRequest)

Updates an existing record in the Asset table.

Parameters
updateAssetRequest Update Asset data
Returns
  • UpdateResponse Object containing results of the operation
Throws
Exception if any error occurs

public UpdateResponse updateIncident (Update updateIncidentRequest)

Updates an existing record in the Incident table.

Parameters
updateIncidentRequest Update object to be updated in service now system
Returns
  • UpdateResponse object contains the updated incident detail
Throws
Exception if any error occurs

public UpdateResponse updateUser (Update updateUserRequest)

Updates an existing record in the User table.

Parameters
updateUserRequest Update object to be updated in service now system
Returns
  • UpdateResponse object contains the updated incident detail
Throws
Exception if any error occurs

public UpdateResponse updateUserGroup (Update updateUserGroupRequest)

Updates an existing record in the Group Member table.

Parameters
updateUserGroupRequest Insert user role data
Returns
  • UpdateResponse Object containing results of the operation
Throws
Exception if any error occurs

public UpdateResponse updateUserRole (Update updateUserRoleRequest)

Updates an existing record in the User Role table.

Parameters
updateUserRoleRequest Insert user role data
Returns
  • UpdateResponse Object containing results of the operation
Throws
Exception if any error occurs