本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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));
}