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