All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softlayer.api.service.user.customer.notification.Hardware Maven / Gradle / Ivy

There is a newer version: 0.3.4
Show newest version
package com.softlayer.api.service.user.customer.notification;

import com.softlayer.api.ApiClient;
import com.softlayer.api.ResponseHandler;
import com.softlayer.api.annotation.ApiMethod;
import com.softlayer.api.annotation.ApiProperty;
import com.softlayer.api.annotation.ApiType;
import com.softlayer.api.service.Entity;
import com.softlayer.api.service.dns.Domain;
import com.softlayer.api.service.user.Customer;
import java.util.List;
import java.util.concurrent.Future;

/**
 * The Customer_Notification_Hardware object stores links between customers and the hardware devices they wish to monitor.  This link is not enough, the user must be sure to also create SoftLayer_Network_Monitor_Version1_Query_Host instance with the response action set to "notify users" in order for the users linked to that hardware object to be notified on failure. 
 *
 * @see SoftLayer_User_Customer_Notification_Hardware
 */
@ApiType("SoftLayer_User_Customer_Notification_Hardware")
public class Hardware extends Entity {

    /**
     * The hardware object that will be monitored.
     */
    @ApiProperty
    protected com.softlayer.api.service.Hardware hardware;

    public com.softlayer.api.service.Hardware getHardware() {
        return hardware;
    }

    public void setHardware(com.softlayer.api.service.Hardware hardware) {
        this.hardware = hardware;
    }

    /**
     * The user that will be notified when the associated hardware object fails a monitoring instance.
     */
    @ApiProperty
    protected Customer user;

    public Customer getUser() {
        return user;
    }

    public void setUser(Customer user) {
        this.user = user;
    }

    /**
     * The ID of the Hardware object that is to be monitored.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long hardwareId;

    public Long getHardwareId() {
        return hardwareId;
    }

    public void setHardwareId(Long hardwareId) {
        hardwareIdSpecified = true;
        this.hardwareId = hardwareId;
    }

    protected boolean hardwareIdSpecified;

    public boolean isHardwareIdSpecified() {
        return hardwareIdSpecified;
    }

    public void unsetHardwareId() {
        hardwareId = null;
        hardwareIdSpecified = false;
    }

    /**
     * The unique identifier for this object
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        idSpecified = true;
        this.id = id;
    }

    protected boolean idSpecified;

    public boolean isIdSpecified() {
        return idSpecified;
    }

    public void unsetId() {
        id = null;
        idSpecified = false;
    }

    /**
     * The ID of the SoftLayer_User_Customer object that represents the user to be notified on monitoring failure.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long userId;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        userIdSpecified = true;
        this.userId = userId;
    }

    protected boolean userIdSpecified;

    public boolean isUserIdSpecified() {
        return userIdSpecified;
    }

    public void unsetUserId() {
        userId = null;
        userIdSpecified = false;
    }

    public Service asService(ApiClient client) {
        return service(client, id);
    }

    public static Service service(ApiClient client) {
        return client.createService(Service.class, null);
    }

    public static Service service(ApiClient client, Long id) {
        return client.createService(Service.class, id == null ? null : id.toString());
    }

    /**
     * This service represents the link between a monitored hardware instance, and a user account. 
*
* When a monitoring service on that hardware instance fails and the monitor is set to "notify users," any users linked to that hardware instance using this service will be notified of the failure. * * @see SoftLayer_User_Customer_Notification_Hardware */ @com.softlayer.api.annotation.ApiService("SoftLayer_User_Customer_Notification_Hardware") public static interface Service extends com.softlayer.api.Service { public ServiceAsync asAsync(); public Mask withNewMask(); public Mask withMask(); public void setMask(Mask mask); /** * Passing in an unsaved instances of a Customer_Notification_Hardware object into this function will create the object and return the results to the user. * * @see SoftLayer_User_Customer_Notification_Hardware::createObject */ @ApiMethod public Hardware createObject(Hardware templateObject); /** * Passing in a collection of unsaved instances of Customer_Notification_Hardware objects into this function will create all objects and return the results to the user. * * @see SoftLayer_User_Customer_Notification_Hardware::createObjects */ @ApiMethod public List createObjects(List templateObjects); /** * Like any other API object, the customer notification objects can be deleted by passing an instance of them into this function. The ID on the object must be set. * * @see SoftLayer_User_Customer_Notification_Hardware::deleteObjects */ @ApiMethod public Boolean deleteObjects(List templateObjects); /** * This method returns all Customer_Notification_Hardware objects associated with the passed in hardware ID as long as that hardware ID is owned by the current user's account.
*
* This behavior can also be accomplished by simply tapping monitoringUserNotification on the Hardware_Server object. * * @see SoftLayer_User_Customer_Notification_Hardware::findByHardwareId */ @ApiMethod public List findByHardwareId(Long hardwareId); /** * getObject retrieves the SoftLayer_User_Customer_Notification_Hardware object whose ID number corresponds to the ID number of the init parameter passed to the SoftLayer_User_Customer_Notification_Hardware service. You can only retrieve hardware notifications attached to hardware and users that belong to your account * * @see SoftLayer_User_Customer_Notification_Hardware::getObject */ @ApiMethod(instanceRequired = true) public Hardware getObject(); /** * The hardware object that will be monitored. * * @see SoftLayer_User_Customer_Notification_Hardware::getHardware */ @ApiMethod(instanceRequired = true) public com.softlayer.api.service.Hardware getHardware(); /** * The user that will be notified when the associated hardware object fails a monitoring instance. * * @see SoftLayer_User_Customer_Notification_Hardware::getUser */ @ApiMethod(instanceRequired = true) public Customer getUser(); } public static interface ServiceAsync extends com.softlayer.api.ServiceAsync { public Mask withNewMask(); public Mask withMask(); public void setMask(Mask mask); /** * Async version of {@link Service#createObject} */ public Future createObject(Hardware templateObject); public Future createObject(Hardware templateObject, ResponseHandler callback); /** * Async version of {@link Service#createObjects} */ public Future> createObjects(List templateObjects); public Future createObjects(List templateObjects, ResponseHandler> callback); /** * Async version of {@link Service#deleteObjects} */ public Future deleteObjects(List templateObjects); public Future deleteObjects(List templateObjects, ResponseHandler callback); /** * Async version of {@link Service#findByHardwareId} */ public Future> findByHardwareId(Long hardwareId); public Future findByHardwareId(Long hardwareId, ResponseHandler> callback); /** * Async version of {@link Service#getObject} */ public Future getObject(); public Future getObject(ResponseHandler callback); /** * Async version of {@link Service#getHardware} */ public Future getHardware(); /** * Async callback version of {@link Service#getHardware} */ public Future getHardware(ResponseHandler callback); /** * Async version of {@link Service#getUser} */ public Future getUser(); /** * Async callback version of {@link Service#getUser} */ public Future getUser(ResponseHandler callback); } public static class Mask extends com.softlayer.api.service.Entity.Mask { public com.softlayer.api.service.Hardware.Mask hardware() { return withSubMask("hardware", com.softlayer.api.service.Hardware.Mask.class); } public com.softlayer.api.service.user.Customer.Mask user() { return withSubMask("user", com.softlayer.api.service.user.Customer.Mask.class); } public Mask hardwareId() { withLocalProperty("hardwareId"); return this; } public Mask id() { withLocalProperty("id"); return this; } public Mask userId() { withLocalProperty("userId"); return this; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy