Examples of ObjectStore


Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore

        // Attach the CallContext to a thread local context that can be accessed
        // from everywhere
        String user = context.getUsername();
        validator.createFolder(context, repositoryId, folderId, extension);

        ObjectStore fs = fStoreManager.getObjectStore(repositoryId);
        StoredObject so = null;
        Folder parent = null;

        // get required properties
        PropertyData<?> pd = properties.getProperties().get(PropertyIds.NAME);
        String folderName = (String) pd.getFirstValue();
        if (null == folderName || folderName.length() == 0) {
            throw new CmisInvalidArgumentException("Cannot create a folder without a name.");
        }

        // check name syntax
        if (!NameValidator.isValidId(folderName)) {
            throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_NAME);
        }

        TypeValidator.validateRequiredSystemProperties(properties);

        TypeDefinition typeDef = getTypeDefinition(repositoryId, properties);

        // check if the given type is a folder type
        if (!typeDef.getBaseTypeId().equals(BaseTypeId.CMIS_FOLDER)) {
            throw new CmisInvalidArgumentException("Cannot create a folder, with a non-folder type: " + typeDef.getId());
        }

        Map<String, PropertyData<?>> propMap = properties.getProperties();
        Map<String, PropertyData<?>> propMapNew = setDefaultProperties(typeDef, propMap);
        if (propMapNew != propMap) {
            properties = new PropertiesImpl(propMapNew.values());
        }

        TypeValidator.validateProperties(typeDef, properties, true);

        // validate ACL
        TypeValidator.validateAcl(typeDef, addACEs, removeACEs);
       
        // create folder
        try {
            LOG.debug("get folder for id: " + folderId);
            so = fs.getObjectById(folderId);
        } catch (Exception e) {
            throw new CmisObjectNotFoundException("Failed to retrieve folder.", e);
        }

        if (so instanceof Folder) {
            parent = (Folder) so;
        } else {
            throw new CmisInvalidArgumentException("Can't create folder, folderId does not refer to a folder: "
                    + folderId);
        }

        if (user == null) {
            user = "unknown";
        }

        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
        Folder newFolder = objStore.createFolder(folderName, properties.getProperties(), user, parent,
    addACEs,  removeACEs);
        LOG.debug("stop createFolder()");
        newFolder.persist();
        return newFolder;
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore

       // validate ACL
       TypeValidator.validateAcl(typeDef, addACEs, removeACEs);
    
       // validate the allowed types of the relationship
       ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);

       TypeDefinition sourceTypeDef = fStoreManager.getTypeById(repositoryId, objStore.getObjectById(sourceId).getTypeId()).getTypeDefinition();
       TypeDefinition targetTypeDef = fStoreManager.getTypeById(repositoryId, objStore.getObjectById(targetId).getTypeId()).getTypeDefinition();
       TypeValidator.validateAllowedRelationshipTypes(typeDef,  sourceTypeDef, targetTypeDef);
      
        StoredObject storedObject = objStore.createRelationship( relationObjects[0], relationObjects[1],
            propMap, user, addACEs,  removeACEs);
      return storedObject; 
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore

        if (null == objectId) {
            throw new CmisInvalidArgumentException("Object Id cannot be null.");
        }

        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);

        if (objStore == null) {
            throw new CmisObjectNotFoundException("Unknown repository id: " + repositoryId);
        }

        StoredObject so = objStore.getObjectById(objectId);

        if (so == null) {
            throw new CmisObjectNotFoundException("Unknown object id: " + objectId);
        }
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.ObjectStore

    cmdLineOptions.addOption(tablePropKey);
  }

  private void initObjectStore(HiveConf hiveConf) {
    if (!isObjStoreInitialized) {
      objStore = new ObjectStore();
      objStore.setConf(hiveConf);
      isObjStoreInitialized = true;
    }
  }
View Full Code Here

