當前位置: 首頁>>代碼示例>>Java>>正文


Java User類代碼示例

本文整理匯總了Java中org.jvalue.commons.auth.User的典型用法代碼示例。如果您正苦於以下問題:Java User類的具體用法?Java User怎麽用?Java User使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


User類屬於org.jvalue.commons.auth包,在下文中一共展示了User類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addAdapter

import org.jvalue.commons.auth.User; //導入依賴的package包/類
@PUT
@Path("/{adapterId}")
public EplAdapter addAdapter(
		@RestrictedTo(Role.ADMIN) User user,
		@PathParam("adapterId") String adapterId,
		@Valid EplAdapterDescription adapterDescription) {

	try {
		adapterManager.get(adapterId);
		throw RestUtils.createJsonFormattedException("adapter already exists", 409);
	} catch (DocumentNotFoundException dnfe) {
		// all good
	}

	EplAdapter adapter = new EplAdapter(adapterId, adapterDescription.getEplBlueprint(), adapterDescription.getRequiredArguments());
	adapterManager.add(adapter);
	return adapter;
}
 
開發者ID:jvalue,項目名稱:cep-service,代碼行數:19,代碼來源:EplAdapterApi.java

示例2: getAllClients

import org.jvalue.commons.auth.User; //導入依賴的package包/類
@GET
public List<Client> getAllClients(
		@RestrictedTo(Role.PUBLIC) User user,
		@PathParam("adapterId") String adapterId) {

	assertIsValidAdapterId(adapterId);
	List<Client> clients;
	if (user.getRole().equals(Role.ADMIN)) clients = notificationManager.getAll();
	else clients = notificationManager.getAll(user);

	// filter for adapter id
	Iterator<Client> iterator = clients.iterator();
	while (iterator.hasNext()) {
		if (!iterator.next().getEplAdapterId().equals(adapterId)) iterator.remove();
	}
	return clients;
}
 
開發者ID:jvalue,項目名稱:cep-service,代碼行數:18,代碼來源:RegistrationApi.java

示例3: addProcessorChain

import org.jvalue.commons.auth.User; //導入依賴的package包/類
@PUT
@Path("/{filterChainId}")
public ProcessorReferenceChain addProcessorChain(
		@RestrictedTo(Role.ADMIN) User user,
		@PathParam("sourceId") String sourceId,
		@PathParam("filterChainId") String filterChainId,
		@Valid ProcessorReferenceChainDescription processorChain) {

	if (processorChain.getExecutionInterval() != null) {
		assertIsValidTimeUnit(processorChain.getExecutionInterval().getUnit());
	}

	DataSource source = sourceManager.findBySourceId(sourceId);
	if (chainManager.contains(source, filterChainId))
		throw RestUtils.createJsonFormattedException("filter chain with id " + filterChainId + " already exists", 409);

	ProcessorReferenceChain chainReference = new ProcessorReferenceChain(
			filterChainId,
			processorChain.getProcessors(),
			processorChain.getExecutionInterval());

	if (processorChain.getExecutionInterval() != null) chainManager.add(source, sourceManager.getDataRepository(source), chainReference);
	else chainManager.executeOnce(source, sourceManager.getDataRepository(source), chainReference);
	return chainReference;
}
 
開發者ID:jvalue,項目名稱:open-data-service,代碼行數:26,代碼來源:ProcessorChainApi.java

示例4: addSource

import org.jvalue.commons.auth.User; //導入依賴的package包/類
@PUT
@Path("/{sourceId}")
public DataSource addSource(
		@RestrictedTo(Role.ADMIN) User user,
		@PathParam("sourceId") String sourceId,
		@Valid DataSourceDescription sourceDescription) {

	if (sourceManager.isValidSourceId(sourceId))
		throw RestUtils.createJsonFormattedException("source with id " + sourceId + " already exists", 409);

	DataSource source = new DataSource(
			sourceId,
			sourceDescription.getDomainIdKey(),
			sourceDescription.getSchema(),
			sourceDescription.getMetaData());
	sourceManager.add(source);
	return source;
}
 
開發者ID:jvalue,項目名稱:open-data-service,代碼行數:19,代碼來源:DataSourceApi.java

示例5: addPlugin

