Package com.skava.web
Class AttributeController
java.lang.Object
com.skava.web.AttributeController
The Class AttributeController-
The controller class has service end points to process Attribute entity.
The controller class has service end points to process Attribute entity.
- Since:
- June 2024
- Version:
- 8.18.4
- Author:
- Infosys Equinox
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Attribute>
createAttribute
(String locale, String version, long storeId, Long collectionId, String authToken, @Valid Attribute request) This method is used to create Attribute based on given request.org.springframework.http.ResponseEntity<AttributeAPIResponse>
deleteAttributeById
(String locale, String version, long storeId, Long collectionId, String authToken, String id) This method is used to delete single Attribute based on given Attribute Request.org.springframework.http.ResponseEntity<AttributesAPIResponse>
findAllAttribute
(String locale, String version, long storeId, Long collectionId, String authToken, int page, int size, String filter, String sort) This method is used to find all Attributes based on given Attribute request.org.springframework.http.ResponseEntity<Attribute>
getAttributeById
(String locale, String version, long storeId, Long collectionId, String authToken, String id) This method is used to load single Attribute based on given Request.org.springframework.http.ResponseEntity<Attribute>
updateAttributeById
(String locale, String version, long storeId, Long collectionId, String authToken, String id, @Valid Attribute request) This method is used to update single Attribute based on given Attribute Request.
-
Field Details
-
attributeResponse
-
-
Constructor Details
-
AttributeController
public AttributeController()
-
-
Method Details
-
createAttribute
@PostMapping("") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_CUSTOMER_ADMIN\', \'user\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_CSR_ADMIN\', \'user\', #collectionId) or hasPrivilegeForServiceAndCollection(\'user/create/attribute\', \'user\', #collectionId)") @ResponseStatus(CREATED) @Audit(action="CreateAttribute") public org.springframework.http.ResponseEntity<Attribute> createAttribute(@RequestParam(value="locale",required=false,defaultValue="en_US") @AuditField(field="LOCALE") String locale, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="VERSION") String version, @RequestHeader(value="x-store-id",required=false,defaultValue="0") @AuditField(field="STORE_ID") long storeId, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @RequestHeader(value="x-auth-token",required=false) @AuditField(field="AUTH_TOKEN") String authToken, @RequestBody @Valid @AuditField(field="Attribute") @Valid Attribute request) This method is used to create Attribute based on given request.- Parameters:
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.collectionId
- This field holds a valid collection identifier of this micro service and requested operation will be performed on this collection identifier. Collection is the top most entity of a micro service under which all the other entities resources reside. Each collection represents an instance of the micro service with configured properties and these properties can be modified to bring in a different behavior per collection of the same micro service. Store association is the process of associating a micro service collection to a store along with its respective sub entity. This way storefront can fetch store the required information from that respective association.authToken
- This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token represents claims containing roles and privileges of the user accessing this API. JSON Web Token is an open standard that defines a compact and self contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API it has to be generated before hand by invoking the auth sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in HTML and HTTP environments while being more compact when compared to XML based standards such as SAML. Thus generated token has to be passed to this service and the request will be processed only if the following conditions are met Token validation against the secret key Expiry time should be in the future Necessary privileges are available for the user to perform the action on the subjected resourcestoreId
- Refers to the unique id of the storeversion
- Refers to the versionrequest
- It contains the attributes required for the creation of Attribute.- Returns:
- It returns the link Attribute.
-
findAllAttribute
@GetMapping @ResponseStatus(OK) @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_CUSTOMER_ADMIN\', \'user\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_GUEST\', \'user\', #collectionId) or hasRoleForBusinessByCollectionId(\'ROLE_REG_USER\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_CSR_ADMIN\', \'user\', #collectionId) or hasPrivilegeForServiceAndCollection(\'user/viewall/attribute\', \'user\', #collectionId)") @Audit(action="findAllAttribute") public org.springframework.http.ResponseEntity<AttributesAPIResponse> findAllAttribute(@RequestParam(value="locale",required=false,defaultValue="en_US") @AuditField(field="LOCALE") String locale, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="VERSION") String version, @RequestHeader(value="x-store-id",required=false,defaultValue="0") @AuditField(field="STORE_ID") long storeId, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @RequestHeader(value="x-auth-token",required=false) @AuditField(field="AUTH_TOKEN") String authToken, @RequestParam(value="page",required=false,defaultValue="1") @AuditField(field="PAGE") int page, @RequestParam(value="size",required=false,defaultValue="10") @AuditField(field="SIZE") int size, @RequestParam(value="filter",required=false,defaultValue="") @AuditField(field="FILTER") String filter, @RequestParam(value="sort",required=false,defaultValue="id,ASC") @AuditField(field="SORT") String sort) This method is used to find all Attributes based on given Attribute request.- Parameters:
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities resources reside. Each collection represents an instance of the microservice with configured properties and these properties can be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub entity. This way storefront can fetch store the required information from that respective association.authToken
- This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token represents claims containing roles and privileges of the user accessing this API. JSON Web Token is an open standard that defines a compact and self contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API it has to be generated before hand by invoking the auth sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in HTML and HTTP environments while being more compact when compared to XML based standards such as SAML. Thus generated token has to be passed to this service and the request will be processed only if the following conditions are met Token validation against the secret key Expiry time should be in the future Necessary privileges are available for the user to perform the action on the subjected resourcestoreId
- Refers to the unique id of the storeversion
- Refers to the versionsort
- the sort.page
- the page.size
- the size.filter
- used to filter the result set.- Returns:
- It returns the link Attribute.
-
getAttributeById
@GetMapping("/{id}") @ResponseStatus(OK) @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_CUSTOMER_ADMIN\', \'user\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_CSR_ADMIN\', \'user\', #collectionId) or hasPrivilegeForServiceAndCollection(\'user/view/attribute\', \'user\', #collectionId)") @Audit(action="GetAttribute") public org.springframework.http.ResponseEntity<Attribute> getAttributeById(@RequestParam(value="locale",required=false,defaultValue="en_US") @AuditField(field="LOCALE") String locale, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="VERSION") String version, @RequestHeader(value="x-store-id",required=false,defaultValue="0") @AuditField(field="STORE_ID") long storeId, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @RequestHeader(value="x-auth-token",required=false) @AuditField(field="AUTH_TOKEN") String authToken, @PathVariable(value="id",required=true) @AuditField(field="ID") String id) This method is used to load single Attribute based on given Request.- Parameters:
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities resources reside. Each collection represents an instance of the microservice with configured properties and these properties can be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub entity. This way storefront can fetch store the required information from that respective association.authToken
- This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token represents claims containing roles and privileges of the user accessing this API. JSON Web Token is an open standard that defines a compact and self contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API it has to be generated before hand by invoking the auth sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in HTML and HTTP environments while being more compact when compared to XML based standards such as SAML. Thus generated token has to be passed to this service and the request will be processed only if the following conditions are met Token validation against the secret key Expiry time should be in the future Necessary privileges are available for the user to perform the action on the subjected resourcestoreId
- Refers to the unique id of the storeversion
- Refers to the versionid
- It refers to the unique identifier of the attribute which is to be retrieved. It is autogenerated when a attribute is created. A valid attribute should be present for the given id.- Returns:
- It returns the link Attribute.
-
updateAttributeById
@PatchMapping("/{id}") @ResponseStatus(OK) @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_CUSTOMER_ADMIN\', \'user\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_CSR_ADMIN\', \'user\', #collectionId) or hasPrivilegeForServiceAndCollection(\'user/update/attribute\', \'user\', #collectionId)") @Audit(action="UpdateAttribute") public org.springframework.http.ResponseEntity<Attribute> updateAttributeById(@RequestParam(value="locale",required=false,defaultValue="en_US") @AuditField(field="LOCALE") String locale, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="VERSION") String version, @RequestHeader(value="x-store-id",required=false,defaultValue="0") @AuditField(field="STORE_ID") long storeId, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @RequestHeader(value="x-auth-token",required=false) @AuditField(field="AUTH_TOKEN") String authToken, @PathVariable(value="id",required=true) @AuditField(field="ID") String id, @RequestBody(required=true) @Valid @AuditField(field="Attribute") @Valid Attribute request) This method is used to update single Attribute based on given Attribute Request.- Parameters:
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities resources reside. Each collection represents an instance of the microservice with configured properties and these properties can be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub entity. This way storefront can fetch store the required information from that respective association.authToken
- This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token represents claims containing roles and privileges of the user accessing this API. JSON Web Token is an open standard that defines a compact and self contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API it has to be generated before hand by invoking the auth sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in HTML and HTTP environments while being more compact when compared to XML based standards such as SAML. Thus generated token has to be passed to this service and the request will be processed only if the following conditions are met Token validation against the secret key Expiry time should be in the future Necessary privileges are available for the user to perform the action on the subjected resourcestoreId
- Refers to the unique id of the storeversion
- Refers to the versionid
- It refers to the unique identifier of the Attribute which is to be updated. It is auto generated when a attribute is created. A valid attribute should be present for the given id.request
- It refers to the attribute request object which consists of the details to be updated for a attribute which is already been created.- Returns:
- It returns the link Attribute.
-
deleteAttributeById
@DeleteMapping("/{id}") @ResponseStatus(NO_CONTENT) @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_CUSTOMER_ADMIN\', \'user\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_CSR_ADMIN\', \'user\', #collectionId) or hasPrivilegeForServiceAndCollection(\'user/delete/attribute\', \'user\', #collectionId)") @Audit(action="DeleteAttribute") public org.springframework.http.ResponseEntity<AttributeAPIResponse> deleteAttributeById(@RequestParam(value="locale",required=false,defaultValue="en_US") @AuditField(field="LOCALE") String locale, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="VERSION") String version, @RequestHeader(value="x-store-id",required=false,defaultValue="0") @AuditField(field="STORE_ID") long storeId, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @RequestHeader(value="x-auth-token",required=false) @AuditField(field="AUTH_TOKEN") String authToken, @PathVariable(value="id",required=true) @AuditField(field="ID") String id) This method is used to delete single Attribute based on given Attribute Request.- Parameters:
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities resources reside. Each collection represents an instance of the microservice with configured properties and these properties can be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub entity. This way storefront can fetch store the required information from that respective association.authToken
- This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token represents claims containing roles and privileges of the user accessing this API. JSON Web Token is an open standard that defines a compact and self contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API it has to be generated before hand by invoking the auth sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in HTML and HTTP environments while being more compact when compared to XML based standards such as SAML. Thus generated token has to be passed to this service and the request will be processed only if the following conditions are met Token validation against the secret key Expiry time should be in the future Necessary privileges are available for the user to perform the action on the subjected resourcestoreId
- Refers to the unique id of the storeversion
- Refers to the versionid
- It refers to the unique identifier of the attribute which is to be deactivated. It is auto generated when a attribute is created. A valid attribute should be present for the given id.- Returns:
- It returns the link Attribute.
-