Package com.ads.services.webservice.rest

# Class AssociationResource

java.lang.Object
com.ads.services.webservice.rest.AssociationResource

@RestController @RequestMapping("/api/miscellaneous") public class AssociationResource extends Object
Contains the methods which performs the operations like creation, update, deletion and retrieval of associations.
All the REST methods have return type ResponseEntity.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `jakarta.servlet.http.HttpServletRequest`
  `request`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AssociationResource()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `org.springframework.http.ResponseEntity`
  `createAssociations(List<Association> associations)`
  Creates the associations for the given list of association objects.
  `org.springframework.http.ResponseEntity`
  `deleteAssociations(Node.NodeType nodeType, String objectIds)`
  Deletes all the associations of an object for the specified nodeType and objectIds.
  `org.springframework.http.ResponseEntity`
  `deleteAssociations(String associationIds)`
  Deletes the associations with the specified list of associationIds.
  `org.springframework.http.ResponseEntity`
  `getAssociations(String associationIds, boolean fillInfo, int page, int per_page)`
  Returns the list association objects for the specified list of associationIds.
  `org.springframework.http.ResponseEntity`
  `getAssociationsByObjectType(Node.NodeType nodeType, String objectIds, boolean fillInfo, int page, int per_page)`
  Returns the list association objects for the specified nodeType and objectIds.
  `org.springframework.http.ResponseEntity`
  `updateAssociations(List<Association> associations)`
  This function is used to update the fields(Extended Properties) for the list of associations.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### request

    @Autowired public jakarta.servlet.http.HttpServletRequest request

- ## Constructor Details

  - ### AssociationResource

    public AssociationResource()

- ## Method Details

  - ### createAssociations

    @PostMapping(path="/associations", consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity createAssociations(@RequestBody List<Association> associations) throws Exception
    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.
    Parameters:
      `associations` - String
    Returns:
      Response
    Throws:
      `Exception` -

      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:
      14.0

  - ### updateAssociations

    @PutMapping(path="/associations", consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity updateAssociations(@RequestBody List<Association> associations) throws Exception
    This function is used to update the fields(Extended Properties) for the list of associations. Specifying the associationId in each association object is mandatory while updating the association.
    Parameters:
      `associations` - List
    Returns:
      Response
    Throws:
      `Exception` -

      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:
      14.0

  - ### deleteAssociations

    @DeleteMapping(path="/associations/ids", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity deleteAssociations(@RequestParam(name="associationIds") String associationIds) throws Exception
    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.
    Parameters:
      `associationIds` - String
    Returns:
      Response
    Throws:
      `Exception`
    Since:
      14.0

  - ### deleteAssociations

    @DeleteMapping(path="/associations", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity deleteAssociations(@RequestParam(name="nodeType") Node.NodeType nodeType, @RequestParam(name="objectIds") String objectIds) throws Exception
    Deletes all the associations of an object for the specified nodeType and objectIds. Specifying the nodeType and objectIds is mandatory.
    Parameters:
      `nodeType` - Node.NodeType
      `objectIds` - String
    Returns:
      Response
    Throws:
      `Exception`
    Since:
      14.0

  - ### getAssociations

    @GetMapping(path="/associations", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity getAssociations(@RequestParam(name="associationIds") String associationIds, @RequestParam(name="fillInfo",required=false) boolean fillInfo, @RequestParam(name="page",defaultValue="1") int page, @RequestParam(name="per_page",defaultValue="25") int per_page) throws Exception
    Returns the list association objects for the specified list of associationIds. Specifying the list of associationIds is mandatory.
    FillInfo takes the values as 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.
    It returns all the details like association name, description, auditHistory details etc..
    Note: Pagination is applied, and by default, 25 records are displayed per page.
    Parameters:
      `associationIds` - String
      `fillInfo` - boolean
      `page` - int
      `per_page` - int
    Returns:
      Response
    Throws:
      `Exception`
    Since:
      14.0

  - ### getAssociationsByObjectType

    @GetMapping(path="/associations/objectIds", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity getAssociationsByObjectType(@RequestParam(name="nodeType") Node.NodeType nodeType, @RequestParam(name="objectIds") String objectIds, @RequestParam(name="fillInfo",required=false) boolean fillInfo, @RequestParam(name="page",defaultValue="1") int page, @RequestParam(name="per_page",defaultValue="25") int per_page) throws Exception
    Returns the list association objects for the specified nodeType and objectIds. Specifying the nodeType and objectIds is mandatory.
    FillInfo takes the values as 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.
    It returns all the details like association name, description, auditHistory details etc..
    Note: Pagination is applied, and by default, 25 records are displayed per page.
    Parameters:
      `nodeType` - Node.NodeType
      `objectIds` - String
      `fillInfo` - boolean
      `page` - int
      `per_page` - int
    Returns:
      Response
    Throws:
      `Exception`
    Since:
      14.0