Examples of org.apache.isis.core.runtime.system.persistence.ObjectStore

    public DebugObjectStorePeer(final AliasRegistry aliasesRegistry, final CellBinding... cellBindings) {
        super(aliasesRegistry, cellBindings);
    }

    public String debugObjectStore() {
        final ObjectStore objectStore = getObjectStore();
        final DebugString debug = new DebugString();
        objectStore.debugData(debug);
        return debug.toString().replaceAll("\n", "<br>");
    }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.ObjectStore

    @Override
    protected PersistenceSession createPersistenceSession(final PersistenceSessionFactory persistenceSessionFactory, final AdapterManagerExtended adapterManager, final ObjectAdapterFactory adapterFactory, final ObjectFactory objectFactory, final OidGenerator oidGenerator,
            final ServicesInjector servicesInjector) {

        final PersistAlgorithm persistAlgorithm = createPersistAlgorithm(getConfiguration());
        ObjectStore objectStore = createObjectStore(getConfiguration(), adapterFactory, adapterManager);

        ensureThatArg(persistAlgorithm, is(not(nullValue())));
        ensureThatArg(objectStore, is(not(nullValue())));

        if (getConfiguration().getBoolean(LOGGING_PROPERTY, false)) {
View Full Code Here

Examples of org.drools.common.ObjectStore

        return thing;
    }

    private <K> InternalFactHandle lookupHandleForWrapper( K core ) {
        for ( WorkingMemoryEntryPoint ep : workingMemory.getEntryPoints().values() ) {
            ObjectStore store = ((InternalWorkingMemoryEntryPoint) ep).getObjectStore();
            Iterator iter = store.iterateFactHandles();
            while ( iter.hasNext() ) {
                InternalFactHandle handle = (InternalFactHandle) iter.next();
                if ( handle.isTraitable() && handle.getObject() instanceof CoreWrapper && ( (CoreWrapper) handle.getObject() ).getCore() == core ) {
                    return handle;
                }
View Full Code Here

Examples of org.drools.core.common.ObjectStore

        return thing;
    }

    private <K> InternalFactHandle lookupHandleForWrapper( K core ) {
        for ( EntryPoint ep : workingMemory.getEntryPoints().values() ) {
            ObjectStore store = ((InternalWorkingMemoryEntryPoint) ep).getObjectStore();
            Iterator iter = store.iterateFactHandles();
            while ( iter.hasNext() ) {
                InternalFactHandle handle = (InternalFactHandle) iter.next();
                if ( handle.isTraitable() && handle.getObject() instanceof CoreWrapper && ( (CoreWrapper) handle.getObject() ).getCore() == core ) {
                    return handle;
                }
View Full Code Here

Examples of org.jboss.arquillian.core.spi.context.ObjectStore

   {
      executeInApplicationContext(new Callable<Void>() {
         @Override
         public Void call() throws Exception {
            ApplicationContext appContext = getContext(ApplicationContext.class);
            ObjectStore store = appContext.getObjectStore();

            for(Context context : contexts)
            {
               store.add((Class<Context>)context.getClass().getInterfaces()[0], context);
            }
            return null;
         }
      });
   }
View Full Code Here

Examples of org.jboss.arquillian.impl.core.ObjectStore

         Assert.assertFalse(context.isActive());
        
         context.activate();
         Assert.assertTrue(context.isActive());
        
         ObjectStore store = context.getObjectStore();
         store.add(Boolean.class, true);
        
         Assert.assertEquals(
               "Verify that we can get objects from a active context",
               new Boolean(true),
               store.get(Boolean.class));
        
         context.deactivate();
         Assert.assertFalse(context.isActive());
        
         try
         {
            context.getObjectStore();
            Assert.fail("Trying to get ObjectStore outside active context should have thrown Exception");
         }
         catch (Exception e) {
         }
  
         context.activate();
         store = context.getObjectStore();
  
         Assert.assertEquals(
               "Verify that we can get objects from a active context",
               new Boolean(true),
               store.get(Boolean.class));
      }
      finally
      {
         context.deactivate();
         context.destroy();
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.