Examples of DataStore


Examples of by.stub.database.DataStore

      final File dataYamlFile = new File(dataYamlFilename);
      final List<StubHttpLifecycle> httpLifecycles = new YamlParser().parse(FileUtils.constructReader(dataYamlFile));

      System.out.println();

      final DataStore dataStore = new DataStore(dataYamlFile, httpLifecycles);
      final JettyFactory jettyFactory = new JettyFactory(commandLineArgs, dataStore);
      final Server server = jettyFactory.construct();

      if (commandLineArgs.containsKey(CommandLineInterpreter.OPTION_WATCH)) {
         watchDataStore(dataStore);
View Full Code Here

Examples of cc.co.evenprime.bukkit.nocheat.data.DataStore

    public NoCheatPlayerImpl(Player player, NoCheat plugin) {

        this.player = player;
        this.plugin = plugin;
        this.data = new DataStore();
        this.history = new ExecutionHistory();

        this.lastUsedTime = System.currentTimeMillis();
    }
View Full Code Here

Examples of cirrus.hibernate.Datastore

        __logger.info( "Initializing" );

        try
        {
            Datastore ds = Hibernate.createDatastore(  );

            /* Classes */
            load( Account.class, ds );
            load( Category.class, ds );
            load( Customer.class, ds );
            load( Item.class, ds );
            load( Order.class, ds );
            load( OrderItem.class, ds );
            load( Product.class, ds );

            /* Hibernate properties */
            __logger.info( "...loading: hibernate.properties" );

            InputStream in = getClass(  ).getClassLoader(  ).getResourceAsStream( "hibernate.properties" );
            Properties  props = new Properties(  );
            props.load( in );

            /* Session Factory */
            __logger.info( "...initializing the Hibernate SessionFactory" );

            SessionFactory sessionFactory = ds.buildSessionFactory( props );
            config.getServletContext(  ).setAttribute( SESSION_FACTORY_KEY, sessionFactory );

            __logger.info( "Initialized" );
        }
        catch ( HibernateException h )
View Full Code Here

Examples of co.nubetech.crux.model.Datastore

public class TestConnectionView {
 
  @Test
  public void testConnectionView(){
   
    Datastore datastore = new Datastore();
    datastore.setId(121212);
    datastore.setName("Hbase");
   
    Connection connection = new Connection();
    ConnectionProperty connectionProperty1 = new ConnectionProperty(connection,
                                  CruxConstants.HBASE_ZOOKEEPER_PROPERTY,"value1");
   
View Full Code Here

Examples of com.alibaba.dubbo.common.store.DataStore

        String componentKey = Constants.EXECUTOR_SERVICE_COMPONENT_KEY;
        if (Constants.CONSUMER_SIDE.equalsIgnoreCase(url.getParameter(Constants.SIDE_KEY))) {
            componentKey = Constants.CONSUMER_SIDE;
        }
        DataStore dataStore = ExtensionLoader.getExtensionLoader(DataStore.class).getDefaultExtension();
        dataStore.put(componentKey, Integer.toString(url.getPort()), executor);
    }
View Full Code Here

Examples of com.cloudhopper.datastore.DataStore

    protected DataStore createDataStoreFromCurrentConfiguration() throws DataStoreFatalException {
        //
        // the DataStore has a nice method of verifying the directory exists
        // or creating it if it doesn't exist, let's try that first
        //
        DataStore ds = DataStoreManager.create(configuration.getDataStoreUrl());

        // replace datastore configuration with current config
        ds.setName(configuration.getName());
        ds.setDirectory(new File(configuration.getDirectory()));

        return ds;
    }
View Full Code Here

Examples of com.funambol.syncclient.sps.DataStore

                    else if (folder.getFullName().indexOf("Inbox") >= 0) {
                        strFolder = "I";
                    }
                }
               
                DataStore dataStore = DataStore.getDataStore(Configuration.mailSourceUri);
                dataStore.appendData(strFolder + ":" +
                                     new Integer(mailMessage.getMessageId()).toString(), Constants.DELETEDITEMS);
            } catch (Exception exp) {
                StaticDataHelper.log("[DELMAIL]Exception in SyncClient.messagesRemoved(:FolderEvent): " + exp.toString());
            } finally {
                setMailListener();       
View Full Code Here

Examples of com.github.jmkgreen.morphia.Datastore

                        mapr.getDatastoreProvider());
                ProxiedEntityReferenceList referencesAsProxy = (ProxiedEntityReferenceList) references;

                if (dbVal instanceof List) {
                    List<DBRef> refList = (List) dbVal;
                    Datastore dsi = mapr.getDatastoreProvider().get();
                    List<Key<Object>> keys = dsi.getKeysByRefs(refList);

                    if (keys.size() != refList.size()) {
                        String msg = "Some of the references could not be fetched for " + mf.getFullName() + ". "
                                + refList + " != " + keys;
                        if (!refAnn.ignoreMissing())
View Full Code Here

Examples of com.google.api.services.datastore.client.Datastore

      System.err.println("Usage: Adams <DATASET_ID>");
      System.exit(1);
    }
    // Set the dataset from the command line parameters.
    String datasetId = args[0];
    Datastore datastore = null;
    try {
      // Setup the connection to Google Cloud Datastore and infer credentials
      // from the environment.
      datastore = DatastoreFactory.get().create(DatastoreHelper.getOptionsfromEnv()
          .dataset(datasetId).build());
    } catch (GeneralSecurityException exception) {
      System.err.println("Security error connecting to the datastore: " + exception.getMessage());
      System.exit(1);
    } catch (IOException exception) {
      System.err.println("I/O error connecting to the datastore: " + exception.getMessage());
      System.exit(1);
    }

    try {
      // Create an RPC request to begin a new transaction.
      BeginTransactionRequest.Builder treq = BeginTransactionRequest.newBuilder();
      // Execute the RPC synchronously.
      BeginTransactionResponse tres = datastore.beginTransaction(treq.build());
      // Get the transaction handle from the response.
      ByteString tx = tres.getTransaction();

      // Create an RPC request to get entities by key.
      LookupRequest.Builder lreq = LookupRequest.newBuilder();
      // Set the entity key with only one `path_element`: no parent.
      Key.Builder key = Key.newBuilder().addPathElement(
          Key.PathElement.newBuilder()
          .setKind("Trivia")
          .setName("hgtg"));
      // Add one key to the lookup request.
      lreq.addKey(key);
      // Set the transaction, so we get a consistent snapshot of the
      // entity at the time the transaction started.
      lreq.getReadOptionsBuilder().setTransaction(tx);
      // Execute the RPC and get the response.
      LookupResponse lresp = datastore.lookup(lreq.build());
      // Create an RPC request to commit the transaction.
      CommitRequest.Builder creq = CommitRequest.newBuilder();
      // Set the transaction to commit.
      creq.setTransaction(tx);
      Entity entity;
      if (lresp.getFoundCount() > 0) {
        entity = lresp.getFound(0).getEntity();
      } else {
        // If no entity was found, create a new one.
        Entity.Builder entityBuilder = Entity.newBuilder();
        // Set the entity key.
        entityBuilder.setKey(key);
        // Add two entity properties:
        // - a utf-8 string: `question`
        entityBuilder.addProperty(Property.newBuilder()
            .setName("question")
            .setValue(Value.newBuilder().setStringValue("Meaning of Life?")));
        // - a 64bit integer: `answer`
        entityBuilder.addProperty(Property.newBuilder()
            .setName("answer")
            .setValue(Value.newBuilder().setIntegerValue(42)));
        // Build the entity.
        entity = entityBuilder.build();
        // Insert the entity in the commit request mutation.
        creq.getMutationBuilder().addInsert(entity);
      }
      // Execute the Commit RPC synchronously and ignore the response.
      // Apply the insert mutation if the entity was not found and close
      // the transaction.
      datastore.commit(creq.build());
      // Get `question` property value.
      String question = entity.getProperty(0).getValue().getStringValue();
      // Get `answer` property value.
      Long answer = entity.getProperty(1).getValue().getIntegerValue();
      System.out.println(question);
View Full Code Here

Examples of com.google.code.morphia.Datastore

    private final static ConcurrentMap<String, Datastore> dataStores_ = new ConcurrentHashMap<String, Datastore>();

    public static Datastore ds(String dbName) {
        if (StringUtil.isEmpty(dbName))
            return ds();
        Datastore ds = dataStores_.get(dbName);
        if (null == ds) {
            Datastore ds0 = morphia_.createDatastore(mongo_, dbName);
            ds = dataStores_.putIfAbsent(dbName, ds0);
            if (null == ds) {
                ds = ds0;
            }
        }
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.