Class UMSObject


  • public class UMSObject
    extends Object
    UMSObject class exposes public methods that serve as the entry points to the UMS SDK. This class is used to replace the public static methods that are previously available in Session class.

           // Previous access class with authenticated context
           //
           UMSObject.getObject( Context ctx, String guid );
           UMSObject.removeObject( Context ctx, String guid );
           UMSObject.logout( Context ctx );
     
           // New API with the use of Principal interface that represents an
           // authenticated principal
           UMSObject.getObject( java.security.Principal principal, String guid );
           UMSObject.removeObject(java.security.Principal principal, String guid);
     
    • Constructor Detail

      • UMSObject

        public UMSObject()
    • Method Detail

      • getObject

        public static PersistentObject getObject​(SSOToken token,
                                                 Guid guid)
                                          throws UMSException
        Returns the persistent object of correct subclass, for the given id. The Java class to construct the persistent object is inferred from the default creation templates registered with the Template manager.
        Parameters:
        token - Authenticated principal's single sign on token.
        guid - GUID identification of the object to get.
        Returns:
        the object read, all non operational attributes are read.
        Throws:
        UMSException - if there is an error while instantiating the right type of object. In addition, it propagates any exception from the datalayer.
      • getObject

        public static PersistentObject getObject​(SSOToken token,
                                                 Guid guid,
                                                 String[] attrNames)
                                          throws UMSException
        Returns the persistent object of correct subclass, for the given ID. The Java class to construct the persistent object is inferred from the default creation templates registered with the Template manager.
        Parameters:
        token - Authenticated principal's single sign on token.
        guid - GUID identification of the object to get
        attrNames - attribute names to read.
        Returns:
        the object read.
        Throws:
        UMSException - if there is an error while instantiating the right type of object. In addition, it propagates any exception from the datalayer.
      • removeObject

        public static void removeObject​(SSOToken token,
                                        Guid guid)
                                 throws EntryNotFoundException,
                                        UMSException
        Removes an object identified by the given ID.
        Parameters:
        token - Authenticated principal's single sign on token.
        guid - GUID identification of the object to be removed.
        Throws:
        EntryNotFoundException - if the entry is not found.
        UMSException - if there is an error while removing the object from persistence store
      • getObjectHandle

        public static PersistentObject getObjectHandle​(SSOToken token,
                                                       Guid guid)
                                                throws UMSException
        Return a PersistentObject given an authenticated token and guid. The validity of the returned PersistentObject can not be guaranteed since the object is created in memory, not instantiated from the persistent storage. Using the PersistentObject returned from this method may result exceptions in the later part of the application if the given guid is not valid or represents an entry that does not exist.
        Parameters:
        token - Valid and authenticated token
        guid - Globally unique identifier for the entity
        Returns:
        the PersistentObject created in memory
        Throws:
        UMSException - for failure to create the object