fidelius-service/src/main/java/org/finra/fidelius/services/CredentialsService.java
@PreAuthorize("@fideliusRoleService.isAuthorizedToDelete(#metadata.getApplication(), #metadata.getAccount())")
    public Metadata deleteMetadata(Metadata metadata) {
        setFideliusEnvironment(metadata.getAccount(), metadata.getRegion());
        String user = fideliusRoleService.getUserProfile().getUserId();

        try {
            if (metadata.getComponent() == null || metadata.getComponent().equals("null")) {
                metadata.setComponent(null);
            }
            fideliusService.deleteMetadata(metadata.getShortKey(), metadata.getApplication(),
                    metadata.getEnvironment(), metadata.getComponent(), tableName, user);
        } catch (Exception e) {
            this.logger.info("Metadata not deleted " + e.toString());
            return null;
        }

        return metadata;
    }
/**
     * Deletes an existing metadata.
     *
     * @param metadata metadata object
     * @return Credential deleted
     */
Deletes an existing metadata.
@param metadata metadata object
@return Credential deleted
Deletes an existing metadata . @param metadata metadata object @return Credential deleted
@PreAuthorize("@fideliusRoleService.isAuthorizedToDelete(#metadata.getApplication(), #metadata.getAccount())")
    public Metadata deleteMetadata(Metadata metadata) {
        setFideliusEnvironment(metadata.getAccount(), metadata.getRegion());
        String user = fideliusRoleService.getUserProfile().getUserId();
        try {
            if (metadata.getComponent() == null || metadata.getComponent().equals("null")) {
                metadata.setComponent(null);
            }
            fideliusService.deleteMetadata(metadata.getShortKey(), metadata.getApplication(),
                    metadata.getEnvironment(), metadata.getComponent(), tableName, user);
        } catch (Exception e) {
            this.logger.info("Metadata not deleted " + e.toString());
            return null;
        }
        return metadata;
    }
@ PreAuthorize ( "@fideliusRoleService.isAuthorizedToDelete(#metadata.getApplication(), #metadata.getAccount())" ) public Metadata deleteMetadata ( Metadata metadata ) { setFideliusEnvironment ( metadata . getAccount ( ) , metadata . getRegion ( ) ) ; String user = fideliusRoleService . getUserProfile ( ) . getUserId ( ) ; try { if ( metadata . getComponent ( ) == null || metadata . getComponent ( ) . equals ( "null" ) ) { metadata . setComponent ( null ) ; } fideliusService . deleteMetadata ( metadata . getShortKey ( ) , metadata . getApplication ( ) , metadata . getEnvironment ( ) , metadata . getComponent ( ) , tableName , user ) ; } catch ( Exception e ) { this . logger . info ( "Metadata not deleted " + e . toString ( ) ) ; return null ; } return metadata ; }
Deletes an existing metadata.
Deletes an existing metadata .