Class Friend

java.lang.Object
org.eclipse.lyo.oslc4j.core.model.AbstractResource
com.sodius.oslc.server.oauth.model.Friend
All Implemented Interfaces:
Friend, IExtendedResource, IResource

@OslcNamespace("http://www.sodius.com/ns/oauth#") @OslcResourceShape(title="Friend Resource Shape", describes="http://www.sodius.com/ns/oauth#Friend") public class Friend extends AbstractResource implements Friend
Describes a friend registered in an OSLC application.
Since:
1.3.0
  • Constructor Details

    • Friend

      public Friend()
  • Method Details

    • getIdentifier

      @OslcDescription("A unique identifier for a resource. Assigned by the service provider when a resource is created. Not intended for end-user display.") @OslcOccurs(ExactlyOne) @OslcPropertyDefinition("http://purl.org/dc/terms/identifier") @OslcTitle("Identifier") public String getIdentifier()
      Description copied from interface: Friend
      Returns the identifier of the friend. Default implementation is to return the root services URL. Callers should not assume anything about the actual format of the identifier, and rather call Friend.getRootServices() if that URL is specifically needed.
      Specified by:
      getIdentifier in interface Friend
      Returns:
      the identifier of the friend
    • setIdentifier

      public void setIdentifier(String identifier)
    • getTitle

      @OslcDescription("Title (reference: Dublin Core) or often a single line summary of the resource represented as rich text in XHTML content.") @OslcOccurs(ExactlyOne) @OslcPropertyDefinition("http://purl.org/dc/terms/title") @OslcTitle("Title") @OslcValueType(XMLLiteral) public String getTitle()
      Description copied from interface: Friend
      Returns the title of the friend, which defaults to the host name of the root services location.
      Specified by:
      getTitle in interface Friend
      Returns:
      the title of the friend
    • setTitle

      public void setTitle(String title)
    • getRootServices

      @OslcPropertyDefinition("http://www.sodius.com/ns/oauth#rootServices") public URI getRootServices()
      Description copied from interface: Friend
      Returns the root services URL of the friend.
      Specified by:
      getRootServices in interface Friend
      Returns:
      the root services URL of the friend.
    • setRootServices

      public void setRootServices(URI rootServices)
    • getConsumerKey

      @OslcPropertyDefinition("http://www.sodius.com/ns/oauth#consumerKey") public String getConsumerKey()
    • setConsumerKey

      public void setConsumerKey(String consumerKey)
    • getConsumerSecret

      @OslcPropertyDefinition("http://www.sodius.com/ns/oauth#consumerSecret") public String getConsumerSecret()
      Description copied from interface: Friend
      Return the secret associated with the consumer key for contacting the friend application using OAuth 1.0a protocol
      Specified by:
      getConsumerSecret in interface Friend
      Returns:
      the consumer secret.
    • setConsumerSecret

      public void setConsumerSecret(String consumerSecret)
    • getConsumerToken

      public final String getConsumerToken()
      Returns the consumer key provided by getConsumerKey().
      Specified by:
      getConsumerToken in interface Friend
      Returns:
      the consumer key.
      Since:
      3.5.0
    • getState

      @OslcName("friendState") @OslcPropertyDefinition("http://www.sodius.com/ns/oauth#friendState") public String getState()
      Allows to know whether a Friend is available or not.
      Returns:
      the friend's state
      Since:
      2.0
    • setState

      public void setState(String state)
    • getStateError

      @OslcPropertyDefinition("http://www.sodius.com/ns/oauth#stateError") @OslcValueType(LocalResource) public OslcError getStateError()
      Returns the (optional) OslcError for display purposes
      Returns:
      the OslcError
      Since:
      3.7.0
    • setStateError

      public void setStateError(OslcError error)
      Sets the (optional) OslcError for display purposes
      Parameters:
      error - the error
      Since:
      3.7.0
    • isReadOnly

      @OslcPropertyDefinition("http://open-services.net/ns/core#readOnly") @OslcName("readOnly") public Boolean isReadOnly()
      Gets the read-only value. A read-only friend cannot be updated in the administration page.
      Returns:
      true if the friend cannot be updated.
      Since:
      3.14.0
    • setReadOnly

      public void setReadOnly(Boolean readOnly)
      Sets the read-only value. A read-only friend cannot be updated in the administration page.
      Parameters:
      readOnly - true to prevent the friend from being updated in the administration page.
      Since:
      3.14.0