Package com.volantis.mcs.repository

Examples of com.volantis.mcs.repository.RepositoryException


                    transformer.transform(hierarchy,
                            new StreamResult(tacOutput));
                    tacOutput.flush();
                    tacOutput.close();
                } catch (TransformerException te) {
                    throw new RepositoryException(te);
                }
            }
            return archive;
        } catch (IOException ioe) {
            throw new RepositoryException(ioe);
        }
    }
View Full Code Here


                za = new ZipArchive(archiveFileName);
            }

            return za.getInputFrom(fileName);
        } catch (IOException ioe) {
            throw new RepositoryException(ioe);
        }
    }
View Full Code Here

        }
        Element existing =
                retrieveDeviceElementFromDocument(deviceName, document);
        if (existing != null) {
            throw new RepositoryException(
                    exceptionLocalizer.format(
                            "device-already-exists",
                            deviceName));
        }
View Full Code Here

        if (newDeviceName == null) {
            throw new IllegalArgumentException(
                    "Cannot rename a device name to null name.");
        }
        if (deviceExists(newDeviceName)) {
            throw new RepositoryException(
                    exceptionLocalizer.format(
                            "device-already-exists-cannot-rename",
                            deviceName));
        }
        Element element = getHierarchyDeviceElement(deviceName);
        if (element == null) {
            throw new RepositoryException(
                    exceptionLocalizer.format(
                            "device-not-found-cannot-rename",
                            deviceName));
        }
View Full Code Here

            String newDevicePath =
                    getXMLFilePath(deviceDirectory, newDeviceName);
            if (!archive.rename(devicePath, newDevicePath)) {
                // Should only happen if the device files are out of date
                // wrt the hierarchy, which should not be often.
                throw new RepositoryException(
                        exceptionLocalizer.format(
                                "device-rename-failed",
                                new Object[]{devicePath,
                                             newDevicePath}));
            }
            // Then update it's contents to change the name internally.
            Document deviceDoc = createNewDocument(
                    archive.getInputFrom(newDevicePath));
            Element deviceElement = deviceDoc.getRootElement();
            deviceElement.setAttribute(
                    DeviceRepositorySchemaConstants.DEVICE_NAME_ATTRIBUTE,
                    newDeviceName);
            try {
                writeDocument(deviceDoc, archive.getOutputTo(newDevicePath));
            } catch (IOException e) {
                throw new RepositoryException(
                        exceptionLocalizer.format(
                                "device-update-failure",
                                newDevicePath),
                        e);
            }
View Full Code Here

                if (list.size() == 1) {
                    result = ((Element) list.get(0)).getAttributeValue(
                            DeviceRepositorySchemaConstants.
                            DEVICE_NAME_ATTRIBUTE);
                } else if (list.size() > 1) {
                    throw new RepositoryException(
                            exceptionLocalizer.format(
                                    "device-hierarchy-too-many-roots",
                                    list));
                }
            }
View Full Code Here

     */
    public void saveRepositoryArchive() throws RepositoryException {
        try {
            repositoryArchive.save();
        } catch (IOException e) {
            throw new RepositoryException(e);
        }
    }
View Full Code Here

                writeDocument(xmlIdentificationDocument, out);

                repositoryArchive = archive;
            }
        } catch (IOException e) {
            throw new RepositoryException(e);
        }
    }
View Full Code Here

                writeDocument(xmlTACIdentificationDocument, out);

                repositoryArchive = archive;
            }
        } catch (IOException e) {
            throw new RepositoryException(e);
        }
    }
View Full Code Here

                writeDocument(xmlHierarchyDocument, out);

                repositoryArchive = archive;
            } else {
                // Repository is invalid without a hierarchy.
                throw new RepositoryException(
                        exceptionLocalizer.format(
                                "device-repository-invalid",
                                DeviceRepositoryConstants.HIERARCHY_XML));
            }
        } catch (IOException e) {
            throw new RepositoryException(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.repository.RepositoryException

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.