public LensMetadataClient(LensConnection connection) { this.connection = connection; this.params = connection.getLensConnectionParams(); objFact = new ObjectFactory(); }
public LensMetadataClient(LensConnection connection) { this.connection = connection; this.params = connection.getLensConnectionParams(); objFact = new ObjectFactory(); }
@SuppressWarnings("unchecked") public static <T> String convertObjectToXml(T object, Class<T> clazz, String functionName) throws SecurityException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { JAXBElement<T> root = null; StringWriter stringWriter = new StringWriter(); ObjectFactory methodObject = new ObjectFactory(); Method method = methodObject.getClass().getMethod(functionName, clazz); root = (JAXBElement<T>) method.invoke(methodObject, object); try { getMarshaller(clazz).marshal(root, stringWriter); } catch (JAXBException e) { log.error("Not able to marshall", e); } return stringWriter.toString(); }
public static XProperties xPropertiesFromMap(Map<String, String> map) { ObjectFactory xCF = new ObjectFactory(); if (map != null && !map.isEmpty()) { XProperties xp = xCF.createXProperties(); List<XProperty> xpList = xp.getProperty(); for (Map.Entry<String, String> e : map.entrySet()) { XProperty property = xCF.createXProperty(); property.setName(e.getKey()); property.setValue(e.getValue()); xpList.add(property); } return xp; } return null; }
@BeforeClass public void create() throws Exception { cubeObjectFactory = new ObjectFactory(); metastoreService = LensServices.get().getService(CubeMetastoreService.NAME); lensSessionId = metastoreService.openSession("foo", "bar", new HashMap<String, String>()); }
CubeMetastoreClient client = getClient(sessionHandle); ObjectFactory objectFactory = new ObjectFactory(); XFlattenedColumns flattenedColumns = objectFactory.createXFlattenedColumns(); List<XFlattenedColumn> columnList = flattenedColumns.getFlattenedColumn();