14 Working with Object Store Utility
This chapter provides information about the Object Store Utility tool that you can use to upload the implementation assets details for the advanced policies from Design Studio workspace to Solution Designer automatically.
About Object Store Utility
- DOCUMENT_UPLOAD: This functionality uploads all the extended designer classes, helper classes, and third-party libraries within the specified Design Studio workspace to the defined S3-compatible object store.
- UPDATE_SCD_ENTITY: This functionality updates the relative paths of the extended designer classes, helper classes, and third-party libraries in S3-compatible object store to the Solution Designer.
Uploading Extended Designer Classes, Helper Classes, and Third-party Libraries
You can use Object Store Utility to upload extended designer classes, helper classes, and third-party libraries to S3-compatible object store that you designated while deploying Solution Designer. You can also use Object Store utility to update the relative path of the files in the object store to corresponding applications in Solution Designer.
Uploading from Design Studio Workspace to S3-Compatible Object Store
-
Locate object-store-utility.jar in the directory.
-
Locate the object_store_config.properties and implementation_assets_config.properties files.
-
Edit the object_store_config.properties file and the sample is as follows:
##object_store_config.properties # s3-compatible Object store's access key accessKey= #End point URL of s3-compatible object store awsEndpointUrl= #Object store's secret key secretKey= #Name of the bucket where Extended Designer classes, Helper classes and Third party libraries to be uploaded bucketName= #Name of the region in which the bucket is available region=
-
Edit the implementation_assets_config.properties file and the sample is as follows:
##implementation_assets_config.properties #Path to the Design studio workspace having designJ project with custom implementations designStudioWorkspace= DesignStudio_designJ_Path #Regular expression to identify all designJ projects in a given workspace, finds the projects whose name ends with _DesignJ projectsPattern=.*\_DesignJ$ #Regular expression to identify all the extended designer class files. In this example, all the matching file names ending with ExtendedDesigner.java in the src folder is selected. These files contain advanced policies custom code. extendedDesignerClassesPattern=.*ExtendedDesigner\\.java$ #Regular expression to identify all the helper files. This example selects the file names ending with .java and not ending with Designer.java in src folder. These files are additional supporting helper classes for writing advanced policies custom code. helperClassesPattern=^(?!.*Designer\\.java$).*\\.java$ #Regular expression to identify all the third-party libraries. This example selects all the files that ends with .jar in the lib folder of the project. These libraries are being used by advanced policy custom code. thirdPartyLibrariesPattern=.*\\.jar$
-
At the command prompt, run the following command:
java -jar object-store-utility.jar functionType objectStoreConfigFilePath implementationAssetsConfigFilePath documentType
Where
-
functionType
is the type of functionality. The valid values are DOCUMENT_UPLOAD and UPDATE_SCD_ENTITY. For uploading the files from Design Studio workspace to object store, use DOCUMENT_UPLOAD. -
objectStoreConfigFilePath
is the path of the object_store_config.properties file. -
implementationAssetsConfigFilePath
is the path of the implementation_assets_config.properties file. -
documentType
is the type of the document to upload to object store. The valid values are:-
EXTENDED_DESIGNER_CLASSES: Uploads all the designer classes identified from the expression specified in the
extendedDesignerClassesPattern
parameter in the implementation_assets_config.properties file. The designer classes exist in the DesignJ projects specified in thedesignStudioWorkspace
parameter in the implementation_assets_config.properties file. -
HELPER_CLASSES: Uploads all the helper classes in the
/src
directory based on the expression specified in thehelperClassesPattern
parameter in the implementation_assets_config.properties file. The helper classes exist in the DesignJ projects specified in thedesignStudioWorkspace
parameter in the implementation_assets_config.properties file. All the identified helper classes are packaged intoZIP
file and then uploaded to the object store. -
THIRD_PARTY_LIBRARIES: Uploads all the third-party libraries classes in the
/lib
directory based on the expression specified in thethirdPartyLibrariesPattern
parameter in the implementation_assets_config.properties file. The third-party libraries exist in the DesignJ projects specified in thedesignStudioWorkspace
parameter in the implementation_assets_config.properties file. -
ALL: Uploads all the extended designer classes, helper classes, and third-party libraries in all the DesignJ projects specified in the
designStudioWorkspace
parameter in the implementation_assets_config.properties file
-
When you run this command, all the files are uploaded to a folder named domainName (domain name that the entities are associated in Solution Designer UI) within the
bucketName
specified in the object_store_config.properties file. The extended designer classes are uploaded with an extension as.java
files, the helper classes are uploaded with an extension as.ZIP
files, and the third-party libraries are uploaded with an extension as.jar
files. -
-
After you run this command, ensure that the files are uploaded properly in the object store.
Updating Relative Paths of Object Store in Solution Designer
After you upload the files in S3-compatible object store, you can use object-store-utility.jar to update the relative paths of the advanced policy implementation assets information such as helper classes, third-party libraries, and extended designer classes into Solution Designer specifications and domain. When the DevOps engine builds the cartridges, it includes the extended designer classes, helper classes, and third-party libraries from the relative paths in Solution Designer.
-
Locate object-store-utility.jar in the directory.
-
Locate the object_store_config.properties and scd_config.properties files.
-
Edit the object_store_config.properties file and the sample is as follows:
##object_store_config.properties # s3-compatible Object store's access key accessKey= #End point URL of s3-compatible object store awsEndpointUrl= #Object store's secret key secretKey= #Name of the bucket in object store where Extended Designer classes, Helper classes and Third party libraries to be uploaded bucketName= #Name of the region in which the bucket is available region=
You need not edit the file if you have already updated the object store details for uploading the extended designer classes, helper classes, and third-party libraries into object store.
-
Edit the scd_config.properties file and the sample is as follows:
##scd_config.properties #SCD application client id registered with identity provider clientId= #SCD application client secret clientSecret= #Identity provider token access url tokenUrl= #application client scope to access apis scope=/lcm #The url to access service catalog and design application scdUrl= http://hostname:port #The initiative having domains and entities initiativeId= #scd application user name userName= #scd application user password password= #If scd environment is security enabled, all the above parameters are required. If not security enabled, only scdUrl and initiativeId are required. securityEnabled=yes #Set this to true, if the client uses CA signed certificate in ssl enabled environment for host verification. # Set this to false, if the client uses self signed certificate so the host verification is disabled. sslHostVerificationEnabled=
Where-
clientId
is the Solution Designer application's client ID that you have registered with your identity provider. -
clientSecret
is the Solution Designer application's client secret that you registered in your identity provider. -
tokenUrl
is the access token URL of the identity provider. -
scope
is the scope of Solution Designer and is defaulted to /lcm. The scope /lcm is for user access and any external API access such as TMF interface. See "About Authentication" in Solution Designer Installation Guide for more information. -
scdUrl
is the Solution Designer application's URL. -
initiativeId
is the initiative ID that you published in Solution Designer. You can copy the initiative ID from Solution Designer user interface. -
userName
is the user name of the Solution Designer application. -
password
is the password of the Solution Designer application. -
securityEnabled
indicates if Solution Designer environment is security enabled. The valid values are yes and no. If the Solution Designer environment is security enabled, you must populate all the parameters in scd_config.properties file. If the Solution Designer environment is not security enabled, only thescdUrl
andinitiativeId
parameters are necessary. -
sslHostVerificationEnabled
indicates if the host verification is enabled. Set this to true, if the client uses CA signed certificate in SSL enabled environment for host verification. Set this to false, if the client uses self signed certificate so the host verification is disabled
-
-
At the command prompt, run the following command:
java -jar object-store-utility.jar functionType objectStoreConfigFilePath scdConfigFilePath
Where
-
functionType
is the type of functionality. The valid values are DOCUMENT_UPLOAD and UPDATE_SCD_ENTITY. For updating Solution Designer with the relative paths in object store, use UPDATE_SCD_ENTITY. -
objectStoreConfigFilePath
is the path of the object_store_config.properties file. -
scdConfigFilePath
is the path of the scd_config.properties file.
-
-
When you run this command, you will receive a confirmation if each advanced policy within the initiative has been implemented in the extended designer class. You can select any of the three options:
-
y: The displayed advanced policy is implemented
-
n: The displayed advanced policy is not implemented
-
a: All the advanced policies are implemented
-
-
When you run this command, the relative paths of the helper classes and third-party libraries are updated in Asset type and Download link in the Implementation assets section in Domains. See "Creating Domains" for more information on adding implementation assets. Similarly, the relative path of the extended designer classes are updated in the Advanced policy implementation assets section in service specifications and resource specifications. See "Adding Advanced Policy Implementation Assets" for more information on adding advanced policy implementation assets to specifications. Ensure that the relative path are updated properly in the domains and the specifications.