Package com.skava.accounts.web
Class PropertiesController
java.lang.Object
com.skava.accounts.web.PropertiesController
The Class PropertiesController-
The controller class has service end points to process properites entity.
The controller class has service end points to process properites entity.
- Author:
- Infosys Equinox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<PropertiesAPIResponse>
findAllProperties
(long collectionId, String authToken, String version, long storeId, long businessId, int page, int size, String sort) This method is used to update all field in Properties based on given Properties Request.org.springframework.http.ResponseEntity<Properties>
getPropertiesByName
(long collectionId, String authToken, String version, long storeId, long businessId, String name) This method is used to find all Properties based on given Properties Request.org.springframework.http.ResponseEntity<List<Properties>>
putUpdateProperties
(long collectionId, String authToken, String version, long storeId, long businessId, List<Properties> request) This method is used to update all field in Properties based on given Properties Request.org.springframework.http.ResponseEntity<Properties>
updateProperties
(long collectionId, String authToken, String version, long storeId, long businessId, String name, Properties request) This method is used to load single Properties based on given Properties Request.
-
Constructor Details
-
PropertiesController
public PropertiesController()
-
-
Method Details
-
getPropertiesByName
@GetMapping("/{collectionId}/properties/{name}") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_ADMIN\', \'account\', #collectionId) or hasPrivilegeForServiceAndCollection(\'account/view/collectionproperties\', #businessId, \'account\', #collectionId)") @ResponseStatus(OK) @Audit(action="FindPropertyByName") public org.springframework.http.ResponseEntity<Properties> getPropertiesByName(@PathVariable("collectionId") @AuditField(field="COLLECTIONID") long collectionId, @RequestHeader(value="x-auth-token",required=true) @AuditField(field="AUTHTOKEN") String authToken, @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="STOREID") long storeId, @RequestParam(value="businessId",required=false) @AuditField(field="BUSINESSID") long businessId, @PathVariable(value="name",required=true) @AuditField(field="NAME") String name) This method is used to find all Properties based on given Properties Request. 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
- Parameters:
storeId
- Refers to the unique id of the storeversion
- Refers to the versionbusinessId
- This field holds a valid business identifier. A Business is typically a customer who has signed up with Infosys Equinox to launch a commerce store or a digital experience. An Infosys Equinox Commerce Instance can have multiple Businesses under which there can be multiple stores - Logical entity which binds all the services together to bring in an storefront experience.name
- It refers to the name of the collection property using which the respective property will be retrieved. A valid collection property should exists for the given property name and it should be associated with the given collection id.collectionId
- It refers to the id of the collection.authToken
- It refers to the authToken of the respective user.- Returns:
- It returns the
PropertiesAPIResponse
.
-
findAllProperties
@GetMapping("/{collectionId}/properties") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_ADMIN\', \'account\', #collectionId) or hasPrivilegeForServiceAndCollection(\'account/viewall/collectionproperties\', #businessId, \'account\', #collectionId)") @ResponseStatus(OK) @Audit(action="FindAllProperties") public org.springframework.http.ResponseEntity<PropertiesAPIResponse> findAllProperties(@PathVariable("collectionId") @AuditField(field="COLLECTIONID") long collectionId, @RequestHeader(value="x-auth-token",required=true) @AuditField(field="AUTHTOKEN") String authToken, @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="STOREID") long storeId, @RequestParam(value="businessId",required=false) @AuditField(field="BUSINESSID") long businessId, @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="sort",required=false) @AuditField(field="SORT") String sort) This method is used to update all field in Properties based on given Properties Request.- Parameters:
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
storeId
- Refers to the unique id of the storeversion
- Refers to the versionbusinessId
- This field holds a valid business identifier. A Business is typically a customer who has signed up with Infosys Equinox to launch a commerce store or a digital experience. An Infosys Equinox Commerce Instance can have multiple Businesses under which there can be multiple stores - Logical entity which binds all the services together to bring in an storefront experience.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
storeId
- Refers to the unique id of the storeversion
- Refers to the versionbusinessId
- This field holds a valid business identifier. A Business is typically a customer who has signed up with Infosys Equinox to launch a commerce store or a digital experience. An Infosys Equinox Commerce Instance can have multiple Businesses under which there can be multiple stores - Logical entity which binds all the services together to bring in an storefront experience.page
- This parameter will be available for all the services that supports pagination. This parameter is used to mention the starting index of the items which going to responded by the API.size
- This parameter will be available for all the services that supports pagination. This parameter is used to mention the number of maximum items that needs to be responded for the request.sort
- the sort.- Returns:
- It returns the
PropertiesAPIResponse
.
-
updateProperties
@PatchMapping("/{collectionId}/properties/{name}") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_ADMIN\', \'account\', #collectionId) or hasPrivilegeForServiceAndCollection(\'account/update/collectionproperties\', #businessId, \'account\', #collectionId)") @ResponseStatus(OK) @Audit(action="UpdateProperties") public org.springframework.http.ResponseEntity<Properties> updateProperties(@PathVariable("collectionId") @AuditField(field="COLLECTIONID") long collectionId, @RequestHeader(value="x-auth-token",required=true) @AuditField(field="AUTHTOKEN") String authToken, @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="STOREID") long storeId, @RequestParam("businessId") @AuditField(field="BUSINESSID") long businessId, @PathVariable(value="name",required=true) @AuditField(field="PROPERTY_NAME") String name, @RequestBody(required=true) @AuditField(field="Properties") Properties request) This method is used to load single Properties based on given Properties Request.- Parameters:
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 details to be updated for a collection property which is already been created.version
- This field denotes the api version of the call.storeId
- This field denotes the id of the corresponding store.businessId
- This field denotes the id of the corresponding business.name
- This field refers to name of the collection property.request
- This field is used to define request of collection properties- Returns:
- It returns the
PropertiesAPIResponse
.
-
putUpdateProperties
@PutMapping("/{collectionId}/properties") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_ADMIN\', \'account\', #collectionId) or hasPrivilegeForServiceAndCollection(\'account/update/collectionproperties\', #businessId, \'account\', #collectionId)") @ResponseStatus(OK) @Audit(action="PutUpdateProperties") public org.springframework.http.ResponseEntity<List<Properties>> putUpdateProperties(@PathVariable("collectionId") @AuditField(field="COLLECTIONID") long collectionId, @RequestHeader(value="x-auth-token",required=true) @AuditField(field="AUTHTOKEN") String authToken, @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="STOREID") long storeId, @RequestParam("businessId") @AuditField(field="BUSINESSID") long businessId, @RequestBody(required=true) @AuditField(field="Properties") List<Properties> request) This method is used to update all field in Properties based on given Properties Request.- Parameters:
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
storeId
- Refers to the unique id of the storeversion
- Refers to the versionbusinessId
- This field holds a valid business identifier. A Business is typically a customer who has signed up with Infosys Equinox to launch a commerce store or a digital experience. An Infosys Equinox Commerce Instance can have multiple Businesses under which there can be multiple stores - Logical entity which binds all the services together to bring in an storefront experience.request
- It refers to the collection property request object which consists of the details to be updated for a collection property which is already been created. Here the previously existing properties for the f=given collection id will be deleted and then the given properties in this request will be created.- Returns:
- It returns the
PropertiesAPIResponse
.
-