import org.jvalue.commons.auth.User; //導入依賴的package包/類
@PUT
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Path("/{pluginId}")
public PluginMetaData addPlugin(
		@RestrictedTo(Role.ADMIN) User user,
		@PathParam("sourceId") String sourceId,
		@PathParam("pluginId") String pluginId,
		@FormDataParam("file") InputStream fileInputStream,
		@FormDataParam("file") FormDataContentDisposition contentDisposition,
		@FormDataParam("file") FormDataBodyPart bodyPart) {

	DataSource source = sourceManager.findBySourceId(sourceId);
	if (pluginManager.contains(source, pluginId)) throw RestUtils.createJsonFormattedException("plugin with id " + pluginId + " already exists", 409);

	String contentType = bodyPart.getMediaType().toString();
	System.out.println("contentType = " + contentType);
	if (!contentType.equals(TYPE_X_JAVA_ARCHIVE) && !contentType.equals(TYPE_JAVA_ARCHIVE))
		throw RestUtils.createJsonFormattedException("content type must be " + TYPE_X_JAVA_ARCHIVE + " or " + TYPE_JAVA_ARCHIVE, 415);

	PluginMetaData metaData = new PluginMetaData(pluginId, "someDummyAuthorForNow");
	pluginManager.addFile(source, metaData, fileInputStream, contentType);
	return metaData;
}
 
開發者ID:jvalue,項目名稱:open-data-service,代碼行數:24,代碼來源:PluginApi.java

示例6: addView

import org.jvalue.commons.auth.User; //導入依賴的package包/類
@PUT
@Path("/{viewId}")
public DataView addView(
		@RestrictedTo(Role.ADMIN) User user,
		@PathParam("sourceId") String sourceId,
		@PathParam("viewId") String viewId,
		@Valid DataViewDescription viewDescription) {

	DataSource source = sourceManager.findBySourceId(sourceId);
	if (viewManager.contains(source, viewId))
		throw RestUtils.createJsonFormattedException("data view with id " + viewId + " already exists", 409);

	DataView view = new DataView(viewId, viewDescription.getMapFunction(), viewDescription.getReduceFunction());
	viewManager.add(source, sourceManager.getDataRepository(source), view);
	return view;
}
 
開發者ID:jvalue,項目名稱:open-data-service,代碼行數:17,代碼來源:DataViewApi.java

示例7: addSource

import org.jvalue.commons.auth.User; //導入依賴的package包/類
@PUT
@Path("/{sourceId}")
public OdsRegistration addSource(
		@RestrictedTo(Role.ADMIN) User user,
		@PathParam("sourceId") String sourceId) {

	try {
		// check that source is registered on ODS
		odsSourceApi.getSource(sourceId);
	} catch (RetrofitError re) {
		throw RestUtils.createJsonFormattedException("source not registered on ODS", 409);
	}
	if (dataManager.isBeingMonitored(sourceId)) throw RestUtils.createJsonFormattedException("already being monitored", 409);
	return dataManager.startMonitoring(sourceId);
}
 
開發者ID:jvalue,項目名稱:cep-service,代碼行數:16,代碼來源:SourcesApi.java

示例8: deleteSource

import org.jvalue.commons.auth.User; //導入依賴的package包/類
@DELETE
@Path("/{sourceId}")
public void deleteSource(
		@RestrictedTo(Role.ADMIN) User user,
		@PathParam("sourceId") String sourceId) {

	if (!dataManager.isBeingMonitored(sourceId)) throw RestUtils.createNotFoundException();
	dataManager.stopMonitoring(sourceId);
}
 
開發者ID:jvalue,項目名稱:cep-service,代碼行數:10,代碼來源:SourcesApi.java

示例9: deleteAdapter

import org.jvalue.commons.auth.User; //導入依賴的package包/類
@DELETE
@Path("/{adapterId}")
public void deleteAdapter(
		@RestrictedTo(Role.ADMIN) User user,
		@PathParam("adapterId") String adapterId) {

	EplAdapter adapter = adapterManager.get(adapterId);
	if (adapter == null) throw RestUtils.createNotFoundException();
	adapterManager.remove(adapter);
}
 
開發者ID:jvalue,項目名稱:cep-service,代碼行數:11,代碼來源:EplAdapterApi.java

