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

com.threatconnect.sdk.client.writer.associate.AbstractVictimAssetAssociateWriterAdapter Maven / Gradle / Ivy

Go to download

The ThreatConnect Java SDK. Used to communicate with teh ThreatConnect Threat Intelligence Platform

The newest version!
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.threatconnect.sdk.client.writer.associate;

import com.threatconnect.sdk.client.UrlTypeable;
import com.threatconnect.sdk.client.response.WriteListResponse;
import com.threatconnect.sdk.client.writer.AbstractBaseWriterAdapter;
import com.threatconnect.sdk.conn.Connection;
import com.threatconnect.sdk.exception.FailedResponseException;
import com.threatconnect.sdk.server.response.entity.*;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 *
 * @author dtineo
 */
public abstract class AbstractVictimAssetAssociateWriterAdapter extends AbstractBaseWriterAdapter implements VictimAssetAssociateWritable

, UrlTypeable { public AbstractVictimAssetAssociateWriterAdapter(Connection conn, Class singleType) { super(conn, singleType); } @Override public WriteListResponse associateVictimAssetEmailAddresses(P uniqueId, List assetIds) throws IOException { return associateVictimAssetEmailAddresses(uniqueId, assetIds,null); } @Override public WriteListResponse associateVictimAssetEmailAddresses(P uniqueId, List assetIds, String ownerName) throws IOException { Map map = createParamMap("id", uniqueId); WriteListResponse data = createListWithParam(getUrlBasePrefix() + ".byId.victimAssets.emailAddresses.byAssetId", VictimEmailAddressResponse.class, ownerName, map, "assetId", assetIds); return data; } @Override public ApiEntitySingleResponse associateVictimAssetEmailAddress(P uniqueId, Integer assetId) throws IOException, FailedResponseException { return associateVictimAssetEmailAddress(uniqueId, assetId, null); } @Override public ApiEntitySingleResponse associateVictimAssetEmailAddress(P uniqueId, Integer assetId, String ownerName) throws IOException, FailedResponseException { Map map = createParamMap("id", uniqueId, "assetId", assetId); VictimEmailAddressResponse data = createItem( getUrlBasePrefix() + ".byId.victimAssets.emailAddresses.byAssetId", VictimEmailAddressResponse.class, ownerName, map, null); return data; } @Override public WriteListResponse associateVictimAssetNetworkAccounts(P uniqueId, List assetIds) throws IOException { return associateVictimAssetEmailAddresses(uniqueId, assetIds, null); } @Override public WriteListResponse associateVictimAssetNetworkAccounts(P uniqueId, List assetIds, String ownerName) throws IOException { Map map = createParamMap("id", uniqueId); WriteListResponse data = createListWithParam(getUrlBasePrefix() + ".byId.victimAssets.networkAccounts.byAssetId", VictimNetworkAccountResponse.class, ownerName, map, "assetId", assetIds); return data; } @Override public ApiEntitySingleResponse associateVictimAssetNetworkAccount(P uniqueId, Integer assetId) throws IOException, FailedResponseException { return associateVictimAssetNetworkAccount(uniqueId, assetId, null); } @Override public ApiEntitySingleResponse associateVictimAssetNetworkAccount(P uniqueId, Integer assetId, String ownerName) throws IOException, FailedResponseException { Map map = createParamMap("id", uniqueId, "assetId", assetId); VictimNetworkAccountResponse data = createItem( getUrlBasePrefix() + ".byId.victimAssets.networkAccounts.byAssetId", VictimNetworkAccountResponse.class, ownerName, map, null); return data; } @Override public WriteListResponse associateVictimAssetPhoneNumbers(P uniqueId, List assetIds) throws IOException { return associateVictimAssetPhoneNumbers(uniqueId, assetIds, null); } @Override public WriteListResponse associateVictimAssetPhoneNumbers(P uniqueId, List assetIds, String ownerName) throws IOException { Map map = createParamMap("id", uniqueId); WriteListResponse data = createListWithParam(getUrlBasePrefix() + ".byId.victimAssets.phoneNumbers.byAssetId", VictimPhoneResponse.class, ownerName, map, "assetId", assetIds); return data; } @Override public ApiEntitySingleResponse associateVictimAssetPhoneNumber(P uniqueId, Integer assetId) throws IOException, FailedResponseException { return associateVictimAssetPhoneNumber(uniqueId, assetId, null); } @Override public ApiEntitySingleResponse associateVictimAssetPhoneNumber(P uniqueId, Integer assetId, String ownerName) throws IOException, FailedResponseException { Map map = createParamMap("id", uniqueId, "assetId", assetId); VictimNetworkAccountResponse data = createItem( getUrlBasePrefix() + ".byId.victimAssets.phoneNumbers.byAssetId", VictimNetworkAccountResponse.class, ownerName, map, null); return data; } @Override public WriteListResponse associateVictimAssetSocialNetworks(P uniqueId, List assetIds) throws IOException, FailedResponseException { return associateVictimAssetSocialNetworks(uniqueId, assetIds, null); } @Override public WriteListResponse associateVictimAssetSocialNetworks(P uniqueId, List assetIds, String ownerName) throws IOException { Map map = createParamMap("id", uniqueId); WriteListResponse data = createListWithParam(getUrlBasePrefix() + ".byId.victimAssets.socialNetworks.byAssetId", VictimSocialNetworkResponse.class, ownerName, map, "assetId", assetIds); return data; } @Override public ApiEntitySingleResponse associateVictimAssetSocialNetwork(P uniqueId, Integer assetId) throws IOException, FailedResponseException { return associateVictimAssetSocialNetwork(uniqueId, assetId, null); } @Override public ApiEntitySingleResponse associateVictimAssetSocialNetwork(P uniqueId, Integer assetId, String ownerName) throws IOException, FailedResponseException { Map map = createParamMap("id", uniqueId, "assetId", assetId); VictimSocialNetworkResponse data = createItem( getUrlBasePrefix() + ".byId.victimAssets.socialNetworks.byAssetId", VictimSocialNetworkResponse.class, ownerName, map, null); return data; } @Override public WriteListResponse associateVictimAssetWebsites(P uniqueId, List assetIds) throws IOException { return associateVictimAssetWebsites(uniqueId, assetIds, null); } @Override public WriteListResponse associateVictimAssetWebsites(P uniqueId, List assetIds, String ownerName) throws IOException { Map map = createParamMap("id", uniqueId); WriteListResponse data = createListWithParam(getUrlBasePrefix() + ".byId.victimAssets.websites.byAssetId", VictimWebSiteResponse.class, ownerName, map, "assetId", assetIds); return data; } @Override public ApiEntitySingleResponse associateVictimAssetWebsite(P uniqueId, Integer assetId) throws IOException, FailedResponseException { return associateVictimAssetWebsite(uniqueId, assetId, null); } @Override public ApiEntitySingleResponse associateVictimAssetWebsite(P uniqueId, Integer assetId, String ownerName) throws IOException, FailedResponseException { Map map = createParamMap("id", uniqueId, "assetId", assetId); VictimWebSiteResponse data = createItem( getUrlBasePrefix() + ".byId.victimAssets.websites.byAssetId", VictimWebSiteResponse.class, ownerName, map, null); return data; } @Override public WriteListResponse dissociateVictimAssetEmailAddresses(P uniqueId, List assetIds) throws IOException { return dissociateVictimAssetEmailAddresses(uniqueId, assetIds, null); } @Override public WriteListResponse dissociateVictimAssetEmailAddresses(P uniqueId, List assetIds, String ownerName) throws IOException { Map map = createParamMap("id", uniqueId); WriteListResponse data = deleteList(getUrlBasePrefix() + ".byId.victimAssets.emailAddresses.byAssetId", VictimEmailAddressResponse.class, ownerName, map, "assetId", assetIds); return data; } @Override public ApiEntitySingleResponse dissociateVictimAssetEmailAddress(P uniqueId, Integer assetId) throws IOException, FailedResponseException { return dissociateVictimAssetEmailAddress(uniqueId, assetId, null); } @Override public ApiEntitySingleResponse dissociateVictimAssetEmailAddress(P uniqueId, Integer assetId, String ownerName) throws IOException, FailedResponseException { Map map = createParamMap("id", uniqueId, "assetId", assetId); VictimEmailAddressResponse item = deleteItem(getUrlBasePrefix() + ".byId.victimAssets.emailAddresses.byAssetId", VictimEmailAddressResponse.class, ownerName, map); return item; } @Override public WriteListResponse dissociateVictimAssetNetworkAccounts(P uniqueId, List assetIds) throws IOException { return dissociateVictimAssetNetworkAccounts(uniqueId, assetIds, null); } @Override public WriteListResponse dissociateVictimAssetNetworkAccounts(P uniqueId, List assetIds, String ownerName) throws IOException { Map map = createParamMap("id", uniqueId); WriteListResponse data = deleteList(getUrlBasePrefix() + ".byId.victimAssets.networkAccounts.byAssetId", VictimNetworkAccountResponse.class, ownerName, map, "assetId", assetIds); return data; } @Override public ApiEntitySingleResponse dissociateVictimAssetNetworkAccount(P uniqueId, Integer assetId) throws IOException, FailedResponseException { return dissociateVictimAssetNetworkAccount(uniqueId, assetId, null); } @Override public ApiEntitySingleResponse dissociateVictimAssetNetworkAccount(P uniqueId, Integer assetId, String ownerName) throws IOException, FailedResponseException { Map map = createParamMap("id", uniqueId, "assetId", assetId); VictimNetworkAccountResponse item = deleteItem(getUrlBasePrefix() + ".byId.victimAssets.networkAccounts.byAssetId", VictimNetworkAccountResponse.class, ownerName, map); return item; } @Override public WriteListResponse dissociateVictimAssetPhoneNumbers(P uniqueId, List assetIds) throws IOException { return dissociateVictimAssetPhoneNumbers(uniqueId, assetIds, null); } @Override public WriteListResponse dissociateVictimAssetPhoneNumbers(P uniqueId, List assetIds, String ownerName) throws IOException { Map map = createParamMap("id", uniqueId); WriteListResponse data = deleteList(getUrlBasePrefix() + ".byId.victimAssets.phoneNumbers.byAssetId", VictimPhoneResponse.class, ownerName, map, "assetId", assetIds); return data; } @Override public ApiEntitySingleResponse dissociateVictimAssetPhoneNumber(P uniqueId, Integer assetId) throws IOException, FailedResponseException { return dissociateVictimAssetPhoneNumber(uniqueId, assetId, null); } @Override public ApiEntitySingleResponse dissociateVictimAssetPhoneNumber(P uniqueId, Integer assetId, String ownerName) throws IOException, FailedResponseException { Map map = createParamMap("id", uniqueId, "assetId", assetId); VictimPhoneResponse item = deleteItem(getUrlBasePrefix() + ".byId.victimAssets.phoneNumbers.byAssetId", VictimPhoneResponse.class, ownerName, map); return item; } @Override public WriteListResponse dissociateVictimAssetSocialNetworks(P uniqueId, List assetIds) throws IOException, FailedResponseException { return dissociateVictimAssetSocialNetworks(uniqueId, assetIds, null); } @Override public WriteListResponse dissociateVictimAssetSocialNetworks(P uniqueId, List assetIds, String ownerName) throws IOException { Map map = createParamMap("id", uniqueId); WriteListResponse data = deleteList(getUrlBasePrefix() + ".byId.victimAssets.socialNetworks.byAssetId", VictimNetworkAccountResponse.class, ownerName, map, "assetId", assetIds); return data; } @Override public ApiEntitySingleResponse dissociateVictimAssetSocialNetwork(P uniqueId, Integer assetId) throws IOException, FailedResponseException { return dissociateVictimAssetSocialNetwork(uniqueId, assetId, null); } @Override public ApiEntitySingleResponse dissociateVictimAssetSocialNetwork(P uniqueId, Integer assetId, String ownerName) throws IOException, FailedResponseException { Map map = createParamMap("id", uniqueId, "assetId", assetId); VictimSocialNetworkResponse item = deleteItem(getUrlBasePrefix() + ".byId.victimAssets.socialNetworks.byAssetId", VictimSocialNetworkResponse.class, ownerName, map); return item; } @Override public WriteListResponse dissociateVictimAssetWebsites(P uniqueId, List assetIds) throws IOException { return dissociateVictimAssetWebsites(uniqueId, assetIds, null); } @Override public WriteListResponse dissociateVictimAssetWebsites(P uniqueId, List assetIds, String ownerName) throws IOException { Map map = createParamMap("id", uniqueId); WriteListResponse data = deleteList(getUrlBasePrefix() + ".byId.victimAssets.websites.byAssetId", VictimWebSiteResponse.class, ownerName, map, "assetId", assetIds); return data; } @Override public ApiEntitySingleResponse dissociateVictimAssetWebsite(P uniqueId, Integer assetId) throws IOException, FailedResponseException { return dissociateVictimAssetWebsite(uniqueId, assetId, null); } @Override public ApiEntitySingleResponse dissociateVictimAssetWebsite(P uniqueId, Integer assetId, String ownerName) throws IOException, FailedResponseException { Map map = createParamMap("id", uniqueId, "assetId", assetId); VictimWebSiteResponse item = deleteItem(getUrlBasePrefix() + ".byId.victimAssets.website.byAssetId", VictimWebSiteResponse.class, ownerName, map); return item; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy