Class AssociationUtil
RequestStatus return type methods will result in being returned as either true or false as its status.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ads.api.util.BaseUtil
com.ads.api.util.BaseUtil.TokenType -
Field Summary
Fields inherited from class com.ads.api.util.BaseUtil
AUTH_TOKEN, AUTH_TOKEN_TYPE -
Method Summary
Modifier and TypeMethodDescriptioncreateAssociation(Association association) Creates the association for the given association object.createAssociationAs(String association, String outputFormat) Creates the association for the given association object.createAssociations(List<Association> associations) Creates the associations for the given list of association objects.createAssociationsAs(String associations, String outputFormat) Creates the associations for the given list of association objects.deleteAssociation(int associationId) Deletes the association with the specified associationId.deleteAssociationAs(int associationId, String outputFormat) Deletes the association with the specified associationId.deleteAssociations(int objectId, int objectTypeId) Deletes the associations with the specified objectId and objectTypeId.deleteAssociations(List<Integer> associationIds) Deletes the associations with the specified list of associationIds.deleteAssociationsAs(String associationIds, String outputFormat) Deletes the associations with the specified list of associationIds.deleteAssociationsByObjectTypeAs(int objectId, int objectTypeId, String outputFormat) Deletes the associations with the specified objectId and objectTypeId.getAssociation(int associationId) Returns the association object for the specified associationId.getAssociation(int associationId, boolean fillInfo) Returns the association object for the specified associationId and fillInfo.getAssociationAs(int associationId, boolean fillInfo, String outputFormat) Returns the association object for the specified associationId and fillInfo.getAssociationAs(int associationId, String outputFormat) Returns the association object for the specified associationId.getAssociations(int objectId, int objectTypeId) Returns the list association objects for the specified sourceObjectId and sourceObjectTypeId.getAssociations(int objectId, int objectTypeId, boolean fillInfo) Returns the list association objects for the specified objectId, objectTypeId and fillInfo.getAssociations(List<Integer> associationIds) Returns the list association objects for the specified list of associationIds.getAssociations(List<Integer> associationIds, boolean fillInfo) Returns the list association objects for the specified list of associationIds and fillInfo.getAssociationsAs(String associationIds, boolean fillInfo, String outputFormat) Returns the list association objects for the specified list of associationIds and fillInfo.getAssociationsAs(String associationIds, String outputFormat) Returns the list association objects for the specified list of associationIds.getAssociationsByObjectTypeAs(int objectId, int objectTypeId, boolean fillInfo, String outputFormat) Returns the list association objects for the specified objectId, objectTypeId and fillInfo.getAssociationsByObjectTypeAs(int objectId, int objectTypeId, String outputFormat) Returns the list association objects for the specified objectId and objectTypeId.updateAssociation(Association association) Updates the association for the given association object.updateAssociationAs(String association, String outputFormat) Updates the association for the given association object.updateAssociations(List<Association> associations) Updates the associations for the given list of association objects.updateAssociationsAs(String associations, String outputFormat) Updates the associations for the given list of association objects.Methods inherited from class com.ads.api.util.BaseUtil
getAccessToken, getAccessTokenType, getTokenType, getUserDetails, permissionDeniedMessage, permissionDeniedStatus, setAccessToken, setAccessTokenType
-
Method Details
-
createAssociation
Creates the association for the given association object. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId are mandatory, while creating the association.
If association is created successfully, RequestStatus.isRequestSuccess() will return true otherwise false.- Parameters:
association- Association- Returns:
- RequestStatus object
- Since:
- 12.0
-
createAssociations
Creates the associations for the given list of association objects. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId in each association object are mandatory, while creating the associations.
If associations are created successfully, RequestStatus.isRequestSuccess() will return true otherwise false.- Parameters:
associations- List of Association- Returns:
- RequestStatus object
- Since:
- 12.0
-
updateAssociation
Updates the association for the given association object. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId are mandatory, to update the association.
If association is updated successfully, RequestStatus.isRequestSuccess() will return true otherwise false.- Parameters:
association- Association- Returns:
- RequestStatus object
- Since:
- 12.0
-
updateAssociations
Updates the associations for the given list of association objects. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId in each association object are mandatory, to update the associations.
If associations are updated successfully, RequestStatus.isRequestSuccess() will return true otherwise false.- Parameters:
associations- List of Association- Returns:
- RequestStatus object
- Throws:
Exception- Since:
- 12.0
-
deleteAssociation
Deletes the association with the specified associationId. Specifying the associationId is mandatory to delete a particular association.
If the association is deleted all its associated data will also be deleted.
If association is deleted successfully, RequestStatus.isRequestSuccess() will return true otherwise false.- Parameters:
associationId- int- Returns:
- RequestStatus object
- Since:
- 12.0
-
deleteAssociations
Deletes the associations with the specified list of associationIds. Specifying the associationIds list is mandatory.
If the associations are deleted all its associated data will also be deleted.
If the associations are deleted successfully, RequestStatus.isRequestSuccess() will return true otherwise false.- Parameters:
associationIds- List of associationIds- Returns:
- RequestStatus object
- Since:
- 12.0
-
deleteAssociations
Deletes the associations with the specified objectId and objectTypeId. Specifying the objectId and objectTypeId are mandatory.
If the associations are deleted all its associated data will also be deleted.
If the associations are deleted successfully, RequestStatus.isRequestSuccess() will return true otherwise false.- Parameters:
objectId- intobjectTypeId- int- Returns:
- RequestStatus object
- Since:
- 12.0
-
getAssociation
Returns the association object for the specified associationId. Specifying the associationId is mandatory.
It returns all the details like association name, description, auditHistory details etc..- Parameters:
associationId- int- Returns:
- Association object
- Throws:
Exception- Since:
- 12.0
-
getAssociations
Returns the list association objects for the specified list of associationIds. Specifying the list of associationIds is mandatory.
It returns all the details like association name, description, auditHistory details etc..- Parameters:
associationIds- List- Returns:
- List of Association objects
- Throws:
Exception- Since:
- 12.0
-
getAssociations
Returns the list association objects for the specified sourceObjectId and sourceObjectTypeId. Specifying the sourceObjectId and sourceObjectTypeId is mandatory.
It returns all the details like association name, description, auditHistory details etc..- Parameters:
objectId- intobjectTypeId- int- Returns:
- List of Association objects
- Throws:
Exception- Since:
- 12.0
-
createAssociationAs
Creates the association for the given association object. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId are mandatory, while creating the association.
Here relationshipType has values FORWARD, REVERSE and BOTH.
OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.- Parameters:
association- StringoutputFormat- String- Valid values: JSON or XML- Returns:
- String - If association is created successfully, it will return
requestStatus object consisting of request success flag, status message
and userObject etc... in the form of JSON or XML String.
Sample 'Association' JSON :
{
"id": 0,
"sourceObjectId": 0,
"sourceObjectTypeId": 0,
"targetObjectId": 0,
"targetObjectTypeId": 0,
"qualifierObjectId": 0,
"qualifierObjectTypeId": 0,
"fields": {},
"relationship":{
"id": "",
"masterId": "",
"titleForward": "",
"titleReverse": "",
"description":"",
"definedBy": "SYSTEM",
"relationshipType": "FORWARD"
}
} - Since:
- 12.0
-
createAssociationsAs
Creates the associations for the given list of association objects. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId in each association object are mandatory, while creating the associations.
Here relationshipType has values FORWARD, REVERSE and BOTH.
OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.- Parameters:
associations- StringoutputFormat- String- Valid values: JSON or XML- Returns:
- String - If associations are created successfully, it will return
requestStatus object consisting of request success flag, status message
and userObject etc... in the form of JSON or XML String.
Sample 'Associations' JSON :
[
{
"id": 0,
"sourceObjectId": 0,
"sourceObjectTypeId": 0,
"targetObjectId": 0,
"targetObjectTypeId": 0,
"qualifierObjectId": 0,
"qualifierObjectTypeId": 0,
"fields": {},
"relationship":{
"id": "",
"masterId": "",
"titleForward": "",
"titleReverse": "",
"description":"",
"definedBy": "SYSTEM",
"relationshipType": "FORWARD"
}
},
{
" id": 0,
"sourceObjectId": 0,
"sourceObjectTypeId": 0,
"targetObjectId": 0,
"targetObjectTypeId": 0,
"qualifierObjectId": 0,
"qualifierObjectTypeId": 0,
"fields": {},
"relationship":{
"id": "",
"masterId": "",
"titleForward": "",
"titleReverse": "",
"description":"",
"definedBy": "SYSTEM",
"relationshipType": "FORWARD"
}
}
] - Since:
- 12.0
-
updateAssociationAs
Updates the association for the given association object. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId are mandatory, to update the association.
Here relationshipType has values FORWARD, REVERSE and BOTH.
OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.- Parameters:
association- StringoutputFormat- String- Valid values: JSON or XML- Returns:
- String - If association is updated successfully, it will return
requestStatus object consisting of request success flag, status message
and userObject etc... in the form of JSON or XML String.
Sample 'Association' JSON :
{
"id": 0,
"sourceObjectId": 0,
"sourceObjectTypeId": 0,
"targetObjectId": 0,
"targetObjectTypeId": 0,
"qualifierObjectId": 0,
"qualifierObjectTypeId": 0,
"fields": {},
"relationship":{
"id": "",
"masterId": "",
"titleForward": "",
"titleReverse": "",
"description":"",
"definedBy": "SYSTEM",
"relationshipType": "FORWARD"
}
} - Since:
- 12.0
-
updateAssociationsAs
Updates the associations for the given list of association objects. Specifying the sourceObjectId, sourceObjectTypeId, targetObjectId, targetObjectTypeId in each association object are mandatory, to update the associations.
Here relationshipType has values FORWARD, REVERSE and BOTH.
OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.- Parameters:
associations- String - List of association objectsoutputFormat- String- Valid values: JSON or XML- Returns:
- String - If associations are updated successfully, it will return
requestStatus object consisting of request success flag, status message
and userObject etc... in the form of JSON or XML String.
Sample 'Associations' JSON :
[
{
"id": 0,
"sourceObjectId": 0,
"sourceObjectTypeId": 0,
"targetObjectId": 0,
"targetObjectTypeId": 0,
"qualifierObjectId": 0,
"qualifierObjectTypeId": 0,
"fields": {},
"relationship":{
"id": "",
"masterId": "",
"titleForward": "",
"titleReverse": "",
"description":"",
"definedBy": "SYSTEM",
"relationshipType": "FORWARD"
}
},
{
" id": 0,
"sourceObjectId": 0,
"sourceObjectTypeId": 0,
"targetObjectId": 0,
"targetObjectTypeId": 0,
"qualifierObjectId": 0,
"qualifierObjectTypeId": 0,
"fields": {},
"relationship":{
"id": "",
"masterId": "",
"titleForward": "",
"titleReverse": "",
"description":"",
"definedBy": "SYSTEM",
"relationshipType": "FORWARD"
}
}
] - Since:
- 12.0
-
deleteAssociationAs
Deletes the association with the specified associationId. Specifying the associationId is mandatory to delete a particular association.
If the association is deleted all its associated data will also be deleted.
OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.- Parameters:
associationId- intoutputFormat- String- Valid values: JSON or XML- Returns:
- String - If association is deleted successfully, it will return requestStatus object consisting of request success flag, status message and userObject etc... in the form of JSON or XML String.
- Since:
- 12.0
-
deleteAssociationsAs
Deletes the associations with the specified list of associationIds. Specifying the associationIds list is mandatory.
If the associations are deleted all its associated data will also be deleted.
OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.- Parameters:
associationIds- StringoutputFormat- String- Valid values: JSON or XML- Returns:
- String - If association is deleted successfully, it will return requestStatus object consisting of request success flag, status message and userObject etc... in the form of JSON or XML String.
- Since:
- 12.0
-
deleteAssociationsByObjectTypeAs
Deletes the associations with the specified objectId and objectTypeId. Specifying the objectId and objectTypeId are mandatory.
If the associations are deleted all its associated data will also be deleted.
OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.- Parameters:
objectId- intobjectTypeId- intoutputFormat- String- Valid values: JSON or XML- Returns:
- String - If associations are deleted successfully, it will return requestStatus object consisting of request success flag, status message and userObject etc... in the form of JSON or XML String.
- Since:
- 12.0
-
getAssociationAs
Returns the association object for the specified associationId. Specifying the associationId is mandatory.
It returns all the details like association name, description, auditHistory details etc..
OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.- Parameters:
associationId- intoutputFormat- String- Valid values: JSON or XML- Returns:
- String - Association object in the form of JSON or XML.
- Since:
- 12.0
-
getAssociationsAs
Returns the list association objects for the specified list of associationIds. Specifying the list of associationIds is mandatory.
It returns all the details like association name, description, auditHistory details etc..
OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.- Parameters:
associationIds- StringoutputFormat- String- Valid values: JSON or XML- Returns:
- String - List of Association objects in the form of JSON or XML.
- Since:
- 12.0
-
getAssociationsByObjectTypeAs
Returns the list association objects for the specified objectId and objectTypeId. Specifying the objectId and objectTypeId is mandatory.
It returns all the details like association name, description, auditHistory details etc..
OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.- Parameters:
objectId-objectTypeId-outputFormat- String- Valid values: JSON or XML- Returns:
- String - List of Association objects in the form of JSON or XML.
- Since:
- 12.0
-
getAssociation
Returns the association object for the specified associationId and fillInfo. Specifying the associationId is mandatory.
FillInfo takes the values has true or false. If fillInfo is true it returns the association object filled with source and target object details. If it is false it return only the association details.- Parameters:
associationId- intfillInfo- boolean- Returns:
- Association object in the form of JSON or XML.
- Throws:
Exception- Since:
- 12.1
-
getAssociations
public List<Association> getAssociations(List<Integer> associationIds, boolean fillInfo) throws Exception Returns the list association objects for the specified list of associationIds and fillInfo. Specifying the associationIds list is mandatory.
FillInfo takes the values has true or false. If fillInfo is true it returns the association object filled with source and target object details. If it is false it return only the association details.- Parameters:
associationIds- ListfillInfo- boolean- Returns:
- List of Association objects in the form of JSON or XML.
- Throws:
Exception- Since:
- 12.1
-
getAssociations
public List<Association> getAssociations(int objectId, int objectTypeId, boolean fillInfo) throws Exception Returns the list association objects for the specified objectId, objectTypeId and fillInfo. Specifying the objectId and objectTypeId is mandatory.
FillInfo takes the values has true or false. If fillInfo is true it returns the association object filled with source and target object details. If it is false it return only the association details.- Parameters:
objectId- intobjectTypeId- intfillInfo- boolean- Returns:
- String
- Throws:
Exception- Since:
- 12.1
-
getAssociationAs
Returns the association object for the specified associationId and fillInfo. Specifying the associationId is mandatory.
FillInfo takes the values has true or false. If fillInfo is true it returns the association object filled with source and target object details. If it is false it return only the association details.
OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.- Parameters:
associationId- intfillInfo- booleanoutputFormat- String- Valid values: JSON or XML- Returns:
- String
- Since:
- 12.1
-
getAssociationsAs
Returns the list association objects for the specified list of associationIds and fillInfo. Specifying the associationIds list is mandatory.
FillInfo takes the values has true or false. If fillInfo is true it returns the association object filled with source and target object details. If it is false it return only the association details.
OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.- Parameters:
associationIds- StringfillInfo- booleanoutputFormat- String- Valid values: JSON or XML- Returns:
- String
- Since:
- 12.1
-
getAssociationsByObjectTypeAs
public String getAssociationsByObjectTypeAs(int objectId, int objectTypeId, boolean fillInfo, String outputFormat) Returns the list association objects for the specified objectId, objectTypeId and fillInfo. Specifying the objectId and objectTypeId is mandatory.
FillInfo takes the values has true or false. If fillInfo is true it returns the association object filled with source and target object details. If it is false it return only the association details.
OutputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.- Parameters:
objectId- intobjectTypeId- intfillInfo- booleanoutputFormat- String- Valid values: JSON or XML- Returns:
- String
- Since:
- 12.1
-