Examples of InvalidCredentialsException


Examples of com.streamreduce.core.service.exception.InvalidCredentialsException

        if (blobStoreContext == null) {
            String username = getConnectionCredentials().getIdentity();
            String password = getConnectionCredentials().getCredential();

            if (!StringUtils.hasText(username) || !StringUtils.hasText(password)) {
                throw new InvalidCredentialsException("You must supply an identity/username for cloud connections.");
            }

            try {
                blobStoreContext = ContextBuilder.newBuilder("aws-s3")
                                                 .credentials(username, password)
                                                 .modules(ImmutableSet.<Module>of(new SLF4JLoggingModule()))
                                                 .buildView(BlobStoreContext.class);
            } catch (AuthorizationException ae) {
                throw new InvalidCredentialsException(ae);
            }
        }

        return blobStoreContext;
    }
View Full Code Here

Examples of com.streamreduce.core.service.exception.InvalidCredentialsException

                cloudWatchContext = ContextBuilder.newBuilder("aws-cloudwatch")
                        .credentials(username, password)
                        .modules(ImmutableSet.<Module>of(new SLF4JLoggingModule()))
                        .build();
            } catch (AuthorizationException ae) {
                throw new InvalidCredentialsException(ae);
            }
        }

        return cloudWatchContext;
    }
View Full Code Here

Examples of com.streamreduce.core.service.exception.InvalidCredentialsException

            return;
        }
        // otherwise we got back an error.
        else if (json.containsKey("error")) {
            JSONObject error = json.getJSONObject("error");
            throw new InvalidCredentialsException(error.getString("errormessage"));
        }
    }
View Full Code Here

Examples of com.streamreduce.core.service.exception.InvalidCredentialsException

     * @throws InvalidCredentialsException
     */
    private void validateCredentials() throws InvalidCredentialsException {
        ConnectionCredentials creds = connection.getCredentials();
        if (creds == null || (creds.getIdentity() == null || creds.getCredential() == null || creds.getApiKey() == null)) {
            throw new InvalidCredentialsException("Connection credentials require a username, password and API key.");
        }
    }
View Full Code Here

Examples of com.streamreduce.core.service.exception.InvalidCredentialsException

                JSONObject fileStatus = responseBody.getJSONObject("FileStatus" );
                /*
                   Since the file exists, does the user own it?
                */
                if (!fileStatus.get("owner" ).equals(username)) {
                    throw new InvalidCredentialsException(String.format("User %s does not own the target destination.", username));
                }
                /*
                   We can't write to a directory.
                   NOTE: This is commented out for now since I'm not sure it's necessary behavior. @NJH
               else if (fileStatus.get("type").equals("DIRECTORY")) {
View Full Code Here

Examples of org.apache.commons.httpclient.auth.InvalidCredentialsException

        {
            return (NTCredentials) credentials;
        }
        catch (ClassCastException e)
        {
            throw new InvalidCredentialsException("Credentials cannot be used for NTLM authentication: "
                                                  + credentials.getClass().getName());
        }
    }
View Full Code Here

Examples of org.apache.commons.httpclient.auth.InvalidCredentialsException

        } catch (GSSException gsse) {
            LOG.fatal(gsse.getMessage());
            state = FAILED;
            if( gsse.getMajor() == GSSException.DEFECTIVE_CREDENTIAL
                    || gsse.getMajor() == GSSException.CREDENTIALS_EXPIRED )
                throw new InvalidCredentialsException(gsse.getMessage(),gsse);
            if( gsse.getMajor() == GSSException.NO_CRED )
                throw new CredentialsNotAvailableException(gsse.getMessage(),gsse);
            if( gsse.getMajor() == GSSException.DEFECTIVE_TOKEN
                    || gsse.getMajor() == GSSException.DUPLICATE_TOKEN
                    || gsse.getMajor() == GSSException.OLD_TOKEN )
View Full Code Here

Examples of org.apache.commons.httpclient.auth.InvalidCredentialsException

        } catch (GSSException gsse) {
            LOG.fatal(gsse.getMessage());
            state = FAILED;
            if( gsse.getMajor() == GSSException.DEFECTIVE_CREDENTIAL
                    || gsse.getMajor() == GSSException.CREDENTIALS_EXPIRED )
                throw new InvalidCredentialsException(gsse.getMessage(),gsse);
            if( gsse.getMajor() == GSSException.NO_CRED )
                throw new CredentialsNotAvailableException(gsse.getMessage(),gsse);
            if( gsse.getMajor() == GSSException.DEFECTIVE_TOKEN
                    || gsse.getMajor() == GSSException.DUPLICATE_TOKEN
                    || gsse.getMajor() == GSSException.OLD_TOKEN )
View Full Code Here

Examples of org.apache.commons.httpclient.auth.InvalidCredentialsException

        } catch (GSSException gsse) {
            LOG.fatal(gsse.getMessage());
            state = FAILED;
            if( gsse.getMajor() == GSSException.DEFECTIVE_CREDENTIAL
                    || gsse.getMajor() == GSSException.CREDENTIALS_EXPIRED )
                throw new InvalidCredentialsException(gsse.getMessage(),gsse);
            if( gsse.getMajor() == GSSException.NO_CRED )
                throw new CredentialsNotAvailableException(gsse.getMessage(),gsse);
            if( gsse.getMajor() == GSSException.DEFECTIVE_TOKEN
                    || gsse.getMajor() == GSSException.DUPLICATE_TOKEN
                    || gsse.getMajor() == GSSException.OLD_TOKEN )
View Full Code Here

Examples of org.apache.commons.httpclient.auth.InvalidCredentialsException

        {
            return (NTCredentials) credentials;
        }
        catch (ClassCastException e)
        {
            throw new InvalidCredentialsException("Credentials cannot be used for NTLM authentication: "
                                                  + credentials.getClass().getName());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.