public <T> T deserializeValue(Class<T> targetClass, Object value) throws JSONException { return typeConverter.convert(targetClass, value); } }
public SOLRDeserializer(NamespaceDAO namespaceDAO) { typeConverter = new SOLRTypeConverter(namespaceDAO); }
public GetTextContentResponse getTextContent(Long nodeId, QName propertyQName, Long modifiedSince) throws AuthenticationException, IOException { if(throwException) { throw new ConnectException("THROWING EXCEPTION, better be ready!"); } //Just put the nodeId innto the content so we query for this in tests. if(nodeContentMap.containsKey(nodeId)) { return new GetTextContentResponse(new DummyResponse(nodeContentMap.get(nodeId))); } return new GetTextContentResponse(new DummyResponse("Hello world "+nodeId)); }
NodeMetaData paramFiltered = new NodeMetaData(); paramFiltered.setId(nodeMetaData.getId()); if (params.isIncludeType()) paramFiltered.setType(nodeMetaData.getType()); if (params.isIncludeAclId()) paramFiltered.setAclId(nodeMetaData.getAclId()); if (params.isIncludeAspects()) paramFiltered.setAspects(nodeMetaData.getAspects()); if (params.isIncludeProperties()) paramFiltered.setProperties(nodeMetaData.getProperties()); if (params.isIncludeChildAssociations()) paramFiltered.setChildAssocs(nodeMetaData.getChildAssocs()); if (params.isIncludeParentAssociations()) paramFiltered.setParentAssocs(nodeMetaData.getParentAssocs()); paramFiltered.setParentAssocsCrc(nodeMetaData.getParentAssocsCrc()); if (params.isIncludeChildIds())
public boolean equals(Object other) { if(this == other) { return true; } if(!(other instanceof AlfrescoModelDiff)) { return false; } AlfrescoModelDiff diff = (AlfrescoModelDiff)other; return(diff.getModelName().equals(getModelName()) && diff.getType().equals(getType()) && diff.getOldChecksum().equals(getOldChecksum()) && diff.getNewChecksum().equals(getNewChecksum())); }
return new SOLRAPIQueueClient(namespaceDAO); alfrescoPortSSL = Integer.parseInt(props.getProperty("alfresco.port.ssl", "8443")); SOLRAPIClient client = getCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL); if (client == null) socketTimeout = Integer.parseInt(props.getProperty("alfresco.socketTimeout", "60000")); client = new SOLRAPIClient(getRepoClient(keyResourceLoader), dictionaryService, namespaceDAO); setCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL, client);
public int hashcode() { int result = 17; result = 31 * result + getModelName().hashCode(); result = 31 * result + getType().hashCode(); result = 31 * result + (int)(getOldChecksum().longValue() ^ (getOldChecksum().longValue() >>> 32)); return result; } }
ret = new StringPropertyValue((String)value); MultiPropertyValue multi = new MultiPropertyValue(); JSONArray array = (JSONArray)value; for(int j = 0; j < array.length(); j++) multi.addValue(getSinglePropertyValue(dataType, array.get(j))); ret = getSinglePropertyValue(dataType, value);
Locale locale = deserializer.deserializeValue(Locale.class, pair.getString("locale")); String mlValue = pair.has("value") && !pair.isNull("value") ? pair.getString("value") : null; mlValues.put(locale, mlValue); ret = new MLTextPropertyValue(mlValues); Locale locale = (o.has("locale") && !o.isNull("locale") ? deserializer.deserializeValue(Locale.class, localeStr) : null); ret = new ContentPropertyValue(locale, size, encoding, mimetype, id); ret = new StringPropertyValue((String)value);
public List<NodeMetaData> getNodesMetaData(NodeMetaDataParameters params, int maxResults) throws AuthenticationException, IOException, JSONException { if(throwException) { throw new ConnectException("THROWING EXCEPTION, better be ready!"); } List<NodeMetaData> resultNodeMetaDatas = new ArrayList(); List<Long> nodeIds = params.getNodeIds(); if(nodeIds != null) { for (long nodeId : nodeIds) { NodeMetaData fullNodeMetadata = nodeMetaDataMap.get(nodeId); NodeMetaData requestedMetadata = this.getOnlyRequestedMetadata(fullNodeMetadata, params); resultNodeMetaDatas.add(requestedMetadata); } } else { Long fromId = params.getFromNodeId(); NodeMetaData fullNodeMetadata = nodeMetaDataMap.get(fromId); NodeMetaData requestedMetadata = this.getOnlyRequestedMetadata(fullNodeMetadata, params); resultNodeMetaDatas.add(requestedMetadata); } return resultNodeMetaDatas; }
public class Account { protected int id; private String name; protected double balance; private double annualInterestRate; private java.util.Date dateCreated; ArrayList<Object> transaction = new ArrayList<Object>(); Transactions tr = new Transactions(); <---
public boolean equals(Object other) { if (this == other) { return true; } if(!(other instanceof AlfrescoModel)) { return false; } AlfrescoModel model = (AlfrescoModel)other; return (this.model.getName().equals(model.getModel().getName()) && checksum.equals(model.getChecksum())); }
/** * Gets the client resource from the pool. * * @param alfrescoHost String * @param alfrescoPort int * @param alfrescoPortSSL int * @return SOLRAPIClient */ private SOLRAPIClient getCachedClient(String alfrescoHost, int alfrescoPort, int alfrescoPortSSL) { String key = constructKey(alfrescoHost, alfrescoPort, alfrescoPortSSL); return clientsPerAlfresco.get(key); }
public SOLRAPIClient(AlfrescoHttpClient repositoryHttpClient, DictionaryService dictionaryService, NamespaceDAO namespaceDAO) { this.repositoryHttpClient = repositoryHttpClient; this.dictionaryService = dictionaryService; this.namespaceDAO = namespaceDAO; this.deserializer = new SOLRDeserializer(namespaceDAO); this.jsonFactory = new JsonFactory(); }
public Transactions getTransactions(Long fromCommitTime, Long minTxnId, Long toCommitTime, Long maxTxnId, int maxResults) throws AuthenticationException, IOException, JSONException { try { return getTransactions(fromCommitTime, minTxnId, toCommitTime, maxTxnId, maxResults, null); } catch (EncoderException e) { // Can not happen .... throw new IOException(e); } }
public static void close() { for(SOLRAPIClient client : clientsPerAlfresco.values()) { client.close(); } }
public Transactions getTransactions(Long fromCommitTime, Long minTxnId, Long toCommitTime, Long maxTxnId, int maxResults) throws AuthenticationException, IOException, JSONException { if(throwException) { throw new ConnectException("THROWING EXCEPTION, better be ready!"); } try { return getTransactions(fromCommitTime, minTxnId, toCommitTime, maxTxnId, maxResults, null); } catch(EncoderException e) { throw new IOException(e); } }
public List<Node> getNodes(GetNodesParameters parameters, int maxResults) throws AuthenticationException, IOException, JSONException { if(throwException) { throw new ConnectException("THROWING EXCEPTION, better be ready!"); } List<Long> txnIds = parameters.getTransactionIds(); List<Node> allNodes = new ArrayList(); for(long txnId : txnIds) { List<Node> nodes = nodeMap.get(txnId); allNodes.addAll(nodes); } return allNodes; }
public GetTextContentResponse(Response response) throws IOException { super(response); this.content = response.getContentAsStream(); this.transformStatusStr = response.getHeader("X-Alfresco-transformStatus"); this.transformException = response.getHeader("X-Alfresco-transformException"); String tmp = response.getHeader("X-Alfresco-transformDuration"); this.transformDuration = (tmp != null ? Long.valueOf(tmp) : null); setStatus(); }
/** * Sets the client in the resource pool. * * @param alfrescoHost String * @param alfrescoPort int * @param alfrescoPortSSL int * @param client SOLRAPIClient */ private void setCachedClient(String alfrescoHost, int alfrescoPort, int alfrescoPortSSL, SOLRAPIClient client) { String key = constructKey(alfrescoHost, alfrescoPort, alfrescoPortSSL); clientsPerAlfresco.put(key, client); }