Product/components used and version/fix level:
Cumulocity Production
Detailed explanation of the problem:
Hi, I have a class called CustomQueryParam which returns a instance of custom query filter. I have tried this with others and it works perfectly fine, so i was wondering if I can similarly use a custom query filter in this way.
package com.solenis.report.SolenisUserDeviceDailyReport.utils;
import com.cumulocity.sdk.client.Param;
import com.cumulocity.sdk.client.QueryParam;
public class CustomQueryParam extends QueryParam {
private static final Param QUERY_PARAM = new Param() {
@Override
public String getName() {
return "creationTime";
}
};
private static final CustomQueryParam INSTANCE = new CustomQueryParam();
public static CustomQueryParam getInstance() {
return INSTANCE;
}
private CustomQueryParam() {
super(QUERY_PARAM, "query=creationTime.date ge "+CustomUtil.getDateWithTime());
}
}
Now I am calling this in my inventory filter call like this:
InventoryFilter deviceFilter = new InventoryFilter().byFragmentType("c8y_IsDevice");
Iterable<ManagedObjectRepresentation> mObjColl = inventoryApi.getManagedObjectsByFilter(deviceFilter).get(2000, CustomQueryParam.getInstance()).allPages();
But i am getting this exception:
Caused by: com.cumulocity.sdk.client.SDKException: Illegal characters used in URL.
Can you please tell me how can I achieve this?
Best Regards,
Samanyu