当前位置: 首页>>代码示例>>Java>>正文


Java DuplicateSubscriptionException类代码示例

本文整理汇总了Java中org.fosstrak.ale.exception.DuplicateSubscriptionException的典型用法代码示例。如果您正苦于以下问题:Java DuplicateSubscriptionException类的具体用法?Java DuplicateSubscriptionException怎么用?Java DuplicateSubscriptionException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DuplicateSubscriptionException类属于org.fosstrak.ale.exception包,在下文中一共展示了DuplicateSubscriptionException类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: subscribe

import org.fosstrak.ale.exception.DuplicateSubscriptionException; //导入依赖的package包/类
@Override
public void subscribe(String specName, String notificationURI) throws NoSuchNameException, InvalidURIException, DuplicateSubscriptionException {

	throwNoSuchNameExceptionIfNoSuchSpec(specName);
	
	reportGeneratorsProvider.get(specName).subscribe(notificationURI);
	persistenceWriteAPI.writeECSpecSubscriber(specName, notificationURI);		
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:9,代码来源:ALEImpl.java

示例2: subscribe

import org.fosstrak.ale.exception.DuplicateSubscriptionException; //导入依赖的package包/类
/**
 * This method subscribes a notification uri of a subscriber to this 
 * report generator. 
 * @param notificationURI to subscribe
 * @throws DuplicateSubscriptionException if the specified notification uri 
 * is already subscribed
 * @throws InvalidURIException if the notification uri is invalid
 */
@Override
public void subscribe(String notificationURI) throws DuplicateSubscriptionException, InvalidURIException {
	
	Subscriber uri = new Subscriber(notificationURI);
	if (subscribers.containsKey(notificationURI)) {
		throw new DuplicateSubscriptionException(String.format("the URI is already subscribed on this specification %s, %s", name, uri));
	} else {
		subscribers.put(notificationURI, uri);
		LOG.debug("NotificationURI '" + notificationURI + "' subscribed to spec '" + name + "'.");
		if (isStateUnRequested()) {
			setState(ReportsGeneratorState.REQUESTED);
		}
	}
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:23,代码来源:ReportsGeneratorImpl.java

示例3: testSubscribeDuplicateSubscriptionException

import org.fosstrak.ale.exception.DuplicateSubscriptionException; //导入依赖的package包/类
/**
 * test duplicate subscription not allowed.
 */
@Test(expected = DuplicateSubscriptionException.class)
public void testSubscribeDuplicateSubscriptionException() throws Exception {
	ECSpec spec = ECElementsUtils.createECSpec();
	ECSpecValidator validator = EasyMock.createMock(ECSpecValidator.class);
	validator.validateSpec(spec);
	EasyMock.expectLastCall();
	EasyMock.replay(validator);
	ReportsGenerator generator = new NonRunnableReportsGenerator("theName", spec, validator);
	
	final String uri ="http://localhost:9999"; 
	generator.subscribe(uri);
	generator.subscribe(uri);
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:17,代码来源:ReportsGeneratorTest.java

示例4: subscribe

import org.fosstrak.ale.exception.DuplicateSubscriptionException; //导入依赖的package包/类
@Override
public void subscribe(String specName, String notificationURI) throws NoSuchNameException, InvalidURIException, DuplicateSubscriptionException {

	throwNoSuchNameExceptionIfNoSuchSpec(specName);
	
	reportGeneratorsProvider.get(specName).subscribe(notificationURI);
	//persistenceWriteAPI.writeECSpecSubscriber(specName, notificationURI);
	//TODO: wdyoon
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:10,代码来源:ALECCImpl.java

示例5: subscribe

import org.fosstrak.ale.exception.DuplicateSubscriptionException; //导入依赖的package包/类
@Override()
public void subscribe(String specName, String notificationURI) throws NoSuchNameException, InvalidURIException, DuplicateSubscriptionException, SecurityException {
	aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
	throwNoSuchNameExceptionIfNoSuchSpec(specName);
	
	reportGeneratorsProvider.get(specName).subscribe(notificationURI);
	persistenceWriteAPI.writeECSpecSubscriber(specName, notificationURI);		
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:9,代码来源:ALEImpl.java

示例6: subscribe

import org.fosstrak.ale.exception.DuplicateSubscriptionException; //导入依赖的package包/类
/**
 * With this method a notification uri can be subscribed to a defined ec specification.
 * 
 * @param specName of the ec specification
 * @param notificationURI to subscribe
 * @throws NoSuchNameException if there is no ec specification with the given name defined
 * @throws InvalidURIException if the specified notification uri is invalid
 * @throws DuplicateSubscriptionException if the same subscription is already done
 */
void subscribe(String specName, String notificationURI) throws NoSuchNameException, InvalidURIException, DuplicateSubscriptionException;
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:11,代码来源:ALE.java

示例7: subscribe

import org.fosstrak.ale.exception.DuplicateSubscriptionException; //导入依赖的package包/类
/**
 * This method subscribes a notification uri of a subscriber to this 
 * report generator. 
 * @param notificationURI to subscribe
 * @throws DuplicateSubscriptionException if the specified notification uri 
 * is already subscribed
 * @throws InvalidURIException if the notification uri is invalid
 */
void subscribe(String notificationURI) throws DuplicateSubscriptionException, InvalidURIException;
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:10,代码来源:ReportsGenerator.java

示例8: subscribe

import org.fosstrak.ale.exception.DuplicateSubscriptionException; //导入依赖的package包/类
/**
 * With this method a notification uri can be subscribed to a defined ec specification.
 * @throws NoSuchNameException  if there is no ec specification with the given name defined
 * @throws InvalidURIException  if the specified notification uri is invalid
 * @throws DuplicateSubscriptionException  if the same subscription is already done
 * @param specName  of the ec specification
 * @param notificationURI  to subscribe
 * @throws SecurityException 
 */
void subscribe(String specName, String notificationURI) throws NoSuchNameException, InvalidURIException, DuplicateSubscriptionException, SecurityException;
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:11,代码来源:ALE.java

示例9: subscribe

import org.fosstrak.ale.exception.DuplicateSubscriptionException; //导入依赖的package包/类
/**
 * With this method a notification uri can be subscribed to a defined cc specification.
 * 
 * @param specName of the cc specification
 * @param notificationURI to subscribe
 * @throws NoSuchNameException if there is no cc specification with the given name defined
 * @throws InvalidURIException if the specified notification uri is invalid
 * @throws DuplicateSubscriptionException if the same subscription is already done
 */
void subscribe(String specName, String notificationURI) throws NoSuchNameException, InvalidURIException, DuplicateSubscriptionException;
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:11,代码来源:ALECC.java


注:本文中的org.fosstrak.ale.exception.DuplicateSubscriptionException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。