Esempio n. 1
0
 /**
  * Queries a given Discovery Service for all events concerning a given EPC code.
  *
  * @param EPC the EPC code
  * @param DSAddress the DS URL
  * @param serviceType the service type
  * @return a list of DS events
  * @throws RemoteException
  */
 public List<DSEvent> queryDS(String epc, String DSAddress, ONSEntryType serviceType)
     throws IoTaException {
   QueryDSRequest in = new QueryDSRequest();
   EPC tepc = new EPC();
   tepc.setValue(epc);
   in.setEpc(tepc);
   in.setIdentity(identity);
   in.setDSAddress(DSAddress);
   in.setServiceType(serviceType.name());
   QueryDSResponse out = port.queryDS(in);
   return out.getDsEventList();
 }
Esempio n. 2
0
 /**
  * Queries the ONS for all NAPTR entries related to the given EPC code.
  *
  * @param EPC the EPC code
  * @return a mapping of all entries by service type
  * @throws RemoteException
  */
 public Map<ONSEntryType, String> queryONS(String epc) throws IoTaException {
   QueryONSRequest in = new QueryONSRequest();
   EPC tepc = new EPC();
   tepc.setValue(epc);
   in.setEpc(tepc);
   QueryONSResponse out = port.queryONS(in);
   Map<ONSEntryType, String> res = new EnumMap<ONSEntryType, String>(ONSEntryType.class);
   for (OnsEntry entry : out.getOnsMap()) {
     ONSEntryType key = ONSEntryType.valueOf(entry.getKey());
     res.put(key, entry.getValue());
   }
   return res;
 }