Package com.emc.esu.api

Examples of com.emc.esu.api.ObjectInfo


    }

    private ObjectInfo adaptObjectInfo( com.emc.atmos.api.bean.ObjectInfo objectInfo ) throws JAXBException {
        if ( objectInfo == null ) return null;

        ObjectInfo newObjectInfo = new ObjectInfo();
        newObjectInfo.setObjectId( (ObjectId) adaptIdentifier( objectInfo.getObjectId() ) );
        newObjectInfo.setSelection( objectInfo.getSelection() );

        if ( objectInfo.getExpiration() != null ) {
            ObjectExpiration objectExpiration = new ObjectExpiration();
            objectExpiration.setEnabled( objectInfo.getExpiration().isEnabled() );
            objectExpiration.setEndAt( objectInfo.getExpiration().getEndAt() );
            newObjectInfo.setExpiration( objectExpiration );
        }

        if ( objectInfo.getRetention() != null ) {
            ObjectRetention objectRetention = new ObjectRetention();
            objectRetention.setEnabled( objectInfo.getRetention().isEnabled() );
            objectRetention.setEndAt( objectInfo.getRetention().getEndAt() );
            newObjectInfo.setRetention( objectRetention );
        }

        if ( objectInfo.getReplicas() != null ) {
            List<ObjectReplica> replicas = new ArrayList<ObjectReplica>();
            for ( Replica replica : objectInfo.getReplicas() ) {
                ObjectReplica newReplica = new ObjectReplica();
                newReplica.setId( "" + replica.getId() );
                newReplica.setCurrent( replica.isCurrent() );
                newReplica.setLocation( replica.getLocation() );
                newReplica.setReplicaType( replica.getType() );
                newReplica.setStorageType( replica.getStorageType() );
                replicas.add( newReplica );
            }
            newObjectInfo.setReplicas( replicas );
        }

        StringWriter xmlString = new StringWriter();
        getMarshaller().marshal( objectInfo, xmlString );
        newObjectInfo.setRawXml( xmlString.toString() );

        return newObjectInfo;
    }
View Full Code Here


            String responseXml = new String(response, "UTF-8");
           
            l4j.debug("Response: " + responseXml );

            con.disconnect();
            return new ObjectInfo( responseXml );

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

TOP

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

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.