public abstract class ChangeManagementSystem
extends java.lang.Object
A "Ticket" is a general term for an object in a CMS which is used to govern approval. Tickets can be tied to FlexDeploy approvals (both in pipeline gates and for deployment workflow requests). Whether the underlying CMS terms this type of object a ticket, change, change request or anything else, the API must map the object to a CMSObjectType.TICKET to enable integration with FlexDeploy's CMS framework.
An "Incident" is a general term for an object in a CMS which is used to report a problem. FlexDeploy can be configured to automatically create incidents upon a deployment failure. Whether the underlying CMS terms this type of object an incident, problem, or anything else, the API must map the object to a CMSObjectType.INCIDENT to enable integration with FlexDeploy's CMS framework.
Out of the box implementations for of this API are provided for:
Modifier and Type | Class and Description |
---|---|
static class |
ChangeManagementSystem.CMSObjectType
CMS Object Type
Any object which is used to govern approval must be set as TICKET.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.io.Serializable> |
mProperties |
Constructor and Description |
---|
ChangeManagementSystem() |
Modifier and Type | Method and Description |
---|---|
void |
addCommentToTicket(java.lang.String pTicketNumber,
java.lang.String pComment)
Adds a comment to a change ticket.
|
abstract void |
checkConnection()
Check connection using details provided in getProperties().
|
abstract CMSObject |
createIncident(java.util.Map<java.lang.String,java.io.Serializable> pIncidentFields)
Creates a CMS Incident with the given fields.
|
abstract CMSObject |
createTicket(java.util.Map<java.lang.String,java.io.Serializable> pTicketFields)
Creates a CMS Ticket with the given fields.
|
abstract CMSObject |
findCMSObjectByType(java.lang.String pCMSObjectNumber,
ChangeManagementSystem.CMSObjectType pCMSObjectType)
Finds and returns a CMS Object (Ticket or Incident) with the given identifier and type.
|
java.util.List<CMSObject> |
findCMSObjectsByType(java.util.List<java.lang.String> pCMSObjectNumbers,
ChangeManagementSystem.CMSObjectType pCMSObjectType)
Finds and returns CMS Objects (Ticket or Incident) with the given identifier and type.
|
CMSObject |
findIncidentByType(java.lang.String pIncidentNumber)
Finds and returns a CMS Ticket object.
|
CMSObject |
findTicketByType(java.lang.String pTicketNumber)
Finds and returns a CMS Ticket object.
|
java.util.Map<java.lang.String,java.lang.String> |
getAdditionalTicketInfo(CMSObject pTicket,
java.lang.String pEnvironmentCode)
Returns a map containing information to add to FlexDeploy External Approvals
5.5.0.2 - 'notes' entry is added to notes of External Approval
|
protected java.lang.Boolean |
getBooleanProperty(java.lang.String pPropertyKey)
Returns a CMS instance property with the given code as a Boolean
|
java.lang.String |
getChangeManagementSystemName()
Retrieves the name of the change management system
|
protected java.lang.Double |
getDoubleProperty(java.lang.String pPropertyKey)
Returns a CMS instance property with the given code as a Double
|
protected java.lang.Float |
getFloatProperty(java.lang.String pPropertyKey)
Returns a CMS instance property with the given code as a Float
|
protected java.lang.Integer |
getIntegerProperty(java.lang.String pPropertyKey)
Returns a CMS instance property with the given code as an Integer
|
java.util.Map<java.lang.String,java.io.Serializable> |
getProperties()
Returns the CMS properties by property code
|
protected java.lang.String |
getProperty(java.lang.String pPropertyKey)
Returns a CMS instance property with given code as a String.
|
java.lang.String |
getTicketURL(CMSObject pCMSObject)
Return ticket's absolute URL.
|
abstract java.lang.Boolean |
isDoPolling()
Returns whether polling is enabled for checking CMS Ticket status.
|
abstract java.lang.Boolean |
isTicketApproved(CMSObject pTicket,
java.lang.String pEnvironmentCode)
Checks if the given CMS Ticket is approved for an environment.
|
abstract java.lang.Boolean |
isTicketRejected(CMSObject pTicket,
java.lang.String pEnvironmentCode)
Checks if the given CMS Ticket is rejected for an environment.
|
void |
setChangeManagementSystemName(java.lang.String pChangeManagementSystemName)
Sets the name of the CMS to be displayed under Change Management Systems
|
void |
setProperties(java.util.Map<java.lang.String,java.io.Serializable> pProperties)
Sets the CMS instance properties
|
void |
uploadAttachmentToIncident(java.lang.String pIncidentNumber,
java.lang.String pFileName,
java.io.InputStream pAttachment)
Uploads an attachment to an existing CMS Incident.
|
void |
uploadAttachmentToTicket(java.lang.String pTicketNumber,
java.lang.String pFileName,
java.io.InputStream pAttachment)
Uploads an attachment to an existing CMS Ticket.
|
public void setChangeManagementSystemName(java.lang.String pChangeManagementSystemName)
pChangeManagementSystemName
- String The name of the Change Management Systempublic java.lang.String getChangeManagementSystemName()
public void setProperties(java.util.Map<java.lang.String,java.io.Serializable> pProperties)
pProperties
- A Map of CMS properties with key of property code and value of String,
Boolean, Integer, Float or Doublepublic java.util.Map<java.lang.String,java.io.Serializable> getProperties()
protected java.lang.String getProperty(java.lang.String pPropertyKey)
pPropertyKey
- String The property keyprotected java.lang.Boolean getBooleanProperty(java.lang.String pPropertyKey)
pPropertyKey
- String The property keyprotected java.lang.Integer getIntegerProperty(java.lang.String pPropertyKey)
pPropertyKey
- String The property keyprotected java.lang.Float getFloatProperty(java.lang.String pPropertyKey)
pPropertyKey
- String The property keyprotected java.lang.Double getDoubleProperty(java.lang.String pPropertyKey)
pPropertyKey
- String The property keypublic abstract CMSObject createTicket(java.util.Map<java.lang.String,java.io.Serializable> pTicketFields) throws ApiException
pTicketFields
- A Map of fields to use when creating the ticketApiException
- Throw if ticket cannot be created in the underlying CMSpublic abstract CMSObject createIncident(java.util.Map<java.lang.String,java.io.Serializable> pIncidentFields) throws ApiException
pIncidentFields
- A Map of fields to use when updating the ticketApiException
- Throw if ticket cannot be updated in the underlying CMSpublic abstract CMSObject findCMSObjectByType(java.lang.String pCMSObjectNumber, ChangeManagementSystem.CMSObjectType pCMSObjectType) throws ApiException
pCMSObjectNumber
- The unique identifier of the ticketpCMSObjectType
- The type of object to find (TICKET or INCIDENT)ApiException
- Throw if the object is not found in the underlying CMSpublic java.util.List<CMSObject> findCMSObjectsByType(java.util.List<java.lang.String> pCMSObjectNumbers, ChangeManagementSystem.CMSObjectType pCMSObjectType) throws ApiException
pCMSObjectNumbers
- The unique identifier of the ticketspCMSObjectType
- The type of object to find (TICKET or INCIDENT)ApiException
- Throw if the object is not found in the underlying CMSpublic CMSObject findTicketByType(java.lang.String pTicketNumber) throws ApiException
pTicketNumber
- The unique identifier of the ticketApiException
- Thrown if the ticket cannot be foundpublic CMSObject findIncidentByType(java.lang.String pIncidentNumber) throws ApiException
pIncidentNumber
- The unique identifier of the incidentApiException
- Thrown if the incident cannot be foundpublic abstract java.lang.Boolean isTicketApproved(CMSObject pTicket, java.lang.String pEnvironmentCode)
pTicket
- The CMS TicketpEnvironmentCode
- The environment code of the target FlexDeploy environmentpublic abstract java.lang.Boolean isTicketRejected(CMSObject pTicket, java.lang.String pEnvironmentCode)
pTicket
- The CMS TicketpEnvironmentCode
- The environment code of the target FlexDeploy environmentpublic abstract java.lang.Boolean isDoPolling()
public abstract void checkConnection() throws ApiException
ApiException
- Throw if connection cannot be established to the underlying CMSpublic java.lang.String getTicketURL(CMSObject pCMSObject) throws ApiException
pCMSObject
- ApiException
public java.util.Map<java.lang.String,java.lang.String> getAdditionalTicketInfo(CMSObject pTicket, java.lang.String pEnvironmentCode) throws ApiException
pTicket
- The CMS TicketpEnvironmentCode
- The environment code of the target FlexDeploy environmentApiException
public void uploadAttachmentToTicket(java.lang.String pTicketNumber, java.lang.String pFileName, java.io.InputStream pAttachment) throws ApiException
pTicketNumber
- The CMS Ticket.pFileName
- The name of the attachment.pAttachment
- The attachment to be uploaded to the CMS Ticket.ApiException
- Throw if attachment cannot be uploaded in the CMS Ticket.public void uploadAttachmentToIncident(java.lang.String pIncidentNumber, java.lang.String pFileName, java.io.InputStream pAttachment) throws ApiException
pIncidentNumber
- The CMS Incident.pFileName
- The name of the attachment.pAttachment
- The attachment to be uploaded to the CMS Incident.ApiException
- Throw if attachment cannot be uploaded in the CMS Incident.public void addCommentToTicket(java.lang.String pTicketNumber, java.lang.String pComment) throws ApiException
pTicketNumber
- pComment
- ApiException