Package org.jayasoft.woj.client.services.exception

Examples of org.jayasoft.woj.client.services.exception.NotSignedException


   
    public  char[] getSource(String className, String jarPath) throws WojException {
        try {
            SimpleMonitor.startTask("WojServicesHelper.getSource.fromjar"); //$NON-NLS-1$
            if(!isAutenticate()) {
                throw new NotSignedException(Messages.getString("common.badlogin.message")); //$NON-NLS-1$
            }
            String md5 = computeMD5(jarPath);
            if(md5 == null) {
                throw new WojException(Messages.getString("common.identifyjar.failed.message")+jarPath); //$NON-NLS-1$
            }
View Full Code Here


   
    public  File getSourceFile(String className, String jarPath) throws WojException {
        try {
            SimpleMonitor.startTask("WojServicesHelper.getSource.fromjar"); //$NON-NLS-1$
            if(!isAutenticate()) {
                throw new NotSignedException(Messages.getString("common.badlogin.message")); //$NON-NLS-1$
            }
            String md5 = computeMD5(jarPath);
            if(md5 == null) {
                throw new WojException(Messages.getString("common.identifyjar.failed.message")+jarPath); //$NON-NLS-1$
            }
View Full Code Here

   
    public URL getSourceURL(String className, String jarPath) throws WojException {
        try {
            SimpleMonitor.startTask("WojServicesHelper.getSource.fromjar"); //$NON-NLS-1$
            if(!isAutenticate()) {
                throw new NotSignedException(Messages.getString("common.badlogin.message")); //$NON-NLS-1$
            }
            String md5 = computeMD5(jarPath);
            if(md5 == null) {
                throw new WojException(Messages.getString("common.identifyjar.failed.message")+jarPath); //$NON-NLS-1$
            }
View Full Code Here

    }

    public  ModuleInfo getModuleInfo(String jarPath) throws ServiceException, NotSignedException {
      LOGGER.debug("getModuleInfo:"+jarPath); //$NON-NLS-1$
        if(!isAutenticate()) {
          throw new NotSignedException(Messages.getString("common.badlogin.message")); //$NON-NLS-1$
        }
        if (isOffline()) {
          LOGGER.debug("Offline mode"); //$NON-NLS-1$
            throw new OfflineException();
        }
View Full Code Here

   
    public  char[] getSourceByMd5(String className, String md5) throws WojException {
        try {
            SimpleMonitor.startTask("WojServicesHelper.getSource.fromjar"); //$NON-NLS-1$
            if(!isAutenticate()) {
                throw new NotSignedException(Messages.getString("common.badlogin.message")); //$NON-NLS-1$
            }
            String source = _wojCache.getSource(md5, className);
            if(source != null) {
                return source.toCharArray();
            }
View Full Code Here

   
    public  File getSourceFileByMd5(String className, String md5) throws WojException {
        try {
            SimpleMonitor.startTask("WojServicesHelper.getSource.fromjar"); //$NON-NLS-1$
            if(!isAutenticate()) {
                throw new NotSignedException(Messages.getString("common.badlogin.message")); //$NON-NLS-1$
            }
            File file = _wojCache.getSourceFile(md5, className);
            if(file != null) {
                return file;
            }
View Full Code Here

   
    public URL getSourceURLByMd5(String className, String md5) throws WojException {
        try {
            SimpleMonitor.startTask("WojServicesHelper.getSource.fromjar"); //$NON-NLS-1$
            if(!isAutenticate()) {
                throw new NotSignedException(Messages.getString("common.badlogin.message")); //$NON-NLS-1$
            }
            URL url = _wojCache.getSourceURL(md5, className);
            if(url != null) {
                return url;
            }
View Full Code Here

    }

    public  ModuleInfo getModuleInfoByMd5(String md5) throws ServiceException, NotSignedException {
      LOGGER.debug("getModuleInfoByMd5:"+md5); //$NON-NLS-1$
        if(!isAutenticate()) {
          throw new NotSignedException(Messages.getString("common.badlogin.message")); //$NON-NLS-1$
        }
        if (isOffline()) {
          LOGGER.debug("Offline mode"); //$NON-NLS-1$
            throw new OfflineException();
        }
View Full Code Here

    }
    public String getSource(Visibility v, String org, String name, String rev, String className) throws WojException {
        try {
            SimpleMonitor.startTask("WojServicesHelper.getSource.fromModule"); //$NON-NLS-1$
            if(!isAutenticate()) {
                throw new NotSignedException(Messages.getString("common.badlogin.message")); //$NON-NLS-1$
            }
            ModuleInfo moduleInfo = new ModuleInfoImpl(org, name, rev, v, true, true);
            String source = WojServicesAccess.INSTANCE.getSource(moduleInfo, className, null);
            if(source == null || source.length()==0) {
                throw new WojException(Messages.getString("common.nosource.messsage")+className+" for module :"+moduleInfo); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

    final boolean autenticate(String user, String password) throws ServiceException, NotSignedException {
      LOGGER.debug("autenticate:"+user); //$NON-NLS-1$
        checkCanConnectServer();
       
        if(user != null && user.length()==0 && password != null && password.length()==0) {
            throw new NotSignedException(Messages.getString("services.bad.account.info")); //$NON-NLS-1$
        }
        Authentification auth = null;
        try {
            SimpleMonitor.startTask("autenticate"); //$NON-NLS-1$
            //always log into master server
            LOGGER.debug("autenticate calling server"); //$NON-NLS-1$
            auth = _serverServicesProvider.getAuthentificationService().authenticate(user, password, System.getProperty(PLUGIN_VERSION, "not set"));
            LOGGER.debug("autenticate server respond:"+auth); //$NON-NLS-1$
        } catch (ServiceNotAvailableException e) {
          LOGGER.error("ServiceNotAvailableException:"+e); //$NON-NLS-1$
            setServerNotAvailable();
            resetLoginInfos();
            throw e;
        } catch (ServiceException e) {
          LOGGER.error("ServiceException:"+e); //$NON-NLS-1$
            resetLoginInfos();
            throw e;
        } finally {
            SimpleMonitor.endTask("autenticate"); //$NON-NLS-1$
        }
        if(auth == null) {
            resetLoginInfos();
        } else {
          if (auth instanceof AuthSuccessfull) {
            LOGGER.debug("AuthSuccessfull:"+auth); //$NON-NLS-1$
            AuthSuccessfull success = (AuthSuccessfull) auth;
            _serverVersion = (String) success.getExtraParameter(Authentification.SERVER_VERSION);
            _serverConfiguration = success.getExtraParameters();
            setExpirationDate(success.getLicenceExpirationDate());
            return true;
          } else if (auth instanceof AuthFailed) {
            LOGGER.debug("AuthFailed:"+auth); //$NON-NLS-1$
            AuthFailed failed = (AuthFailed) auth;
            _serverVersion = (String) failed.getExtraParameter(Authentification.SERVER_VERSION);
            resetLoginInfos();
            switch (failed.getReasonCode()) {
            case AuthFailed.BAD_AUTHENTIFICATION_INFO:
              throw new NotSignedException(Messages.getString("services.error.badlogin"), failed.getReasonCode()); //$NON-NLS-1$
            case AuthFailed.LICENCE_EXPIRED:
              throw new NotSignedException(Messages.getString("services.error.licenseexpired"), failed.getReasonCode());       //$NON-NLS-1$
            case AuthFailed.SERVER_UNDER_MAINTENANCE:
              throw new NotSignedException(Messages.getString("services.error.servernotreachable"), failed.getReasonCode());                                //$NON-NLS-1$
            case AuthFailed.ACCOUNT_BLOCKED:
              throw new NotSignedException(Messages.getString("services.error.account.suspended")+"\n"+failed.getReasonMessage(), failed.getReasonCode());                                //$NON-NLS-1$ //$NON-NLS-2$
            default:
              throw new NotSignedException(Messages.getString("services.error.unknow")+failed.getReasonMessage(), failed.getReasonCode()); //$NON-NLS-1$
            }
          }
        }
        return false;
    }
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.client.services.exception.NotSignedException

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.