Class Peers


  • public class Peers
    extends java.lang.Object
    Orthanc peer
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Peers​(long self)
      Construct a Java object wrapping a C object that is managed by Orthanc.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Manually deallocate the C object that is associated with this Java wrapper.
      protected void finalize()  
      java.lang.String getPeerName​(int peerIndex)
      Get the symbolic name of an Orthanc peer.
      static Peers getPeers()
      Return the list of available Orthanc peers.
      int getPeersCount()
      Get the number of Orthanc peers.
      java.lang.String getPeerUrl​(int peerIndex)
      Get the base URL of an Orthanc peer.
      java.lang.String getPeerUserProperty​(int peerIndex, java.lang.String userProperty)
      Get some user-defined property of an Orthanc peer.
      protected long getSelf()
      Return the C object that is associated with this Java wrapper.
      • Methods inherited from class java.lang.Object

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

      • Peers

        protected Peers​(long self)
        Construct a Java object wrapping a C object that is managed by Orthanc.
        Parameters:
        self - Pointer to the C object.
    • Method Detail

      • getSelf

        protected long getSelf()
        Return the C object that is associated with this Java wrapper.
        Returns:
        Pointer to the C object.
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • dispose

        public void dispose()
        Manually deallocate the C object that is associated with this Java wrapper. This method can be used to immediately deallocate the C object, instead of waiting for the garbage collector to dispose the Java wrapper.
      • getPeers

        public static Peers getPeers()
        Return the list of available Orthanc peers. This function returns the parameters of the Orthanc peers that are known to the Orthanc server hosting the plugin.
        Returns:
        The newly constructed object.
      • getPeersCount

        public int getPeersCount()
        Get the number of Orthanc peers. This function returns the number of Orthanc peers. This function is thread-safe: Several threads sharing the same OrthancPluginPeers object can simultaneously call this function.
        Returns:
        The number of peers.
      • getPeerName

        public java.lang.String getPeerName​(int peerIndex)
        Get the symbolic name of an Orthanc peer. This function returns the symbolic name of the Orthanc peer, which corresponds to the key of the "OrthancPeers" configuration option of Orthanc. This function is thread-safe: Several threads sharing the same OrthancPluginPeers object can simultaneously call this function.
        Parameters:
        peerIndex - The index of the peer of interest. This value must be lower than OrthancPluginGetPeersCount().
        Returns:
        The resulting string.
      • getPeerUrl

        public java.lang.String getPeerUrl​(int peerIndex)
        Get the base URL of an Orthanc peer. This function returns the base URL to the REST API of some Orthanc peer. This function is thread-safe: Several threads sharing the same OrthancPluginPeers object can simultaneously call this function.
        Parameters:
        peerIndex - The index of the peer of interest. This value must be lower than OrthancPluginGetPeersCount().
        Returns:
        The resulting string.
      • getPeerUserProperty

        public java.lang.String getPeerUserProperty​(int peerIndex,
                                                    java.lang.String userProperty)
        Get some user-defined property of an Orthanc peer. This function returns some user-defined property of some Orthanc peer. An user-defined property is a property that is associated with the peer in the Orthanc configuration file, but that is not recognized by the Orthanc core. This function is thread-safe: Several threads sharing the same OrthancPluginPeers object can simultaneously call this function.
        Parameters:
        peerIndex - The index of the peer of interest. This value must be lower than OrthancPluginGetPeersCount().
        userProperty - The user property of interest.
        Returns:
        The resulting string.