Package sage.api

Class UserRecordAPI


  • public class UserRecordAPI
    extends java.lang.Object
    API for plugins and other utilities to be able to store arbitrary name-value pairs in the database under a keyed object system.
    • Constructor Summary

      Constructors 
      Constructor Description
      UserRecordAPI()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      sage.UserRecord AddUserRecord​(java.lang.String Store, java.lang.String Key)
      Creates a new UserRecord object in the database under the specified data 'Store' and with the specified 'Key'.
      void DeleteAllUserRecords​(java.lang.String Store)
      Deletes the all the UserRecords from the database under the specified Store.
      boolean DeleteUserRecord​(sage.UserRecord UserRecord)
      Deletes the specified UserRecord object from the database.
      sage.UserRecord[] GetAllUserRecords​(java.lang.String Store)
      Gets all existing UserRecord objects that exist under the specified data Store.
      java.lang.String[] GetAllUserStores()
      Gets all existing Stores that UserRecord objects have been created under in the database.
      sage.UserRecord GetUserRecord​(java.lang.String Store, java.lang.String Key)
      Gets an existing UserRecord object in the database under the specified data 'Store' and with the specified 'Key'.
      java.lang.String GetUserRecordData​(sage.UserRecord UserRecord, java.lang.String Name)
      Gets the Value from the specified Name that's stored in the given UserRecord object.
      java.lang.String[] GetUserRecordNames​(sage.UserRecord UserRecord)
      Gets a list of all the 'Name' values used in name->value pairs in this UserRecord object
      boolean IsUserRecordObject​(java.lang.Object UserRecord)
      Returns true if the passed in argument is a UserRecord object
      void SetUserRecordData​(sage.UserRecord UserRecord, java.lang.String Name, java.lang.String Value)
      Sets the Value for the specified Name that's stored in the given UserRecord object
      • Methods inherited from class java.lang.Object

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

      • UserRecordAPI

        public UserRecordAPI()
    • Method Detail

      • AddUserRecord

        public sage.UserRecord AddUserRecord​(java.lang.String Store,
                                             java.lang.String Key)
        Creates a new UserRecord object in the database under the specified data 'Store' and with the specified 'Key'. If a UserRecord already exists with that Store/Key combination, it will be returned instead.
        Parameters:
        Store - the data store name to add the user record to
        Key - the unique key to use for indexing this record
        Returns:
        the newly created UserRecord object, or if one already exists with this Store/Key combination, that is returned, null is returned if any parameters are null or the empty string
        Since:
        7.0
      • GetUserRecordData

        public java.lang.String GetUserRecordData​(sage.UserRecord UserRecord,
                                                  java.lang.String Name)
        Gets the Value from the specified Name that's stored in the given UserRecord object.
        Parameters:
        UserRecord - the UserRecord object
        Name - the name to retrieve the corresponding value for from the specified UserRecord object, must not be null or the empty String
        Returns:
        the Value from the specified Name that's stored in the given UserRecord object., null will be returned if the Name has no defined value
        Since:
        7.0
      • SetUserRecordData

        public void SetUserRecordData​(sage.UserRecord UserRecord,
                                      java.lang.String Name,
                                      java.lang.String Value)
        Sets the Value for the specified Name that's stored in the given UserRecord object
        Parameters:
        UserRecord - the UserRecord object
        Name - the Name to set the corresponding Value for in the specified UserRecord object, must not be null or the empty String
        Value - the Value to set, use null to clear the existing setting for the specified Name
        Since:
        7.0
      • GetUserRecord

        public sage.UserRecord GetUserRecord​(java.lang.String Store,
                                             java.lang.String Key)
        Gets an existing UserRecord object in the database under the specified data 'Store' and with the specified 'Key'.
        Parameters:
        Store - the data store name to retrieve the UserRecord from
        Key - the unique key that was used when creating the UserRecord
        Returns:
        the requested UserRecord object, or null if no matching record was found
        Since:
        7.0
      • DeleteUserRecord

        public boolean DeleteUserRecord​(sage.UserRecord UserRecord)
        Deletes the specified UserRecord object from the database.
        Parameters:
        UserRecord - the UserRecord object to remove from the database
        Returns:
        true if the specified UserRecord was removed from the database, false if it no longer exists in the database
        Since:
        7.0
      • GetAllUserRecords

        public sage.UserRecord[] GetAllUserRecords​(java.lang.String Store)
        Gets all existing UserRecord objects that exist under the specified data Store.
        Parameters:
        Store - the data store name to retrieve the UserRecords from
        Returns:
        an array of all UserRecord objects in the database under the specified Store
        Since:
        7.0
      • GetAllUserStores

        public java.lang.String[] GetAllUserStores()
        Gets all existing Stores that UserRecord objects have been created under in the database.
        Returns:
        an array of all the Store names that exist for UserRecords in the database
        Since:
        7.0
      • DeleteAllUserRecords

        public void DeleteAllUserRecords​(java.lang.String Store)
        Deletes the all the UserRecords from the database under the specified Store.
        Parameters:
        Store - the Store name that should have all corresponding UserRecords deleted
        Since:
        7.0
      • IsUserRecordObject

        public boolean IsUserRecordObject​(java.lang.Object UserRecord)
        Returns true if the passed in argument is a UserRecord object
        Parameters:
        UserRecord - the object to test to see if it is a UserRecord object
        Returns:
        true if the passed in argument is a UserRecord object, false otherwise
        Since:
        7.0
      • GetUserRecordNames

        public java.lang.String[] GetUserRecordNames​(sage.UserRecord UserRecord)
        Gets a list of all the 'Name' values used in name->value pairs in this UserRecord object
        Parameters:
        UserRecord - the UserRecord object to get the list of Names stored in
        Returns:
        an array of all the names used to store data within this UserRecord object
        Since:
        7.0