Package com.volantis.mcs.repository

Examples of com.volantis.mcs.repository.RepositoryConnection


     * @throws RepositoryException if there was a problem.
     */
    private void initialiseDevicePatternCache(Repository repository,
            DeviceRepositoryAccessor accessor) throws RepositoryException {

        RepositoryConnection connection = null;
        try {
            connection = repository.connect();
            accessor.initializeDevicePatternCache(connection);
            connection.disconnect();
            connection = null;
        } finally {
            if (connection != null) {
                connection.disconnect();
            }
        }
    }


            // check if it's been cached
            descriptor = (PolicyDescriptor) nameToDescriptor.get(policyName);
            if (descriptor == null) {
                // if not go to the repository and load it
                try {
                    final RepositoryConnection connection =
                        repository.connect();
                    try {
                        descriptor = accessor.retrievePolicyDescriptor(
                                connection, policyName, locale);
                        nameToDescriptor.put(policyName, descriptor);

     */
    private Set calculatePolicyNames() throws RepositoryException {

        Set result = new HashSet();

        RepositoryConnection connection = repository.connect();
        try {
            RepositoryEnumeration policyNames =
                    accessor.enumeratePolicyNames(connection);
            try {
                while (policyNames.hasNext()) {

            throws DeviceRepositoryException {
        Device device = null;

        if (deviceName != null) {
            try {
                RepositoryConnection connection = repository.connect();
                try {
                    device =
                        DevicesHelper.getDevice(connection, deviceName, accessor);
              } finally {
                    repository.disconnect(connection);

    public List getDevices(String deviceNamePattern)
            throws DeviceRepositoryException {
        List devices = null;
        if (deviceNamePattern != null) {
            try {
                RepositoryConnection connection = repository.connect();

                try {
                    devices = accessor.enumerateDeviceNames(connection,
                                                            deviceNamePattern);
                } finally {

                                "' is not a valid IMEI");
                    }
                }
            }
            try {
                RepositoryConnection connection = repository.connect();
                try {
                    long tacL = Long.parseLong(imei.substring(0,8));
                    devName = accessor.retrieveDeviceName(connection,
                            tacL);
                    if (devName == null) {

            if (tac == null || (tac.length() != 8 && tac.length() != 6)) {
                throw new IllegalArgumentException(tac + " is not a valid TAC");
            }

            try {
                RepositoryConnection connection = repository.connect();
                try {
                    long tacL = Long.parseLong(tac);
                    devName = accessor.retrieveDeviceName(connection,
                            tacL);
                } finally {

                throw new IllegalArgumentException(tacfac +
                        " is not a valid TAC/FAC combo");
            }

            try {
                RepositoryConnection connection = repository.connect();
                try {
                    long tacL = Long.parseLong(tacfac);
                    devName = accessor.retrieveDeviceName(connection,
                            tacL);
                    if (devName == null) {

    public List getPolicyCategoryNames()
            throws DeviceRepositoryException {

        final List names = new LinkedList();
        try {
            final RepositoryConnection connection = repository.connect();
            try {
                final RepositoryEnumeration e =
                    accessor.enumerateCategoryNames(connection);
                try {
                    while (e.hasNext()) {

        // either.
        List names = null;
        if (category != null) {
            names = new ArrayList();
            try {
                RepositoryConnection connection = repository.connect();
                try {
                    RepositoryEnumeration e = accessor.enumeratePolicyNames(
                            connection, category);
                    try {
                        while (e.hasNext()) {

TOP

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

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.