示例10: unregisterClient

import org.jvalue.commons.auth.User; //導入依賴的package包/類
@DELETE
@Path("/{clientId}")
public void unregisterClient(
		@RestrictedTo(Role.PUBLIC) User user,
		@PathParam("adapterId") String adapterId,
		@PathParam("clientId") String clientId) {

	assertIsValidAdapterId(adapterId);

	if (!notificationManager.isRegistered(clientId)) throw RestUtils.createNotFoundException();
	Client client = notificationManager.get(clientId);
	if (!user.getRole().equals(Role.ADMIN) && !user.getId().equals(client.getUserId()))  throw RestUtils.createNotFoundException();
	notificationManager.unregister(clientId);
}
 
開發者ID:jvalue,項目名稱:cep-service,代碼行數:15,代碼來源:RegistrationApi.java

示例11: getClient

import org.jvalue.commons.auth.User; //導入依賴的package包/類
@GET
@Path("/{clientId}")
public Client getClient(
		@RestrictedTo(Role.PUBLIC) User user,
		@PathParam("adapterId") String adapterId,
		@PathParam("clientId") String clientId) {

	assertIsValidAdapterId(adapterId);
	Client client = notificationManager.get(clientId);
	if (!user.getRole().equals(Role.ADMIN) && !user.getId().equals(client.getUserId()))  throw RestUtils.createNotFoundException();
	return client;
}
 
開發者ID:jvalue,項目名稱:cep-service,代碼行數:13,代碼來源:RegistrationApi.java

示例12: registerClient

import org.jvalue.commons.auth.User; //導入依賴的package包/類
@PUT
@Path("/{clientId}")
public Client registerClient(
		@RestrictedTo(Role.ADMIN) User user,
		@PathParam("sourceId") String sourceId,
		@PathParam("clientId") String clientId,
		@Valid ClientDescription clientDescription) {

	DataSource source = sourceManager.findBySourceId(sourceId);
	if (notificationManager.contains(source, clientId)) throw RestUtils.createJsonFormattedException("client with id " + clientId + " already exists", 409);
	Client client = clientDescription.accept(clientAdapter, clientId);
	notificationManager.add(source, sourceManager.getDataRepository(source), client);
	return client;
}
 
開發者ID:jvalue,項目名稱:open-data-service,代碼行數:15,代碼來源:NotificationApi.java

示例13: unregisterClient

import org.jvalue.commons.auth.User; //導入依賴的package包/類
@DELETE
@Path("/{clientId}")
public void unregisterClient(
		@RestrictedTo(Role.ADMIN) User user,
		@PathParam("sourceId") String sourceId,
		@PathParam("clientId") String clientId) {

	DataSource source = sourceManager.findBySourceId(sourceId);
	Client client = notificationManager.get(source, clientId);
	notificationManager.remove(source, sourceManager.getDataRepository(source), client);
}
 
開發者ID:jvalue,項目名稱:open-data-service,代碼行數:12,代碼來源:NotificationApi.java

示例14: deleteProcessorChain

import org.jvalue.commons.auth.User; //導入依賴的package包/類
@DELETE
@Path("/{filterChainId}")
public void deleteProcessorChain(
		@RestrictedTo(Role.ADMIN) User user,
		@PathParam("sourceId") String sourceId,
		@PathParam("filterChainId") String filterChainId) {

	DataSource source = sourceManager.findBySourceId(sourceId);
	ProcessorReferenceChain reference = chainManager.get(source, filterChainId);
	chainManager.remove(source, sourceManager.getDataRepository(source), reference);
}
 
開發者ID:jvalue,項目名稱:open-data-service,代碼行數:12,代碼來源:ProcessorChainApi.java

示例15: deleteSource

import org.jvalue.commons.auth.User; //導入依賴的package包/類
@DELETE
@Path("/{sourceId}")
public void deleteSource(
		@RestrictedTo(Role.ADMIN) User user,
		@PathParam("sourceId") String sourceId) {

	sourceManager.remove(sourceManager.findBySourceId(sourceId));
}
 
開發者ID:jvalue,項目名稱:open-data-service,代碼行數:9,代碼來源:DataSourceApi.java


注:本文中的org.jvalue.commons.auth.User類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。