Examples of findById()


Examples of com.twitterapime.rest.TweetER.findByID()

        UserAccountManager m = login();
        try {
            if (m.verifyCredential()) {
                TweetER ter = TweetER.getInstance(m);
                Tweet t1 = ter.findByID(t.getString(MetadataSet.TWEET_ID));
                t1 = ter.repost(t1);
                ret = true;
            } else {
                throw new Exception("Sin Credenciales");
            }
View Full Code Here

Examples of controllers.CRUD.ObjectType.findById()

  public static void save(String id) throws Exception {

    ObjectType type = ObjectType.get(getControllerClass());
    notFoundIfNull(type);
   
    Dashboard dash = (Dashboard) type.findById(id);

    if (params.allSimple().containsKey(c1)
        && !params.allSimple().get(c1).equals("-1")
        && dash.assignments != null) {
      Assignment[] assignments = new Assignment[dash.assignments.size()];
View Full Code Here

Examples of dao.ContactDao.findById()

                    c1.setFirstName("Jack");
                    c1.setLastName("Jones");
                    dao.persist(c1);

                    assertNotNull("saved contact id is null", c1.getId());
                    Contact c2 = dao.findById(c1.getId());
                    assertEquals("names are not equal", c2.getFirstName(), c1.getFirstName());
                    dao.remove(c2);
                    Contact c3 = dao.findById(c1.getId());
                    assertNull("removed contact is not null", c3);
                } catch (DataAccessException e) {
View Full Code Here

Examples of net.juniper.contrail.api.ApiConnector.findById()

            }
        }
        int count = 0;
        for (ObjectReference<T> childRef : childs) {
            @SuppressWarnings("unchecked")
            ApiObjectBase child = api.findById((Class<? extends ApiObjectBase>)childCls, childRef.getUuid());
            if (method != null) {
                method.invoke(this, child, syncLogMesg);
            } else {
                deleteDefault(child, childCls, syncLogMesg);
            }
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.ClusterDAO.findById()

    configEntity = clusterDAO.findConfig(configEntityPK);
    Assert.assertNotNull(configEntity);

    //Get updated cluster
    clusterEntity = clusterDAO.findById(1L);

    boolean failFlag = true;
    for (ClusterConfigMappingEntity ccme : clusterEntity.getConfigMappingEntities()) {
      if ("hdfs-log4j".equals(ccme.getType())) {
        failFlag = false;
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findById()

  private void removeWidget(HttpServletRequest request, Configuration properties, IWidgetAdminManager manager) {
    final String WIDGETFOLDER = getServletContext().getRealPath(properties.getString("widget.widgetfolder"));//$NON-NLS-1$
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
    String widgetId = request.getParameter("widgetId"); //$NON-NLS-1$
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidget widget = persistenceManager.findById(IWidget.class, widgetId);
    String guid = widget.getGuid();
    if(WidgetFactory.destroy(widget)){
      if(WidgetFileUtils.removeWidgetResources(WIDGETFOLDER, guid)){     
        request.setAttribute("message_value", localizedMessages.getString("WidgetAdminServlet.12"));       //$NON-NLS-1$ //$NON-NLS-2$
      }
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findById()

      HttpServletResponse response) throws ResourceNotFoundException,
      UnauthorizedAccessException, IOException {
    // attempt to get specific widget by id; note that this is the internal
    // widget integer ID and not the widget URI
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidget widget = persistenceManager.findById(IWidget.class, resourceId);
    if (widget == null) throw new ResourceNotFoundException();
    // redirect to the UDD
    if (widget.getUpdateLocation() ==  null) throw new ResourceNotFoundException();
    response.sendRedirect(widget.getUpdateLocation());
  }
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findById()

  protected void update(String resourceId, HttpServletRequest request)
      throws ResourceNotFoundException, InvalidParametersException,
      UnauthorizedAccessException {
      // attempt to get specific widget by id
      IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
      IWidget widget = persistenceManager.findById(IWidget.class, resourceId);
      if (widget == null) throw new ResourceNotFoundException();
      // FIXME localize error messages
      try {
        W3CWidgetFactory factory  = getFactory(request.getSession().getServletContext());
        installUpdate(factory, widget, false);
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findById()

   * @return
   */
  private static IWidgetService getWidgetService(String resourceId) throws ResourceNotFoundException{
    if (resourceId == null) throw new ResourceNotFoundException();
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetService ws = persistenceManager.findById(IWidgetService.class, resourceId);
    if (ws == null) {
      IWidgetService[] wsa = persistenceManager.findByValue(IWidgetService.class, "serviceName", resourceId);
      if (wsa != null && wsa.length == 1) ws = wsa[0];
    }
    if (ws == null) throw new ResourceNotFoundException();
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findById()

  @Override
  protected boolean remove(String resourceId, HttpServletRequest request)
      throws ResourceNotFoundException, UnauthorizedAccessException,
      InvalidParametersException {
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IApiKey apiKey = persistenceManager.findById(IApiKey.class, resourceId);
    if (apiKey == null) throw new ResourceNotFoundException();
    persistenceManager.delete(apiKey);
    _logger.info("API key deleted for "+apiKey.getEmail());
    return true;
  }
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.