Skip to main content

Home/ Groups/ Google AppEngine
3More

Key - 0 views

  • public final class Keyextends java.lang.Objectimplements java.io.Serializable, java.lang.Comparable<Key> The primary key for a datastore entity. A datastore GUID. A Key instance uniquely identifies an entity across all apps, and includes all information necessary to fetch the entity from the datastore with DatastoreService.get(Key). You can create Key objects directly by using KeyFactory.createKey(java.lang.String, long) or getChild(java.lang.String, long). You can also retrieve the Key automatically created when you create a new Entity, or serialize Key objects, or use KeyFactory to convert them to and from websafe String values.
  • equals public boolean equals(java.lang.Object object) Compares two Key objects by comparing ids, kinds, parent and appIdNamespace. If both keys are assigned names rather than ids, compares names instead of ids. If neither key has an id or a name, the keys are only equal if they reference the same object.
  • compareTo public int compareTo(Key other) Compares two Key objects. The algorithm proceeds as follows: Turn each Key into an iterator where the first element returned is the top-most ancestor, the next element is the child of the previous element, and so on. The last element will be the Key we started with. Once we have assembled these two iterators (one for 'this' and one for the Key we're comparing to), consume them in parallel, comparing the next element from each iterator. If at any point the comparison of these two elements yields a non-zero result, return that as the result of the overall comparison. If we exhaust the iterator built from 'this' before we exhaust the iterator built from the other Key, we return less than. An example: app1.type1.4.app1.type2.9 < app1.type1.4.app1.type2.9.app1.type3.2 If we exhaust the iterator built from the other Key before we exhaust the iterator built from 'this', we return greater than. An example: app1.type1.4.app1.type2.9.app1.type3.2 > app1.type1.4.app1.type2.9 The relationship between individual Key Keys is performed by comparing app followed by kind followed by id. If both keys are assigned names rather than ids, compares names instead of ids. If neither key has an id or a name we return an arbitrary but consistent result. Assuming all other components are equal, all ids are less than all names.
1More

Session Management on GAE - Google App Engine for Java | Google Groups - 0 views

  • you don't get sessionDestroyed. I believe there's a couple of issues with notification of a destroyed session and the most significant one would be that there's no guarantee that an instance of your application will even be running (1.4.0 will allow reserved instances but that isn't out yet.) Other issues would be that since this is a distributed environment which instance should receive sessionDestroyed. GAE would have to implement this one their backend. I believe sessions currently are just created by the Servlet Context of an instance when necessary and that instance's sessionCreated is the one that is executed. You however can query the _ah_SESSION table to see if a given session is still active or has expired.
1More

1.3.8 Console Logging Issue - Google App Engine for Java | Google Groups - 0 views

  • We're going to fix this for the App Engine 1.4.0 release. What we'll do is have messages at Log.INFO level be outputted when you've got your Launch Configuration's log level set to INFO. In the Google Plugin for Eclipse, we'll make a change such that any new launch configurations created have a default log level of WARN.
2More

DTO object - Google App Engine for Java | Google Groups - 0 views

  • From what I understand, you are "manually" copying the properties from the Entity to the DTO. But this process is automated in GWT 2.1 So, I am not sending my entities directly, but the proxies as per the documentation : http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html "An entity proxy is a client-side representation of an entity, otherwise known as a DTO (Data Transfer Object). With RequestFactory, entity proxies are interfaces that extend the EntityProxy interface, which is the hook used to indicate that an object can be managed by RequestFactory. RequestFactory automatically populates bean-style properties between entities on the server and the corresponding EntityProxy on the client, which simplifies using the DTO pattern. Furthermore, the EntityProxy interface enables RequestFactory to compute and send only changes ("deltas") to the server." "Entity proxies simply extend the EntityProxy interface and use the @ProxyFor annotation to reference the server-side entity being represented. It is not necessary to represent every property and method from the server-side entity in the EntityProxy, only getters and setters for properties that should be exposed to the client." The entity proxies are merely interfaces that are being populated by the new GWT 2.1 RequestFactory framework. I have no control over this copying process. Per definition, getters/setters of the real entity are injected into the EntityProxy whenever they are present; So my problem still stands : what about complex values like com.google.appengine.api.datastore.Email that are not known by the client side code ? How to transfer these complex values to the client.
  • When I copy my entities onto my dtos, some entity fields don't even make it into the dto. Others only have getters in the dto because they are read-only to the client. Those that do get into the dto get converted to native Java types. For instance, Text gets converted to String. Key gets encoded to a url friendly string. If I have Set fields on the entities to manager my relations (property lists), I remap those to ArrayList... First, don't serialize interfaces to GWT client, you'll get Javascript bloat. Then, Hashmap is costly to serialize because String.hashCode() is not the same on in Java and in Javascript. Hence, all the items need to be re-inserted into a client side map. Of course, in Web mode, performance is good enough... but in development mode, your data transfers will become really slow for somewhat big transfers.
