Comments (7)
indeed, so i can also use it via jms as a seporate dependency,
then they should implement a interface a TransferObject that extends Serializable ?
from jrs-rest-java-client.
also then you can create a typesafe client template to reduce boiler plate code (open/close sessions)
from jrs-rest-java-client.
Hi Mortias,
What do you mean by "typesafe client template"? Could you please explain me?
from jrs-rest-java-client.
never mind :)
what i try to do is templating, i wanted to make it typesafe but there is no sense to it..
i tweaked the RestClientConfiguration so i can drag my admin pwd everywhere
public class ClientTemplate {
public Session session = null;
private JasperserverRestClient client;
private JRRestClientConfiguration config;
public static final Log log = LogFactory.getLog(ClientTemplate.class);
public ClientTemplate() {
config = JRRestClientConfiguration.loadConfiguration("config/jasper.properties");
client = new JasperserverRestClient(config);
}
public Object process(StackTraceElement stackTraceElement, String requestId, ClientProcessor processor) {
Object result = null;
try {
session = client.authenticate(config.getAdminUserName(), config.getAdminUserPassword());
long startTime = System.nanoTime();
result = processor.process(session, requestId);
long endTime = System.nanoTime();
long duration = (endTime - startTime);
log.info(stackTraceElement.getMethodName() + ", " + duration / 1000000 + " ms");
} catch (Exception e) {
e.printStackTrace();
log.error(stackTraceElement.getClassName() + ", " + stackTraceElement.getMethodName() + ", error: " + e.getCause());
} finally {
if (session != null)
session.logout();
}
return result;
}
}
from jrs-rest-java-client.
@test
// The resources service, when resources() method used without specifying any repository URI,
// is used to search the repository. The various parameters let you refine the search and specify
// how you receive search results.
public void findResources() {
ClientResourceListWrapper result = (ClientResourceListWrapper) clientTemplate.process(
Thread.currentThread().getStackTrace()[1], "",
new ClientProcessor() {
@Override
public ClientResourceListWrapper process(Session session, String requestId) throws Exception {
BatchResourcesAdapter query = session.resourcesService().resources();
// query.parameter(ResourceSearchParameter.Q, "");
query.parameter(ResourceSearchParameter.RECURSIVE, "true");
query.parameter(ResourceSearchParameter.FOLDER_URI, "/dev/portal/ercmice/map_security");
query.parameter(ResourceSearchParameter.SHOW_HIDDEN_ITEMS, "true");
ClientResourceListWrapper resourceListWrapper = query.search().getEntity();
return resourceListWrapper != null ? resourceListWrapper : new ClientResourceListWrapper();
}
});
if (result.getResourceLookups() != null)
for (ClientResourceLookup lookup : result.getResourceLookups())
log.info(lookup.toString());
}
from jrs-rest-java-client.
Very interesting customization.
from jrs-rest-java-client.
Tx, the idea then of using dto's is in the context of a microservice architecture that has a reporting service. Where this rest client is embedded and triggered by a camel flow. Dto's define the contract to be used on the different interfaces like a jaxrs jaxws or jms the service provides. Maybe a feature request could also be to create a camel component!
from jrs-rest-java-client.
Related Issues (20)
- There is no JSESSIONID in the content of HTTP response after a bad request. HOT 2
- IllegalParameterValueException happens when there is a comma in the uri for Resources Service. HOT 1
- When getting data, in what situation will Bad Request occur ? HOT 1
- String index out of range: -14 HOT 1
- 400 Bad Request Create ClientSemanticLayerDataSource Domain HOT 1
- Unable to find contextual data of type: javax.ws.rs.ext.Providers at Autentication HOT 2
- Support for REST API dependsOn search parameter. HOT 1
- Build failure HOT 1
- TEXT Export for jrs-rest-java-client is not available HOT 1
- Support for this project? HOT 3
- Support to Jasper 7.1
- Support for jersey 2.27 HOT 2
- Read time out issue with JRS 7.1 server HOT 4
- Problem in exports object after reportExecution
- java.lang.NoClassDefFoundError: com/jaspersoft/jasperserver/jaxrs/client/providers/CustomRepresentationTypeProvider
- 生产自定义写的 jrxml ,出现bad request 问题
- Can't install maven dependency HOT 2
- still using log4j 1.2.17 HOT 1
- Missing Documentation For Uploading File Resources
- not compatible with spring boot 2.0.x and above
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jrs-rest-java-client.