本文整理汇总了Java中org.fosstrak.ale.exception.NoSuchNameException类的典型用法代码示例。如果您正苦于以下问题:Java NoSuchNameException类的具体用法?Java NoSuchNameException怎么用?Java NoSuchNameException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NoSuchNameException类属于org.fosstrak.ale.exception包,在下文中一共展示了NoSuchNameException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: undefine
import org.fosstrak.ale.exception.NoSuchNameException; //导入依赖的package包/类
/**
* Delete the ROSpec defined on the logical reader, stop the thread and
* remove the persisted file.
* @param lrSpecName the name of the logical reader
*/
public void undefine(String lrSpecName) throws NoSuchNameException {
LOG.debug("Undefine ROSPEC for " + lrSpecName);
if (!lrROSpecMap.containsKey(lrSpecName)) {
throw new NoSuchNameException("this logical reader doesn't exist");
}
ROSpec roSpec = lrROSpecMap.get(lrSpecName);
if (roSpec != null) {
// stop the thread and remove it
LLRPChecking llrpCheck = lrLLRPCheckMap.get(lrSpecName);
llrpCheck.stop();
lrLLRPCheckMap.remove(lrSpecName);
// delete the defined ROSpec and remove it
DELETE_ROSPEC deleteRoSpec = new DELETE_ROSPEC();
deleteRoSpec.setROSpecID(roSpec.getROSpecID());
AdaptorMgmt.sendLLRPMessage(llrpCheck.getReaderName(), deleteRoSpec);
// remove the lrSpecName from the HashMap
lrROSpecMap.remove(lrSpecName);
//persistence
ALEApplicationContext.getBean(RemoveConfig.class).removeROSpec(lrSpecName);
}
LOG.debug("End Undefine ROSPEC for " + lrSpecName);
}
示例2: start
import org.fosstrak.ale.exception.NoSuchNameException; //导入依赖的package包/类
/**
* Starts the RoSpec defined on the logical reader
* @param lrSpecName the logical reader name
*/
public void start (String lrSpecName) throws NoSuchNameException {
LOG.debug("Start ROSPEC for " + lrSpecName);
if (!lrROSpecMap.containsKey(lrSpecName)) {
throw new NoSuchNameException("this logical reader doesn't exist");
}
ROSpec roSpec = lrROSpecMap.get(lrSpecName);
String readerName = lrPhysicalMap.get(lrSpecName);
if (roSpec != null && readerName != null) {
START_ROSPEC startROSpec = new START_ROSPEC();
startROSpec.setROSpecID(roSpec.getROSpecID());
AdaptorMgmt.sendLLRPMessage(readerName, startROSpec);
}
LOG.debug("End Start ROSPEC for " + lrSpecName);
}
示例3: stop
import org.fosstrak.ale.exception.NoSuchNameException; //导入依赖的package包/类
/**
* Stop the RoSpec defined on the logical reader
* @param lrSpecName the logical reader name
*/
public void stop(String lrSpecName) throws NoSuchNameException {
LOG.debug("Stop ROSPEC for " + lrSpecName);
if (!lrROSpecMap.containsKey(lrSpecName)) {
throw new NoSuchNameException("this logical reader doesn't exist");
}
ROSpec roSpec = lrROSpecMap.get(lrSpecName);
String readerName = lrPhysicalMap.get(lrSpecName);
if (roSpec != null && readerName != null) {
STOP_ROSPEC stopROSpec = new STOP_ROSPEC();
stopROSpec.setROSpecID(roSpec.getROSpecID());
AdaptorMgmt.sendLLRPMessage(readerName, stopROSpec);
}
LOG.debug("End Stop ROSPEC for " + lrSpecName);
}
示例4: enable
import org.fosstrak.ale.exception.NoSuchNameException; //导入依赖的package包/类
/**
* Enable the RoSpec defined on the logical reader
* @param lrSpecName the logical reader name
*/
public void enable(String lrSpecName) throws NoSuchNameException {
LOG.debug("Enable ROSPEC for " + lrSpecName);
if (!lrROSpecMap.containsKey(lrSpecName)) {
throw new NoSuchNameException("this logical reader doesn't exist");
}
ROSpec roSpec = lrROSpecMap.get(lrSpecName);
String readerName = lrPhysicalMap.get(lrSpecName);
if (roSpec != null && readerName != null) {
ENABLE_ROSPEC enableROSpec = new ENABLE_ROSPEC();
enableROSpec.setROSpecID(roSpec.getROSpecID());
AdaptorMgmt.sendLLRPMessage(readerName, enableROSpec);
}
LOG.debug("End Enable ROSPEC for " + lrSpecName);
}
示例5: disable
import org.fosstrak.ale.exception.NoSuchNameException; //导入依赖的package包/类
/**
* Disable the RoSpec defined on the logical reader
* @param lrSpecName the logical reader name
*/
public void disable(String lrSpecName) throws NoSuchNameException {
LOG.debug("Disable ROSPEC for " + lrSpecName);
if (!lrROSpecMap.containsKey(lrSpecName)) {
throw new NoSuchNameException("this logical reader doesn't exist");
}
ROSpec roSpec = lrROSpecMap.get(lrSpecName);
String readerName = lrPhysicalMap.get(lrSpecName);
if (roSpec != null && readerName != null) {
DISABLE_ROSPEC disableROSpec = new DISABLE_ROSPEC();
disableROSpec.setROSpecID(roSpec.getROSpecID());
AdaptorMgmt.sendLLRPMessage(readerName, disableROSpec);
}
LOG.debug("End Disable ROSPEC for " + lrSpecName);
}
示例6: defineAccessSpec
import org.fosstrak.ale.exception.NoSuchNameException; //导入依赖的package包/类
/**
* ORANGE: Add a new AccessSpec
* @param lrSpecName the logical reader name
* @param addAccessSpec the ADD_ACCESSSPEC
*/
public void defineAccessSpec (String lrSpecName, ADD_ACCESSSPEC addAccessSpec)
throws DuplicateNameException, NoSuchNameException {
if (addAccessSpec != null) {
LOG.debug("Define an ADD_ACCESSSPEC for " + lrSpecName);
// init the Connection and the LLRP context :
// not necessary because it has already be done by the ROSpec
AdaptorMgmt.initializeLLRPContext();
String readerName= retrievePhysicalReader(lrSpecName);
// add and enable the AccessSpec
AdaptorMgmt.sendLLRPMessage(readerName, addAccessSpec);
ENABLE_ACCESSSPEC enableAccessSpec = new ENABLE_ACCESSSPEC();
UnsignedInteger accessSpecId = addAccessSpec.getAccessSpec().getAccessSpecID();
enableAccessSpec.setAccessSpecID(accessSpecId);
AdaptorMgmt.sendLLRPMessage(readerName, enableAccessSpec);
// init the internal data
lrAccessSpecMap.put(lrSpecName, addAccessSpec.getAccessSpec());
// persistence
ALEApplicationContext.getBean(WriteConfig.class).writeAddAccessSpec(lrSpecName, addAccessSpec);
LOG.info("End define an ADD_ACCESSSPEC for " + lrSpecName);
} else {
LOG.error("ERROR !!!! ADD_ACCESSSPEC is null for " + lrSpecName);
}
}
示例7: setProperties
import org.fosstrak.ale.exception.NoSuchNameException; //导入依赖的package包/类
@Override
public void setProperties(String name, List<LRProperty> properties) throws NoSuchNameException, ValidationException, InUseException, ImmutableReaderException, SecurityException, ImplementationException {
throwValidationExceptionOnNullInput(properties);
LogicalReader logRd = logicalReaders.get(name);
throwNoSuchNameExceptionIfReaderNull(logRd, name);
LRSpec spec = logRd.getLRSpec();
if (spec.getProperties() == null) {
spec.setProperties(new LRSpec.Properties());
}
// we need to replace the properties, not just add to the old ones.
spec.getProperties().getProperty().clear();
spec.getProperties().getProperty().addAll(properties);
LOG.debug("set the properties");
try {
update(name, spec);
} catch (ReaderLoopException e) {
String errMsg = "ReaderLoopException during update.";
LOG.debug(errMsg, e);
throw new ImplementationException(errMsg, e);
}
}
示例8: addReaders
import org.fosstrak.ale.exception.NoSuchNameException; //导入依赖的package包/类
@Override
public void addReaders(String name, java.util.List<String> readers) throws NoSuchNameException, ValidationException, InUseException, ImmutableReaderException, ReaderLoopException, SecurityException, ImplementationException, NonCompositeReaderException {
LogicalReader logRd = logicalReaders.get(name);
throwNoSuchNameExceptionIfReaderNull(logRd, name);
throwNonCompositeReaderExceptionIfReaderNotComposite(logRd, name);
throwValidationExceptionIfNotAllReadersAvailable(readers);
LRSpec spec = logRd.getLRSpec();
if (spec.getReaders() == null) {
spec.setReaders(new LRSpec.Readers());
}
for (String reader : readers) {
if (!spec.getReaders().getReader().contains(reader)) {
spec.getReaders().getReader().add(reader);
}
}
update(name, spec);
}
示例9: poll
import org.fosstrak.ale.exception.NoSuchNameException; //导入依赖的package包/类
private ECReports poll(ReportsGenerator reportGenerator) throws NoSuchNameException {
ECReports reports = null;
reportGenerator.poll();
try {
synchronized (reportGenerator) {
reports = reportGenerator.getPollReports();
while (reports == null) {
reportGenerator.wait();
reports = reportGenerator.getPollReports();
}
}
} catch (InterruptedException e) {
LOG.debug("got interrupted.");
}
return reports;
}
示例10: setReaders
import org.fosstrak.ale.exception.NoSuchNameException; //导入依赖的package包/类
@Override
public void setReaders(String name, java.util.List<String> readers) throws NoSuchNameException, ValidationException, InUseException, ImmutableReaderException, NonCompositeReaderException, ReaderLoopException, SecurityException, ImplementationException {
aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
LogicalReader logRd = logicalReaders.get(name);
throwNoSuchNameExceptionIfReaderNull(logRd, name);
throwNonCompositeReaderExceptionIfReaderNotComposite(logRd, name);
throwValidationExceptionIfNotAllReadersAvailable(readers);
LRSpec spec = logRd.getLRSpec();
spec.setReaders(new LRSpec.Readers());
spec.getReaders().getReader().addAll(readers);
update(name, spec);
}
示例11: addReaders
import org.fosstrak.ale.exception.NoSuchNameException; //导入依赖的package包/类
@Override
public void addReaders(String name, java.util.List<String> readers) throws NoSuchNameException, ValidationException, InUseException, ImmutableReaderException, ReaderLoopException, SecurityException, ImplementationException, NonCompositeReaderException {
aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
LogicalReader logRd = logicalReaders.get(name);
throwNoSuchNameExceptionIfReaderNull(logRd, name);
throwNonCompositeReaderExceptionIfReaderNotComposite(logRd, name);
throwValidationExceptionIfNotAllReadersAvailable(readers);
LRSpec spec = logRd.getLRSpec();
if (spec.getReaders() == null) {
spec.setReaders(new LRSpec.Readers());
}
for (String reader : readers) {
if (!spec.getReaders().getReader().contains(reader)) {
spec.getReaders().getReader().add(reader);
}
}
update(name, spec);
}
示例12: poll
import org.fosstrak.ale.exception.NoSuchNameException; //导入依赖的package包/类
private CCReports poll(ReportsGenerator reportGenerator) throws NoSuchNameException {
CCReports reports = null;
reportGenerator.poll();
try {
synchronized (reportGenerator) {
reports = reportGenerator.getPollCCReports();
while (reports == null) {
reportGenerator.wait();
reports = reportGenerator.getPollCCReports();
}
}
} catch (InterruptedException e) {
LOG.debug("got interrupted.");
}
return reports;
}
示例13: getSubscribers
import org.fosstrak.ale.exception.NoSuchNameException; //导入依赖的package包/类
@Override
@WebResult(name = "GetSubscribersResult", targetNamespace = "urn:epcglobal:alecc:wsdl:1", partName = "getSubscribersReturn")
@WebMethod
public ArrayOfString getSubscribers(
@WebParam(partName = "parms", name = "GetSubscribers", targetNamespace = "urn:epcglobal:alecc:wsdl:1") GetSubscribers arg0)
throws SecurityExceptionResponse, NoSuchNameExceptionResponse,
ImplementationExceptionResponse {
log.debug("getSubscribers");
ArrayOfString aof = new ArrayOfString();
try {
for (String sub : alecc.getSubscribers(arg0.getSpecName())) {
aof.getString().add(sub);
}
} catch (NoSuchNameException e) {
throw new NoSuchNameExceptionResponse(e.getMessage(), e);
}
return aof;
}
示例14: define
import org.fosstrak.ale.exception.NoSuchNameException; //导入依赖的package包/类
/**
* Add a new RoSpec, enable it, launch the thread and persist the ADD_ROSPEC
* @param lrSpecName the logical reader name
* @param addRoSpec the ADD_ROSPEC object
*/
public void define(String lrSpecName, ADD_ROSPEC addRoSpec)
throws DuplicateNameException, NoSuchNameException {
if (addRoSpec != null) {
LOG.debug("Define an ADD_ROSPEC for " + lrSpecName);
// init the Connection and the LLRP context
AdaptorMgmt.initializeLLRPContext();
String readerName= retrievePhysicalReader (lrSpecName);
getLLRPConfiguration();
initClientConnection(readerName);
// add ROSpec
AdaptorMgmt.sendLLRPMessage(readerName, addRoSpec);
// enable the ROSpec
ENABLE_ROSPEC enableROSpec = new ENABLE_ROSPEC();
UnsignedInteger roSpecId = addRoSpec.getROSpec().getROSpecID();
enableROSpec.setROSpecID(roSpecId);
AdaptorMgmt.sendLLRPMessage(readerName, enableROSpec);
// init the internal data
lrROSpecMap.put(lrSpecName, addRoSpec.getROSpec());
physicalLRMap.put(readerName, lrSpecName);
//TODO: case of composite reader
lrPhysicalMap.put(lrSpecName, readerName);
//TODO: case of composite reader
lrLLRPCheckMap.put(lrSpecName, new LLRPChecking(readerName));
// persistence
ALEApplicationContext.getBean(WriteConfig.class).writeAddROSpec(lrSpecName, addRoSpec);
LOG.debug("End Define an ADD_ROSPEC for " + lrSpecName);
} else {
LOG.error("ERROR !!!! ADD_ROSPEC is null for " + lrSpecName);
}
}
示例15: disableAll
import org.fosstrak.ale.exception.NoSuchNameException; //导入依赖的package包/类
/**
* Disable all defined RoSpec.
*/
public void disableAll() {
LOG.debug("DisableAll ROSPEC on LLRP Readers");
for (String lrSpecName : lrROSpecMap.keySet()) {
try {
disable(lrSpecName);
} catch (NoSuchNameException e) {
LOG.error("try to stop lrSpec " + lrSpecName, e);
}
}
LOG.debug("End DisableAll ROSPEC on LLRP Readers");
}