1More

Class not found in Eclipse - Google App Engine for Java | Google Groups - 0 views

  • Unfortunately, GPE does not handle the case of dependent projects correctly. You can either manually jar up the classes from SimpleJavaProject, and drop that JAR into your war/WEB-INF/lib folder for the Web Application Project, or you can define the output folder for SimpleJavaProject to be equal to the output path for your Web Applicaton Project.
1More

Security and Authentication - in web.xml annoying error - Google App Engine for Java |... - 0 views

  • Add a <web-resource-name> element.  App Engine does not pay attention to it, but I believe it is technically required.
1More

FAQ - Google Plugin for Eclipse - Google Code - 0 views

  •  
    "How do I use the plugin with a GWT project built with Maven? Although GWT projects typically use the Ant build system, it is also possible to use GWT and the Google Plugin for Eclipse with projects built with Maven. We recommend using Eclipse for Java EE when developing Maven projects, because it allows you to modify your source code and resources during a debugging session and have the changes automatically reflected in your running application. To enable this behavior, you'll need to convert your Maven project to an Eclipse Dynamic Web Project: 1. Open the New Dynamic Web Project wizard. Set the Project name and any applicable options, then click Next. 2. On the Java page, remove the default source folder (src) and add your Maven source folders (e.g. src/main/java, src/main/resources, and src/test/java). Click Next. 3. On the Web Module page, set the Content directory to src/main/webapp and click Finish. 4. Import your project's source code and resources into the newly-generated project, and set up your build path. 5. Finally, follow the steps in the GWT + Eclipse for Java EE FAQ to enable GWT for the project and create a Web Application launch configuration."
1More

Goolge app engine + java + spring + REST + JSON + Flex - 0 views

  •  
    Once you are finished with this article, you will be able to implement REST services in Google Apps Engine using JAVA, Spring 3.0 and JSON. In the next part you will learn how to add flex application to consume the services.
1More

Google App Engine + JAVA + JDO = Simple Search | Wet Feet - Online Marketing and Techno... - 0 views

  •  
    This article will show you how to implement a simple search in Google App Engine using JDO engine including searching in child objects.
1More

[appengine-java] Re: Any examples for low level datastore? or suggest a - 0 views

  • I believe that Twig is the only library that can store objects with entire collections embedded as components. So the Columns could actually be stored in the same entity as the Table. This means that querying or reading Tables is _much_ faster. If the tables are read more than written this would be ideal. Docs are a bit light but basically you just define an embedded collection like this: class Table { @Key String name; @Component Collection<Column> columns; } and thats it! The columns are then stored as a multi-valued property so you can even query properties them like "show all tables with a column named 'age'".
1More

Using the Google Plugin for Eclipse - Google App Engine - Google Code - 0 views

  • The war/ directory uses the WAR standard layout for bundling web applications. (WAR archive files are not yet supported by the SDK.) The Eclipse plugin uses this directory for running the development server, and for deploying the app to App Engine. When Eclipse builds your project, it creates a directory named classes/ in war/WEB-INF/, and puts compiled class files here. Eclipse also copies non-source files found in src/ to war/WEB-INF/classes/, including META-INF/ and the log4j.properties and logging.properties files. The final contents of the war/ directory make up your application for testing and deployment. For details about the new project that the plugin creates, see the Getting Started Guide.
1More

Jeremy's Blog: JSTL on Google App Engine - 0 views

  • 01<%@ page contentType="text/html" pageEncoding="UTF-8" %>02<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>03 04<!DOCTYPE html>05<html>06 <head>07  <title>Maintenance</title>08 </head>09<body>10 <p>Hello from Spring ${user}</p>11 <p>AuthDomain = ${user.authDomain}</p>12 <p>Nickname = ${user.nickname}</p>13 <p>Email = ${user.email}</p>14 <p>UserId = ${user.userId}</p>15</body>16</html>
2More

