@Test(expected = ServerException.class) public void testContentPropSaveInvalidRequest2() { contentStore.updateContentProperty("", "body", "test_content_body"); }
public void updateContentProperty(String contentId, String property, String value) { TelemetryManager.log( "UpdateContentProperty | Content: " + contentId + " | Property: " + property + " - Value: " + value); Session session = CassandraConnector.getSession(); String query = getUpdateQuery(property); if (StringUtils.isBlank(query)) throw new ClientException(ContentStoreParams.ERR_INVALID_PROPERTY_NAME.name(), "Invalid property name. Please specify a valid property name"); PreparedStatement ps = session.prepare(query); BoundStatement bound = ps.bind(value, contentId); try { session.execute(bound); Map<String, Object> map = new HashMap<String, Object>(); map.put(property, value); logTransactionEvent("UPDATE", contentId, map); } catch (Exception e) { TelemetryManager.error("Error! Executing update content property:" + e.getMessage(), e); throw new ServerException(ContentStoreParams.ERR_SERVER_ERROR.name(), "Error updating property in Content Store."); } }
ContentStore extends CassandraStore { public void updateContentProperty(String contentId, String property, String value) { TelemetryManager.log( "UpdateContentProperty | Content: " + contentId + " | Property: " + property + " - Value: " + value); Session session = CassandraConnector.getSession(); String query = getUpdateQuery(property); if (StringUtils.isBlank(query)) throw new ClientException(ContentStoreParams.ERR_INVALID_PROPERTY_NAME.name(), "Invalid property name. Please specify a valid property name"); PreparedStatement ps = session.prepare(query); BoundStatement bound = ps.bind(value, contentId); try { session.execute(bound); Map<String, Object> map = new HashMap<String, Object>(); map.put(property, value); logTransactionEvent("UPDATE", contentId, map); } catch (Exception e) { TelemetryManager.error("Error! Executing update content property:" + e.getMessage(), e); throw new ServerException(ContentStoreParams.ERR_SERVER_ERROR.name(), "Error updating property in Content Store."); } } }
ContentStore extends CassandraStore { public void updateContentProperty(String contentId, String property, String value) { TelemetryManager.log( "UpdateContentProperty | Content: " + contentId + " | Property: " + property + " - Value: " + value); Session session = CassandraConnector.getSession(); String query = getUpdateQuery(property); if (StringUtils.isBlank(query)) throw new ClientException(ContentStoreParams.ERR_INVALID_PROPERTY_NAME.name(), "Invalid property name. Please specify a valid property name"); PreparedStatement ps = session.prepare(query); BoundStatement bound = ps.bind(value, contentId); try { session.execute(bound); Map<String, Object> map = new HashMap<String, Object>(); map.put(property, value); logTransactionEvent("UPDATE", contentId, map); } catch (Exception e) { TelemetryManager.error("Error! Executing update content property:" + e.getMessage(), e); throw new ServerException(ContentStoreParams.ERR_SERVER_ERROR.name(), "Error updating property in Content Store."); } } ContentStore(); }
ContentStore extends CassandraStore { public void updateContentProperty(String contentId, String property, String value) { TelemetryManager.log( "UpdateContentProperty | Content: " + contentId + " | Property: " + property + " - Value: " + value); Session session = CassandraConnector.getSession(); String query = getUpdateQuery(property); if (StringUtils.isBlank(query)) throw new ClientException(ContentStoreParams.ERR_INVALID_PROPERTY_NAME.name(), "Invalid property name. Please specify a valid property name"); PreparedStatement ps = session.prepare(query); BoundStatement bound = ps.bind(value, contentId); try { session.execute(bound); Map<String, Object> map = new HashMap<String, Object>(); map.put(property, value); logTransactionEvent("UPDATE", contentId, map); } catch (Exception e) { TelemetryManager.error("Error! Executing update content property:" + e.getMessage(), e); throw new ServerException(ContentStoreParams.ERR_SERVER_ERROR.name(), "Error updating property in Content Store."); } } ContentStore(); void updateContentBody(String contentId, String body); void updateContentOldBody(String contentId, String body); String getContentBody(String contentId); String getContentProperty(String contentId, String property); Map<String, Object> getContentProperties(String contentId, List<String> properties); void updateContentProperty(String contentId, String property, String value); void updateContentProperties(String contentId, Map<String, Object> map); }
ContentStore extends CassandraStore { public void updateContentProperty(String contentId, String property, String value) { TelemetryManager.log( "UpdateContentProperty | Content: " + contentId + " | Property: " + property + " - Value: " + value); Session session = CassandraConnector.getSession(); String query = getUpdateQuery(property); if (StringUtils.isBlank(query)) throw new ClientException(ContentStoreParams.ERR_INVALID_PROPERTY_NAME.name(), "Invalid property name. Please specify a valid property name"); PreparedStatement ps = session.prepare(query); BoundStatement bound = ps.bind(value, contentId); try { session.execute(bound); Map<String, Object> map = new HashMap<String, Object>(); map.put(property, value); logTransactionEvent("UPDATE", contentId, map); } catch (Exception e) { TelemetryManager.error("Error! Executing update content property:" + e.getMessage(), e); throw new ServerException(ContentStoreParams.ERR_SERVER_ERROR.name(), "Error updating property in Content Store."); } } ContentStore(); void updateContentBody(String contentId, String body); void updateContentOldBody(String contentId, String body); String getContentBody(String contentId); String getContentProperty(String contentId, String property); Map<String, Object> getContentProperties(String contentId, List<String> properties); void updateContentProperty(String contentId, String property, String value); void updateContentProperties(String contentId, Map<String, Object> map);  }