Package org.criticalfailure.torchlight.core.campaign.services.so

Examples of org.criticalfailure.torchlight.core.campaign.services.so.ObjectInstanceSO


            String path = PathUtils.buildPath(storagePath, "object-instances", id.substring(0, 1), id.substring(0, 2),
                    id);
            logger.trace("path: " + path);

            XMLDecoder dec = new XMLDecoder(new BufferedInputStream(new FileInputStream(path)));
            ObjectInstanceSO vo = (ObjectInstanceSO)dec.readObject();
            logger.trace("objectInstanceVO: " + vo);

            dec.close();

            doSetStatus(CampaignStorageConstants.STORAGE_STATUS_ONLINE);
View Full Code Here


            Set<ObjectInstance> instances = new HashSet<ObjectInstance>();
            logger.debug("instances: " + so.getInstances().size());
            for(String instanceId : so.getInstances()) {
                logger.trace("instanceId: " + instanceId);

                ObjectInstanceSO oiVO = csm.loadObjectInstance(instanceId);
                logger.trace("oiVO: " + oiVO);

                ObjectInstance oi = objectInstanceStorageObjectTranslator.translateFrom(oiVO, csm);
                logger.trace("oi: " + oi);
View Full Code Here

     */
    public ObjectInstanceSO translateTo(ObjectInstance obj) {

        logger.debug("translate to: " + obj);

        ObjectInstanceSO vo = new ObjectInstanceSO();

        vo.setId(obj.getId());
        vo.setCampaignId(obj.getCampaign().getId());
        if(obj.getObjectTemplate() != null) {
            vo.setObjectTemplateId(obj.getObjectTemplate().getId());
        }
        if(obj.getOwner() != null) {
            vo.setParticipantId(obj.getOwner().getId());
        }

        Set<String> data = new HashSet<String>();
        for(ObjectData objectData : obj.getData().values()) {
            data.add(objectData.getId());
        }
        vo.setData(data);

        return vo;
    }
View Full Code Here

TOP

Related Classes of org.criticalfailure.torchlight.core.campaign.services.so.ObjectInstanceSO

Copyright © 2018 www.massapicom. 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.