public AIP createAIP(AIPState state, String parentId, String type, Permissions permissions, boolean notify, String createdBy) throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException, AuthorizationDeniedException { RodaCoreFactory.checkIfWriteIsAllowedAndIfFalseThrowException(nodeType); Directory directory = storage.createRandomDirectory(DefaultStoragePath.parse(RodaConstants.STORAGE_CONTAINER_AIP)); String id = directory.getStoragePath().getName(); Permissions inheritedPermissions = this.addParentPermissions(permissions, parentId); AIP aip = new AIP(id, parentId, type, state, inheritedPermissions, createdBy); createAIPMetadata(aip); if (notify) { notifyAipCreated(aip).failOnError(); } return aip; }
public AIP createAIP(AIPState state, String parentId, String type, Permissions permissions, String ingestSIPUUID, List<String> ingestSIPIds, String ingestJobId, boolean notify, String createdBy) throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException, AuthorizationDeniedException { RodaCoreFactory.checkIfWriteIsAllowedAndIfFalseThrowException(nodeType); Directory directory = storage.createRandomDirectory(DefaultStoragePath.parse(RodaConstants.STORAGE_CONTAINER_AIP)); String id = directory.getStoragePath().getName(); Permissions inheritedPermissions = this.addParentPermissions(permissions, parentId); AIP aip = new AIP(id, parentId, type, state, inheritedPermissions, createdBy).setIngestSIPIds(ingestSIPIds) .setIngestJobId(ingestJobId).setIngestSIPUUID(ingestSIPUUID); createAIPMetadata(aip); if (notify) { notifyAipCreated(aip).failOnError(); } return aip; }
public AIP createAIP(String parentId, String type, Permissions permissions, List<String> ingestSIPIds, String ingestJobId, boolean notify, String createdBy, boolean isGhost) throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException, AuthorizationDeniedException { RodaCoreFactory.checkIfWriteIsAllowedAndIfFalseThrowException(nodeType); AIPState state = AIPState.ACTIVE; Directory directory = storage.createRandomDirectory(DefaultStoragePath.parse(RodaConstants.STORAGE_CONTAINER_AIP)); String id = directory.getStoragePath().getName(); Permissions inheritedPermissions = this.addParentPermissions(permissions, parentId); AIP aip = new AIP(id, parentId, type, state, inheritedPermissions, createdBy); aip.setGhost(isGhost); aip.setIngestSIPIds(ingestSIPIds); aip.setIngestJobId(ingestJobId); createAIPMetadata(aip); if (notify) { notifyAipCreated(aip).failOnError(); } return aip; }