Class WSRPUtils

  • Direct Known Subclasses:
    WSRPProducerUtils

    public class WSRPUtils
    extends java.lang.Object
    WSRP utility class.
    Since:
    6.0.0
    Version:
    $Revision: 14842 $ $Date: 2012-10-23 12:54:24 -0200 (Tue, 23 Oct 2012) $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long MILISSECONDS_IN_A_DAY  
      static java.lang.String[] WSRP_PORTLET_MODES
      Array of strings containing the default possible portletModes to be used with WSRP.
      static java.lang.String[] WSRP_WINDOWS_STATES
      Array of strings containing the default possible windowStates to be used with WSRP.
    • Constructor Summary

      Constructors 
      Constructor Description
      WSRPUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.sun.portal.wsrp.common.stubs.v2.Lifetime convertLeasetimeToLifetime​(com.sun.portal.wsrp.common.LeaseTime leasetime)
      Converts a LeaseTime into a Lifetime.
      static com.sun.portal.wsrp.common.LeaseTime convertLifetimeToLeaseTime​(com.sun.portal.wsrp.common.stubs.v2.Lifetime lifetime)
      Converts a Lifetime into a LeaseTime.
      static java.util.Date dateFromXMLGregorianCalendar​(javax.xml.datatype.XMLGregorianCalendar calendar)
      Converts a XMLGregorianCalendar into a Date object.
      static long fromXMLGregorianCalendar​(javax.xml.datatype.XMLGregorianCalendar calendar)
      Converts a XMLGregorianCalendar into a date, in milliseconds.
      static java.util.Map<java.lang.String,​java.lang.String[]> getMapFromString​(java.lang.String paramString)
      Adjustment for 'com.sun.portal.wsrp.common.Util'.
      static java.lang.String join​(java.util.List<? extends java.lang.CharSequence> s, java.lang.String delimiter)
      Joins a list into a String with its values separated by the delimiter.
      static com.sun.portal.wsrp.common.stubs.v2.Lifetime lifetimeTerminationTimeFromDate​(java.util.Date date)
      Creates a Lifetime object and sets its termination time converting the Date instance to a XMLGregorianCalendar.
      static java.util.Date lifetimeTerminationTimeToDate​(com.sun.portal.wsrp.common.stubs.v2.Lifetime lifetime)
      Creates a Date object getting the terminationTime from a Lifetime object.
      static javax.xml.datatype.XMLGregorianCalendar toXMLGregorianCalendar​(long date)
      Converts a date, in milliseconds, into a XMLGregorianCalendar.
      static javax.xml.datatype.XMLGregorianCalendar toXMLGregorianCalendar​(java.util.Date date)
      Converts a date, into a XMLGregorianCalendar.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • WSRP_WINDOWS_STATES

        public static final java.lang.String[] WSRP_WINDOWS_STATES
        Array of strings containing the default possible windowStates to be used with WSRP.
      • WSRP_PORTLET_MODES

        public static final java.lang.String[] WSRP_PORTLET_MODES
        Array of strings containing the default possible portletModes to be used with WSRP.
    • Constructor Detail

      • WSRPUtils

        public WSRPUtils()
    • Method Detail

      • toXMLGregorianCalendar

        public static javax.xml.datatype.XMLGregorianCalendar toXMLGregorianCalendar​(long date)
        Converts a date, in milliseconds, into a XMLGregorianCalendar.
        Parameters:
        long - representing the desired date.
        Returns:
        date the date in XMLGregorianCalendar format.
      • toXMLGregorianCalendar

        public static javax.xml.datatype.XMLGregorianCalendar toXMLGregorianCalendar​(java.util.Date date)
        Converts a date, into a XMLGregorianCalendar.
        Parameters:
        date - to be converted.
        Returns:
        date in the XMLGregorianCalendar format.
      • fromXMLGregorianCalendar

        public static long fromXMLGregorianCalendar​(javax.xml.datatype.XMLGregorianCalendar calendar)
        Converts a XMLGregorianCalendar into a date, in milliseconds.
        Parameters:
        calendar - XMLGregorianCalendar format of the date.
        Returns:
        date converted to milliseconds.
      • dateFromXMLGregorianCalendar

        public static java.util.Date dateFromXMLGregorianCalendar​(javax.xml.datatype.XMLGregorianCalendar calendar)
        Converts a XMLGregorianCalendar into a Date object.
        Parameters:
        calendar - XMLGregorianCalendar format of the date.
        Returns:
        date as java.lang.Date object.
      • join

        public static java.lang.String join​(java.util.List<? extends java.lang.CharSequence> s,
                                            java.lang.String delimiter)
        Joins a list into a String with its values separated by the delimiter.
        Parameters:
        list - of CharSequence to join into a single string.
        delimiter - used to join the CharSequences.
        Returns:
        list in the form of a string.
      • lifetimeTerminationTimeFromDate

        public static com.sun.portal.wsrp.common.stubs.v2.Lifetime lifetimeTerminationTimeFromDate​(java.util.Date date)
        Creates a Lifetime object and sets its termination time converting the Date instance to a XMLGregorianCalendar.
        Parameters:
        date - an instance of Date.
        Returns:
        an instance of Lifetime.
      • lifetimeTerminationTimeToDate

        public static java.util.Date lifetimeTerminationTimeToDate​(com.sun.portal.wsrp.common.stubs.v2.Lifetime lifetime)
        Creates a Date object getting the terminationTime from a Lifetime object.
        Parameters:
        lifetime - an instance of Lifetime.
        Returns:
        an instance of Date.
      • convertLeasetimeToLifetime

        public static com.sun.portal.wsrp.common.stubs.v2.Lifetime convertLeasetimeToLifetime​(com.sun.portal.wsrp.common.LeaseTime leasetime)
        Converts a LeaseTime into a Lifetime. The attribute refreshDuration will not be filled in the Lifetime.
        Parameters:
        leasetime - LeaseTime to be converted into a lifetime.
        Returns:
        lifetime representation of the given LeaseTime.
      • convertLifetimeToLeaseTime

        public static com.sun.portal.wsrp.common.LeaseTime convertLifetimeToLeaseTime​(com.sun.portal.wsrp.common.stubs.v2.Lifetime lifetime)
        Converts a Lifetime into a LeaseTime.
        Parameters:
        lifetime - Lifetime to be converted.
        Returns:
        resulting LeaseTime.
      • getMapFromString

        public static java.util.Map<java.lang.String,​java.lang.String[]> getMapFromString​(java.lang.String paramString)
        Adjustment for 'com.sun.portal.wsrp.common.Util'.
        Parameters:
        paramString -
        Returns:
        Map parameter map.