Entity - 0 views

  • Entity is the fundamental unit of data storage. It has an immutable identifier (contained in the Key) object, a reference to an optional parent Entity, a kind (represented as an arbitrary string), and a set of zero or more typed properties.
  • setProperty public void setProperty(java.lang.String propertyName, java.lang.Object value) Sets the property named, propertyName, to value. As the value is stored in the datastore, it is converted to the datastore's native type. This may include widening, such as converting a Short to a Long. All Collections are prone to losing their sort order and their original types as they are stored in the datastore. For example, a TreeSet may be returned as a List from getProperty(java.lang.String), with an arbitrary re-ordering of elements. Overrides any existing value for this property, whether indexed or unindexed. Note that Blob and Text property values are never indexed by the built-in single property indexes. To store other types without being indexed, use #setUnindexedProperty. Parameters:value - may be one of the supported datatypes, a heterogenous Collection of one of the supported datatypes, or an UnindexedValue wrapping one of the supported datatypes. Throws: java.lang.IllegalArgumentException - If the value is not of a type that the data store supports.
1More

KeyRange - 0 views

  • public final class KeyRangeextends java.lang.Objectimplements java.lang.Iterable<Key>, java.io.Serializable Represents a range of unique datastore identifiers from getStart().getId() to getEnd().getId() inclusive. The Keys returned by an instance of this class have been consumed in the datastore's id-space and are guaranteed never to be reused. This class can be used to construct Entities with Keys that have specific id values without fear of the datastore creating new records with those same ids at a later date. This can be helpful as part of a data migration or large bulk upload where you may need to preserve existing ids and relationships between entities. This class is threadsafe but the Iterators returned by iterator() are not.
1More

Handling very large lists of objects without paging? - Stack Overflow - 0 views

  • I have a class which can contain many small elements in a list. Looks like: public class Farm {    private ArrayList<Horse> mHorses;} just wondering what will happen if the mHorses array grew to something crazy like 15,000 elements. I'm assuming that trying to write and read this from the datastore would be crazy, because I'd get killed on the serialization process. It's important that I can get the entire array in one shot without paging, and each Horse element may only have two string properties in it, so they are pretty lightweight: public class Horse {    private String mId;    private String mName;} I don't need these horses indexed at all. Does it sound reasonable to just store the mHorse array as a raw Text field, and force my clients to do the deserialization? Something like: public class Farm {    private Text mHorsesSerialized;} then whenever the client receives a Farm instance, it has to take the raw string of horses, and split it in order to reinstantiate the list, something like: // GWT client perhapsFarm farm = rpcCall.getMyFarm();String horsesSerialized = farm.getHorses();String[] horseBlocks = horsesSerialized.split(",");for (int i = 0; i < horseBlocks.length; i++) {    // .. continue deserializing the individual objects ...} yeah...
1More

Google App Engine Testing with Spring « objectuser.blog(brain) - 0 views

  • The GAE docs talk about how to setup a test to use the datastore.  But also follow the instructions here until the docs are fully updated.
2More

Creating, Getting and Deleting Data - Google App Engine - Google Code - 0 views

  • Tip: If the app creates a new object and gives it the same string ID as another object of the same kind (and the same entity group parent), saving the new object overwrites the other object in the datastore. To detect whether a string ID is already in use prior to creating a new object, you can use a transaction to attempt to get an entity with a given ID, then create one if it doesn't exist. See Transactions.
  • There are 4 types of primary key fields:
1More

Task Queue Python API Overview - Google App Engine - Google Code - 0 views

  • With the Task Queue API, applications can perform work outside of a user request but initiated by a user request. If an app needs to execute some background work, it may use the Task Queue API to organize that work into small, discrete units, called Tasks. The app then inserts these Tasks into one or more Queues. App Engine automatically detects new Tasks and executes them when system resources permit.
2More

Google App Engine Task Queue on GWT - Stack Overflow - 0 views

  • Yes, worker would be a servlet which can handle a request with POST parameters. If you want an asynchronous call from client's point of view then RPC is enough (from server's point of view it is still synchronous). If you want to do "delayed" jobs which don't talk to your client, you can use a task queue.
  • Instead of trying to create a thread (which is impossible in App Engine), this is a great way to asynchronously run tasks.
1More

Sharding counters - Google App Engine - Google Code - 0 views

  • you can only expect to update any single entity or entity group about five times a second. That is an estimate and the actual update rate for an entity is dependent on several attributes of the entity, including how many properties it has, how large it is, and how many indexes need updating. While a single entity or entity group has a limit on how quickly it can be updated, App Engine excels at handling many parallel requests distributed across distinct entities, and we can take advantage of this by using sharding.
« First ‹ Previous 81 - 100 Next › Last »
Showing 20 items per page