Package com.skava.web

Class CustomPropertiesController

java.lang.Object
com.skava.web.CustomPropertiesController

@RestController @RequestMapping("/users") public class CustomPropertiesController extends Object
This controller class contains service end-point that are used to load one or many, update and delete custom properties of a user.
Author:
Infosys Equinox
  • Field Details

    • GET_ALL_CUST_PROP_SERVICE

      public static final String GET_ALL_CUST_PROP_SERVICE
      GET_ALL_CUST_PROP_SERVICE
      See Also:
  • Constructor Details

    • CustomPropertiesController

      public CustomPropertiesController()
      Default Constructor.
  • Method Details

    • getAllCustomPropertyService

      @GetMapping("/{userId}/properties") @Audit(action="getCustomProperties") public org.springframework.http.ResponseEntity<Map<String,String>> getAllCustomPropertyService(@PathVariable @AuditField(field="USER_ID") long userId, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @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)
      This service endpoint loads all available custom properties for the user
      Parameters:
      userId - Indicates the user identifier for which user the custom properties are loaded. Holds long value
      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 (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 - API Response and error messages will be responded in the locale mentioned in this parameter.
      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 of Map.
    • getCustomPropertyService

      @GetMapping("/{userId}/properties/{name}") @Audit(action="getCustomProperty") public org.springframework.http.ResponseEntity<Map<String,String>> getCustomPropertyService(@PathVariable @AuditField(field="USER_ID") long userId, @PathVariable @AuditField(field="PROPERTY_NAME") String name, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @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)
      This service endpoint is used to load the particular property of a user, particular property is based on the property name
      Parameters:
      userId - Indicates the user identifier for which user the custom properties needs to be loaded. Holds long value.
      name - Indicates the name of a property that needs to be loaded. Holds string value.
      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 (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 - API Response and error messages will be responded in the locale mentioned in this parameter.
      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 of Map.
    • updateCustomPropertyService

      @PatchMapping("/{userId}/properties") @Audit(action="updateCustomProperty") public org.springframework.http.ResponseEntity<Map<String,String>> updateCustomPropertyService(@PathVariable @AuditField(field="USER_ID") long userId, @RequestBody @AuditField(field="USER_PROPERTIES") UserPropertiesRequest propertiesRequest, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @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)
      This service endpoint is used to update custom properties of a user
      Parameters:
      userId - Indicates the user identifier for which user the custom properties needs to be updated. Holds long value.
      propertiesRequest - Holds UserPropertiesRequest Holds the custom properties for the user that needs to be updated.
      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 (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 - API Response and error messages will be responded in the locale mentioned in this parameter.
      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 of Map.
    • deleteSpecificpropertyByName

      @DeleteMapping("/{userId}/properties/{name}") @Audit(action="deleteCustomProperty") public org.springframework.http.ResponseEntity<Object> deleteSpecificpropertyByName(@PathVariable @AuditField(field="USER_ID") long userId, @PathVariable @AuditField(field="NAME") String name, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @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)
      This service endpoint is used to delete the given user property
      Parameters:
      userId - Indicates the user identifier for which user the custom properties needs to be deleted. Holds long value.
      name - Indicates the name of a custom property that need to be deleted. Holds string value.
      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 (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 - API Response and error messages will be responded in the locale mentioned in this parameter.
      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 of Map.