mirror of
				https://github.com/Alfresco/alfresco-community-repo.git
				synced 2025-10-29 15:21:53 +00:00 
			
		
		
		
	git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@128510 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
		
			
				
	
	
		
			169 lines
		
	
	
		
			4.2 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
			
		
		
	
	
			169 lines
		
	
	
		
			4.2 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
| /*
 | |
|  * #%L
 | |
|  * Alfresco Repository
 | |
|  * %%
 | |
|  * Copyright (C) 2005 - 2016 Alfresco Software Limited
 | |
|  * %%
 | |
|  * This file is part of the Alfresco software. 
 | |
|  * If the software was purchased under a paid Alfresco license, the terms of 
 | |
|  * the paid license agreement will prevail.  Otherwise, the software is 
 | |
|  * provided under the following open source license terms:
 | |
|  * 
 | |
|  * Alfresco is free software: you can redistribute it and/or modify
 | |
|  * it under the terms of the GNU Lesser General Public License as published by
 | |
|  * the Free Software Foundation, either version 3 of the License, or
 | |
|  * (at your option) any later version.
 | |
|  * 
 | |
|  * Alfresco is distributed in the hope that it will be useful,
 | |
|  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | |
|  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | |
|  * GNU Lesser General Public License for more details.
 | |
|  * 
 | |
|  * You should have received a copy of the GNU Lesser General Public License
 | |
|  * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
 | |
|  * #L%
 | |
|  */
 | |
| 
 | |
| package org.alfresco.repo.publishing;
 | |
| 
 | |
| import java.io.Serializable;
 | |
| import java.util.Collections;
 | |
| import java.util.List;
 | |
| import java.util.Map;
 | |
| import java.util.Set;
 | |
| 
 | |
| import org.alfresco.model.ContentModel;
 | |
| import org.alfresco.repo.transfer.manifest.TransferManifestNormalNode;
 | |
| import org.alfresco.service.cmr.publishing.NodeSnapshot;
 | |
| import org.alfresco.service.cmr.repository.AssociationRef;
 | |
| import org.alfresco.service.cmr.repository.ChildAssociationRef;
 | |
| import org.alfresco.service.cmr.repository.NodeRef;
 | |
| import org.alfresco.service.cmr.repository.Path;
 | |
| import org.alfresco.service.namespace.QName;
 | |
| 
 | |
| /**
 | |
|  * @author Brian
 | |
|  * @author Nick Smith
 | |
|  * @since 4.0
 | |
|  */
 | |
| public class NodeSnapshotTransferImpl implements NodeSnapshot
 | |
| {
 | |
|     private final TransferManifestNormalNode transferNode; 
 | |
|     
 | |
|     /**
 | |
|      * @param transferNode TransferManifestNormalNode
 | |
|      */
 | |
|     public NodeSnapshotTransferImpl(TransferManifestNormalNode transferNode)
 | |
|     {
 | |
|         this.transferNode = transferNode;
 | |
|     }
 | |
| 
 | |
|     public List<ChildAssociationRef> getAllParentAssocs()
 | |
|     {
 | |
|         if (transferNode == null)
 | |
|         {
 | |
|             return Collections.emptyList();
 | |
|         }
 | |
|         return transferNode.getParentAssocs();
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|     * {@inheritDoc}
 | |
|      */
 | |
|     public Set<QName> getAspects()
 | |
|     {
 | |
|         if (transferNode == null)
 | |
|         {
 | |
|             return Collections.emptySet();
 | |
|         }
 | |
|         return transferNode.getAspects();
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * {@inheritDoc}
 | |
|       */
 | |
|     public NodeRef getNodeRef()
 | |
|     {
 | |
|         if (transferNode == null)
 | |
|         {
 | |
|             return null;
 | |
|         }
 | |
|         return transferNode.getNodeRef();
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      */
 | |
|     public List<AssociationRef> getOutboundPeerAssociations()
 | |
|     {
 | |
|         if (transferNode == null)
 | |
|         {
 | |
|             return Collections.emptyList();
 | |
|         }
 | |
|         return transferNode.getTargetAssocs();
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * @return ChildAssociationRef
 | |
|      */
 | |
|     public ChildAssociationRef getPrimaryParentAssoc()
 | |
|     {
 | |
|         if (transferNode == null)
 | |
|         {
 | |
|             return null;
 | |
|         }
 | |
|         return transferNode.getPrimaryParentAssoc();
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * @return Path
 | |
|      */
 | |
|     public Path getPrimaryPath()
 | |
|     {
 | |
|         if (transferNode == null)
 | |
|         {
 | |
|             return null;
 | |
|         }
 | |
|         return transferNode.getParentPath();
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * {@inheritDoc}
 | |
|      */
 | |
|     public Map<QName, Serializable> getProperties()
 | |
|     {
 | |
|         if (transferNode == null)
 | |
|         {
 | |
|             return Collections.emptyMap();
 | |
|         }
 | |
|         return transferNode.getProperties();
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * {@inheritDoc}
 | |
|      */
 | |
|     public QName getType()
 | |
|     {
 | |
|         if (transferNode == null)
 | |
|         {
 | |
|             return null;
 | |
|         }
 | |
|         return transferNode.getType();
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|     * {@inheritDoc}
 | |
|     */
 | |
|     public String getVersion()
 | |
|     {
 | |
|         return (String) getProperties().get(ContentModel.PROP_VERSION_LABEL);
 | |
|     }
 | |
|     
 | |
|     /**
 | |
|      * @return the transferNode
 | |
|      */
 | |
|     public TransferManifestNormalNode getTransferNode()
 | |
|     {
 | |
|         return transferNode;
 | |
|     }
 | |
| }
 |