本文整理了Java中org.apache.abdera.factory.Factory.newService()
方法的一些代码示例,展示了Factory.newService()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Factory.newService()
方法的具体详情如下:
包路径:org.apache.abdera.factory.Factory
类名称:Factory
方法名:newService
[英]Create a new Service element.
[中]创建一个新的服务元素。
代码示例来源:origin: org.apache.abdera/abdera-core
/**
* Create a new Service instance. This is a convenience shortcut for <code>abdera.getFactory().newService()</code>
*
* @return A newly created service element
*/
public Service newService() {
return getFactory().newService();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera
/**
* Create a new Service instance. This is a convenience shortcut for
* <code>abdera.getFactory().newService()</code>
* @return A newly created service element
*/
public Service newService() {
return getFactory().newService();
}
代码示例来源:origin: org.xcmis/xcmis-restatom
private Response makeRepositoryInfoResponse(HttpServletRequest httpRequest, URI baseUri, String repositoryId)
{
Service service = AbderaFactory.getInstance().getFactory().newService();
service.declareNS(AtomCMIS.CMIS_NS_URI, AtomCMIS.CMIS_PREFIX);
service.declareNS(AtomCMIS.CMISRA_NS_URI, AtomCMIS.CMISRA_PREFIX);
addCmisRepository(httpRequest, service, repositoryId, baseUri);
Document<Service> serviceDocument = service.getDocument();
serviceDocument.setCharset("utf-8");
ResponseContext abderaResponse = new BaseResponseContext<Document<Service>>(serviceDocument);
abderaResponse.setStatus(200);
return Response.ok(abderaResponse).header(HttpHeaders.CACHE_CONTROL, "no-cache")
.type(MediaType.APPLICATION_ATOM_XML).build();
}
代码示例来源:origin: org.fuzzydb.atom/org.fuzzydb.abdera.util
private Document<Service> init_service_doc(Abdera abdera) {
Factory factory = abdera.getFactory();
Service service = factory.newService();
Workspace workspace = service.addWorkspace("Simple");
try {
Collection collection = workspace.addCollection("Simple", "atom/feed");
collection.setAccept("entry");
collection.addCategories().setFixed(false);
} catch (Exception e) {
e.printStackTrace();
} // FIXME: Document this exception
return service.getDocument();
}
代码示例来源:origin: org.xcmis/xcmis-restatom
Service service = AbderaFactory.getInstance().getFactory().newService();
service.declareNS(AtomCMIS.CMISRA_NS_URI, AtomCMIS.CMISRA_PREFIX);
Set<RepositoryShortInfo> shortInfos = CmisRegistry.getInstance().getStorageInfos();
代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-atom-runtime
Service service = abderaFactory.newService();
代码示例来源:origin: org.dataconservancy.deposit/dc-deposit-sword-server
public ResponseContext process(RequestContext requestContext,
WorkspaceManager workspaceManager,
CollectionAdapter collectionAdapter) {
Service serviceDoc =
requestContext.getAbdera().getFactory().newService();
serviceDoc.addExtension(SWORDExtensionFactory.VERSION).setText(sword
.getVersion());
serviceDoc.addExtension(SWORDExtensionFactory.NO_OP).setText(Boolean
.toString(sword.getNoOp()));
serviceDoc.addExtension(SWORDExtensionFactory.VERBOSE).setText(Boolean
.toString(sword.getVerbose()));
if (sword.getMaxUploadSize() > 0) {
serviceDoc.addExtension(SWORDExtensionFactory.MAX_UPLOAD_SIZE)
.setText(Integer.toString(sword.getMaxUploadSize()));
}
for (WorkspaceInfo wi : workspaceManager.getWorkspaces(requestContext)) {
serviceDoc.addWorkspace(wi.asWorkspaceElement(requestContext));
}
return ProviderHelper.returnBase(serviceDoc, 200, null);
}
内容来源于网络,如有侵权,请联系作者删除!