Package com.emc.esu.api

Examples of com.emc.esu.api.EsuException


            con.disconnect();
            return acl;

        } catch (MalformedURLException e) {
            throw new EsuException("Invalid URL", e);
        } catch (IOException e) {
            throw new EsuException("Error connecting to server", e);
        } catch (GeneralSecurityException e) {
            throw new EsuException("Error computing request signature", e);
        } catch (URISyntaxException e) {
            throw new EsuException("Invalid URL", e);
        }
    }
View Full Code Here


            readTags(tags, header, true);

            con.disconnect();
            return tags;
        } catch (MalformedURLException e) {
            throw new EsuException("Invalid URL", e);
        } catch (IOException e) {
            throw new EsuException("Error connecting to server", e);
        } catch (GeneralSecurityException e) {
            throw new EsuException("Error computing request signature", e);
        } catch (URISyntaxException e) {
            throw new EsuException("Invalid URL", e);
        }
    }
View Full Code Here

            con.disconnect();
            return meta;

        } catch (MalformedURLException e) {
            throw new EsuException("Invalid URL", e);
        } catch (IOException e) {
            throw new EsuException("Error connecting to server", e);
        } catch (GeneralSecurityException e) {
            throw new EsuException("Error computing request signature", e);
        } catch (URISyntaxException e) {
            throw new EsuException("Invalid URL", e);
        }
    }
View Full Code Here

            con.disconnect();
            return meta;

        } catch (MalformedURLException e) {
            throw new EsuException("Invalid URL", e);
        } catch (IOException e) {
            throw new EsuException("Error connecting to server", e);
        } catch (GeneralSecurityException e) {
            throw new EsuException("Error computing request signature", e);
        } catch (URISyntaxException e) {
            throw new EsuException("Invalid URL", e);
        }
    }
View Full Code Here

            // Add tag
            if (tag != null) {
                headers.put("x-emc-tags", unicodeEnabled ? encodeUtf8(tag) : tag);
            } else {
                throw new EsuException("Tag cannot be null");
            }
           
            // Process options
            if( options != null ) {
              if( options.isIncludeMetadata() ) {
                headers.put( "x-emc-include-meta", "1" );
                if( options.getSystemMetadata() != null ) {
                  headers.put( "x-emc-system-tags",
                      join( options.getSystemMetadata(), "," ) );
                }
                if( options.getUserMetadata() != null ) {
                  headers.put( "x-emc-user-tags",
                      join( options.getUserMetadata(), "," ) );                 
                }
              }
              if( options.getLimit() > 0 ) {
                headers.put( "x-emc-limit", ""+options.getLimit() );
              }
              if( options.getToken() != null ) {
                headers.put( "x-emc-token", options.getToken() );
              }
            }

            // Add date
            headers.put("Date", getDateHeader());

            // Sign request
            signRequest("GET", resource, null, headers);
            configureRequest( con, "GET", headers );

            con.connect();

            // Check response
            try {
              if (con.getResponseCode() > 299) {
                  handleError(con);
              }
            } catch( EsuException e ) {
              if( e.getAtmosCode() == 1003 ) {
                return Collections.emptyList();
              }
              throw e;
            }

            // Get object id list from response
            byte[] response = readResponse(con, null);

            l4j.debug("Response: " + new String(response, "UTF-8"));
            con.disconnect();
           
            if( options != null ) {
              // Update the token for listing more results.  If there are no
              // more results, the header will not be set and the token will
              // be cleared in the options object.
              options.setToken( con.getHeaderField("x-emc-token") );
            } else {
              if( con.getHeaderField( "x-emc-token" ) != null ) {
                l4j.warn( "Result set truncated. Use ListOptions to " +
                    "retrieve token for next page of results." );
              }
            }

            return parseObjectListWithMetadata(response);

        } catch (MalformedURLException e) {
            throw new EsuException("Invalid URL", e);
        } catch (IOException e) {
            throw new EsuException("Error connecting to server", e);
        } catch (GeneralSecurityException e) {
            throw new EsuException("Error computing request signature", e);
        } catch (URISyntaxException e) {
            throw new EsuException("Invalid URL", e);
        }
    }
View Full Code Here

            con.disconnect();
            return tags;

        } catch (MalformedURLException e) {
            throw new EsuException("Invalid URL", e);
        } catch (IOException e) {
            throw new EsuException("Error connecting to server", e);
        } catch (GeneralSecurityException e) {
            throw new EsuException("Error computing request signature", e);
        } catch (URISyntaxException e) {
            throw new EsuException("Invalid URL", e);
        }
    }
View Full Code Here

            con.disconnect();
            return parseVersionList(response);

        } catch (MalformedURLException e) {
            throw new EsuException("Invalid URL", e);
        } catch (IOException e) {
            throw new EsuException("Error connecting to server", e);
        } catch (GeneralSecurityException e) {
            throw new EsuException("Error computing request signature", e);
        } catch (URISyntaxException e) {
            throw new EsuException("Invalid URL", e);
        }
    }
View Full Code Here

            con.disconnect();
            return parseVersionListLong(response);

        } catch (MalformedURLException e) {
            throw new EsuException("Invalid URL", e);
        } catch (IOException e) {
            throw new EsuException("Error connecting to server", e);
        } catch (GeneralSecurityException e) {
            throw new EsuException("Error computing request signature", e);
        } catch (URISyntaxException e) {
            throw new EsuException("Invalid URL", e);
        }
    }
View Full Code Here

            // Add query
            if (xquery != null) {
                headers.put("x-emc-xquery", xquery);
            } else {
                throw new EsuException("Query cannot be null");
            }

            // Add date
            headers.put("Date", getDateHeader());

            // Sign request
            signRequest("GET", resource, null, headers);
            configureRequest( con, "GET", headers );

            con.connect();

            // Check response
            if (con.getResponseCode() > 299) {
                handleError(con);
            }

            // Get object id list from response
            Map<String,List<String>> responseHeaders = con.getHeaderFields();
            l4j.debug("Response headers: " + responseHeaders);
            byte[] response = readResponse(con, null);

            if(l4j.isDebugEnabled()) {
              String responseBody = new String(response, "UTF-8");
              l4j.debug("Response: " + responseBody);
            }

            con.disconnect();
            return parseObjectList(response);

        } catch (MalformedURLException e) {
            throw new EsuException("Invalid URL", e);
        } catch (IOException e) {
            throw new EsuException("Error connecting to server", e);
        } catch (GeneralSecurityException e) {
            throw new EsuException("Error computing request signature", e);
        } catch (URISyntaxException e) {
            throw new EsuException("Invalid URL", e);
        }
    }
View Full Code Here

           
            con.disconnect();
            return data;

        } catch (MalformedURLException e) {
            throw new EsuException("Invalid URL", e);
        } catch (IOException e) {
            throw new EsuException("Error connecting to server", e);
        } catch (GeneralSecurityException e) {
            throw new EsuException("Error computing request signature", e);
        } catch (URISyntaxException e) {
            throw new EsuException("Invalid URL", e);
        }

    }
View Full Code Here

TOP

Related Classes of com.emc.esu.api.EsuException

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.