Package com.skava.web
Class CollectionAttributeController
java.lang.Object
com.skava.web.CollectionAttributeController
@RestController
@RequestMapping("/collections")
public class CollectionAttributeController
extends Object
This controller class used to get all the available collection attributes from the system. List of operations
handled by this controller are All the available collection attributes retrieval from the system.
- Author:
- Infosys Equinox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<List<CollectionAttribute>>
getAllCollectionAttributes
(String authToken, String locale, String version, long storeId) getAllCollectionAttributes.
-
Constructor Details
-
CollectionAttributeController
public CollectionAttributeController()Default Constructor.
-
-
Method Details
-
getAllCollectionAttributes
@GetMapping("/properties") @Audit(action="getAttributes") @PreAuthorize("hasAnyRole() or hasPrivilege(\'user/view/collectionproperties\')") public org.springframework.http.ResponseEntity<List<CollectionAttribute>> getAllCollectionAttributes(@RequestHeader(value="x-auth-token",required=true) @AuditField(field="AUTH_TOKEN") String authToken, @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) getAllCollectionAttributes.
This service is used to retrieve all user's collection attributes available in the system.- Parameters:
authToken
- aString
object. This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token (JWT format) represents claims containing roles and privileges of the user accessing this API. JSON Web Token (JWT) is an open standard (RFC 7519) 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 resource
locale
- aString
object. API Response and error messages will be responded in the locale mentioned in this parameter. Locale needs to be mentioned in Java standard locale format.version
- It hold the value of version number of API. Using this parameter we can access the different version of the API. It is currently unused.storeId
- It Holds a valid unique identifier of the store.- Returns:
- The
ResponseEntity
ofList
ofCollectionAttribute
. Returns list of user's collection attributes.
-