Examples of ItemNotFound


Examples of org.apache.ambari.view.pig.persistence.utils.ItemNotFound

   */
  public T read(String id) throws ItemNotFound {
    T object = null;
    object = getPigStorage().load(this.resourceClass, Integer.parseInt(id));
    if (!checkPermissions(object))
      throw new ItemNotFound();
    return object;
  }
View Full Code Here

Examples of org.apache.ambari.view.pig.persistence.utils.ItemNotFound

   * @throws ItemNotFound
   */
  public void delete(String resourceId) throws ItemNotFound {
    int id = Integer.parseInt(resourceId);
    if (!getPigStorage().exists(this.resourceClass, id)) {
      throw new ItemNotFound();
    }
    getPigStorage().delete(this.resourceClass, id);
  }
View Full Code Here

Examples of org.apache.ambari.view.pig.persistence.utils.ItemNotFound

  @Override
  public T update(T newObject, String id) throws ItemNotFound {
    T object = getPigStorage().load(this.resourceClass, Integer.parseInt(id));
    if (object.getOwner().compareTo(this.context.getUsername()) != 0) {
      throw new ItemNotFound();
    }

    newObject.setOwner(this.context.getUsername());
    return super.update(newObject, id);
  }
View Full Code Here

Examples of org.apache.ambari.view.pig.persistence.utils.ItemNotFound

    if (getConfig().containsKey(modelPropName)) {
      String json = read(modelPropName);
      LOG.debug(String.format("json: %s", json));
      return deserialize(model, json);
    } else {
      throw new ItemNotFound();
    }
  }
View Full Code Here

Examples of rocks.xmpp.core.stanza.model.errors.ItemNotFound

                                IQ result = iq.createResult();
                                result.setExtension(new InfoDiscovery(infoNode.getNode(), infoNode.getIdentities(), infoNode.getFeatures(), infoNode.getExtensions()));
                                xmppSession.send(result);
                                e.consume();
                            } else {
                                xmppSession.send(iq.createError(new StanzaError(new ItemNotFound())));
                                e.consume();
                            }
                        }
                    } else {
                        ItemDiscovery itemDiscovery = iq.getExtension(ItemDiscovery.class);
                        if (itemDiscovery != null) {
                            if (itemDiscovery.getNode() == null) {
                                IQ result = iq.createResult();
                                result.setExtension(new ItemDiscovery(items));
                                xmppSession.send(result);
                                e.consume();
                            } else {
                                ItemNode itemNode = itemNodeMap.get(itemDiscovery.getNode());
                                if (itemNode != null) {
                                    IQ result = iq.createResult();
                                    result.setExtension(new ItemDiscovery(itemNode.getNode(), items));
                                    xmppSession.send(result);
                                    e.consume();
                                } else {
                                    xmppSession.send(iq.createError(new StanzaError(new ItemNotFound())));
                                    e.consume();
                                }
                            }
                        }
                    }
View Full Code Here

Examples of rocks.xmpp.core.stanza.model.errors.ItemNotFound

                            if (!ibbSession.dataReceived(data)) {
                                // 2. Because the sequence number has already been used, the recipient returns an <unexpected-request/> error with a type of 'cancel'.
                                xmppSession.send(e.getMessage().createError(new StanzaError(StanzaError.Type.CANCEL, new UnexpectedRequest())));
                            }
                        } else {
                            xmppSession.send(e.getMessage().createError(new StanzaError(new ItemNotFound())));
                        }
                    }
                }
            }
        });
View Full Code Here

Examples of rocks.xmpp.core.stanza.model.errors.ItemNotFound

    private IbbSession getIbbSession(IQ iq, String sessionId) {
        // Check, if the session id is known.
        IbbSession ibbSession = ibbSessionMap.get(sessionId);
        if (ibbSession == null) {
            // 1. Because the session ID is unknown, the recipient returns an <item-not-found/> error with a type of 'cancel'.
            xmppSession.send(iq.createError(new StanzaError(new ItemNotFound())));
        }
        return ibbSession;
    }
View Full Code Here

Examples of rocks.xmpp.core.stanza.model.errors.ItemNotFound

                        if (cachedData != null) {
                            IQ result = iq.createResult();
                            result.setExtension(cachedData);
                            xmppSession.send(result);
                        } else {
                            xmppSession.send(iq.createError(new StanzaError(new ItemNotFound())));
                        }
                        e.consume();
                    }
                }
            }
View Full Code Here

Examples of rocks.xmpp.core.stanza.model.errors.ItemNotFound

            result.setExtension(Socks5ByteStream.streamHostUsed(s5bSession.getStreamHost()));
            xmppSession.send(result);
            return s5bSession;
        } catch (IOException e) {
            // If the Target tries but is unable to connect to any of the StreamHosts and it does not wish to attempt a connection from its side, it MUST return an <item-not-found/> error to the Requester.
            xmppSession.send(iq.createError(new StanzaError(new ItemNotFound())));
            throw e;
        }
    }
View Full Code Here

Examples of rocks.xmpp.core.stanza.model.errors.ItemNotFound

                            JingleSession jingleSession = jingleSessionMap.get(jingle.getSessionId());

                            if (jingleSession == null) {
                                // If we receive a non-session-initiate Jingle action with an unknown session id,
                                // return <item-not-found/> and <unknown-session/>
                                StanzaError stanzaError = new StanzaError(new ItemNotFound());
                                stanzaError.setExtension(new UnknownSession());
                                xmppSession.send(iq.createError(stanzaError));
                            } else {
                                jingleSession.notifyJingleListeners(new JingleEvent(JingleManager.this, xmppSession, iq, jingle));
                                xmppSession.send(iq.createResult());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.